kitchen-simulator 11.27.0 → 11.28.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/items-actions.js +8 -1
- package/es/class/item.js +48 -0
- package/es/components/viewer2d/viewer2d.js +2 -2
- package/es/constants.js +3 -1
- package/es/events/external/handleExternalEvent.util.js +4 -2
- package/es/events/external/handlers.changeDoorStyle.js +28 -7
- package/es/mappings/external-events/mappers/ccdfMapper.js +1 -1
- package/es/reducers/items-reducer.js +3 -1
- package/es/utils/geometry.js +5 -3
- package/lib/actions/items-actions.js +8 -0
- package/lib/class/item.js +48 -0
- package/lib/components/viewer2d/viewer2d.js +2 -2
- package/lib/constants.js +5 -3
- package/lib/events/external/handleExternalEvent.util.js +4 -2
- package/lib/events/external/handlers.changeDoorStyle.js +28 -7
- package/lib/mappings/external-events/mappers/ccdfMapper.js +1 -1
- package/lib/reducers/items-reducer.js +2 -0
- package/lib/utils/geometry.js +5 -3
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { TOGGLE_LOADING_CABINET, SELECT_ITEM, SELECT_TOOL_DRAWING_ITEM, UPDATE_DRAWING_ITEM, END_DRAWING_ITEM, BEGIN_DRAGGING_ITEM, BEGIN_DRAGGING_ITEM_3D, UPDATE_DRAGGING_ITEM, UPDATE_DRAGGING_ITEM_3DX, UPDATE_DRAGGING_ITEM_3DY, END_DRAGGING_ITEM, END_DRAGGING_ITEM_3D, UPDATE_DRAGGING_ITEM_CHANGED, UPDATE_ROTATING_ITEM_CHANGED, BEGIN_ROTATING_ITEM, BEGIN_ROTATING_ITEM_3D, UPDATE_ROTATING_ITEM, UPDATE_ROTATING, END_ROTATING_ITEM, END_ROTATING_ITEM_3D, REPLACE_SUBMODULE, ANIMATE_OBJECT, REMOVE_REPLACE_SUBMODULE, ITEM_MOVE_UP, SELECT_TOOL_DRAWING_ITEM_3D, SET_DOOR_STYLE, SET_HANDLE_MATERIAL, SET_INITIAL_DOOR_STYLE, SET_DISTANT, SET_DOOR_HANDLE, SET_WALL_COLOR, END_CREATING_CABINET, UPDATE_POPUP_OPEN, SET_MODELLING, SET_COUNTER_TOP, SET_BACKSPLASH, SET_BACKSPLASH_VISIBLE, SET_APPLIANCE_MATERIAL, DUPLICATE_SELECTED, EDIT_WIDTH, END_LOADING, STORE_DIST_ARRAY, SET_MOLDING, UPDATE_MOLDING, VALIDATE_ITEM_POSTIONS, REPLACE_ITEM, SET_MOVE_STATUS, SET_ROTATE_STATUS } from "../constants";
|
|
2
|
-
import { SET_ITEMS_CCDF } from "../constants";
|
|
2
|
+
import { SET_ITEMS_CCDF, SET_MOLDINGS_CCDF } from "../constants";
|
|
3
3
|
export function storeDistArray(layerID, itemID, distArray) {
|
|
4
4
|
return {
|
|
5
5
|
type: STORE_DIST_ARRAY,
|
|
@@ -329,4 +329,11 @@ export function setItemsCCDF(ccdf_list, applyScope) {
|
|
|
329
329
|
itemIds: itemIds,
|
|
330
330
|
doorFinishId: doorFinishId
|
|
331
331
|
};
|
|
332
|
+
}
|
|
333
|
+
export function setMoldingsCCDF(ccdf_list, applyScope) {
|
|
334
|
+
return {
|
|
335
|
+
type: SET_MOLDINGS_CCDF,
|
|
336
|
+
ccdf_list: ccdf_list,
|
|
337
|
+
applyScope: applyScope
|
|
338
|
+
};
|
|
332
339
|
}
|
package/es/class/item.js
CHANGED
|
@@ -300,6 +300,54 @@ var Item = /*#__PURE__*/function () {
|
|
|
300
300
|
updatedState: state
|
|
301
301
|
};
|
|
302
302
|
}
|
|
303
|
+
}, {
|
|
304
|
+
key: "setMoldingsCCDF",
|
|
305
|
+
value: function setMoldingsCCDF(state, ccdf_list, applyScope) {
|
|
306
|
+
var layerID = state.getIn(['scene', 'selectedLayer']);
|
|
307
|
+
var layer = state.getIn(['scene', 'layers', layerID]);
|
|
308
|
+
if (!Array.isArray(ccdf_list)) return {
|
|
309
|
+
updatedState: state
|
|
310
|
+
};
|
|
311
|
+
var idSet = null;
|
|
312
|
+
if (applyScope === DOORSTYLE_SCOPE_SINGLE) {
|
|
313
|
+
var selectedItemIds = state.getIn(['scene', 'layers', layerID, 'selected', 'items']).toJS();
|
|
314
|
+
idSet = new Set(selectedItemIds);
|
|
315
|
+
}
|
|
316
|
+
var layerMoldings = layer.molding;
|
|
317
|
+
if (!isEmpty(layerMoldings)) {
|
|
318
|
+
var updatedLayerMoldings = [];
|
|
319
|
+
layerMoldings === null || layerMoldings === void 0 || layerMoldings.forEach(function (md) {
|
|
320
|
+
var moldingID = md.itemID;
|
|
321
|
+
var picked = ccdf_list.find(function (c) {
|
|
322
|
+
return (c === null || c === void 0 ? void 0 : c.cabinet_id) && c.cabinet_id === moldingID;
|
|
323
|
+
});
|
|
324
|
+
md.ccdf = picked;
|
|
325
|
+
updatedLayerMoldings.push(md);
|
|
326
|
+
});
|
|
327
|
+
state = state.setIn(['scene', 'layers', layerID, 'molding'], updatedLayerMoldings);
|
|
328
|
+
}
|
|
329
|
+
layer.items.forEach(function (it) {
|
|
330
|
+
var _idSet2;
|
|
331
|
+
// if (isEmpty(it?.molding)) return;
|
|
332
|
+
var should = applyScope === DOORSTYLE_SCOPE_ALL ? true : (_idSet2 = idSet) === null || _idSet2 === void 0 ? void 0 : _idSet2.has(it.id);
|
|
333
|
+
if (!should) return;
|
|
334
|
+
var itemMoldings = it.molding;
|
|
335
|
+
var updatedItemMoldings = [];
|
|
336
|
+
itemMoldings === null || itemMoldings === void 0 || itemMoldings.forEach(function (md) {
|
|
337
|
+
var itemMoldingID = md.itemID;
|
|
338
|
+
var picked = ccdf_list.find(function (c) {
|
|
339
|
+
return (c === null || c === void 0 ? void 0 : c.cabinet_id) && c.cabinet_id === itemMoldingID;
|
|
340
|
+
});
|
|
341
|
+
if (!picked) return;
|
|
342
|
+
md.ccdf = picked;
|
|
343
|
+
updatedItemMoldings.push(md);
|
|
344
|
+
});
|
|
345
|
+
state = state.setIn(['scene', 'layers', layerID, 'items', it.id, 'molding'], updatedItemMoldings);
|
|
346
|
+
});
|
|
347
|
+
return {
|
|
348
|
+
updatedState: state
|
|
349
|
+
};
|
|
350
|
+
}
|
|
303
351
|
}, {
|
|
304
352
|
key: "updateDoorHandle",
|
|
305
353
|
value: function updateDoorHandle(item, layer) {
|
|
@@ -680,7 +680,7 @@ export default function Viewer2D(_ref, _ref2) {
|
|
|
680
680
|
endPoint.x = nx;
|
|
681
681
|
endPoint.y = ny;
|
|
682
682
|
}
|
|
683
|
-
if (allItemRect.cur && allItemRect.cur.itemInfo.name.includes('Hood') || allItemRect.cur && allItemRect.cur.itemInfo.name.includes('Range') || allItemRect.cur && allItemRect.cur.itemInfo.name.includes('Cook Top')) {
|
|
683
|
+
if (allItemRect.cur && allItemRect.cur.itemInfo.name.includes('Hood') || allItemRect.cur.itemInfo.cabinet_category.toLowerCase().includes('hood') || allItemRect.cur && allItemRect.cur.itemInfo.name.includes('Range') || allItemRect.cur && allItemRect.cur.itemInfo.name.includes('Cook Top')) {
|
|
684
684
|
itemsActions.updateDraggingItemChanged(nx, ny, layerID, current_sel_obj_id);
|
|
685
685
|
itemsActions.updateRotatingItemChanged(rot, layerID, current_sel_obj_id);
|
|
686
686
|
endPoint.x = nx;
|
|
@@ -752,7 +752,7 @@ export default function Viewer2D(_ref, _ref2) {
|
|
|
752
752
|
itemsActions.updateDraggingItemChanged(nx, ny, layerID, current_sel_obj_id);
|
|
753
753
|
itemsActions.updateRotatingItemChanged(rot, layerID, current_sel_obj_id);
|
|
754
754
|
}
|
|
755
|
-
if (allItemRect.cur && allItemRect.cur.itemInfo.name.includes('Hood') || allItemRect.cur && allItemRect.cur.itemInfo.name.includes('Range') || allItemRect.cur && allItemRect.cur.itemInfo.name.includes('Cook Top')) {
|
|
755
|
+
if (allItemRect.cur && allItemRect.cur.itemInfo.name.includes('Hood') || allItemRect.cur.itemInfo.cabinet_category.toLowerCase().includes('hood') || allItemRect.cur && allItemRect.cur.itemInfo.name.includes('Range') || allItemRect.cur && allItemRect.cur.itemInfo.name.includes('Cook Top')) {
|
|
756
756
|
itemsActions.updateDraggingItemChanged(nx, ny, layerID, current_sel_obj_id);
|
|
757
757
|
itemsActions.updateRotatingItemChanged(rot, layerID, current_sel_obj_id);
|
|
758
758
|
}
|
package/es/constants.js
CHANGED
|
@@ -127,6 +127,7 @@ export var SET_APPLIANCE_MATERIAL = 'SET_APPLIANCE_MATERIAL';
|
|
|
127
127
|
export var SET_MOVE_STATUS = 'SET_MOVE_STATUS';
|
|
128
128
|
export var SET_ROTATE_STATUS = 'SET_ROTATE_STATUS';
|
|
129
129
|
export var SET_ITEMS_CCDF = 'SET_ITEMS_CCDF';
|
|
130
|
+
export var SET_MOLDINGS_CCDF = 'SET_MOLDINGS_CCDF';
|
|
130
131
|
//ACTIONS groups
|
|
131
132
|
export var ADD_GROUP = 'ADD_GROUP';
|
|
132
133
|
export var ADD_GROUP_FROM_SELECTED = 'ADD_GROUP_FROM_SELECTED';
|
|
@@ -318,7 +319,8 @@ export var ITEMS_ACTIONS = {
|
|
|
318
319
|
STORE_DIST_ARRAY: STORE_DIST_ARRAY,
|
|
319
320
|
VALIDATE_ITEM_POSTIONS: VALIDATE_ITEM_POSTIONS,
|
|
320
321
|
REPLACE_ITEM: REPLACE_ITEM,
|
|
321
|
-
SET_ITEMS_CCDF: SET_ITEMS_CCDF
|
|
322
|
+
SET_ITEMS_CCDF: SET_ITEMS_CCDF,
|
|
323
|
+
SET_MOLDINGS_CCDF: SET_MOLDINGS_CCDF
|
|
322
324
|
};
|
|
323
325
|
export var HOLE_ACTIONS = {
|
|
324
326
|
SELECT_HOLE: SELECT_HOLE,
|
|
@@ -90,7 +90,8 @@ function _parseTempPlaceholdersFromCabinetPayload() {
|
|
|
90
90
|
has_single_door = false;
|
|
91
91
|
fixedPHs = 0;
|
|
92
92
|
temp.forEach(function (t, index) {
|
|
93
|
-
var
|
|
93
|
+
var _t$data;
|
|
94
|
+
var nodes = t === null || t === void 0 || (_t$data = t.data) === null || _t$data === void 0 ? void 0 : _t$data.nodes;
|
|
94
95
|
if (nodes === undefined) {
|
|
95
96
|
nodes = [];
|
|
96
97
|
}
|
|
@@ -221,7 +222,8 @@ function _parseTempPlaceholdersFromCabinetPayload() {
|
|
|
221
222
|
return felement.name === 'base_drawer_door' + t.name.slice(-2);
|
|
222
223
|
});
|
|
223
224
|
if (ph_temp != undefined) {
|
|
224
|
-
var
|
|
225
|
+
var _ph_temp$data$nodes, _ph_temp;
|
|
226
|
+
var ph_drawer_door_handle = (_ph_temp$data$nodes = (_ph_temp = ph_temp) === null || _ph_temp === void 0 || (_ph_temp = _ph_temp.data) === null || _ph_temp === void 0 ? void 0 : _ph_temp.nodes) !== null && _ph_temp$data$nodes !== void 0 ? _ph_temp$data$nodes : [];
|
|
225
227
|
ph_drawer_door_handle = ph_drawer_door_handle.filter(function (element) {
|
|
226
228
|
return element.name.startsWith('ph_') && element.name.includes('handle');
|
|
227
229
|
});
|
|
@@ -1,11 +1,28 @@
|
|
|
1
1
|
import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator";
|
|
2
2
|
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
3
|
+
function prepareMoldingCCDFList(doorStyle, moldingData) {
|
|
4
|
+
var moldingCCDFs = [];
|
|
5
|
+
for (var i = 0; i < moldingData.length; i++) {
|
|
6
|
+
var _molding$ccdf$catalog, _molding$ccdf, _molding$ccdf$cabinet, _molding$ccdf2, _doorStyle$id, _molding$long_name;
|
|
7
|
+
var molding = moldingData[i];
|
|
8
|
+
moldingCCDFs.push({
|
|
9
|
+
sizeinfo: molding.sizeinfo,
|
|
10
|
+
catalog_cabinet_sku: (_molding$ccdf$catalog = molding === null || molding === void 0 || (_molding$ccdf = molding.ccdf) === null || _molding$ccdf === void 0 ? void 0 : _molding$ccdf.catalog_cabinet_sku) !== null && _molding$ccdf$catalog !== void 0 ? _molding$ccdf$catalog : molding.sku_number,
|
|
11
|
+
cabinet_id: (_molding$ccdf$cabinet = molding === null || molding === void 0 || (_molding$ccdf2 = molding.ccdf) === null || _molding$ccdf2 === void 0 ? void 0 : _molding$ccdf2.cabinet_id) !== null && _molding$ccdf$cabinet !== void 0 ? _molding$ccdf$cabinet : molding.itemID,
|
|
12
|
+
ccdf: molding.ccdf,
|
|
13
|
+
target_door_finish_id: (_doorStyle$id = doorStyle === null || doorStyle === void 0 ? void 0 : doorStyle.id) !== null && _doorStyle$id !== void 0 ? _doorStyle$id : null,
|
|
14
|
+
long_name: (_molding$long_name = molding === null || molding === void 0 ? void 0 : molding.long_name) !== null && _molding$long_name !== void 0 ? _molding$long_name : null,
|
|
15
|
+
id: molding.itemID
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
return moldingCCDFs;
|
|
19
|
+
}
|
|
3
20
|
export function handleChangeDoorStyleEvent(_x, _x2, _x3, _x4, _x5, _x6, _x7, _x8, _x9, _x0, _x1, _x10) {
|
|
4
21
|
return _handleChangeDoorStyleEvent.apply(this, arguments);
|
|
5
22
|
}
|
|
6
23
|
function _handleChangeDoorStyleEvent() {
|
|
7
24
|
_handleChangeDoorStyleEvent = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee2(props, state, layer, payload, DOORSTYLE_SCOPE_SINGLE, DOORSTYLE_SCOPE_MULTIPLE, DOORSTYLE_SCOPE_ALL, INTERNAL_EVENT_ITEMS_CATALOG, mapFromCCDFToCDS, ccdfMapper, mergeSameElements, addItemToCatalog) {
|
|
8
|
-
var doorStyle, applyScope, _payload$itemIds, itemIds, itemCDS, layerId, allItems, targetItems, idSet, selectedItemIds, ccdf_list, _loop, i, _props$onInternalEven, _t;
|
|
25
|
+
var doorStyle, applyScope, _payload$itemIds, itemIds, itemCDS, layerId, allItems, moldingData, targetItems, idSet, selectedItemIds, ccdf_list, _loop, i, moldingCCDFList, _props$onInternalEven, _t;
|
|
9
26
|
return _regeneratorRuntime.wrap(function (_context3) {
|
|
10
27
|
while (1) switch (_context3.prev = _context3.next) {
|
|
11
28
|
case 0:
|
|
@@ -13,6 +30,7 @@ function _handleChangeDoorStyleEvent() {
|
|
|
13
30
|
itemCDS = [];
|
|
14
31
|
layerId = state.getIn(['scene', 'selectedLayer']);
|
|
15
32
|
allItems = state.getIn(['scene', 'layers', layerId, 'items']).toJS();
|
|
33
|
+
moldingData = state.getIn(['scene', 'layers', layerId, 'molding']);
|
|
16
34
|
targetItems = []; // Prepare idSet for SINGLE or MULTIPLE
|
|
17
35
|
idSet = null;
|
|
18
36
|
if (applyScope === DOORSTYLE_SCOPE_SINGLE) {
|
|
@@ -40,7 +58,7 @@ function _handleChangeDoorStyleEvent() {
|
|
|
40
58
|
case 4:
|
|
41
59
|
ccdf_list = [];
|
|
42
60
|
_loop = /*#__PURE__*/_regeneratorRuntime.mark(function _loop() {
|
|
43
|
-
var item, _item$ccdf$catalog_ca, _item$ccdf, _item$ccdf$cabinet_id, _item$ccdf2, _doorStyle$
|
|
61
|
+
var item, _item$ccdf$catalog_ca, _item$ccdf, _item$ccdf$cabinet_id, _item$ccdf2, _doorStyle$id3, _item$long_name;
|
|
44
62
|
return _regeneratorRuntime.wrap(function (_context2) {
|
|
45
63
|
while (1) switch (_context2.prev = _context2.next) {
|
|
46
64
|
case 0:
|
|
@@ -54,7 +72,7 @@ function _handleChangeDoorStyleEvent() {
|
|
|
54
72
|
catalog_cabinet_sku: (_item$ccdf$catalog_ca = item === null || item === void 0 || (_item$ccdf = item.ccdf) === null || _item$ccdf === void 0 ? void 0 : _item$ccdf.catalog_cabinet_sku) !== null && _item$ccdf$catalog_ca !== void 0 ? _item$ccdf$catalog_ca : item.sku_number,
|
|
55
73
|
cabinet_id: (_item$ccdf$cabinet_id = item === null || item === void 0 || (_item$ccdf2 = item.ccdf) === null || _item$ccdf2 === void 0 ? void 0 : _item$ccdf2.cabinet_id) !== null && _item$ccdf$cabinet_id !== void 0 ? _item$ccdf$cabinet_id : null,
|
|
56
74
|
ccdf: item.ccdf,
|
|
57
|
-
target_door_finish_id: (_doorStyle$
|
|
75
|
+
target_door_finish_id: (_doorStyle$id3 = doorStyle === null || doorStyle === void 0 ? void 0 : doorStyle.id) !== null && _doorStyle$id3 !== void 0 ? _doorStyle$id3 : null,
|
|
58
76
|
long_name: (_item$long_name = item === null || item === void 0 ? void 0 : item.long_name) !== null && _item$long_name !== void 0 ? _item$long_name : null,
|
|
59
77
|
scene_cabinet_id: item.id
|
|
60
78
|
});
|
|
@@ -77,19 +95,21 @@ function _handleChangeDoorStyleEvent() {
|
|
|
77
95
|
_context3.next = 5;
|
|
78
96
|
break;
|
|
79
97
|
case 7:
|
|
98
|
+
moldingCCDFList = prepareMoldingCCDFList(doorStyle, moldingData);
|
|
80
99
|
if (ccdf_list.length > 0) {
|
|
81
100
|
(_props$onInternalEven = props.onInternalEvent) === null || _props$onInternalEven === void 0 || _props$onInternalEven.call(props, {
|
|
82
101
|
type: INTERNAL_EVENT_ITEMS_CATALOG,
|
|
83
102
|
value: {
|
|
84
103
|
event_type: 'change_door_style',
|
|
85
|
-
ccdf_list: ccdf_list
|
|
104
|
+
ccdf_list: ccdf_list,
|
|
105
|
+
molding_ccdf_list: moldingCCDFList
|
|
86
106
|
}
|
|
87
107
|
},
|
|
88
108
|
/*#__PURE__*/
|
|
89
109
|
// result is ccdf_list
|
|
90
110
|
function () {
|
|
91
111
|
var _ref = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(result) {
|
|
92
|
-
var _result$ccdf_list, _doorStyle$
|
|
112
|
+
var _result$ccdf_list, _doorStyle$id2, _result$molding_ccdf_;
|
|
93
113
|
var mappedCabinetDefinitionList, rt, _i;
|
|
94
114
|
return _regeneratorRuntime.wrap(function (_context) {
|
|
95
115
|
while (1) switch (_context.prev = _context.next) {
|
|
@@ -97,7 +117,7 @@ function _handleChangeDoorStyleEvent() {
|
|
|
97
117
|
// Map CCDF rows back to placed items using stable identity (long_name),
|
|
98
118
|
// because host `cabinet_id` can vary by doorstyle.
|
|
99
119
|
itemCDS = mapFromCCDFToCDS(result === null || result === void 0 ? void 0 : result.ccdf_list, targetItems);
|
|
100
|
-
mappedCabinetDefinitionList = ccdfMapper(result.ccdf_list, layer); // result: ccdf_list
|
|
120
|
+
mappedCabinetDefinitionList = ccdfMapper(result === null || result === void 0 ? void 0 : result.ccdf_list, layer); // result: ccdf_list
|
|
101
121
|
rt = mergeSameElements(mappedCabinetDefinitionList);
|
|
102
122
|
_i = 0;
|
|
103
123
|
case 1:
|
|
@@ -115,7 +135,8 @@ function _handleChangeDoorStyleEvent() {
|
|
|
115
135
|
// Persist ccdf on affected instances so SYNC includes the latest ccdf.id for each item.
|
|
116
136
|
// IMPORTANT: host response `ccdf_list[]` may not include `door_finish_id`.
|
|
117
137
|
// Use request door_finish_id (doorStyle.id) as the source of truth for door_finish_id.
|
|
118
|
-
props.itemsActions.setItemsCCDF((_result$ccdf_list = result === null || result === void 0 ? void 0 : result.ccdf_list) !== null && _result$ccdf_list !== void 0 ? _result$ccdf_list : [], applyScope, itemIds, (_doorStyle$
|
|
138
|
+
props.itemsActions.setItemsCCDF((_result$ccdf_list = result === null || result === void 0 ? void 0 : result.ccdf_list) !== null && _result$ccdf_list !== void 0 ? _result$ccdf_list : [], applyScope, itemIds, (_doorStyle$id2 = doorStyle === null || doorStyle === void 0 ? void 0 : doorStyle.id) !== null && _doorStyle$id2 !== void 0 ? _doorStyle$id2 : null);
|
|
139
|
+
props.itemsActions.setMoldingsCCDF((_result$molding_ccdf_ = result === null || result === void 0 ? void 0 : result.molding_ccdf_list) !== null && _result$molding_ccdf_ !== void 0 ? _result$molding_ccdf_ : [], applyScope);
|
|
119
140
|
props.itemsActions.setDoorStyle(doorStyle, itemCDS, applyScope, itemIds);
|
|
120
141
|
case 4:
|
|
121
142
|
case "end":
|
|
@@ -70,7 +70,7 @@ export function ccdfMapper(ccdf_list, layer) {
|
|
|
70
70
|
});
|
|
71
71
|
}
|
|
72
72
|
// make structure_json
|
|
73
|
-
if (cd.category === 'cabinet' || cd.category === 'Base'
|
|
73
|
+
if (cd.category === 'cabinet' || cd.category === 'Base') structure_json = {
|
|
74
74
|
tempPlaceholders: tempPlaceholders
|
|
75
75
|
};else structure_json = structure;
|
|
76
76
|
// make cabinet definition using structure_json and catalog
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Item, Area } from "../class/export";
|
|
2
2
|
import { history } from "../utils/export";
|
|
3
|
-
import { TOGGLE_LOADING_CABINET, SELECT_TOOL_DRAWING_ITEM, UPDATE_DRAWING_ITEM, END_DRAWING_ITEM, BEGIN_DRAGGING_ITEM, BEGIN_DRAGGING_ITEM_3D, UPDATE_DRAGGING_ITEM, UPDATE_DRAGGING_ITEM_CHANGED, UPDATE_DRAGGING_ITEM_3DX, UPDATE_DRAGGING_ITEM_3DY, END_DRAGGING_ITEM, END_DRAGGING_ITEM_3D, BEGIN_ROTATING_ITEM, BEGIN_ROTATING_ITEM_3D, UPDATE_ROTATING_ITEM, UPDATE_ROTATING_ITEM_CHANGED, END_ROTATING_ITEM, END_ROTATING_ITEM_3D, REPLACE_SUBMODULE, SELECT_ITEM, ANIMATE_OBJECT, REMOVE_REPLACE_SUBMODULE, ITEM_MOVE_UP, SELECT_TOOL_DRAWING_ITEM_3D, SET_DOOR_STYLE, SET_HANDLE_MATERIAL, SET_INITIAL_DOOR_STYLE, UPDATE_ITEM_POSITION, SET_DOOR_HANDLE, SET_WALL_COLOR, END_CREATING_CABINET, UPDATE_POPUP_OPEN, SET_MODELLING, SET_COUNTER_TOP, SET_BACKSPLASH, SET_BACKSPLASH_VISIBLE, SET_APPLIANCE_MATERIAL, DUPLICATE_SELECTED, EDIT_WIDTH, END_LOADING, SET_MOLDING, UPDATE_MOLDING, STORE_DIST_ARRAY, VALIDATE_ITEM_POSTIONS, REPLACE_ITEM, SET_ITEMS_CCDF
|
|
3
|
+
import { TOGGLE_LOADING_CABINET, SELECT_TOOL_DRAWING_ITEM, UPDATE_DRAWING_ITEM, END_DRAWING_ITEM, BEGIN_DRAGGING_ITEM, BEGIN_DRAGGING_ITEM_3D, UPDATE_DRAGGING_ITEM, UPDATE_DRAGGING_ITEM_CHANGED, UPDATE_DRAGGING_ITEM_3DX, UPDATE_DRAGGING_ITEM_3DY, END_DRAGGING_ITEM, END_DRAGGING_ITEM_3D, BEGIN_ROTATING_ITEM, BEGIN_ROTATING_ITEM_3D, UPDATE_ROTATING_ITEM, UPDATE_ROTATING_ITEM_CHANGED, END_ROTATING_ITEM, END_ROTATING_ITEM_3D, REPLACE_SUBMODULE, SELECT_ITEM, ANIMATE_OBJECT, REMOVE_REPLACE_SUBMODULE, ITEM_MOVE_UP, SELECT_TOOL_DRAWING_ITEM_3D, SET_DOOR_STYLE, SET_HANDLE_MATERIAL, SET_INITIAL_DOOR_STYLE, UPDATE_ITEM_POSITION, SET_DOOR_HANDLE, SET_WALL_COLOR, END_CREATING_CABINET, UPDATE_POPUP_OPEN, SET_MODELLING, SET_COUNTER_TOP, SET_BACKSPLASH, SET_BACKSPLASH_VISIBLE, SET_APPLIANCE_MATERIAL, DUPLICATE_SELECTED, EDIT_WIDTH, END_LOADING, SET_MOLDING, UPDATE_MOLDING, STORE_DIST_ARRAY, VALIDATE_ITEM_POSTIONS, REPLACE_ITEM, SET_ITEMS_CCDF, SET_MOLDINGS_CCDF
|
|
4
4
|
// SET_MOVE_STATUS,
|
|
5
5
|
// SET_ROTATE_STATUS
|
|
6
6
|
} from "../constants";
|
|
@@ -136,6 +136,8 @@ export default function (state, action) {
|
|
|
136
136
|
return Item.setInitialDoorStyle(state, action.doorStyle).updatedState;
|
|
137
137
|
case SET_ITEMS_CCDF:
|
|
138
138
|
return Item.setItemsCCDF(state, action.ccdf_list, action.applyScope, action.itemIds, action.doorFinishId).updatedState;
|
|
139
|
+
case SET_MOLDINGS_CCDF:
|
|
140
|
+
return Item.setMoldingsCCDF(state, action.ccdf_list, action.applyScope).updatedState;
|
|
139
141
|
case UPDATE_ITEM_POSITION:
|
|
140
142
|
return Item.updateItemPosition(state, action.layerID, action.itemID, action.pos).updatedState;
|
|
141
143
|
// case SET_MOVE_STATUS:
|
package/es/utils/geometry.js
CHANGED
|
@@ -1645,12 +1645,12 @@ export function calcSnap2(allItemRect, allItemSnap, allLineRects, allLineSnap, a
|
|
|
1645
1645
|
}
|
|
1646
1646
|
});
|
|
1647
1647
|
}
|
|
1648
|
-
if (allItemRect.cur.itemInfo.name.includes('Hood') || allItemRect.cur.itemInfo.name.includes('Range') || allItemRect.cur.itemInfo.name.includes('Cook Top')) {
|
|
1648
|
+
if (allItemRect.cur.itemInfo.name.includes('Hood') || allItemRect.cur.itemInfo.cabinet_category.toLowerCase().includes('hood') || allItemRect.cur.itemInfo.name.includes('Range') || allItemRect.cur.itemInfo.name.includes('Cook Top')) {
|
|
1649
1649
|
var _intersects = allItemRect.others.filter(function (others) {
|
|
1650
1650
|
return intersectRect(others.rect, curitem.rect);
|
|
1651
1651
|
});
|
|
1652
1652
|
_intersects.forEach(function (rect) {
|
|
1653
|
-
if (isPointInArea(allArea, rect.itemInfo) || !allArea.length) if (rect.itemInfo.name.includes('Hood') || rect.itemInfo.name.includes('Range') || rect.itemInfo.name.includes('Cook Top')) {
|
|
1653
|
+
if (isPointInArea(allArea, rect.itemInfo) || !allArea.length) if (rect.itemInfo.name.includes('Hood') || rect.itemInfo.cabinet_category.toLowerCase().includes('hood') || rect.itemInfo.name.includes('Range') || rect.itemInfo.name.includes('Cook Top')) {
|
|
1654
1654
|
nx = rect.itemInfo.x;
|
|
1655
1655
|
ny = rect.itemInfo.y;
|
|
1656
1656
|
rotRad = rect.itemInfo.rotation * Math.PI / 180;
|
|
@@ -2036,9 +2036,11 @@ export function needSnap(curItem, othItem) {
|
|
|
2036
2036
|
var delta;
|
|
2037
2037
|
curFloor > otherFloor ? delta = otherItem.height : delta = currentItem.height;
|
|
2038
2038
|
if (Math.abs(curFloor - otherFloor) < delta) blSnap = true;
|
|
2039
|
+
var isBlsnapOth = othItem.item.category === 'cabinet' && othItem.item.layoutpos === BASE_CABINET_LAYOUTPOS && Math.abs(curFloor - otherFloor) >= delta;
|
|
2040
|
+
var isBlsnapCur = curItem.selectedItem.category === 'cabinet' && curItem.selectedItem.layoutpos === BASE_CABINET_LAYOUTPOS && Math.abs(curFloor - otherFloor) >= delta;
|
|
2039
2041
|
if (curItem.cat.hasOwnProperty('long_name') || othItem.cat && othItem.cat.hasOwnProperty('long_name')) {
|
|
2040
2042
|
if (curItem.cat.long_name.includes('Hood') || othItem.cat && othItem.cat.long_name.includes('Hood')) blSnap = true;
|
|
2041
|
-
if (curItem.cat.long_name.includes('Hood') && othItem.cat &&
|
|
2043
|
+
if (curItem.cat.long_name.includes('Hood') && othItem.cat && isBlsnapOth || isBlsnapCur && othItem.cat.long_name.includes('Hood')) blSnap = false;
|
|
2042
2044
|
if (curItem.cat.long_name.includes('Cook Top') && othItem.cat && othItem.cat.long_name.includes('Cabinet') || curItem.cat.long_name.includes('Cabinet') && othItem.cat && othItem.cat.long_name.includes('Cook Top')) blSnap = true;
|
|
2043
2045
|
}
|
|
2044
2046
|
return blSnap;
|
|
@@ -34,6 +34,7 @@ exports.setInitialDoorStyle = setInitialDoorStyle;
|
|
|
34
34
|
exports.setItemsCCDF = setItemsCCDF;
|
|
35
35
|
exports.setModelling = setModelling;
|
|
36
36
|
exports.setMolding = setMolding;
|
|
37
|
+
exports.setMoldingsCCDF = setMoldingsCCDF;
|
|
37
38
|
exports.setMoveStatus = setMoveStatus;
|
|
38
39
|
exports.setRotateStatus = setRotateStatus;
|
|
39
40
|
exports.setWallColor = setWallColor;
|
|
@@ -380,4 +381,11 @@ function setItemsCCDF(ccdf_list, applyScope) {
|
|
|
380
381
|
itemIds: itemIds,
|
|
381
382
|
doorFinishId: doorFinishId
|
|
382
383
|
};
|
|
384
|
+
}
|
|
385
|
+
function setMoldingsCCDF(ccdf_list, applyScope) {
|
|
386
|
+
return {
|
|
387
|
+
type: _constants.SET_MOLDINGS_CCDF,
|
|
388
|
+
ccdf_list: ccdf_list,
|
|
389
|
+
applyScope: applyScope
|
|
390
|
+
};
|
|
383
391
|
}
|
package/lib/class/item.js
CHANGED
|
@@ -307,6 +307,54 @@ var Item = exports["default"] = /*#__PURE__*/function () {
|
|
|
307
307
|
updatedState: state
|
|
308
308
|
};
|
|
309
309
|
}
|
|
310
|
+
}, {
|
|
311
|
+
key: "setMoldingsCCDF",
|
|
312
|
+
value: function setMoldingsCCDF(state, ccdf_list, applyScope) {
|
|
313
|
+
var layerID = state.getIn(['scene', 'selectedLayer']);
|
|
314
|
+
var layer = state.getIn(['scene', 'layers', layerID]);
|
|
315
|
+
if (!Array.isArray(ccdf_list)) return {
|
|
316
|
+
updatedState: state
|
|
317
|
+
};
|
|
318
|
+
var idSet = null;
|
|
319
|
+
if (applyScope === _constants.DOORSTYLE_SCOPE_SINGLE) {
|
|
320
|
+
var selectedItemIds = state.getIn(['scene', 'layers', layerID, 'selected', 'items']).toJS();
|
|
321
|
+
idSet = new Set(selectedItemIds);
|
|
322
|
+
}
|
|
323
|
+
var layerMoldings = layer.molding;
|
|
324
|
+
if (!(0, _utils.isEmpty)(layerMoldings)) {
|
|
325
|
+
var updatedLayerMoldings = [];
|
|
326
|
+
layerMoldings === null || layerMoldings === void 0 || layerMoldings.forEach(function (md) {
|
|
327
|
+
var moldingID = md.itemID;
|
|
328
|
+
var picked = ccdf_list.find(function (c) {
|
|
329
|
+
return (c === null || c === void 0 ? void 0 : c.cabinet_id) && c.cabinet_id === moldingID;
|
|
330
|
+
});
|
|
331
|
+
md.ccdf = picked;
|
|
332
|
+
updatedLayerMoldings.push(md);
|
|
333
|
+
});
|
|
334
|
+
state = state.setIn(['scene', 'layers', layerID, 'molding'], updatedLayerMoldings);
|
|
335
|
+
}
|
|
336
|
+
layer.items.forEach(function (it) {
|
|
337
|
+
var _idSet2;
|
|
338
|
+
// if (isEmpty(it?.molding)) return;
|
|
339
|
+
var should = applyScope === _constants.DOORSTYLE_SCOPE_ALL ? true : (_idSet2 = idSet) === null || _idSet2 === void 0 ? void 0 : _idSet2.has(it.id);
|
|
340
|
+
if (!should) return;
|
|
341
|
+
var itemMoldings = it.molding;
|
|
342
|
+
var updatedItemMoldings = [];
|
|
343
|
+
itemMoldings === null || itemMoldings === void 0 || itemMoldings.forEach(function (md) {
|
|
344
|
+
var itemMoldingID = md.itemID;
|
|
345
|
+
var picked = ccdf_list.find(function (c) {
|
|
346
|
+
return (c === null || c === void 0 ? void 0 : c.cabinet_id) && c.cabinet_id === itemMoldingID;
|
|
347
|
+
});
|
|
348
|
+
if (!picked) return;
|
|
349
|
+
md.ccdf = picked;
|
|
350
|
+
updatedItemMoldings.push(md);
|
|
351
|
+
});
|
|
352
|
+
state = state.setIn(['scene', 'layers', layerID, 'items', it.id, 'molding'], updatedItemMoldings);
|
|
353
|
+
});
|
|
354
|
+
return {
|
|
355
|
+
updatedState: state
|
|
356
|
+
};
|
|
357
|
+
}
|
|
310
358
|
}, {
|
|
311
359
|
key: "updateDoorHandle",
|
|
312
360
|
value: function updateDoorHandle(item, layer) {
|
|
@@ -689,7 +689,7 @@ function Viewer2D(_ref, _ref2) {
|
|
|
689
689
|
endPoint.x = nx;
|
|
690
690
|
endPoint.y = ny;
|
|
691
691
|
}
|
|
692
|
-
if (allItemRect.cur && allItemRect.cur.itemInfo.name.includes('Hood') || allItemRect.cur && allItemRect.cur.itemInfo.name.includes('Range') || allItemRect.cur && allItemRect.cur.itemInfo.name.includes('Cook Top')) {
|
|
692
|
+
if (allItemRect.cur && allItemRect.cur.itemInfo.name.includes('Hood') || allItemRect.cur.itemInfo.cabinet_category.toLowerCase().includes('hood') || allItemRect.cur && allItemRect.cur.itemInfo.name.includes('Range') || allItemRect.cur && allItemRect.cur.itemInfo.name.includes('Cook Top')) {
|
|
693
693
|
itemsActions.updateDraggingItemChanged(nx, ny, layerID, current_sel_obj_id);
|
|
694
694
|
itemsActions.updateRotatingItemChanged(rot, layerID, current_sel_obj_id);
|
|
695
695
|
endPoint.x = nx;
|
|
@@ -761,7 +761,7 @@ function Viewer2D(_ref, _ref2) {
|
|
|
761
761
|
itemsActions.updateDraggingItemChanged(nx, ny, layerID, current_sel_obj_id);
|
|
762
762
|
itemsActions.updateRotatingItemChanged(rot, layerID, current_sel_obj_id);
|
|
763
763
|
}
|
|
764
|
-
if (allItemRect.cur && allItemRect.cur.itemInfo.name.includes('Hood') || allItemRect.cur && allItemRect.cur.itemInfo.name.includes('Range') || allItemRect.cur && allItemRect.cur.itemInfo.name.includes('Cook Top')) {
|
|
764
|
+
if (allItemRect.cur && allItemRect.cur.itemInfo.name.includes('Hood') || allItemRect.cur.itemInfo.cabinet_category.toLowerCase().includes('hood') || allItemRect.cur && allItemRect.cur.itemInfo.name.includes('Range') || allItemRect.cur && allItemRect.cur.itemInfo.name.includes('Cook Top')) {
|
|
765
765
|
itemsActions.updateDraggingItemChanged(nx, ny, layerID, current_sel_obj_id);
|
|
766
766
|
itemsActions.updateRotatingItemChanged(rot, layerID, current_sel_obj_id);
|
|
767
767
|
}
|
package/lib/constants.js
CHANGED
|
@@ -6,8 +6,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.END_DRAGGING_VERTEX = exports.END_DRAGGING_LINE = exports.END_DRAGGING_ITEM_3D = exports.END_DRAGGING_ITEM = exports.END_DRAGGING_HOLE_3D = exports.END_DRAGGING_HOLE = exports.END_CREATING_HOLE = exports.END_CREATING_CABINET = exports.ELEVATION_VIEW_TITLE = exports.ELEVATION_VIEW_RIGHT = exports.ELEVATION_VIEW_LEFT = exports.ELEVATION_VIEW_KEYWORD = exports.ELEVATION_VIEW_FRONT = exports.ELEVATION_VIEW_BACK = exports.ELEVATION_VIEW = exports.ELEMENT_VERTEX = exports.ELEMENT_LINE = exports.ELEMENT_ITEM = exports.ELEMENT_HOLE = exports.ELEMENT_AREA = exports.EDIT_WIDTH = exports.EDIT = exports.DUPLICATE_SELECTED = exports.DOORSTYLE_SCOPE_SINGLE = exports.DOORSTYLE_SCOPE_MULTIPLE = exports.DOORSTYLE_SCOPE_ALL = exports.DISTANCE_MEASUREMENT_LINE_COLOR = exports.DISTANCE_EPSILON = exports.DIFFERENT_VALUES_PATH_LENGTH = exports.DELTA = exports.DEFAULT_MOLDING_PIECE_LENGTH = exports.DEFAULT_INTERIOR_TEXTURE = exports.DEFAULT_FONT_FAMILY = exports.DEFAULT_DOOR_HANDLE_TEXTURE_URL = exports.DECIMAL_PLACES_3 = exports.DECIMAL_PLACES_2 = exports.DASH_LINE_COLOR = exports.CREATE_ROOM_WITH_SHAPE = exports.COPY_PROPERTIES = exports.CLIENTS_NAME = exports.CHANGE_WINDOW_DOOR_MEASURE = exports.CHANGE_WALL_LENGTH_MEASURE = exports.CHANGE_WALL_CABINET_MEASURE = exports.CHANGE_MEASUREMENT_UNIT = exports.CHANGE_CATALOG_PAGE = exports.CHANGE_BASE_CABINET_MEASURE = exports.CEIL_UNITS_LENGTH = exports.BROWN_COLOR = exports.BOTTOM_MOLDING_LOCATION = exports.BOTTOM = exports.BG_COLOR_OVERLAY = exports.BG_COLOR_HOVER = exports.BG_COLOR_1 = exports.BG_COLOR_0 = exports.BEGIN_UPLOADING_IMAGE = exports.BEGIN_ROTATING_ITEM_3D = exports.BEGIN_ROTATING_ITEM = exports.BEGIN_FITTING_IMAGE = exports.BEGIN_DRAWING_LINE = exports.BEGIN_DRAGGING_VERTEX = exports.BEGIN_DRAGGING_LINE = exports.BEGIN_DRAGGING_ITEM_3D = exports.BEGIN_DRAGGING_ITEM = exports.BEGIN_DRAGGING_HOLE_3D = exports.BEGIN_DRAGGING_HOLE = exports.BASE_ITEM_MEASUREMENT_LINE_COLOR = exports.BASE_CABINET_LAYOUTPOS = exports.BACK_DIST_ANG = exports.ATT_VERTEXT_TWO = exports.ATT_VERTEXT_ONE = exports.ATT_LINE_LENGTH = exports.ATT_ITEM_ROTATION = exports.ATT_ITEM_POS = exports.ATT_HOLE_OFFSET_B = exports.ATT_HOLE_OFFSET_A = exports.ARROW_TEXT_FORECOLOR = exports.ARROW_TEXT_FONTFACE = exports.ARROW_TEXT_BACKCOLOR = exports.ARROW_COLOR = exports.ARRAY_ELEVATION_VIEW_MODES = exports.ARRAY_3D_MODES = exports.AREA_ACTIONS = exports.API_SERVER_URL = exports.ANIMATE_STEP_MIN = exports.ANIMATE_STEP_MAX = exports.ANIMATE_OBJECT_OPEN_DOOR_ROTATION_UNIT = exports.ANIMATE_OBJECT = exports.ALTERATE_STATE = exports.ADD_VERTICAL_GUIDE = exports.ADD_TO_GROUP = exports.ADD_LAYER = exports.ADD_HORIZONTAL_GUIDE = exports.ADD_GROUP_FROM_SELECTED = exports.ADD_GROUP = exports.ADD_ELEMENT_TO_CATALOG = exports.ADD_CIRCULAR_GUIDE = exports.ADD_CABINETS = exports.ADD_APPLIANCES = exports.ACCESSORIES_LAYOUTPOS = exports.ACCENT_COLOR = void 0;
|
|
7
7
|
exports.MODE_DRAGGING_HOLE_3D = exports.MODE_DRAGGING_HOLE = exports.MODE_CONFIGURING_PROJECT = exports.MODE_BACK_ELEVATION_VIEW = exports.MODE_3D_VIEW = exports.MODE_3D_FIRST_PERSON = exports.MODE_2D_ZOOM_OUT = exports.MODE_2D_ZOOM_IN = exports.MODE_2D_PAN = exports.MODE = exports.MIN_ANGLE_DISALLOW_DRAW_WALL = exports.MIDDLE_MOLDING_LOCATION = exports.MEPSILON = exports.MAX_ZOOM_IN_SCALE = exports.MAX_ANGLE_SCALE = exports.MAKE_FLOOR_PLAN = exports.LOGOUT = exports.LOGIN_SUCCESS = exports.LOGIN_ERROR = exports.LOCAL_STORAGE_TOKEN_VALUE = exports.LOCAL_STORAGE_TOKEN_NAME = exports.LOCAL_STORAGE_ORIGINAL_TOKEN = exports.LOCAL_STORAGE_CUSTOMER_INFO = exports.LOCAL_STORAGE_CART_ACTION = exports.LOAD_PROJECT = exports.LIST_QUANTITIES = exports.LIST_PARTS = exports.LINE_THICKNESS = exports.LINE_ACTIONS = exports.LEFT_DIST_ANG = exports.LEFT = exports.LABEL_COLOR = exports.KITCHEN_KONFIGURATOR = exports.KEYBOARD_BUTTON_CODE = exports.ITEM_TYPE = exports.ITEM_MOVE_UP = exports.ITEMS_ACTIONS = exports.INVERT = exports.INTERNAL_EVENT_UNSELECT_ALL = exports.INTERNAL_EVENT_TOGGLE_TO_ELEVATION = exports.INTERNAL_EVENT_SYNC_SCENE = exports.INTERNAL_EVENT_START_DRAW_WALL = exports.INTERNAL_EVENT_SELECT_ELEMENT = exports.INTERNAL_EVENT_ROTATE_ELEMENT = exports.INTERNAL_EVENT_REPLACE_CABINET = exports.INTERNAL_EVENT_ITEMS_CATALOG = exports.INTERNAL_EVENT_DRAW_ELEMENT = exports.INTERNAL_EVENT_DRAG_ELEMENT = exports.INSTALLATION_TYPE_SKU_SUFFIX = exports.INSTALLATION_TYPE_NAME = exports.INSTALLATION_SUFFIX_TYPE = exports.INIT_CATALOG = exports.HOLE_NAMES = exports.HOLE_ACTIONS = exports.HDR_URLS = exports.HAS_LOADINGBAR = exports.GROUP_TRANSLATE = exports.GROUP_ROTATE = exports.GROUP_ACTIONS = exports.GO_BACK_TO_CATALOG_PAGE = exports.FRONT_DIST_ANG = exports.FINISHING_TYPE = exports.FINISHING_TOUCH = exports.EXTERNAL_EVENT_ZOOM_OUT = exports.EXTERNAL_EVENT_ZOOM_IN = exports.EXTERNAL_EVENT_UPDATE_PROPERTY = exports.EXTERNAL_EVENT_UPDATE_ATTRIBUTE = exports.EXTERNAL_EVENT_UNDO = exports.EXTERNAL_EVENT_TOGGLE_TO_ELEVATION = exports.EXTERNAL_EVENT_TOGGLE_TO_3D = exports.EXTERNAL_EVENT_TOGGLE_TO_2D = exports.EXTERNAL_EVENT_SYNC_SCENE = exports.EXTERNAL_EVENT_SET_MOLDING = exports.EXTERNAL_EVENT_SET_FINISHING = exports.EXTERNAL_EVENT_ROTATE_PAN = exports.EXTERNAL_EVENT_REPLACE_CABINET = exports.EXTERNAL_EVENT_REDO = exports.EXTERNAL_EVENT_PROJECT_SETTING = exports.EXTERNAL_EVENT_NEW_PROJECT = exports.EXTERNAL_EVENT_MOVE_PAN = exports.EXTERNAL_EVENT_LOAD_PROJECT = exports.EXTERNAL_EVENT_DUPLICATE_ELEMENT = exports.EXTERNAL_EVENT_DELETE_ELEMENT = exports.EXTERNAL_EVENT_CHANGE_DOORSTYLE = exports.EXTERNAL_EVENT_CENTERING_2D = exports.EXTERNAL_EVENT_ADD_WALL = exports.EXTERNAL_EVENT_ADD_ROOM_SHAPE = exports.EXTERNAL_EVENT_ADD_ITEM = exports.EXTERNAL_EVENT_ADD_HOLE = exports.ERROR_DATABASE = exports.EPSILON = exports.END_UPLOADING_IMAGE = exports.END_ROTATING_ITEM_3D = exports.END_ROTATING_ITEM = exports.END_LOADING = exports.END_FITTING_IMAGE = exports.END_DRAWING_LINE = exports.END_DRAWING_ITEM = exports.END_DRAWING_HOLE_3D = exports.END_DRAWING_HOLE = void 0;
|
|
8
8
|
exports.SELECT_TOOL_ZOOM_IN = exports.SELECT_TOOL_UPLOAD_IMAGE = exports.SELECT_TOOL_PAN = exports.SELECT_TOOL_EDIT = exports.SELECT_TOOL_DRAWING_LINE = exports.SELECT_TOOL_DRAWING_ITEM_3D = exports.SELECT_TOOL_DRAWING_ITEM = exports.SELECT_TOOL_DRAWING_HOLE_3D = exports.SELECT_TOOL_DRAWING_HOLE = exports.SELECT_TOOL_3D_VIEW = exports.SELECT_TOOL_3D_FIRST_PERSON = exports.SELECT_LINE = exports.SELECT_LAYER = exports.SELECT_ITEM = exports.SELECT_HOLE = exports.SELECT_GROUP = exports.SELECT_DOOR_STYLE = exports.SELECT_AREA = exports.SELECT_ALL = exports.SELECTALL = exports.SECONDARY_PURPLE_COLOR = exports.SECONDARY_BLUE_COLOR = exports.SCENE_ACTIONS = exports.SAVE_PROJECT = exports.SAVE_DESIGN = exports.ROOM_SHAPE_TYPE = exports.ROOM_SHAPE_MEASUREMENT_LINE_COLOR = exports.ROOM_ELEMENT_MEASUREMENT_LINE_COLOR = exports.ROLLBACK = exports.RIGHT_DIST_ANG = exports.RIGHT = exports.REVIEW_AND_QUOTE = exports.REQUEST_ASSISTANCE = exports.REPLACE_SUBMODULE = exports.REPLACE_ITEM = exports.REMOVE_VERTICAL_GUIDE = exports.REMOVE_REPLACE_SUBMODULE = exports.REMOVE_LINEAR = exports.REMOVE_LAYER = exports.REMOVE_HORIZONTAL_GUIDE = exports.REMOVE_GROUP_AND_DELETE_ELEMENTS = exports.REMOVE_GROUP = exports.REMOVE_FROM_GROUP = exports.REMOVE_DRAWING_SUPPORT = exports.REMOVE_CIRCULAR_GUIDE = exports.REMOVE = exports.REDO = exports.RECREATE = exports.PUSH_LAST_SELECTED_CATALOG_ELEMENT_TO_HISTORY = exports.PROP_RESIZE_WIDTH = exports.PROP_RESIZE_HEIGHT = exports.PROP_RESIZE_DEPTH = exports.PROP_OPEN_DOORS = exports.PROP_FLIP_DOOR_HANDLE = exports.PROP_ALTITUDE = exports.PROJECT_SETTING_OPTION = exports.PROJECT_RE_NAME = exports.PROJECT_NAME_LENGTH_LIMIT = exports.PROJECT_ACTIONS = exports.PRODUCT = exports.PRIMARY_GREEN_COLOR = exports.PASTE_PROPERTIES = exports.OVERLAP_SOME = exports.OVERLAP_SAME = exports.OVERLAP_NONE = exports.OVERLAP_LINK = exports.OVERLAP_INCLUDED = exports.OPEN_PROJECT_CONFIGURATOR = exports.OPEN_CATALOG = exports.OBJTYPE_MESH = exports.OBJTYPE_GROUP = exports.NO_DATA_DATABASE = exports.NEW_PROJECT_BTN = exports.NEW_PROJECT = exports.NEW_DESIGN = exports.MOVE_COMPONENT = exports.MOLDING_LOCATIONS = exports.MODE_WAITING_DRAWING_LINE = exports.MODE_VIEWING_CATALOG = exports.MODE_UPLOADING_IMAGE = exports.MODE_SNAPPING = exports.MODE_ROTATING_ITEM_3D = exports.MODE_ROTATING_ITEM = exports.MODE_RIGHT_ELEVATION_VIEW = exports.MODE_LEFT_ELEVATION_VIEW = exports.MODE_IDLE_3D = exports.MODE_IDLE = exports.MODE_FRONT_VIEW = exports.MODE_FRONT_ELEVATION_VIEW = exports.MODE_FITTING_IMAGE = exports.MODE_ELEVATION_VIEW = exports.MODE_DRAWING_LINE = exports.MODE_DRAWING_ITEM_3D = exports.MODE_DRAWING_ITEM = exports.MODE_DRAWING_HOLE_3D = exports.MODE_DRAWING_HOLE = exports.MODE_DRAGGING_VERTEX = exports.MODE_DRAGGING_LINE = exports.MODE_DRAGGING_ITEM_3D = exports.MODE_DRAGGING_ITEM = void 0;
|
|
9
|
-
exports.
|
|
10
|
-
exports.ZOOM_VARIABLE = exports.WARRANTY_VIEW = exports.WARRANTY_SUPPORT = exports.WARNING_MESSAGE = exports.WALL_ITEM_MEASUREMENT_LINE_COLOR = exports.WALL_CABINET_LAYOUTPOS = exports.VIEWER3D_ACTIONS = exports.VIEWER2D_ACTIONS = exports.VERTEX_ACTIONS = exports.VANITY_CABINET_LAYOUTPOS = exports.VALIDATE_ITEM_POSTIONS = exports.USER_ACTIONS = exports.UPDATE_ZOOM_SCALE = exports.UPDATE_ROTATING_ITEM_CHANGED = exports.UPDATE_ROTATING_ITEM = exports.UPDATE_ROTATING = exports.UPDATE_POPUP_OPEN = exports.UPDATE_MOVING_STATE = exports.UPDATE_MOUSE_COORDS = exports.UPDATE_MOLDING = exports.UPDATE_ITEM_POSITION = exports.UPDATE_DRAWING_LINE = exports.UPDATE_DRAWING_ITEM = exports.UPDATE_DRAWING_HOLE_3D = exports.UPDATE_DRAWING_HOLE = exports.UPDATE_DRAGGING_VERTEX = exports.UPDATE_DRAGGING_LINE = exports.UPDATE_DRAGGING_ITEM_CHANGED = exports.UPDATE_DRAGGING_ITEM_3DY = exports.UPDATE_DRAGGING_ITEM_3DX = exports.UPDATE_DRAGGING_ITEM = exports.UPDATE_DRAGGING_HOLE_RULER_CHANGED = exports.UPDATE_DRAGGING_HOLE_CHANGED = exports.UPDATE_DRAGGING_HOLE_3D = exports.UPDATE_DRAGGING_HOLE = exports.UPDATE_CEIL_HEIGHT_UNIT = void 0;
|
|
9
|
+
exports.UPDATE_3D_CEIL_HEIGHT_UNIT = exports.UPDATE_3D_CEIL_HEIGHT = exports.UPDATE_2D_CAMERA = exports.UNSELECT_GROUP = exports.UNSELECT_ALL = exports.UNIT_MILLIMETER = exports.UNIT_MILE = exports.UNIT_METER = exports.UNIT_INCH_LONG = exports.UNIT_INCH = exports.UNIT_FOOT = exports.UNIT_CENTIMETER = exports.UNIT_ANGLE = exports.UNITS_LENGTH = exports.UNDO = exports.UNCREATE = exports.TWO_D_FLOOR_PLAN = exports.TOP_MOLDING_LOCATION = exports.TOP = exports.TOGGLE_SNAP = exports.TOGGLE_LOADING_CABINET = exports.TOE_KICK_MOLDING = exports.TITLE_SMALL_COLOR = exports.TITLE_COLOR = exports.THROW_WARNING = exports.THROW_ERROR = exports.TEXT_COLOR_NEUTRAL_7 = exports.TEXT_COLOR_NEUTRAL_6 = exports.TEXT_COLOR_NEUTRAL_5 = exports.TEXT_COLOR_NEUTRAL_4 = exports.TEXT_COLOR_NEUTRAL_3 = exports.TEXT_COLOR_NEUTRAL_2 = exports.TEXT_COLOR_NEUTRAL_1 = exports.TEXT_COLOR_NEUTRAL_0 = exports.TEXT_COLOR = exports.TECHNICAL_VIEW = exports.TALL_CABINET_LAYOUTPOS = exports.TAKE_PICTURE = exports.SUBTOTAL = exports.SUBMIT_REQUEST_ASSIST = exports.SUBMIT_DESIGN = exports.SUBMIT_ADD_CART = exports.STORE_DIST_ARRAY = exports.STOP_DRAWING_LINE = exports.STEP_CABINET_CHOOSE_PRODUCT = exports.STATUS_WARNING_LIGHT_COLOR = exports.STATUS_WARNING_COLOR = exports.STATUS_POSITIVE_LIGHT_COLOR = exports.STATUS_POSITIVE_COLOR = exports.STATUS_OVERDUE_LIGHT_COLOR = exports.STATUS_OVERDUE_COLOR = exports.STATUS_NEGATIVE_LIGHT_COLOR = exports.STATUS_NEGATIVE_COLOR = exports.STATUS_INFO_LIGHT_COLOR = exports.STATUS_INFO_COLOR = exports.SHIFT2DON = exports.SHIFT2DOFF = exports.SHAPE_SVG_WIDTH = exports.SHAPE_SVG_PADDING = exports.SHAPE_SVG_DEPTH = exports.SHADE_LIGHT_PURPLE_COLOR = exports.SHADE_LIGHT_GREEN_COLOR = exports.SHADE_LIGHT_BLUE_COLOR = exports.SHADE_DARK_PURPLE_COLOR = exports.SHADE_DARK_GREEN_COLOR = exports.SHADE_DARK_BLUE_COLOR = exports.SET_WALL_COLOR = exports.SET_USER_DATA = exports.SET_STATE_PROPERTIES = exports.SET_ROTATE_STATUS = exports.SET_RELATED_LINE = exports.SET_PROPERTIES = exports.SET_PROJECT_PROPERTIES = exports.SET_PROJECT_ID = exports.SET_MOVE_STATUS = exports.SET_MOLDINGS_CCDF = exports.SET_MOLDING = exports.SET_MODELLING = exports.SET_MODE = exports.SET_LINES_ATTRIBUTES = exports.SET_LAYER_PROPERTIES = exports.SET_ITEMS_CCDF = exports.SET_ITEMS_ATTRIBUTES = exports.SET_IS_HELP = exports.SET_IS_CABINET_DRAWING = exports.SET_INITIAL_DOOR_STYLE = exports.SET_HOLES_ATTRIBUTES = exports.SET_HANDLE_MATERIAL = exports.SET_GROUP_PROPERTIES = exports.SET_GROUP_BARYCENTER = exports.SET_GROUP_ATTRIBUTES = exports.SET_FLOOR_STYLES = exports.SET_DOOR_STYLE = exports.SET_DOOR_HANDLE = exports.SET_DISTANT = exports.SET_COUNTER_TOP = exports.SET_BACKSPLASH_VISIBLE = exports.SET_BACKSPLASH = exports.SET_APPLIANCE_MATERIAL = exports.SELECT_TOOL_ZOOM_OUT = void 0;
|
|
10
|
+
exports.ZOOM_VARIABLE = exports.WARRANTY_VIEW = exports.WARRANTY_SUPPORT = exports.WARNING_MESSAGE = exports.WALL_ITEM_MEASUREMENT_LINE_COLOR = exports.WALL_CABINET_LAYOUTPOS = exports.VIEWER3D_ACTIONS = exports.VIEWER2D_ACTIONS = exports.VERTEX_ACTIONS = exports.VANITY_CABINET_LAYOUTPOS = exports.VALIDATE_ITEM_POSTIONS = exports.USER_ACTIONS = exports.UPDATE_ZOOM_SCALE = exports.UPDATE_ROTATING_ITEM_CHANGED = exports.UPDATE_ROTATING_ITEM = exports.UPDATE_ROTATING = exports.UPDATE_POPUP_OPEN = exports.UPDATE_MOVING_STATE = exports.UPDATE_MOUSE_COORDS = exports.UPDATE_MOLDING = exports.UPDATE_ITEM_POSITION = exports.UPDATE_DRAWING_LINE = exports.UPDATE_DRAWING_ITEM = exports.UPDATE_DRAWING_HOLE_3D = exports.UPDATE_DRAWING_HOLE = exports.UPDATE_DRAGGING_VERTEX = exports.UPDATE_DRAGGING_LINE = exports.UPDATE_DRAGGING_ITEM_CHANGED = exports.UPDATE_DRAGGING_ITEM_3DY = exports.UPDATE_DRAGGING_ITEM_3DX = exports.UPDATE_DRAGGING_ITEM = exports.UPDATE_DRAGGING_HOLE_RULER_CHANGED = exports.UPDATE_DRAGGING_HOLE_CHANGED = exports.UPDATE_DRAGGING_HOLE_3D = exports.UPDATE_DRAGGING_HOLE = exports.UPDATE_CEIL_HEIGHT_UNIT = exports.UPDATE_CEIL_HEIGHT = void 0;
|
|
11
11
|
//API server
|
|
12
12
|
// export const API_SERVER = 'http://localhost:3000/';
|
|
13
13
|
// ACTIONS project
|
|
@@ -137,6 +137,7 @@ var SET_APPLIANCE_MATERIAL = exports.SET_APPLIANCE_MATERIAL = 'SET_APPLIANCE_MAT
|
|
|
137
137
|
var SET_MOVE_STATUS = exports.SET_MOVE_STATUS = 'SET_MOVE_STATUS';
|
|
138
138
|
var SET_ROTATE_STATUS = exports.SET_ROTATE_STATUS = 'SET_ROTATE_STATUS';
|
|
139
139
|
var SET_ITEMS_CCDF = exports.SET_ITEMS_CCDF = 'SET_ITEMS_CCDF';
|
|
140
|
+
var SET_MOLDINGS_CCDF = exports.SET_MOLDINGS_CCDF = 'SET_MOLDINGS_CCDF';
|
|
140
141
|
//ACTIONS groups
|
|
141
142
|
var ADD_GROUP = exports.ADD_GROUP = 'ADD_GROUP';
|
|
142
143
|
var ADD_GROUP_FROM_SELECTED = exports.ADD_GROUP_FROM_SELECTED = 'ADD_GROUP_FROM_SELECTED';
|
|
@@ -328,7 +329,8 @@ var ITEMS_ACTIONS = exports.ITEMS_ACTIONS = {
|
|
|
328
329
|
STORE_DIST_ARRAY: STORE_DIST_ARRAY,
|
|
329
330
|
VALIDATE_ITEM_POSTIONS: VALIDATE_ITEM_POSTIONS,
|
|
330
331
|
REPLACE_ITEM: REPLACE_ITEM,
|
|
331
|
-
SET_ITEMS_CCDF: SET_ITEMS_CCDF
|
|
332
|
+
SET_ITEMS_CCDF: SET_ITEMS_CCDF,
|
|
333
|
+
SET_MOLDINGS_CCDF: SET_MOLDINGS_CCDF
|
|
332
334
|
};
|
|
333
335
|
var HOLE_ACTIONS = exports.HOLE_ACTIONS = {
|
|
334
336
|
SELECT_HOLE: SELECT_HOLE,
|
|
@@ -103,7 +103,8 @@ function _parseTempPlaceholdersFromCabinetPayload() {
|
|
|
103
103
|
has_single_door = false;
|
|
104
104
|
fixedPHs = 0;
|
|
105
105
|
temp.forEach(function (t, index) {
|
|
106
|
-
var
|
|
106
|
+
var _t$data;
|
|
107
|
+
var nodes = t === null || t === void 0 || (_t$data = t.data) === null || _t$data === void 0 ? void 0 : _t$data.nodes;
|
|
107
108
|
if (nodes === undefined) {
|
|
108
109
|
nodes = [];
|
|
109
110
|
}
|
|
@@ -234,7 +235,8 @@ function _parseTempPlaceholdersFromCabinetPayload() {
|
|
|
234
235
|
return felement.name === 'base_drawer_door' + t.name.slice(-2);
|
|
235
236
|
});
|
|
236
237
|
if (ph_temp != undefined) {
|
|
237
|
-
var
|
|
238
|
+
var _ph_temp$data$nodes, _ph_temp;
|
|
239
|
+
var ph_drawer_door_handle = (_ph_temp$data$nodes = (_ph_temp = ph_temp) === null || _ph_temp === void 0 || (_ph_temp = _ph_temp.data) === null || _ph_temp === void 0 ? void 0 : _ph_temp.nodes) !== null && _ph_temp$data$nodes !== void 0 ? _ph_temp$data$nodes : [];
|
|
238
240
|
ph_drawer_door_handle = ph_drawer_door_handle.filter(function (element) {
|
|
239
241
|
return element.name.startsWith('ph_') && element.name.includes('handle');
|
|
240
242
|
});
|
|
@@ -7,12 +7,29 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
exports.handleChangeDoorStyleEvent = handleChangeDoorStyleEvent;
|
|
8
8
|
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
9
9
|
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
10
|
+
function prepareMoldingCCDFList(doorStyle, moldingData) {
|
|
11
|
+
var moldingCCDFs = [];
|
|
12
|
+
for (var i = 0; i < moldingData.length; i++) {
|
|
13
|
+
var _molding$ccdf$catalog, _molding$ccdf, _molding$ccdf$cabinet, _molding$ccdf2, _doorStyle$id, _molding$long_name;
|
|
14
|
+
var molding = moldingData[i];
|
|
15
|
+
moldingCCDFs.push({
|
|
16
|
+
sizeinfo: molding.sizeinfo,
|
|
17
|
+
catalog_cabinet_sku: (_molding$ccdf$catalog = molding === null || molding === void 0 || (_molding$ccdf = molding.ccdf) === null || _molding$ccdf === void 0 ? void 0 : _molding$ccdf.catalog_cabinet_sku) !== null && _molding$ccdf$catalog !== void 0 ? _molding$ccdf$catalog : molding.sku_number,
|
|
18
|
+
cabinet_id: (_molding$ccdf$cabinet = molding === null || molding === void 0 || (_molding$ccdf2 = molding.ccdf) === null || _molding$ccdf2 === void 0 ? void 0 : _molding$ccdf2.cabinet_id) !== null && _molding$ccdf$cabinet !== void 0 ? _molding$ccdf$cabinet : molding.itemID,
|
|
19
|
+
ccdf: molding.ccdf,
|
|
20
|
+
target_door_finish_id: (_doorStyle$id = doorStyle === null || doorStyle === void 0 ? void 0 : doorStyle.id) !== null && _doorStyle$id !== void 0 ? _doorStyle$id : null,
|
|
21
|
+
long_name: (_molding$long_name = molding === null || molding === void 0 ? void 0 : molding.long_name) !== null && _molding$long_name !== void 0 ? _molding$long_name : null,
|
|
22
|
+
id: molding.itemID
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
return moldingCCDFs;
|
|
26
|
+
}
|
|
10
27
|
function handleChangeDoorStyleEvent(_x, _x2, _x3, _x4, _x5, _x6, _x7, _x8, _x9, _x0, _x1, _x10) {
|
|
11
28
|
return _handleChangeDoorStyleEvent.apply(this, arguments);
|
|
12
29
|
}
|
|
13
30
|
function _handleChangeDoorStyleEvent() {
|
|
14
31
|
_handleChangeDoorStyleEvent = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee2(props, state, layer, payload, DOORSTYLE_SCOPE_SINGLE, DOORSTYLE_SCOPE_MULTIPLE, DOORSTYLE_SCOPE_ALL, INTERNAL_EVENT_ITEMS_CATALOG, mapFromCCDFToCDS, ccdfMapper, mergeSameElements, addItemToCatalog) {
|
|
15
|
-
var doorStyle, applyScope, _payload$itemIds, itemIds, itemCDS, layerId, allItems, targetItems, idSet, selectedItemIds, ccdf_list, _loop, i, _props$onInternalEven, _t;
|
|
32
|
+
var doorStyle, applyScope, _payload$itemIds, itemIds, itemCDS, layerId, allItems, moldingData, targetItems, idSet, selectedItemIds, ccdf_list, _loop, i, moldingCCDFList, _props$onInternalEven, _t;
|
|
16
33
|
return _regenerator["default"].wrap(function (_context3) {
|
|
17
34
|
while (1) switch (_context3.prev = _context3.next) {
|
|
18
35
|
case 0:
|
|
@@ -20,6 +37,7 @@ function _handleChangeDoorStyleEvent() {
|
|
|
20
37
|
itemCDS = [];
|
|
21
38
|
layerId = state.getIn(['scene', 'selectedLayer']);
|
|
22
39
|
allItems = state.getIn(['scene', 'layers', layerId, 'items']).toJS();
|
|
40
|
+
moldingData = state.getIn(['scene', 'layers', layerId, 'molding']);
|
|
23
41
|
targetItems = []; // Prepare idSet for SINGLE or MULTIPLE
|
|
24
42
|
idSet = null;
|
|
25
43
|
if (applyScope === DOORSTYLE_SCOPE_SINGLE) {
|
|
@@ -47,7 +65,7 @@ function _handleChangeDoorStyleEvent() {
|
|
|
47
65
|
case 4:
|
|
48
66
|
ccdf_list = [];
|
|
49
67
|
_loop = /*#__PURE__*/_regenerator["default"].mark(function _loop() {
|
|
50
|
-
var item, _item$ccdf$catalog_ca, _item$ccdf, _item$ccdf$cabinet_id, _item$ccdf2, _doorStyle$
|
|
68
|
+
var item, _item$ccdf$catalog_ca, _item$ccdf, _item$ccdf$cabinet_id, _item$ccdf2, _doorStyle$id3, _item$long_name;
|
|
51
69
|
return _regenerator["default"].wrap(function (_context2) {
|
|
52
70
|
while (1) switch (_context2.prev = _context2.next) {
|
|
53
71
|
case 0:
|
|
@@ -61,7 +79,7 @@ function _handleChangeDoorStyleEvent() {
|
|
|
61
79
|
catalog_cabinet_sku: (_item$ccdf$catalog_ca = item === null || item === void 0 || (_item$ccdf = item.ccdf) === null || _item$ccdf === void 0 ? void 0 : _item$ccdf.catalog_cabinet_sku) !== null && _item$ccdf$catalog_ca !== void 0 ? _item$ccdf$catalog_ca : item.sku_number,
|
|
62
80
|
cabinet_id: (_item$ccdf$cabinet_id = item === null || item === void 0 || (_item$ccdf2 = item.ccdf) === null || _item$ccdf2 === void 0 ? void 0 : _item$ccdf2.cabinet_id) !== null && _item$ccdf$cabinet_id !== void 0 ? _item$ccdf$cabinet_id : null,
|
|
63
81
|
ccdf: item.ccdf,
|
|
64
|
-
target_door_finish_id: (_doorStyle$
|
|
82
|
+
target_door_finish_id: (_doorStyle$id3 = doorStyle === null || doorStyle === void 0 ? void 0 : doorStyle.id) !== null && _doorStyle$id3 !== void 0 ? _doorStyle$id3 : null,
|
|
65
83
|
long_name: (_item$long_name = item === null || item === void 0 ? void 0 : item.long_name) !== null && _item$long_name !== void 0 ? _item$long_name : null,
|
|
66
84
|
scene_cabinet_id: item.id
|
|
67
85
|
});
|
|
@@ -84,19 +102,21 @@ function _handleChangeDoorStyleEvent() {
|
|
|
84
102
|
_context3.next = 5;
|
|
85
103
|
break;
|
|
86
104
|
case 7:
|
|
105
|
+
moldingCCDFList = prepareMoldingCCDFList(doorStyle, moldingData);
|
|
87
106
|
if (ccdf_list.length > 0) {
|
|
88
107
|
(_props$onInternalEven = props.onInternalEvent) === null || _props$onInternalEven === void 0 || _props$onInternalEven.call(props, {
|
|
89
108
|
type: INTERNAL_EVENT_ITEMS_CATALOG,
|
|
90
109
|
value: {
|
|
91
110
|
event_type: 'change_door_style',
|
|
92
|
-
ccdf_list: ccdf_list
|
|
111
|
+
ccdf_list: ccdf_list,
|
|
112
|
+
molding_ccdf_list: moldingCCDFList
|
|
93
113
|
}
|
|
94
114
|
},
|
|
95
115
|
/*#__PURE__*/
|
|
96
116
|
// result is ccdf_list
|
|
97
117
|
function () {
|
|
98
118
|
var _ref = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee(result) {
|
|
99
|
-
var _result$ccdf_list, _doorStyle$
|
|
119
|
+
var _result$ccdf_list, _doorStyle$id2, _result$molding_ccdf_;
|
|
100
120
|
var mappedCabinetDefinitionList, rt, _i;
|
|
101
121
|
return _regenerator["default"].wrap(function (_context) {
|
|
102
122
|
while (1) switch (_context.prev = _context.next) {
|
|
@@ -104,7 +124,7 @@ function _handleChangeDoorStyleEvent() {
|
|
|
104
124
|
// Map CCDF rows back to placed items using stable identity (long_name),
|
|
105
125
|
// because host `cabinet_id` can vary by doorstyle.
|
|
106
126
|
itemCDS = mapFromCCDFToCDS(result === null || result === void 0 ? void 0 : result.ccdf_list, targetItems);
|
|
107
|
-
mappedCabinetDefinitionList = ccdfMapper(result.ccdf_list, layer); // result: ccdf_list
|
|
127
|
+
mappedCabinetDefinitionList = ccdfMapper(result === null || result === void 0 ? void 0 : result.ccdf_list, layer); // result: ccdf_list
|
|
108
128
|
rt = mergeSameElements(mappedCabinetDefinitionList);
|
|
109
129
|
_i = 0;
|
|
110
130
|
case 1:
|
|
@@ -122,7 +142,8 @@ function _handleChangeDoorStyleEvent() {
|
|
|
122
142
|
// Persist ccdf on affected instances so SYNC includes the latest ccdf.id for each item.
|
|
123
143
|
// IMPORTANT: host response `ccdf_list[]` may not include `door_finish_id`.
|
|
124
144
|
// Use request door_finish_id (doorStyle.id) as the source of truth for door_finish_id.
|
|
125
|
-
props.itemsActions.setItemsCCDF((_result$ccdf_list = result === null || result === void 0 ? void 0 : result.ccdf_list) !== null && _result$ccdf_list !== void 0 ? _result$ccdf_list : [], applyScope, itemIds, (_doorStyle$
|
|
145
|
+
props.itemsActions.setItemsCCDF((_result$ccdf_list = result === null || result === void 0 ? void 0 : result.ccdf_list) !== null && _result$ccdf_list !== void 0 ? _result$ccdf_list : [], applyScope, itemIds, (_doorStyle$id2 = doorStyle === null || doorStyle === void 0 ? void 0 : doorStyle.id) !== null && _doorStyle$id2 !== void 0 ? _doorStyle$id2 : null);
|
|
146
|
+
props.itemsActions.setMoldingsCCDF((_result$molding_ccdf_ = result === null || result === void 0 ? void 0 : result.molding_ccdf_list) !== null && _result$molding_ccdf_ !== void 0 ? _result$molding_ccdf_ : [], applyScope);
|
|
126
147
|
props.itemsActions.setDoorStyle(doorStyle, itemCDS, applyScope, itemIds);
|
|
127
148
|
case 4:
|
|
128
149
|
case "end":
|
|
@@ -77,7 +77,7 @@ function ccdfMapper(ccdf_list, layer) {
|
|
|
77
77
|
});
|
|
78
78
|
}
|
|
79
79
|
// make structure_json
|
|
80
|
-
if (cd.category === 'cabinet' || cd.category === 'Base'
|
|
80
|
+
if (cd.category === 'cabinet' || cd.category === 'Base') structure_json = {
|
|
81
81
|
tempPlaceholders: tempPlaceholders
|
|
82
82
|
};else structure_json = structure;
|
|
83
83
|
// make cabinet definition using structure_json and catalog
|
|
@@ -139,6 +139,8 @@ function _default(state, action) {
|
|
|
139
139
|
return _export.Item.setInitialDoorStyle(state, action.doorStyle).updatedState;
|
|
140
140
|
case _constants.SET_ITEMS_CCDF:
|
|
141
141
|
return _export.Item.setItemsCCDF(state, action.ccdf_list, action.applyScope, action.itemIds, action.doorFinishId).updatedState;
|
|
142
|
+
case _constants.SET_MOLDINGS_CCDF:
|
|
143
|
+
return _export.Item.setMoldingsCCDF(state, action.ccdf_list, action.applyScope).updatedState;
|
|
142
144
|
case _constants.UPDATE_ITEM_POSITION:
|
|
143
145
|
return _export.Item.updateItemPosition(state, action.layerID, action.itemID, action.pos).updatedState;
|
|
144
146
|
// case SET_MOVE_STATUS:
|
package/lib/utils/geometry.js
CHANGED
|
@@ -1749,12 +1749,12 @@ function calcSnap2(allItemRect, allItemSnap, allLineRects, allLineSnap, allRect,
|
|
|
1749
1749
|
}
|
|
1750
1750
|
});
|
|
1751
1751
|
}
|
|
1752
|
-
if (allItemRect.cur.itemInfo.name.includes('Hood') || allItemRect.cur.itemInfo.name.includes('Range') || allItemRect.cur.itemInfo.name.includes('Cook Top')) {
|
|
1752
|
+
if (allItemRect.cur.itemInfo.name.includes('Hood') || allItemRect.cur.itemInfo.cabinet_category.toLowerCase().includes('hood') || allItemRect.cur.itemInfo.name.includes('Range') || allItemRect.cur.itemInfo.name.includes('Cook Top')) {
|
|
1753
1753
|
var _intersects = allItemRect.others.filter(function (others) {
|
|
1754
1754
|
return intersectRect(others.rect, curitem.rect);
|
|
1755
1755
|
});
|
|
1756
1756
|
_intersects.forEach(function (rect) {
|
|
1757
|
-
if (isPointInArea(allArea, rect.itemInfo) || !allArea.length) if (rect.itemInfo.name.includes('Hood') || rect.itemInfo.name.includes('Range') || rect.itemInfo.name.includes('Cook Top')) {
|
|
1757
|
+
if (isPointInArea(allArea, rect.itemInfo) || !allArea.length) if (rect.itemInfo.name.includes('Hood') || rect.itemInfo.cabinet_category.toLowerCase().includes('hood') || rect.itemInfo.name.includes('Range') || rect.itemInfo.name.includes('Cook Top')) {
|
|
1758
1758
|
nx = rect.itemInfo.x;
|
|
1759
1759
|
ny = rect.itemInfo.y;
|
|
1760
1760
|
rotRad = rect.itemInfo.rotation * Math.PI / 180;
|
|
@@ -2140,9 +2140,11 @@ function needSnap(curItem, othItem) {
|
|
|
2140
2140
|
var delta;
|
|
2141
2141
|
curFloor > otherFloor ? delta = otherItem.height : delta = currentItem.height;
|
|
2142
2142
|
if (Math.abs(curFloor - otherFloor) < delta) blSnap = true;
|
|
2143
|
+
var isBlsnapOth = othItem.item.category === 'cabinet' && othItem.item.layoutpos === _constants.BASE_CABINET_LAYOUTPOS && Math.abs(curFloor - otherFloor) >= delta;
|
|
2144
|
+
var isBlsnapCur = curItem.selectedItem.category === 'cabinet' && curItem.selectedItem.layoutpos === _constants.BASE_CABINET_LAYOUTPOS && Math.abs(curFloor - otherFloor) >= delta;
|
|
2143
2145
|
if (curItem.cat.hasOwnProperty('long_name') || othItem.cat && othItem.cat.hasOwnProperty('long_name')) {
|
|
2144
2146
|
if (curItem.cat.long_name.includes('Hood') || othItem.cat && othItem.cat.long_name.includes('Hood')) blSnap = true;
|
|
2145
|
-
if (curItem.cat.long_name.includes('Hood') && othItem.cat &&
|
|
2147
|
+
if (curItem.cat.long_name.includes('Hood') && othItem.cat && isBlsnapOth || isBlsnapCur && othItem.cat.long_name.includes('Hood')) blSnap = false;
|
|
2146
2148
|
if (curItem.cat.long_name.includes('Cook Top') && othItem.cat && othItem.cat.long_name.includes('Cabinet') || curItem.cat.long_name.includes('Cabinet') && othItem.cat && othItem.cat.long_name.includes('Cook Top')) blSnap = true;
|
|
2147
2149
|
}
|
|
2148
2150
|
return blSnap;
|