kitchen-simulator 4.4.1 → 4.4.2
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/constants.js +3 -1
- package/es/utils/isolate-event-handler.js +507 -125
- package/es/utils/molding.js +3 -235
- package/es/utils/skinPanelEngine.js +14 -1
- package/lib/constants.js +8 -6
- package/lib/utils/isolate-event-handler.js +506 -124
- package/lib/utils/molding.js +3 -236
- package/lib/utils/skinPanelEngine.js +14 -1
- package/package.json +1 -1
|
@@ -48,7 +48,7 @@ var __svgCache = new _immutable.Map(); // url -> Promise<svgData|null>
|
|
|
48
48
|
function loadJSON(_x) {
|
|
49
49
|
return _loadJSON.apply(this, arguments);
|
|
50
50
|
}
|
|
51
|
-
|
|
51
|
+
/********Parse TempPlaceholder from cabinetPayloadData **************/
|
|
52
52
|
function _loadJSON() {
|
|
53
53
|
_loadJSON = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee3(path) {
|
|
54
54
|
var p;
|
|
@@ -87,27 +87,407 @@ function _loadJSON() {
|
|
|
87
87
|
}));
|
|
88
88
|
return _loadJSON.apply(this, arguments);
|
|
89
89
|
}
|
|
90
|
-
function
|
|
90
|
+
function parseTempPlaceholdersFromCabinetPayload(_x2) {
|
|
91
|
+
return _parseTempPlaceholdersFromCabinetPayload.apply(this, arguments);
|
|
92
|
+
}
|
|
93
|
+
/***** Update cabinetPayloadData with updatedTempPlaceholders *****/
|
|
94
|
+
function _parseTempPlaceholdersFromCabinetPayload() {
|
|
95
|
+
_parseTempPlaceholdersFromCabinetPayload = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee4(cabinetPayload) {
|
|
96
|
+
var link, keys, temp, i, _cabinetPayload$struc, _cabinetPayload$struc2, tempPlaceholdersData, _loop3, tempData, doorKey, drawerKey, fixedKey, doorPHs, drawerPHs, has_single_door, fixedPHs, k, _cabinetPayload$struc3, _t2, _t3, _t4;
|
|
97
|
+
return _regenerator["default"].wrap(function (_context5) {
|
|
98
|
+
while (1) switch (_context5.prev = _context5.next) {
|
|
99
|
+
case 0:
|
|
100
|
+
link = '';
|
|
101
|
+
keys = Object.keys(cabinetPayload.structure_json);
|
|
102
|
+
temp = [];
|
|
103
|
+
i = 0;
|
|
104
|
+
case 1:
|
|
105
|
+
if (!(i < keys.length)) {
|
|
106
|
+
_context5.next = 4;
|
|
107
|
+
break;
|
|
108
|
+
}
|
|
109
|
+
if (!((_cabinetPayload$struc = cabinetPayload.structure_json[keys[i]]) !== null && _cabinetPayload$struc !== void 0 && (_cabinetPayload$struc = _cabinetPayload$struc.toString()) !== null && _cabinetPayload$struc !== void 0 && _cabinetPayload$struc.includes('.gltf') && (_cabinetPayload$struc2 = cabinetPayload.structure_json[keys[i]]) !== null && _cabinetPayload$struc2 !== void 0 && (_cabinetPayload$struc2 = _cabinetPayload$struc2.toString()) !== null && _cabinetPayload$struc2 !== void 0 && _cabinetPayload$struc2.startsWith('http'))) {
|
|
110
|
+
_context5.next = 3;
|
|
111
|
+
break;
|
|
112
|
+
}
|
|
113
|
+
link = cabinetPayload.structure_json[keys[i]];
|
|
114
|
+
_t2 = temp;
|
|
115
|
+
_t3 = keys[i];
|
|
116
|
+
_context5.next = 2;
|
|
117
|
+
return loadJSON(link);
|
|
118
|
+
case 2:
|
|
119
|
+
_t4 = _context5.sent;
|
|
120
|
+
_t2.push.call(_t2, {
|
|
121
|
+
name: _t3,
|
|
122
|
+
data: _t4
|
|
123
|
+
});
|
|
124
|
+
case 3:
|
|
125
|
+
i++;
|
|
126
|
+
_context5.next = 1;
|
|
127
|
+
break;
|
|
128
|
+
case 4:
|
|
129
|
+
tempPlaceholdersData = [];
|
|
130
|
+
_loop3 = /*#__PURE__*/_regenerator["default"].mark(function _loop3(k) {
|
|
131
|
+
var el;
|
|
132
|
+
return _regenerator["default"].wrap(function (_context4) {
|
|
133
|
+
while (1) switch (_context4.prev = _context4.next) {
|
|
134
|
+
case 0:
|
|
135
|
+
el = cabinetPayload.structure_json.tempPlaceholders[k].id;
|
|
136
|
+
tempData = {};
|
|
137
|
+
doorKey = 0;
|
|
138
|
+
drawerKey = 0;
|
|
139
|
+
fixedKey = 0;
|
|
140
|
+
doorPHs = 0;
|
|
141
|
+
drawerPHs = 0;
|
|
142
|
+
has_single_door = false;
|
|
143
|
+
fixedPHs = 0;
|
|
144
|
+
temp.forEach(function (t, index) {
|
|
145
|
+
var nodes = t.data.nodes;
|
|
146
|
+
if (nodes === undefined) {
|
|
147
|
+
nodes = [];
|
|
148
|
+
}
|
|
149
|
+
var tempPlaceholders = nodes.filter(function (element) {
|
|
150
|
+
return element.name.startsWith('ph_');
|
|
151
|
+
});
|
|
152
|
+
tempPlaceholders.sort(function (a, b) {
|
|
153
|
+
return a.name > b.name ? 1 : -1;
|
|
154
|
+
});
|
|
155
|
+
if (tempPlaceholders.length > 0) {
|
|
156
|
+
if (t.name === 'base') {
|
|
157
|
+
tempPlaceholders.map(function (element) {
|
|
158
|
+
var sink_match = element.name.match(/\d_(sink_[^LR12]*)(_[LR12])?$/);
|
|
159
|
+
if (sink_match && sink_match.length >= 2) {
|
|
160
|
+
var _process$env$API_URL, _cabinetPayload$struc4;
|
|
161
|
+
tempData['sink'] = tempData['sink'] || [];
|
|
162
|
+
tempData['sink'].push(element.name);
|
|
163
|
+
var sink_url = (_process$env$API_URL = process.env.API_URL) !== null && _process$env$API_URL !== void 0 ? _process$env$API_URL :
|
|
164
|
+
// server url from 3DTool env
|
|
165
|
+
import.meta.env.VITE_APP_API_URL + // server url from Host env
|
|
166
|
+
"/uploads/assets/default/".concat(sink_match[1], ".gltf");
|
|
167
|
+
if (cabinetPayload !== null && cabinetPayload !== void 0 && (_cabinetPayload$struc4 = cabinetPayload.structure_json) !== null && _cabinetPayload$struc4 !== void 0 && (_cabinetPayload$struc4 = _cabinetPayload$struc4.tempPlaceholders[k]) !== null && _cabinetPayload$struc4 !== void 0 && _cabinetPayload$struc4.structure) cabinetPayload.structure_json.tempPlaceholders[k].structure.sink = sink_url;
|
|
168
|
+
} else if (temp.some(function (felement) {
|
|
169
|
+
return felement.name.includes('base_drawer');
|
|
170
|
+
}) && element.name.includes('interior_drawer')) {
|
|
171
|
+
var objCnt = temp.filter(function (felement) {
|
|
172
|
+
return felement.name.includes('base_drawer') && !felement.name.includes('_door');
|
|
173
|
+
}).length;
|
|
174
|
+
var phCnt = tempPlaceholders.filter(function (felement) {
|
|
175
|
+
return felement.name.includes('interior');
|
|
176
|
+
}).length;
|
|
177
|
+
drawerPHs = phCnt;
|
|
178
|
+
if (objCnt === 1 || phCnt % objCnt !== 0) {
|
|
179
|
+
if (tempData['base_drawer_1'] === undefined) {
|
|
180
|
+
tempData['base_drawer_1'] = [];
|
|
181
|
+
}
|
|
182
|
+
tempData['base_drawer_1'].push(element.name);
|
|
183
|
+
drawerKey++;
|
|
184
|
+
} else if (objCnt > 1 && phCnt % objCnt === 0) {
|
|
185
|
+
if (tempData['base_drawer_' + (drawerKey % objCnt + 1)] === undefined) {
|
|
186
|
+
tempData['base_drawer_' + (drawerKey % objCnt + 1)] = [];
|
|
187
|
+
}
|
|
188
|
+
tempData['base_drawer_' + (drawerKey % objCnt + 1)].push(element.name);
|
|
189
|
+
drawerKey++;
|
|
190
|
+
}
|
|
191
|
+
} else if (temp.some(function (felement) {
|
|
192
|
+
return felement.name.includes('base_door');
|
|
193
|
+
}) && !element.name.includes('interior_drawer') && !element.name.includes('drawer') && element.name.includes('door')) {
|
|
194
|
+
var _objCnt = temp.filter(function (felement) {
|
|
195
|
+
return felement.name.includes('base_door');
|
|
196
|
+
}).length;
|
|
197
|
+
var _phCnt = tempPlaceholders.filter(function (felement) {
|
|
198
|
+
return !felement.name.includes('interior') && !felement.name.includes('drawer') && felement.name.includes('door');
|
|
199
|
+
}).length;
|
|
200
|
+
doorPHs = _phCnt;
|
|
201
|
+
if (_objCnt === 1 || _phCnt % _objCnt !== 0) {
|
|
202
|
+
if (tempData['base_door_1'] === undefined) {
|
|
203
|
+
tempData['base_door_1'] = [];
|
|
204
|
+
}
|
|
205
|
+
tempData['base_door_1'].push(element.name);
|
|
206
|
+
doorKey++;
|
|
207
|
+
} else if (_objCnt > 1) {
|
|
208
|
+
if (tempData['base_door_' + (doorKey % _objCnt + 1)] === undefined) {
|
|
209
|
+
tempData['base_door_' + (doorKey % _objCnt + 1)] = [];
|
|
210
|
+
}
|
|
211
|
+
tempData['base_door_' + (doorKey % _objCnt + 1)].push(element.name);
|
|
212
|
+
doorKey++;
|
|
213
|
+
}
|
|
214
|
+
} else if (temp.some(function (felement) {
|
|
215
|
+
return felement.name.includes('base_fixed_drawer_door');
|
|
216
|
+
}) && element.name.includes('_drawer_door_fixed')) {
|
|
217
|
+
var _objCnt2 = temp.filter(function (felement) {
|
|
218
|
+
return felement.name.includes('base_fixed_drawer_door');
|
|
219
|
+
}).length;
|
|
220
|
+
var _phCnt2 = tempPlaceholders.filter(function (felement) {
|
|
221
|
+
return felement.name.includes('_drawer_door_fixed');
|
|
222
|
+
}).length;
|
|
223
|
+
fixedPHs = _phCnt2;
|
|
224
|
+
if (_objCnt2 === 1 || _phCnt2 % _objCnt2 !== 0) {
|
|
225
|
+
if (tempData['base_fixed_drawer_door_1'] === undefined) {
|
|
226
|
+
tempData['base_fixed_drawer_door_1'] = [];
|
|
227
|
+
}
|
|
228
|
+
tempData['base_fixed_drawer_door_1'].push(element.name);
|
|
229
|
+
fixedKey++;
|
|
230
|
+
} else if (_objCnt2 > 1) {
|
|
231
|
+
if (tempData['base_fixed_drawer_door_' + (fixedKey % _objCnt2 + 1)] === undefined) {
|
|
232
|
+
tempData['base_fixed_drawer_door_' + (fixedKey % _objCnt2 + 1)] = [];
|
|
233
|
+
}
|
|
234
|
+
tempData['base_fixed_drawer_door_' + (fixedKey % _objCnt2 + 1)].push(element.name);
|
|
235
|
+
fixedKey++;
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
});
|
|
239
|
+
} else if (t.name.includes('base_drawer') && !t.name.includes('_door')) {
|
|
240
|
+
var objCnt = temp.filter(function (felement) {
|
|
241
|
+
return felement.name.includes('base_drawer') && !felement.name.includes('_door');
|
|
242
|
+
}).length;
|
|
243
|
+
if (objCnt === 1 || drawerPHs % objCnt !== 0) {
|
|
244
|
+
if (tempData['base_drawer_door_1'] === undefined) tempData['base_drawer_door_1'] = [];
|
|
245
|
+
//get drawer door handle placeholders
|
|
246
|
+
var ph_temp = temp.find(function (felement) {
|
|
247
|
+
return felement.name === 'base_drawer_door_1';
|
|
248
|
+
});
|
|
249
|
+
if (ph_temp != undefined) {
|
|
250
|
+
var ph_drawer_door_handle = ph_temp.data.nodes;
|
|
251
|
+
ph_drawer_door_handle = ph_drawer_door_handle.filter(function (element) {
|
|
252
|
+
return element.name.startsWith('ph_') && element.name.includes('handle');
|
|
253
|
+
});
|
|
254
|
+
for (var w = 0; w < drawerPHs; w++) {
|
|
255
|
+
if (!tempData['base_drawer_door_1'].some(function (el) {
|
|
256
|
+
return el === 'base_drawer_door_1/' + tempPlaceholders[0].name;
|
|
257
|
+
})) {
|
|
258
|
+
tempData['base_drawer_door_1'].push('base_drawer_1/' + tempPlaceholders[0].name);
|
|
259
|
+
//add drawer door handle placeholders
|
|
260
|
+
if (tempData['drawer_door_handle_1'] === undefined) tempData['drawer_door_handle_1'] = [];
|
|
261
|
+
if (ph_drawer_door_handle.length > 0) tempData['drawer_door_handle_1'].push('base_drawer_door_1/' + ph_drawer_door_handle[0].name);
|
|
262
|
+
}
|
|
263
|
+
}
|
|
264
|
+
}
|
|
265
|
+
} else if (objCnt > 1 && drawerPHs > 0 && drawerPHs % objCnt === 0) {
|
|
266
|
+
if (tempData['base_drawer_door' + t.name.slice(-2)] === undefined) tempData['base_drawer_door' + t.name.slice(-2)] = [];
|
|
267
|
+
//get drawer door handle placeholders
|
|
268
|
+
var ph_temp = temp.find(function (felement) {
|
|
269
|
+
return felement.name === 'base_drawer_door' + t.name.slice(-2);
|
|
270
|
+
});
|
|
271
|
+
if (ph_temp != undefined) {
|
|
272
|
+
var ph_drawer_door_handle = ph_temp.data.nodes;
|
|
273
|
+
ph_drawer_door_handle = ph_drawer_door_handle.filter(function (element) {
|
|
274
|
+
return element.name.startsWith('ph_') && element.name.includes('handle');
|
|
275
|
+
});
|
|
276
|
+
tempPlaceholders.forEach(function (element) {
|
|
277
|
+
if (!tempData['base_drawer_door' + t.name.slice(-2)].some(function (el) {
|
|
278
|
+
return el === t.name + '/' + element.name;
|
|
279
|
+
})) {
|
|
280
|
+
tempData['base_drawer_door' + t.name.slice(-2)].push(t.name + '/' + element.name);
|
|
281
|
+
//add drawer door handle placeholders
|
|
282
|
+
if (tempData['drawer_door_handle' + t.name.slice(-2)] === undefined) tempData['drawer_door_handle' + t.name.slice(-2)] = [];
|
|
283
|
+
if (ph_drawer_door_handle.length > 0) tempData['drawer_door_handle' + t.name.slice(-2)].push('base_drawer_door' + t.name.slice(-2) + '/' + ph_drawer_door_handle[0].name);
|
|
284
|
+
}
|
|
285
|
+
});
|
|
286
|
+
}
|
|
287
|
+
}
|
|
288
|
+
} else if (t.name.includes('base_door')) {
|
|
289
|
+
var _objCnt3 = temp.filter(function (felement) {
|
|
290
|
+
return felement.name.includes('base_door');
|
|
291
|
+
}).length;
|
|
292
|
+
tempPlaceholders = tempPlaceholders.filter(function (el) {
|
|
293
|
+
return el.name.includes('handle');
|
|
294
|
+
});
|
|
295
|
+
if (tempPlaceholders.length > 0) if (_objCnt3 === 1 || doorPHs % _objCnt3 !== 0) {
|
|
296
|
+
if (tempData['door_handle_1'] === undefined) {
|
|
297
|
+
tempData['door_handle_1'] = [];
|
|
298
|
+
}
|
|
299
|
+
var _loop4 = function _loop4() {
|
|
300
|
+
var phname = tempPlaceholders[0].name;
|
|
301
|
+
var newph = undefined;
|
|
302
|
+
if (tempData['base_door_1'][_w].isLeftPlaceholder()) {
|
|
303
|
+
newph = tempPlaceholders.find(function (el) {
|
|
304
|
+
return el.name.isRightPlaceholder();
|
|
305
|
+
});
|
|
306
|
+
}
|
|
307
|
+
if (tempData['base_door_1'][_w].isRightPlaceholder()) {
|
|
308
|
+
newph = tempPlaceholders.find(function (el) {
|
|
309
|
+
return el.name.isLeftPlaceholder();
|
|
310
|
+
});
|
|
311
|
+
}
|
|
312
|
+
if (newph != undefined) {
|
|
313
|
+
phname = newph.name;
|
|
314
|
+
}
|
|
315
|
+
if (doorPHs === 1 && tempPlaceholders.find(function (el) {
|
|
316
|
+
return el.name.isLeftPlaceholder();
|
|
317
|
+
}) != undefined && tempPlaceholders.find(function (el) {
|
|
318
|
+
return el.name.isRightPlaceholder();
|
|
319
|
+
}) != undefined) {
|
|
320
|
+
has_single_door = true;
|
|
321
|
+
}
|
|
322
|
+
if (!tempData['door_handle_1'].some(function (el) {
|
|
323
|
+
return el === 'door_handle_1/' + phname;
|
|
324
|
+
})) {
|
|
325
|
+
tempData['door_handle_1'].push('base_door_1/' + phname);
|
|
326
|
+
}
|
|
327
|
+
};
|
|
328
|
+
for (var _w = 0; _w < doorPHs; _w++) {
|
|
329
|
+
_loop4();
|
|
330
|
+
}
|
|
331
|
+
} else if (_objCnt3 > 1 && doorPHs > 0 && doorPHs % _objCnt3 === 0) {
|
|
332
|
+
if (tempData['door_handle' + t.name.slice(-2)] === undefined) tempData['door_handle' + t.name.slice(-2)] = [];
|
|
333
|
+
var phname = tempPlaceholders[0].name;
|
|
334
|
+
var newph = undefined;
|
|
335
|
+
var blAdd = true;
|
|
336
|
+
if (cabinetPayload.is_corner) {
|
|
337
|
+
if (tempData['base_door' + t.name.slice(-2)][0].isLeftPlaceholder()) {
|
|
338
|
+
newph = tempPlaceholders.find(function (el) {
|
|
339
|
+
return el.name.isLeftPlaceholder();
|
|
340
|
+
});
|
|
341
|
+
} else {
|
|
342
|
+
blAdd = false;
|
|
343
|
+
}
|
|
344
|
+
} else {
|
|
345
|
+
if (tempData['base_door' + t.name.slice(-2)][0].isLeftPlaceholder()) {
|
|
346
|
+
newph = tempPlaceholders.find(function (el) {
|
|
347
|
+
return el.name.isRightPlaceholder();
|
|
348
|
+
});
|
|
349
|
+
}
|
|
350
|
+
if (tempData['base_door' + t.name.slice(-2)][0].isRightPlaceholder()) {
|
|
351
|
+
newph = tempPlaceholders.find(function (el) {
|
|
352
|
+
return el.name.isLeftPlaceholder();
|
|
353
|
+
});
|
|
354
|
+
}
|
|
355
|
+
}
|
|
356
|
+
if (blAdd) {
|
|
357
|
+
if (newph != undefined) {
|
|
358
|
+
phname = newph.name;
|
|
359
|
+
}
|
|
360
|
+
if (!tempData['door_handle' + t.name.slice(-2)].some(function (el) {
|
|
361
|
+
return el === t.name + '/' + phname;
|
|
362
|
+
})) {
|
|
363
|
+
tempData['door_handle' + t.name.slice(-2)].push(t.name + '/' + phname);
|
|
364
|
+
}
|
|
365
|
+
}
|
|
366
|
+
}
|
|
367
|
+
} else if (t.name.includes('base_fixed_drawer_door')) {
|
|
368
|
+
var _objCnt4 = temp.filter(function (felement) {
|
|
369
|
+
return felement.name.includes('base_fixed_drawer_door');
|
|
370
|
+
}).length;
|
|
371
|
+
tempPlaceholders = tempPlaceholders.filter(function (el) {
|
|
372
|
+
return el.name.includes('handle');
|
|
373
|
+
});
|
|
374
|
+
if (tempPlaceholders.length > 0) if (_objCnt4 === 1 || fixedPHs % _objCnt4 !== 0) {
|
|
375
|
+
if (tempData['fixed_drawer_door_handle_1'] === undefined) tempData['fixed_drawer_door_handle_1'] = [];
|
|
376
|
+
var _loop5 = function _loop5() {
|
|
377
|
+
var phname = tempPlaceholders[0].name;
|
|
378
|
+
var newph = undefined;
|
|
379
|
+
if (tempData['base_fixed_drawer_door_1'][_w2].isLeftPlaceholder()) {
|
|
380
|
+
newph = tempPlaceholders.find(function (el) {
|
|
381
|
+
return el.name.isRightPlaceholder();
|
|
382
|
+
});
|
|
383
|
+
}
|
|
384
|
+
if (tempData['base_fixed_drawer_door_1'][_w2].isRightPlaceholder()) {
|
|
385
|
+
newph = tempPlaceholders.find(function (el) {
|
|
386
|
+
return el.name.isLeftPlaceholder();
|
|
387
|
+
});
|
|
388
|
+
}
|
|
389
|
+
if (newph != undefined) {
|
|
390
|
+
phname = newph.name;
|
|
391
|
+
}
|
|
392
|
+
if (!tempData['fixed_drawer_door_handle_1'].some(function (el) {
|
|
393
|
+
return el === 'fixed_drawer_door_handle_1/' + phname;
|
|
394
|
+
})) {
|
|
395
|
+
tempData['fixed_drawer_door_handle_1'].push('base_fixed_drawer_door_1/' + phname);
|
|
396
|
+
}
|
|
397
|
+
};
|
|
398
|
+
for (var _w2 = 0; _w2 < fixedPHs; _w2++) {
|
|
399
|
+
_loop5();
|
|
400
|
+
}
|
|
401
|
+
} else if (_objCnt4 > 1 && fixedPHs > 0 && fixedPHs % _objCnt4 === 0) {
|
|
402
|
+
if (tempData['fixed_drawer_door_handle' + t.name.slice(-2)] === undefined) {
|
|
403
|
+
tempData['fixed_drawer_door_handle' + t.name.slice(-2)] = [];
|
|
404
|
+
}
|
|
405
|
+
var _phname = tempPlaceholders[0].name;
|
|
406
|
+
var _newph = undefined;
|
|
407
|
+
if (tempData['base_fixed_drawer_door' + t.name.slice(-2)][0].isLeftPlaceholder()) {
|
|
408
|
+
_newph = tempPlaceholders.find(function (el) {
|
|
409
|
+
return el.name.isRightPlaceholder();
|
|
410
|
+
});
|
|
411
|
+
}
|
|
412
|
+
if (tempData['base_fixed_drawer_door' + t.name.slice(-2)][0].isRightPlaceholder()) {
|
|
413
|
+
_newph = tempPlaceholders.find(function (el) {
|
|
414
|
+
return el.name.isLeftPlaceholder();
|
|
415
|
+
});
|
|
416
|
+
}
|
|
417
|
+
if (_newph != undefined) {
|
|
418
|
+
_phname = _newph.name;
|
|
419
|
+
}
|
|
420
|
+
if (!tempData['fixed_drawer_door_handle' + t.name.slice(-2)].some(function (el) {
|
|
421
|
+
return el === t.name + '/' + _phname;
|
|
422
|
+
})) {
|
|
423
|
+
tempData['fixed_drawer_door_handle' + t.name.slice(-2)].push(t.name + '/' + _phname);
|
|
424
|
+
}
|
|
425
|
+
}
|
|
426
|
+
}
|
|
427
|
+
}
|
|
428
|
+
});
|
|
429
|
+
tempPlaceholdersData.push({
|
|
430
|
+
id: parseInt(el, 10),
|
|
431
|
+
placeholders: tempData,
|
|
432
|
+
structure: cabinetPayload.structure_json.tempPlaceholders[k].structure
|
|
433
|
+
});
|
|
434
|
+
case 1:
|
|
435
|
+
case "end":
|
|
436
|
+
return _context4.stop();
|
|
437
|
+
}
|
|
438
|
+
}, _loop3);
|
|
439
|
+
});
|
|
440
|
+
k = 0;
|
|
441
|
+
case 5:
|
|
442
|
+
if (!(k < (cabinetPayload === null || cabinetPayload === void 0 || (_cabinetPayload$struc3 = cabinetPayload.structure_json) === null || _cabinetPayload$struc3 === void 0 || (_cabinetPayload$struc3 = _cabinetPayload$struc3.tempPlaceholders) === null || _cabinetPayload$struc3 === void 0 ? void 0 : _cabinetPayload$struc3.length))) {
|
|
443
|
+
_context5.next = 7;
|
|
444
|
+
break;
|
|
445
|
+
}
|
|
446
|
+
return _context5.delegateYield(_loop3(k), "t0", 6);
|
|
447
|
+
case 6:
|
|
448
|
+
k++;
|
|
449
|
+
_context5.next = 5;
|
|
450
|
+
break;
|
|
451
|
+
case 7:
|
|
452
|
+
return _context5.abrupt("return", tempPlaceholdersData);
|
|
453
|
+
case 8:
|
|
454
|
+
case "end":
|
|
455
|
+
return _context5.stop();
|
|
456
|
+
}
|
|
457
|
+
}, _callee4);
|
|
458
|
+
}));
|
|
459
|
+
return _parseTempPlaceholdersFromCabinetPayload.apply(this, arguments);
|
|
460
|
+
}
|
|
461
|
+
function updateCabinetPayload(_x3) {
|
|
91
462
|
return _updateCabinetPayload.apply(this, arguments);
|
|
92
463
|
}
|
|
93
464
|
function _updateCabinetPayload() {
|
|
94
|
-
_updateCabinetPayload = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function
|
|
465
|
+
_updateCabinetPayload = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee5(cabinetPayload) {
|
|
95
466
|
var cabinetPayloadKeys, i, _cabinetPayload$cabin, _cabinetPayload$cabin2;
|
|
96
|
-
return _regenerator["default"].wrap(function (
|
|
97
|
-
while (1) switch (
|
|
467
|
+
return _regenerator["default"].wrap(function (_context6) {
|
|
468
|
+
while (1) switch (_context6.prev = _context6.next) {
|
|
98
469
|
case 0:
|
|
470
|
+
// let tempPlaceholders = [];
|
|
471
|
+
// tempPlaceholders = await parseTempPlaceholdersFromCabinetPayload(
|
|
472
|
+
// cabinetPayload
|
|
473
|
+
// );
|
|
99
474
|
cabinetPayloadKeys = Object.keys(cabinetPayload);
|
|
100
475
|
for (i = 0; i < cabinetPayloadKeys.length; i++) {
|
|
101
476
|
if (cabinetPayloadKeys[i] === 'structure_json') {
|
|
102
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
|
+
// cabinetPayload[cabinetPayloadKeys[i]]['placeholders'] =
|
|
480
|
+
// tempPlaceholders[0].placeholders;
|
|
481
|
+
// cabinetPayload[cabinetPayloadKeys[i]]['tempPlaceholders'] =
|
|
482
|
+
// tempPlaceholders;
|
|
103
483
|
}
|
|
104
484
|
}
|
|
105
|
-
return
|
|
485
|
+
return _context6.abrupt("return", cabinetPayload);
|
|
106
486
|
case 1:
|
|
107
487
|
case "end":
|
|
108
|
-
return
|
|
488
|
+
return _context6.stop();
|
|
109
489
|
}
|
|
110
|
-
},
|
|
490
|
+
}, _callee5);
|
|
111
491
|
}));
|
|
112
492
|
return _updateCabinetPayload.apply(this, arguments);
|
|
113
493
|
}
|
|
@@ -179,34 +559,34 @@ var loadSVGsByItem = /*#__PURE__*/function () {
|
|
|
179
559
|
}
|
|
180
560
|
}, _callee2);
|
|
181
561
|
}));
|
|
182
|
-
return function loadSVGsByItem(
|
|
562
|
+
return function loadSVGsByItem(_x4) {
|
|
183
563
|
return _ref.apply(this, arguments);
|
|
184
564
|
};
|
|
185
565
|
}();
|
|
186
|
-
function addItemToCatalog(
|
|
566
|
+
function addItemToCatalog(_x5, _x6, _x7, _x8) {
|
|
187
567
|
return _addItemToCatalog.apply(this, arguments);
|
|
188
568
|
} // Get attributs of current selected element
|
|
189
569
|
function _addItemToCatalog() {
|
|
190
|
-
_addItemToCatalog = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function
|
|
570
|
+
_addItemToCatalog = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee6(element, state, catalogInstance, projectActions) {
|
|
191
571
|
var _elementJs, _elementJs3;
|
|
192
572
|
var elementJs, outlineSVGData, _state$getIn, _elementJs$structure_, _elementJs$structure_2, _elementJs$structure_3, cds, _cds$find, _elementJs2, currentCdsId, cdsIdx, ttph, updatedStructureJson, catalogElements, catalogElementKeys, catalogItem, k, _catalogElements$cata, tempPlaceholderArray, _catalogItem$structur, newTempPlaceholderArray, mergedTempPlaceholder;
|
|
193
|
-
return _regenerator["default"].wrap(function (
|
|
194
|
-
while (1) switch (
|
|
573
|
+
return _regenerator["default"].wrap(function (_context7) {
|
|
574
|
+
while (1) switch (_context7.prev = _context7.next) {
|
|
195
575
|
case 0:
|
|
196
576
|
if (!(0, _helper.isEmpty)(element === null || element === void 0 ? void 0 : element.name)) {
|
|
197
|
-
|
|
577
|
+
_context7.next = 1;
|
|
198
578
|
break;
|
|
199
579
|
}
|
|
200
|
-
return
|
|
580
|
+
return _context7.abrupt("return");
|
|
201
581
|
case 1:
|
|
202
582
|
// clone element
|
|
203
583
|
elementJs = Object.assign({}, element); // if (isEmpty(catalog?.elements[element.name])) {
|
|
204
|
-
|
|
584
|
+
_context7.next = 2;
|
|
205
585
|
return loadSVGsByItem(elementJs);
|
|
206
586
|
case 2:
|
|
207
|
-
outlineSVGData =
|
|
587
|
+
outlineSVGData = _context7.sent;
|
|
208
588
|
if (!(((_elementJs = elementJs) === null || _elementJs === void 0 ? void 0 : _elementJs.type) === 'cabinet')) {
|
|
209
|
-
|
|
589
|
+
_context7.next = 4;
|
|
210
590
|
break;
|
|
211
591
|
}
|
|
212
592
|
// move the tempPlaceholder of current door style to first of tempPlaceholders array
|
|
@@ -234,13 +614,13 @@ function _addItemToCatalog() {
|
|
|
234
614
|
}
|
|
235
615
|
});
|
|
236
616
|
if ((0, _helper.isEmpty)((_elementJs$structure_3 = elementJs.structure_json) === null || _elementJs$structure_3 === void 0 ? void 0 : _elementJs$structure_3.tempPlaceholders)) {
|
|
237
|
-
|
|
617
|
+
_context7.next = 4;
|
|
238
618
|
break;
|
|
239
619
|
}
|
|
240
|
-
|
|
620
|
+
_context7.next = 3;
|
|
241
621
|
return updateCabinetPayload(elementJs);
|
|
242
622
|
case 3:
|
|
243
|
-
elementJs =
|
|
623
|
+
elementJs = _context7.sent;
|
|
244
624
|
case 4:
|
|
245
625
|
elementJs = _objectSpread(_objectSpread({}, elementJs), {}, {
|
|
246
626
|
outlineSVGData: outlineSVGData,
|
|
@@ -257,18 +637,18 @@ function _addItemToCatalog() {
|
|
|
257
637
|
k = 0;
|
|
258
638
|
case 5:
|
|
259
639
|
if (!(k < catalogElementKeys.length)) {
|
|
260
|
-
|
|
640
|
+
_context7.next = 7;
|
|
261
641
|
break;
|
|
262
642
|
}
|
|
263
643
|
if (!(((_catalogElements$cata = catalogElements[catalogElementKeys[k]]) === null || _catalogElements$cata === void 0 ? void 0 : _catalogElements$cata.itemID) === elementJs.itemID)) {
|
|
264
|
-
|
|
644
|
+
_context7.next = 6;
|
|
265
645
|
break;
|
|
266
646
|
}
|
|
267
647
|
catalogItem = catalogElements[catalogElementKeys[k]];
|
|
268
|
-
return
|
|
648
|
+
return _context7.abrupt("continue", 7);
|
|
269
649
|
case 6:
|
|
270
650
|
k++;
|
|
271
|
-
|
|
651
|
+
_context7.next = 5;
|
|
272
652
|
break;
|
|
273
653
|
case 7:
|
|
274
654
|
// get old tempPlaceholder array from catalog item
|
|
@@ -299,9 +679,9 @@ function _addItemToCatalog() {
|
|
|
299
679
|
}
|
|
300
680
|
case 8:
|
|
301
681
|
case "end":
|
|
302
|
-
return
|
|
682
|
+
return _context7.stop();
|
|
303
683
|
}
|
|
304
|
-
},
|
|
684
|
+
}, _callee6);
|
|
305
685
|
}));
|
|
306
686
|
return _addItemToCatalog.apply(this, arguments);
|
|
307
687
|
}
|
|
@@ -661,15 +1041,15 @@ function getElement(objProps, state) {
|
|
|
661
1041
|
}
|
|
662
1042
|
return curObject;
|
|
663
1043
|
}
|
|
664
|
-
function loadMoldingSvg(
|
|
1044
|
+
function loadMoldingSvg(_x9) {
|
|
665
1045
|
return _loadMoldingSvg.apply(this, arguments);
|
|
666
1046
|
}
|
|
667
1047
|
function _loadMoldingSvg() {
|
|
668
|
-
_loadMoldingSvg = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function
|
|
669
|
-
return _regenerator["default"].wrap(function (
|
|
670
|
-
while (1) switch (
|
|
1048
|
+
_loadMoldingSvg = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee7(molding) {
|
|
1049
|
+
return _regenerator["default"].wrap(function (_context8) {
|
|
1050
|
+
while (1) switch (_context8.prev = _context8.next) {
|
|
671
1051
|
case 0:
|
|
672
|
-
return
|
|
1052
|
+
return _context8.abrupt("return", new Promise(function (resolve, reject) {
|
|
673
1053
|
var url = molding === null || molding === void 0 ? void 0 : molding.shape_svg;
|
|
674
1054
|
if (!url) {
|
|
675
1055
|
// Skip if no SVG URL available
|
|
@@ -691,9 +1071,9 @@ function _loadMoldingSvg() {
|
|
|
691
1071
|
}));
|
|
692
1072
|
case 1:
|
|
693
1073
|
case "end":
|
|
694
|
-
return
|
|
1074
|
+
return _context8.stop();
|
|
695
1075
|
}
|
|
696
|
-
},
|
|
1076
|
+
}, _callee7);
|
|
697
1077
|
}));
|
|
698
1078
|
return _loadMoldingSvg.apply(this, arguments);
|
|
699
1079
|
}
|
|
@@ -834,43 +1214,43 @@ function mergeSameElements(projectItemsCatalog) {
|
|
|
834
1214
|
}
|
|
835
1215
|
return result;
|
|
836
1216
|
}
|
|
837
|
-
function handleExternalEvent(
|
|
1217
|
+
function handleExternalEvent(_x0) {
|
|
838
1218
|
return _handleExternalEvent.apply(this, arguments);
|
|
839
1219
|
}
|
|
840
1220
|
function _handleExternalEvent() {
|
|
841
|
-
_handleExternalEvent = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function
|
|
1221
|
+
_handleExternalEvent = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee0(props) {
|
|
842
1222
|
var _evt$payload3, _evt$payload4;
|
|
843
|
-
var evt, state, layerId, layer, _evt$payload, _state$catalog, cdsItems, itemKeys,
|
|
844
|
-
return _regenerator["default"].wrap(function (
|
|
845
|
-
while (1) switch (
|
|
1223
|
+
var evt, state, 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$payload5, doorStyle, itemCDS, applyScope, _evt$payload5$itemIds, itemIds, _layerId, allItems, targetItems, idSet, selectedItemIds, _cdsItems, _loop7, _i2, _props$onInternalEven2, _evt$payload6, roomShapeType, width, height, measurementUnit, _doorStyle, value, _value, _evt$payload7, moldingInfo, isGlobal, distElement, _distElement, _evt$payload8, option, _value2, _layerId2, _layer, _layer$getIn, selectedLines, selectedHoles, selectedItems, _i4, _i5, _i6, _evt$payload9, _evt$payload0, _evt$payload1, _evt$payload10, _layerID, _layer2, orginalItemInfo, originalItem, originalItemPos, replaceItem, _props$configData$mol, _props$configData, _props$configData$ski, _props$configData2, _props$onInternalEven3, sceneData, currentTexture, moldingPieceLength, skinPanelExclusionSKUs, _t5, _t6, _t7;
|
|
1224
|
+
return _regenerator["default"].wrap(function (_context11) {
|
|
1225
|
+
while (1) switch (_context11.prev = _context11.next) {
|
|
846
1226
|
case 0:
|
|
847
1227
|
// console.log('***external event****', props.externalEvent);
|
|
848
1228
|
evt = props.externalEvent;
|
|
849
1229
|
state = getPlannerStateFromProps(props);
|
|
850
1230
|
if (state) {
|
|
851
|
-
|
|
1231
|
+
_context11.next = 1;
|
|
852
1232
|
break;
|
|
853
1233
|
}
|
|
854
|
-
return
|
|
1234
|
+
return _context11.abrupt("return");
|
|
855
1235
|
case 1:
|
|
856
1236
|
layerId = state.getIn(['scene', 'selectedLayer']);
|
|
857
1237
|
layer = state.getIn(['scene', 'layers', layerId]);
|
|
858
|
-
|
|
859
|
-
|
|
1238
|
+
_t5 = evt === null || evt === void 0 ? void 0 : evt.type;
|
|
1239
|
+
_context11.next = _t5 === _constants.EXTERNAL_EVENT_LOAD_PROJECT ? 2 : _t5 === _constants.EXTERNAL_EVENT_TOGGLE_TO_3D ? 7 : _t5 === _constants.EXTERNAL_EVENT_TOGGLE_TO_2D ? 8 : _t5 === _constants.EXTERNAL_EVENT_TOGGLE_TO_ELEVATION ? 9 : _t5 === _constants.EXTERNAL_EVENT_ADD_WALL ? 10 : _t5 === _constants.EXTERNAL_EVENT_ADD_ITEM ? 11 : _t5 === _constants.EXTERNAL_EVENT_ADD_HOLE ? 14 : _t5 === _constants.EXTERNAL_EVENT_ROTATE_PAN ? 15 : _t5 === _constants.EXTERNAL_EVENT_MOVE_PAN ? 15 : _t5 === _constants.EXTERNAL_EVENT_NEW_PROJECT ? 16 : _t5 === _constants.EXTERNAL_EVENT_CHANGE_DOORSTYLE ? 17 : _t5 === _constants.EXTERNAL_EVENT_ADD_ROOM_SHAPE ? 25 : _t5 === _constants.EXTERNAL_EVENT_ZOOM_IN ? 26 : _t5 === _constants.EXTERNAL_EVENT_ZOOM_OUT ? 27 : _t5 === _constants.EXTERNAL_EVENT_CENTERING_2D ? 28 : _t5 === _constants.EXTERNAL_EVENT_UNDO ? 29 : _t5 === _constants.EXTERNAL_EVENT_REDO ? 30 : _t5 === _constants.EXTERNAL_EVENT_SET_MOLDING ? 31 : _t5 === _constants.EXTERNAL_EVENT_DUPLICATE_ELEMENT ? 33 : _t5 === _constants.EXTERNAL_EVENT_DELETE_ELEMENT ? 34 : _t5 === _constants.EXTERNAL_EVENT_PROJECT_SETTING ? 35 : _t5 === _constants.EXTERNAL_EVENT_UPDATE_ATTRIBUTE ? 44 : _t5 === _constants.EXTERNAL_EVENT_UPDATE_PROPERTY ? 44 : _t5 === _constants.EXTERNAL_EVENT_REPLACE_CABINET ? 45 : _t5 === _constants.EXTERNAL_EVENT_SET_FINISHING ? 47 : _t5 === _constants.EXTERNAL_EVENT_SYNC_SCENE ? 48 : 49;
|
|
860
1240
|
break;
|
|
861
1241
|
case 2:
|
|
862
1242
|
if (!(evt !== null && evt !== void 0 && evt.payload)) {
|
|
863
|
-
|
|
1243
|
+
_context11.next = 6;
|
|
864
1244
|
break;
|
|
865
1245
|
}
|
|
866
1246
|
// prepare item data request
|
|
867
1247
|
cdsItems = [];
|
|
868
1248
|
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) : [];
|
|
869
|
-
|
|
1249
|
+
_loop6 = /*#__PURE__*/_regenerator["default"].mark(function _loop6() {
|
|
870
1250
|
var _evt$payload2, _it$properties, _it$properties2, _it$properties3, _it$doorStyle2;
|
|
871
1251
|
var it;
|
|
872
|
-
return _regenerator["default"].wrap(function (
|
|
873
|
-
while (1) switch (
|
|
1252
|
+
return _regenerator["default"].wrap(function (_context0) {
|
|
1253
|
+
while (1) switch (_context0.prev = _context0.next) {
|
|
874
1254
|
case 0:
|
|
875
1255
|
it = evt === null || evt === void 0 || (_evt$payload2 = evt.payload) === null || _evt$payload2 === void 0 || (_evt$payload2 = _evt$payload2.layers['layer-1']) === null || _evt$payload2 === void 0 ? void 0 : _evt$payload2.items[itemKeys[i]]; //////// check altitude of item property and change length from _length (convert length from 'in' fo 'cm')
|
|
876
1256
|
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')) {
|
|
@@ -891,20 +1271,20 @@ function _handleExternalEvent() {
|
|
|
891
1271
|
});
|
|
892
1272
|
case 1:
|
|
893
1273
|
case "end":
|
|
894
|
-
return
|
|
1274
|
+
return _context0.stop();
|
|
895
1275
|
}
|
|
896
|
-
},
|
|
1276
|
+
}, _loop6);
|
|
897
1277
|
});
|
|
898
1278
|
i = 0;
|
|
899
1279
|
case 3:
|
|
900
1280
|
if (!(i < itemKeys.length)) {
|
|
901
|
-
|
|
1281
|
+
_context11.next = 5;
|
|
902
1282
|
break;
|
|
903
1283
|
}
|
|
904
|
-
return
|
|
1284
|
+
return _context11.delegateYield(_loop6(), "t0", 4);
|
|
905
1285
|
case 4:
|
|
906
1286
|
i++;
|
|
907
|
-
|
|
1287
|
+
_context11.next = 3;
|
|
908
1288
|
break;
|
|
909
1289
|
case 5:
|
|
910
1290
|
newScene = new _models.Scene(evt === null || evt === void 0 ? void 0 : evt.payload);
|
|
@@ -919,63 +1299,63 @@ function _handleExternalEvent() {
|
|
|
919
1299
|
cdsItems: cdsItems
|
|
920
1300
|
}
|
|
921
1301
|
}, /*#__PURE__*/function () {
|
|
922
|
-
var _ref3 = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function
|
|
1302
|
+
var _ref3 = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee8(result) {
|
|
923
1303
|
var rt, _i;
|
|
924
|
-
return _regenerator["default"].wrap(function (
|
|
925
|
-
while (1) switch (
|
|
1304
|
+
return _regenerator["default"].wrap(function (_context9) {
|
|
1305
|
+
while (1) switch (_context9.prev = _context9.next) {
|
|
926
1306
|
case 0:
|
|
927
1307
|
rt = mergeSameElements(result === null || result === void 0 ? void 0 : result.elements);
|
|
928
1308
|
_i = 0;
|
|
929
1309
|
case 1:
|
|
930
1310
|
if (!(_i < (rt === null || rt === void 0 ? void 0 : rt.length))) {
|
|
931
|
-
|
|
1311
|
+
_context9.next = 3;
|
|
932
1312
|
break;
|
|
933
1313
|
}
|
|
934
|
-
|
|
1314
|
+
_context9.next = 2;
|
|
935
1315
|
return addItemToCatalog(rt[_i], tempState, props.catalog, props.projectActions);
|
|
936
1316
|
case 2:
|
|
937
1317
|
_i++;
|
|
938
|
-
|
|
1318
|
+
_context9.next = 1;
|
|
939
1319
|
break;
|
|
940
1320
|
case 3:
|
|
941
1321
|
props.projectActions.loadProject(evt.payload);
|
|
942
1322
|
case 4:
|
|
943
1323
|
case "end":
|
|
944
|
-
return
|
|
1324
|
+
return _context9.stop();
|
|
945
1325
|
}
|
|
946
|
-
},
|
|
1326
|
+
}, _callee8);
|
|
947
1327
|
}));
|
|
948
|
-
return function (
|
|
1328
|
+
return function (_x1) {
|
|
949
1329
|
return _ref3.apply(this, arguments);
|
|
950
1330
|
};
|
|
951
1331
|
}());
|
|
952
1332
|
} else props.projectActions.loadProject(evt.payload);
|
|
953
1333
|
case 6:
|
|
954
|
-
return
|
|
1334
|
+
return _context11.abrupt("continue", 49);
|
|
955
1335
|
case 7:
|
|
956
1336
|
props.projectActions.unselectAll();
|
|
957
1337
|
props.projectActions.setMode(_constants.MODE_IDLE_3D);
|
|
958
|
-
return
|
|
1338
|
+
return _context11.abrupt("continue", 49);
|
|
959
1339
|
case 8:
|
|
960
1340
|
props.projectActions.setMode(_constants.MODE_IDLE);
|
|
961
|
-
return
|
|
1341
|
+
return _context11.abrupt("continue", 49);
|
|
962
1342
|
case 9:
|
|
963
1343
|
sLineCnt = layer.selected.lines.size;
|
|
964
1344
|
if (sLineCnt > 0) props.projectActions.setMode(_constants.MODE_ELEVATION_VIEW);
|
|
965
|
-
return
|
|
1345
|
+
return _context11.abrupt("continue", 49);
|
|
966
1346
|
case 10:
|
|
967
1347
|
if (state.mode === _constants.MODE_IDLE || state.mode === _constants.MODE_2D_PAN) props.linesActions.selectToolDrawingLine('wall');else {
|
|
968
1348
|
props.projectActions.setMode(_constants.MODE_IDLE);
|
|
969
1349
|
props.linesActions.selectToolDrawingLine('wall');
|
|
970
1350
|
}
|
|
971
|
-
return
|
|
1351
|
+
return _context11.abrupt("continue", 49);
|
|
972
1352
|
case 11:
|
|
973
1353
|
if ((0, _helper.isEmpty)(evt === null || evt === void 0 ? void 0 : evt.payload)) {
|
|
974
|
-
|
|
1354
|
+
_context11.next = 13;
|
|
975
1355
|
break;
|
|
976
1356
|
}
|
|
977
1357
|
element = evt.payload;
|
|
978
|
-
|
|
1358
|
+
_context11.next = 12;
|
|
979
1359
|
return addItemToCatalog(element, state, props.catalog, props.projectActions);
|
|
980
1360
|
case 12:
|
|
981
1361
|
// start drawing item
|
|
@@ -999,18 +1379,18 @@ function _handleExternalEvent() {
|
|
|
999
1379
|
props.projectActions.pushLastSelectedCatalogElementToHistory(element);
|
|
1000
1380
|
props.projectActions.setIsCabinetDrawing(true);
|
|
1001
1381
|
case 13:
|
|
1002
|
-
return
|
|
1382
|
+
return _context11.abrupt("continue", 49);
|
|
1003
1383
|
case 14:
|
|
1004
1384
|
_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);
|
|
1005
|
-
return
|
|
1385
|
+
return _context11.abrupt("continue", 49);
|
|
1006
1386
|
case 15:
|
|
1007
1387
|
moveAndRotatePan2D3D(evt.type, props, evt.payload, state);
|
|
1008
|
-
return
|
|
1388
|
+
return _context11.abrupt("continue", 49);
|
|
1009
1389
|
case 16:
|
|
1010
1390
|
defaulTitle = 'Untitle';
|
|
1011
1391
|
props.projectActions.newProject();
|
|
1012
1392
|
props.projectActions.rename(defaulTitle);
|
|
1013
|
-
return
|
|
1393
|
+
return _context11.abrupt("continue", 49);
|
|
1014
1394
|
case 17:
|
|
1015
1395
|
_evt$payload5 = evt.payload, doorStyle = _evt$payload5.doorStyle, itemCDS = _evt$payload5.itemCDS, applyScope = _evt$payload5.applyScope, _evt$payload5$itemIds = _evt$payload5.itemIds, itemIds = _evt$payload5$itemIds === void 0 ? [] : _evt$payload5$itemIds;
|
|
1016
1396
|
_layerId = state.getIn(['scene', 'selectedLayer']);
|
|
@@ -1025,27 +1405,27 @@ function _handleExternalEvent() {
|
|
|
1025
1405
|
// itemIds contains item.id (instance IDs)
|
|
1026
1406
|
idSet = new Set(itemIds);
|
|
1027
1407
|
}
|
|
1028
|
-
|
|
1029
|
-
|
|
1408
|
+
_t6 = applyScope;
|
|
1409
|
+
_context11.next = _t6 === _constants.DOORSTYLE_SCOPE_ALL ? 18 : _t6 === _constants.DOORSTYLE_SCOPE_SINGLE ? 19 : _t6 === _constants.DOORSTYLE_SCOPE_MULTIPLE ? 19 : 20;
|
|
1030
1410
|
break;
|
|
1031
1411
|
case 18:
|
|
1032
1412
|
targetItems = Object.values(allItems);
|
|
1033
|
-
return
|
|
1413
|
+
return _context11.abrupt("continue", 21);
|
|
1034
1414
|
case 19:
|
|
1035
1415
|
targetItems = Object.values(allItems).filter(function (item) {
|
|
1036
1416
|
var _idSet;
|
|
1037
1417
|
return (_idSet = idSet) === null || _idSet === void 0 ? void 0 : _idSet.has(item.id);
|
|
1038
1418
|
});
|
|
1039
|
-
return
|
|
1419
|
+
return _context11.abrupt("continue", 21);
|
|
1040
1420
|
case 20:
|
|
1041
|
-
return
|
|
1421
|
+
return _context11.abrupt("continue", 21);
|
|
1042
1422
|
case 21:
|
|
1043
1423
|
_cdsItems = [];
|
|
1044
|
-
|
|
1424
|
+
_loop7 = /*#__PURE__*/_regenerator["default"].mark(function _loop7() {
|
|
1045
1425
|
var _itemCDS$find;
|
|
1046
1426
|
var item, cdsId;
|
|
1047
|
-
return _regenerator["default"].wrap(function (
|
|
1048
|
-
while (1) switch (
|
|
1427
|
+
return _regenerator["default"].wrap(function (_context10) {
|
|
1428
|
+
while (1) switch (_context10.prev = _context10.next) {
|
|
1049
1429
|
case 0:
|
|
1050
1430
|
item = targetItems[_i2];
|
|
1051
1431
|
cdsId = (_itemCDS$find = itemCDS.find(function (itCDS) {
|
|
@@ -1066,20 +1446,20 @@ function _handleExternalEvent() {
|
|
|
1066
1446
|
}
|
|
1067
1447
|
case 1:
|
|
1068
1448
|
case "end":
|
|
1069
|
-
return
|
|
1449
|
+
return _context10.stop();
|
|
1070
1450
|
}
|
|
1071
|
-
},
|
|
1451
|
+
}, _loop7);
|
|
1072
1452
|
});
|
|
1073
1453
|
_i2 = 0;
|
|
1074
1454
|
case 22:
|
|
1075
1455
|
if (!(_i2 < targetItems.length)) {
|
|
1076
|
-
|
|
1456
|
+
_context11.next = 24;
|
|
1077
1457
|
break;
|
|
1078
1458
|
}
|
|
1079
|
-
return
|
|
1459
|
+
return _context11.delegateYield(_loop7(), "t1", 23);
|
|
1080
1460
|
case 23:
|
|
1081
1461
|
_i2++;
|
|
1082
|
-
|
|
1462
|
+
_context11.next = 22;
|
|
1083
1463
|
break;
|
|
1084
1464
|
case 24:
|
|
1085
1465
|
if (_cdsItems.length > 0) {
|
|
@@ -1089,44 +1469,44 @@ function _handleExternalEvent() {
|
|
|
1089
1469
|
cdsItems: _cdsItems
|
|
1090
1470
|
}
|
|
1091
1471
|
}, /*#__PURE__*/function () {
|
|
1092
|
-
var _ref4 = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function
|
|
1472
|
+
var _ref4 = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee9(result) {
|
|
1093
1473
|
var rt, _i3;
|
|
1094
|
-
return _regenerator["default"].wrap(function (
|
|
1095
|
-
while (1) switch (
|
|
1474
|
+
return _regenerator["default"].wrap(function (_context1) {
|
|
1475
|
+
while (1) switch (_context1.prev = _context1.next) {
|
|
1096
1476
|
case 0:
|
|
1097
1477
|
rt = mergeSameElements(result === null || result === void 0 ? void 0 : result.elements);
|
|
1098
1478
|
_i3 = 0;
|
|
1099
1479
|
case 1:
|
|
1100
1480
|
if (!(_i3 < (rt === null || rt === void 0 ? void 0 : rt.length))) {
|
|
1101
|
-
|
|
1481
|
+
_context1.next = 3;
|
|
1102
1482
|
break;
|
|
1103
1483
|
}
|
|
1104
|
-
|
|
1484
|
+
_context1.next = 2;
|
|
1105
1485
|
return addItemToCatalog(rt[_i3], state, props.catalog, props.projectActions);
|
|
1106
1486
|
case 2:
|
|
1107
1487
|
_i3++;
|
|
1108
|
-
|
|
1488
|
+
_context1.next = 1;
|
|
1109
1489
|
break;
|
|
1110
1490
|
case 3:
|
|
1111
1491
|
props.itemsActions.setDoorStyle(doorStyle, itemCDS, applyScope, itemIds);
|
|
1112
1492
|
case 4:
|
|
1113
1493
|
case "end":
|
|
1114
|
-
return
|
|
1494
|
+
return _context1.stop();
|
|
1115
1495
|
}
|
|
1116
|
-
},
|
|
1496
|
+
}, _callee9);
|
|
1117
1497
|
}));
|
|
1118
|
-
return function (
|
|
1498
|
+
return function (_x10) {
|
|
1119
1499
|
return _ref4.apply(this, arguments);
|
|
1120
1500
|
};
|
|
1121
1501
|
}());
|
|
1122
1502
|
} else {
|
|
1123
1503
|
props.itemsActions.setDoorStyle(doorStyle, itemCDS, applyScope, itemIds);
|
|
1124
1504
|
}
|
|
1125
|
-
return
|
|
1505
|
+
return _context11.abrupt("continue", 49);
|
|
1126
1506
|
case 25:
|
|
1127
1507
|
_evt$payload6 = evt.payload, roomShapeType = _evt$payload6.roomShapeType, width = _evt$payload6.width, height = _evt$payload6.height, measurementUnit = _evt$payload6.measurementUnit, _doorStyle = _evt$payload6.doorStyle;
|
|
1128
1508
|
props.projectActions.createRoomWithShape(roomShapeType, width, height, measurementUnit, _doorStyle);
|
|
1129
|
-
return
|
|
1509
|
+
return _context11.abrupt("continue", 49);
|
|
1130
1510
|
case 26:
|
|
1131
1511
|
value = state.getIn(['viewer2D']).toJS();
|
|
1132
1512
|
value.a += 0.1;
|
|
@@ -1134,7 +1514,7 @@ function _handleExternalEvent() {
|
|
|
1134
1514
|
value.e -= value.SVGWidth * 0.1 / 2;
|
|
1135
1515
|
value.f -= value.SVGHeight * 0.1 / 2;
|
|
1136
1516
|
(0, _helper.updateViwer2D)(value, props.viewer2DActions);
|
|
1137
|
-
return
|
|
1517
|
+
return _context11.abrupt("continue", 49);
|
|
1138
1518
|
case 27:
|
|
1139
1519
|
_value = state.getIn(['viewer2D']).toJS();
|
|
1140
1520
|
_value.a -= 0.1;
|
|
@@ -1142,62 +1522,62 @@ function _handleExternalEvent() {
|
|
|
1142
1522
|
_value.e += _value.SVGWidth * 0.1 / 2;
|
|
1143
1523
|
_value.f += _value.SVGHeight * 0.1 / 2;
|
|
1144
1524
|
(0, _helper.updateViwer2D)(_value, props.viewer2DActions);
|
|
1145
|
-
return
|
|
1525
|
+
return _context11.abrupt("continue", 49);
|
|
1146
1526
|
case 28:
|
|
1147
1527
|
(0, _helper.centering2D)(state, props.viewer2DActions);
|
|
1148
|
-
return
|
|
1528
|
+
return _context11.abrupt("continue", 49);
|
|
1149
1529
|
case 29:
|
|
1150
1530
|
props.projectActions.undo();
|
|
1151
|
-
return
|
|
1531
|
+
return _context11.abrupt("continue", 49);
|
|
1152
1532
|
case 30:
|
|
1153
1533
|
props.projectActions.redo();
|
|
1154
|
-
return
|
|
1534
|
+
return _context11.abrupt("continue", 49);
|
|
1155
1535
|
case 31:
|
|
1156
1536
|
_evt$payload7 = evt.payload, moldingInfo = _evt$payload7.moldingInfo, isGlobal = _evt$payload7.isGlobal;
|
|
1157
|
-
|
|
1537
|
+
_context11.next = 32;
|
|
1158
1538
|
return loadMoldingSvg(moldingInfo);
|
|
1159
1539
|
case 32:
|
|
1160
1540
|
props.itemsActions.setMolding(moldingInfo, isGlobal);
|
|
1161
|
-
return
|
|
1541
|
+
return _context11.abrupt("continue", 49);
|
|
1162
1542
|
case 33:
|
|
1163
1543
|
distElement = getElement(evt.payload, state);
|
|
1164
1544
|
if (distElement) props.itemsActions.duplicateSelected(distElement, props.onInternalEvent);
|
|
1165
|
-
return
|
|
1545
|
+
return _context11.abrupt("continue", 49);
|
|
1166
1546
|
case 34:
|
|
1167
1547
|
_distElement = getElement(evt.payload, state);
|
|
1168
1548
|
if (_distElement) props.projectActions.remove(_distElement);
|
|
1169
|
-
return
|
|
1549
|
+
return _context11.abrupt("continue", 49);
|
|
1170
1550
|
case 35:
|
|
1171
1551
|
_evt$payload8 = evt.payload, option = _evt$payload8.option, _value2 = _evt$payload8.value;
|
|
1172
|
-
|
|
1173
|
-
|
|
1552
|
+
_t7 = option;
|
|
1553
|
+
_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;
|
|
1174
1554
|
break;
|
|
1175
1555
|
case 36:
|
|
1176
1556
|
props.viewer2DActions.updateCeilHeight((0, _convertUnitsLite.convert)(layer.ceilHeight).from(layer.unit).to(_value2));
|
|
1177
1557
|
props.viewer2DActions.updateCeilHeightUnit(_value2);
|
|
1178
1558
|
props.viewer3DActions.update3DCeilHeightUnit(_value2);
|
|
1179
1559
|
props.viewer3DActions.update3DCeilHeight((0, _convertUnitsLite.convert)(layer.ceilHeight).from(layer.unit).to(_value2));
|
|
1180
|
-
return
|
|
1560
|
+
return _context11.abrupt("continue", 43);
|
|
1181
1561
|
case 37:
|
|
1182
1562
|
props.viewer2DActions.updateCeilHeight(_value2);
|
|
1183
1563
|
props.viewer3DActions.update3DCeilHeight(_value2);
|
|
1184
|
-
return
|
|
1564
|
+
return _context11.abrupt("continue", 43);
|
|
1185
1565
|
case 38:
|
|
1186
1566
|
props.viewer2DActions.changeWallLengthMeasure(_value2);
|
|
1187
|
-
return
|
|
1567
|
+
return _context11.abrupt("continue", 43);
|
|
1188
1568
|
case 39:
|
|
1189
1569
|
props.viewer2DActions.changeBaseCabinetMeasure(_value2);
|
|
1190
|
-
return
|
|
1570
|
+
return _context11.abrupt("continue", 43);
|
|
1191
1571
|
case 40:
|
|
1192
1572
|
props.viewer2DActions.changeWallCabinetMeasure(_value2);
|
|
1193
|
-
return
|
|
1573
|
+
return _context11.abrupt("continue", 43);
|
|
1194
1574
|
case 41:
|
|
1195
1575
|
props.viewer2DActions.changeWindowDoorMeasure(_value2);
|
|
1196
|
-
return
|
|
1576
|
+
return _context11.abrupt("continue", 43);
|
|
1197
1577
|
case 42:
|
|
1198
|
-
return
|
|
1578
|
+
return _context11.abrupt("continue", 43);
|
|
1199
1579
|
case 43:
|
|
1200
|
-
return
|
|
1580
|
+
return _context11.abrupt("continue", 49);
|
|
1201
1581
|
case 44:
|
|
1202
1582
|
_layerId2 = state.getIn(['scene', 'selectedLayer']);
|
|
1203
1583
|
_layer = state.getIn(['scene', 'layers', _layerId2]);
|
|
@@ -1205,13 +1585,13 @@ function _handleExternalEvent() {
|
|
|
1205
1585
|
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.catalog, props.projectActions, evt.callback) : updatePropertyOfSelectedElement(_layer.getIn(['lines', selectedLines.get(_i4)]), evt.payload, props.catalog, props.projectActions, evt.callback);
|
|
1206
1586
|
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.catalog, props.projectActions, evt.callback) : updatePropertyOfSelectedElement(_layer.getIn(['holes', selectedHoles.get(_i5)]), evt.payload, props.catalog, props.projectActions, evt.callback);
|
|
1207
1587
|
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.catalog, props.projectActions, evt.callback) : updatePropertyOfSelectedElement(_layer.getIn(['items', selectedItems.get(_i6)]), evt.payload, props.catalog, props.projectActions, evt.callback);
|
|
1208
|
-
return
|
|
1588
|
+
return _context11.abrupt("continue", 49);
|
|
1209
1589
|
case 45:
|
|
1210
1590
|
_layerID = state.scene.selectedLayer;
|
|
1211
1591
|
_layer2 = state.scene.getIn(['layers', _layerID]).toJS();
|
|
1212
1592
|
orginalItemInfo = evt === null || evt === void 0 || (_evt$payload9 = evt.payload) === null || _evt$payload9 === void 0 ? void 0 : _evt$payload9.orginalItemInfo;
|
|
1213
1593
|
originalItem = _layer2 === null || _layer2 === void 0 ? void 0 : _layer2.items[orginalItemInfo.id];
|
|
1214
|
-
|
|
1594
|
+
_context11.next = 46;
|
|
1215
1595
|
return addItemToCatalog(evt.payload.replaceItemInfo, state, props.catalog, props.projectActions);
|
|
1216
1596
|
case 46:
|
|
1217
1597
|
originalItemPos = {
|
|
@@ -1228,17 +1608,19 @@ function _handleExternalEvent() {
|
|
|
1228
1608
|
}
|
|
1229
1609
|
};
|
|
1230
1610
|
props.itemsActions.replaceItem(originalItemPos, originalItem, replaceItem);
|
|
1231
|
-
return
|
|
1611
|
+
return _context11.abrupt("continue", 49);
|
|
1232
1612
|
case 47:
|
|
1233
1613
|
setFinishing(props, state, evt.payload);
|
|
1234
|
-
return
|
|
1614
|
+
return _context11.abrupt("continue", 49);
|
|
1235
1615
|
case 48:
|
|
1236
1616
|
sceneData = state.scene.toJS(); // get molding data for "ReviewForQuote"
|
|
1237
1617
|
currentTexture = layer.doorStyle !== null || layer.doorStyle !== undefined ? layer.doorStyle : props.state.doorStyle.toJS();
|
|
1238
|
-
|
|
1618
|
+
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
|
+
sceneData.layers[layerId].moldingData = (0, _molding.getMoldingDataOfScene2)(layer, props.catalog, currentTexture, moldingPieceLength);
|
|
1239
1620
|
|
|
1240
1621
|
// get skin panel data
|
|
1241
|
-
|
|
1622
|
+
skinPanelExclusionSKUs = (_props$configData$ski = props === null || props === void 0 || (_props$configData2 = props.configData) === null || _props$configData2 === void 0 ? void 0 : _props$configData2.skinPanelExclusionSKUs) !== null && _props$configData$ski !== void 0 ? _props$configData$ski : [];
|
|
1623
|
+
sceneData.layers[layerId].skinPanelData = (0, _skinPanelEngine.computeSkinPanels)(layer, skinPanelExclusionSKUs);
|
|
1242
1624
|
|
|
1243
1625
|
// send scene object from 3DTool to HostApp using internalEvent
|
|
1244
1626
|
(_props$onInternalEven3 = props.onInternalEvent) === null || _props$onInternalEven3 === void 0 || _props$onInternalEven3.call(props, {
|
|
@@ -1247,12 +1629,12 @@ function _handleExternalEvent() {
|
|
|
1247
1629
|
scene: sceneData
|
|
1248
1630
|
}
|
|
1249
1631
|
});
|
|
1250
|
-
return
|
|
1632
|
+
return _context11.abrupt("continue", 49);
|
|
1251
1633
|
case 49:
|
|
1252
1634
|
case "end":
|
|
1253
|
-
return
|
|
1635
|
+
return _context11.stop();
|
|
1254
1636
|
}
|
|
1255
|
-
},
|
|
1637
|
+
}, _callee0);
|
|
1256
1638
|
}));
|
|
1257
1639
|
return _handleExternalEvent.apply(this, arguments);
|
|
1258
1640
|
}
|