kitchen-simulator 3.10.0 → 3.12.0-test.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/LiteKitchenConfigurator.js +21 -2
- package/es/assets/img/svg/bottombar/elevation.svg +12 -5
- package/es/catalog/utils/item-loader.js +201 -201
- package/es/class/item.js +5 -4
- package/es/class/line.js +4 -8
- package/es/components/viewer2d/viewer2d.js +2 -20
- package/es/components/viewer3d/scene-creator.js +4 -4
- package/es/components/viewer3d/viewer3d.js +9 -23
- package/es/index.js +17 -1
- package/es/utils/helper.js +38 -1
- package/es/utils/isolate-event-handler.js +85 -75
- package/lib/LiteKitchenConfigurator.js +21 -2
- package/lib/assets/img/svg/bottombar/elevation.svg +12 -5
- package/lib/catalog/utils/item-loader.js +198 -198
- package/lib/class/item.js +3 -2
- package/lib/class/line.js +3 -7
- package/lib/components/viewer2d/viewer2d.js +1 -18
- package/lib/components/viewer3d/scene-creator.js +4 -4
- package/lib/components/viewer3d/viewer3d.js +6 -19
- package/lib/index.js +17 -1
- package/lib/utils/helper.js +40 -1
- package/lib/utils/isolate-event-handler.js +85 -75
- package/package.json +1 -1
package/es/class/item.js
CHANGED
|
@@ -9,10 +9,10 @@ import { Group, Hole, Layer } from "./export";
|
|
|
9
9
|
import { GeometryUtils, IDBroker, MoldingUtils, NameGenerator } from "../utils/export";
|
|
10
10
|
import { fromJS, Map } from 'immutable';
|
|
11
11
|
import { INSTALLATION_SUFFIX_TYPE, INTERNAL_EVENT_DRAW_ELEMENT, MODE_DRAGGING_ITEM, MODE_DRAGGING_ITEM_3D, MODE_DRAWING_ITEM, MODE_DRAWING_ITEM_3D, MODE_IDLE, MODE_IDLE_3D, MODE_ROTATING_ITEM, MODE_ROTATING_ITEM_3D, MOLDING_LOCATIONS } from "../constants";
|
|
12
|
-
import { debugUtil } from "../utils/helper";
|
|
12
|
+
import { debugUtil, updatePayloadOfInternalEvent } from "../utils/helper";
|
|
13
13
|
import { isUndefined } from 'util';
|
|
14
14
|
import { hasMoldingLayout } from "../utils/molding";
|
|
15
|
-
import { getInstallationSuffix
|
|
15
|
+
import { getInstallationSuffix } from "../components/viewer2d/utils";
|
|
16
16
|
import { historyPush } from "../utils/history";
|
|
17
17
|
var allItemRect;
|
|
18
18
|
var allItemSnap;
|
|
@@ -465,8 +465,9 @@ var Item = /*#__PURE__*/function () {
|
|
|
465
465
|
break;
|
|
466
466
|
}
|
|
467
467
|
if (onInternalEvent && duplicatedElement) {
|
|
468
|
-
var
|
|
469
|
-
|
|
468
|
+
var _state$get;
|
|
469
|
+
var catalog = (_state$get = state.get('catalog')) === null || _state$get === void 0 ? void 0 : _state$get.toJS();
|
|
470
|
+
var jsElement = updatePayloadOfInternalEvent(duplicatedElement, layer, catalog);
|
|
470
471
|
onInternalEvent({
|
|
471
472
|
type: INTERNAL_EVENT_DRAW_ELEMENT,
|
|
472
473
|
value: jsElement
|
package/es/class/line.js
CHANGED
|
@@ -6,8 +6,7 @@ import { Group, Hole, Layer, Vertex } from "./export";
|
|
|
6
6
|
import { GeometryUtils, history, IDBroker, NameGenerator, SnapSceneUtils, SnapUtils } from "../utils/export";
|
|
7
7
|
import * as Three from 'three';
|
|
8
8
|
import { END_DRAGGING_LINE, END_DRAGGING_VERTEX, END_DRAWING_LINE, EPSILON, INTERNAL_EVENT_START_DRAW_WALL, MIN_ANGLE_DISALLOW_DRAW_WALL, MODE_DRAGGING_LINE, MODE_DRAWING_LINE, MODE_IDLE, MODE_WAITING_DRAWING_LINE, UNIT_ANGLE } from "../constants";
|
|
9
|
-
import { isEmpty } from "../utils/helper";
|
|
10
|
-
import { convert } from "../utils/convert-units-lite";
|
|
9
|
+
import { isEmpty, updatePayloadOfInternalEvent } from "../utils/helper";
|
|
11
10
|
var timeGlobal = 0;
|
|
12
11
|
var TimeRecorder = /*#__PURE__*/function () {
|
|
13
12
|
function TimeRecorder(name) {
|
|
@@ -428,6 +427,7 @@ var Line = /*#__PURE__*/function () {
|
|
|
428
427
|
}, {
|
|
429
428
|
key: "beginDrawingLine",
|
|
430
429
|
value: function beginDrawingLine(state, layerID, x, y, onInternalEvent) {
|
|
430
|
+
var _state$get;
|
|
431
431
|
// if end drawing by created area
|
|
432
432
|
if (state.mode == MODE_IDLE) {
|
|
433
433
|
return {
|
|
@@ -481,12 +481,8 @@ var Line = /*#__PURE__*/function () {
|
|
|
481
481
|
drawingSupport: drawingSupport
|
|
482
482
|
});
|
|
483
483
|
var layer = state.getIn(['scene', 'layers', layerID]);
|
|
484
|
-
var
|
|
485
|
-
var
|
|
486
|
-
var v_b = layer.vertices.get(line.vertices.get(1));
|
|
487
|
-
var distance = GeometryUtils.pointsDistance(v_a.x, v_a.y, v_b.x, v_b.y);
|
|
488
|
-
var _length = convert(distance).from('cm').to(layer.unit);
|
|
489
|
-
payload.length = _length;
|
|
484
|
+
var catalog = (_state$get = state.get('catalog')) === null || _state$get === void 0 ? void 0 : _state$get.toJS();
|
|
485
|
+
var payload = updatePayloadOfInternalEvent(line, layer, catalog);
|
|
490
486
|
if (onInternalEvent) onInternalEvent({
|
|
491
487
|
type: INTERNAL_EVENT_START_DRAW_WALL,
|
|
492
488
|
value: payload
|
|
@@ -15,9 +15,8 @@ import FormNumberInput from "../style/form-number-input";
|
|
|
15
15
|
import { convert } from "../../utils/convert-units-lite";
|
|
16
16
|
import { Map } from 'immutable';
|
|
17
17
|
import { formatNumber } from "../../utils/math";
|
|
18
|
-
import { isEmpty } from "../../utils/helper"; // variables
|
|
18
|
+
import { isEmpty, updatePayloadOfInternalEvent } from "../../utils/helper"; // variables
|
|
19
19
|
import { isWarningItem } from "./utils";
|
|
20
|
-
import { MoldingUtils } from "../../utils/export";
|
|
21
20
|
// variables
|
|
22
21
|
var pinFlag = false;
|
|
23
22
|
var sFlag = false; //for all object move
|
|
@@ -1251,24 +1250,7 @@ export default function Viewer2D(_ref, _ref2) {
|
|
|
1251
1250
|
_currentObject = state.getIn(['scene', 'layers', layerID, elementPrototype, elementID]);
|
|
1252
1251
|
}
|
|
1253
1252
|
if (_currentObject) {
|
|
1254
|
-
var
|
|
1255
|
-
var payload = (_currentObject3 = _currentObject) === null || _currentObject3 === void 0 ? void 0 : _currentObject3.toJS();
|
|
1256
|
-
if (((_currentObject4 = _currentObject) === null || _currentObject4 === void 0 ? void 0 : _currentObject4.prototype) === 'lines') {
|
|
1257
|
-
// caculating length of selected line//
|
|
1258
|
-
var v_a = layer.vertices.get(_currentObject.vertices.get(0));
|
|
1259
|
-
var v_b = layer.vertices.get(_currentObject.vertices.get(1));
|
|
1260
|
-
var distance = GeometryUtils.pointsDistance(v_a.x, v_a.y, v_b.x, v_b.y);
|
|
1261
|
-
var _length3 = convert(distance).from('cm').to(layer.unit);
|
|
1262
|
-
payload.length = _length3;
|
|
1263
|
-
//////////////////////////////////////
|
|
1264
|
-
} else if (((_currentObject5 = _currentObject) === null || _currentObject5 === void 0 ? void 0 : _currentObject5.prototype) === 'items') {
|
|
1265
|
-
// check this cabinet has warning box
|
|
1266
|
-
payload.isWarning = isWarningItem(_currentObject);
|
|
1267
|
-
// check this item is available molding
|
|
1268
|
-
payload.isMoldingAvailable = MoldingUtils.isEnableItemForMolding(layer, _currentObject);
|
|
1269
|
-
// check this item is snapped to wall
|
|
1270
|
-
payload.isAttachedWall = MoldingUtils.isAttachedWall(layer, _currentObject);
|
|
1271
|
-
}
|
|
1253
|
+
var payload = updatePayloadOfInternalEvent(_currentObject, layer, catalog);
|
|
1272
1254
|
|
|
1273
1255
|
// send selection event befor replace event
|
|
1274
1256
|
if (internalType === constants.INTERNAL_EVENT_REPLACE_CABINET) {
|
|
@@ -642,10 +642,10 @@ function replaceObject(modifiedPath, layer, planData, actions, sceneData, oldSce
|
|
|
642
642
|
vLine3.material.depthTest = false;
|
|
643
643
|
var uVec = new Three.Vector3(-posVec.x / scalevec.x, -posVec.y / scalevec.y, -posVec.z / scalevec.z);
|
|
644
644
|
var blLighting = item.type.includes('Light');
|
|
645
|
-
vLine.translateY(blLighting ? 1.6 : 0.1);
|
|
646
|
-
vLine1.translateY(blLighting ? 1.6 : 0.1);
|
|
647
|
-
vLine2.translateY(blLighting ? 1.6 : 0.1);
|
|
648
|
-
vLine3.translateY(blLighting ? 1.6 : 0.1);
|
|
645
|
+
vLine.translateY(blLighting ? 1.6 : boundingBox.min.y + 0.1);
|
|
646
|
+
vLine1.translateY(blLighting ? 1.6 : boundingBox.min.y + 0.1);
|
|
647
|
+
vLine2.translateY(blLighting ? 1.6 : boundingBox.min.y + 0.1);
|
|
648
|
+
vLine3.translateY(blLighting ? 1.6 : boundingBox.min.y + 0.1);
|
|
649
649
|
upObj.translateOnAxis(uVec, 1);
|
|
650
650
|
upObj.translateY(max.y - min.y);
|
|
651
651
|
_mBox.name = 'TransformBox';
|
|
@@ -19,17 +19,16 @@ import { checkCabinetOverlap, createBacksplash, deleteSpecifiedMeshObjects, fVLi
|
|
|
19
19
|
import { disposeObject, disposeScene } from "./three-memory-cleaner";
|
|
20
20
|
import diff from 'immutablediff';
|
|
21
21
|
import * as SharedStyle from "../../shared-style";
|
|
22
|
-
import { BASE_CABINET_LAYOUTPOS, MODE_3D_VIEW, MODE_DRAGGING_ITEM_3D, MODE_DRAWING_HOLE_3D, MODE_DRAWING_ITEM_3D, MODE_ELEVATION_VIEW, MODE_IDLE_3D, MODE_ROTATING_ITEM_3D, SECONDARY_PURPLE_COLOR, TALL_CABINET_LAYOUTPOS, UNIT_CENTIMETER, WALL_CABINET_LAYOUTPOS, INTERNAL_EVENT_SELECT_ELEMENT, INTERNAL_EVENT_DRAG_ELEMENT, INTERNAL_EVENT_DRAW_ELEMENT, INTERNAL_EVENT_ROTATE_ELEMENT, MODE_ROTATING_ITEM, MODE_DRAGGING_HOLE_3D } from "../../constants";
|
|
22
|
+
import { BASE_CABINET_LAYOUTPOS, MODE_3D_VIEW, MODE_DRAGGING_ITEM_3D, MODE_DRAWING_HOLE_3D, MODE_DRAWING_ITEM_3D, MODE_ELEVATION_VIEW, MODE_IDLE_3D, MODE_ROTATING_ITEM_3D, SECONDARY_PURPLE_COLOR, TALL_CABINET_LAYOUTPOS, UNIT_CENTIMETER, WALL_CABINET_LAYOUTPOS, INTERNAL_EVENT_SELECT_ELEMENT, INTERNAL_EVENT_DRAG_ELEMENT, INTERNAL_EVENT_DRAW_ELEMENT, INTERNAL_EVENT_ROTATE_ELEMENT, MODE_ROTATING_ITEM, MODE_DRAGGING_HOLE_3D, INTERNAL_EVENT_REPLACE_CABINET } from "../../constants";
|
|
23
23
|
import { isUndefined } from 'util';
|
|
24
24
|
import { verticesDistance } from "../../utils/geometry";
|
|
25
25
|
import { convert } from "../../utils/convert-units-lite";
|
|
26
26
|
import { GeometryUtils } from "../../utils/export";
|
|
27
|
-
import { handleCamRect, isElevationView, isEmpty } from "../../utils/helper";
|
|
27
|
+
import { handleCamRect, isElevationView, isEmpty, updatePayloadOfInternalEvent } from "../../utils/helper";
|
|
28
28
|
import { RGBELoader } from 'three/examples/jsm/loaders/RGBELoader';
|
|
29
29
|
import CameraControls from 'camera-controls';
|
|
30
30
|
import { getAllMeshes, vectorIntersectWithMesh } from "../../utils/objects-utils";
|
|
31
|
-
import {
|
|
32
|
-
import { MoldingUtils } from "../../utils/export";
|
|
31
|
+
import { returnReplaceableDeepSearchType } from "../viewer2d/utils";
|
|
33
32
|
CameraControls.install({
|
|
34
33
|
THREE: Three
|
|
35
34
|
});
|
|
@@ -1187,25 +1186,9 @@ var Scene3DViewer = /*#__PURE__*/function (_React$Component) {
|
|
|
1187
1186
|
var sendInternalEvent = function sendInternalEvent(evtType, evtElement) {
|
|
1188
1187
|
var pointArray = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
|
|
1189
1188
|
if (!isEmpty(evtType) && !isEmpty(evtElement)) {
|
|
1190
|
-
var _this2$props$onIntern, _this2$props;
|
|
1191
|
-
var
|
|
1192
|
-
|
|
1193
|
-
// caculating length of selected line//
|
|
1194
|
-
var v_a = layer.vertices.get(evtElement.vertices.get(0));
|
|
1195
|
-
var v_b = layer.vertices.get(evtElement.vertices.get(1));
|
|
1196
|
-
var distance = GeometryUtils.pointsDistance(v_a.x, v_a.y, v_b.x, v_b.y);
|
|
1197
|
-
var _length = convert(distance).from('cm').to(layer.unit);
|
|
1198
|
-
payload.length = _length;
|
|
1199
|
-
//////////////////////////////////////
|
|
1200
|
-
} else if ((evtElement === null || evtElement === void 0 ? void 0 : evtElement.prototype) === 'items') {
|
|
1201
|
-
// check this cabinet has warning box
|
|
1202
|
-
payload.isWarning = isWarningItem(evtElement);
|
|
1203
|
-
// check this item is available molding
|
|
1204
|
-
payload.isMoldingAvailable = MoldingUtils.isEnableItemForMolding(layer, evtElement); // check this item is snapped to wall
|
|
1205
|
-
payload.isAttachedWall = MoldingUtils.isAttachedWall(layer, evtElement);
|
|
1206
|
-
// update distArray
|
|
1207
|
-
if (pointArray) payload.distArray = pointArray;
|
|
1208
|
-
}
|
|
1189
|
+
var _state$get, _this2$props$onIntern, _this2$props;
|
|
1190
|
+
var catalog = (_state$get = state.get('catalog')) === null || _state$get === void 0 ? void 0 : _state$get.toJS();
|
|
1191
|
+
var payload = updatePayloadOfInternalEvent(evtElement, layer, catalog, pointArray);
|
|
1209
1192
|
(_this2$props$onIntern = (_this2$props = _this2.props).onInternalEvent) === null || _this2$props$onIntern === void 0 || _this2$props$onIntern.call(_this2$props, {
|
|
1210
1193
|
type: evtType,
|
|
1211
1194
|
value: payload
|
|
@@ -1477,6 +1460,9 @@ var Scene3DViewer = /*#__PURE__*/function (_React$Component) {
|
|
|
1477
1460
|
var replaceInfo = intersects[_i10].object.parent.parent.userData;
|
|
1478
1461
|
_this2.context.itemsActions.selectItem(replaceInfo.layerId, replaceInfo.itemId);
|
|
1479
1462
|
!_this2.props.downloadFlag && _this2.props.replaceCabinet(true);
|
|
1463
|
+
internalType = INTERNAL_EVENT_REPLACE_CABINET;
|
|
1464
|
+
var replaceElement = _this2.props.state.scene.layers.get(replaceInfo.layerId).items.get(replaceInfo.itemId);
|
|
1465
|
+
sendInternalEvent(internalType, replaceElement);
|
|
1480
1466
|
return;
|
|
1481
1467
|
}
|
|
1482
1468
|
}
|
package/es/index.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
1
2
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
3
|
import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
|
|
3
4
|
import _createClass from "@babel/runtime/helpers/esm/createClass";
|
|
@@ -5,6 +6,8 @@ import _possibleConstructorReturn from "@babel/runtime/helpers/esm/possibleConst
|
|
|
5
6
|
import _getPrototypeOf from "@babel/runtime/helpers/esm/getPrototypeOf";
|
|
6
7
|
import _inherits from "@babel/runtime/helpers/esm/inherits";
|
|
7
8
|
import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator";
|
|
9
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
10
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
8
11
|
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
9
12
|
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
10
13
|
function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; }
|
|
@@ -444,10 +447,23 @@ export function renderKitchenSimulator(container) {
|
|
|
444
447
|
}
|
|
445
448
|
}]);
|
|
446
449
|
}(React.Component);
|
|
450
|
+
var lastProps = _objectSpread({}, props);
|
|
447
451
|
var api = {
|
|
448
452
|
// internal: rerender wrapper with latest props if host calls renderKitchenSimulator again
|
|
449
453
|
__render: function __render(nextProps) {
|
|
450
|
-
|
|
454
|
+
lastProps = _objectSpread(_objectSpread({}, lastProps), nextProps);
|
|
455
|
+
root.render(/*#__PURE__*/React.createElement(Wrapper, lastProps));
|
|
456
|
+
},
|
|
457
|
+
updateContainerDimensions: function updateContainerDimensions(width, height) {
|
|
458
|
+
var extraProps = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
459
|
+
if (destroyed) return false;
|
|
460
|
+
|
|
461
|
+
// optional: accept numbers or strings, up to you
|
|
462
|
+
api.__render(_objectSpread(_objectSpread(_objectSpread({}, lastProps), extraProps), {}, {
|
|
463
|
+
width: width,
|
|
464
|
+
height: height
|
|
465
|
+
}));
|
|
466
|
+
return true;
|
|
451
467
|
},
|
|
452
468
|
/**
|
|
453
469
|
* Send one or many events (in order).
|
package/es/utils/helper.js
CHANGED
|
@@ -5,10 +5,11 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
5
5
|
import { HDRCubeTextureLoader } from 'three/examples/jsm/loaders/HDRCubeTextureLoader.js';
|
|
6
6
|
import { ANIMATE_OBJECT_OPEN_DOOR_ROTATION_UNIT, ANIMATE_STEP_MAX, DECIMAL_PLACES_2, HDR_URLS, MAX_ZOOM_IN_SCALE, MODE_ELEVATION_VIEW, ZOOM_VARIABLE } from "../constants";
|
|
7
7
|
import * as Three from 'three';
|
|
8
|
-
import { returnReplaceableDeepSearchType } from "./../components/viewer2d/utils";
|
|
8
|
+
import { isWarningItem, returnReplaceableDeepSearchType } from "./../components/viewer2d/utils";
|
|
9
9
|
import { convert } from "./convert-units-lite";
|
|
10
10
|
import { formatNumber } from "./math";
|
|
11
11
|
import AWS from 'aws-sdk';
|
|
12
|
+
import { GeometryUtils, MoldingUtils } from "./export";
|
|
12
13
|
var s3 = new AWS.S3({
|
|
13
14
|
accessKeyId: process.env.REACT_APP_AWS_ID,
|
|
14
15
|
secretAccessKey: process.env.REACT_APP_AWS_SECRET
|
|
@@ -396,4 +397,40 @@ export function centering2D(state) {
|
|
|
396
397
|
});
|
|
397
398
|
if (viewer2DActions) updateViwer2D(viewer, viewer2DActions);
|
|
398
399
|
return state;
|
|
400
|
+
}
|
|
401
|
+
export function updatePayloadOfInternalEvent(currentObject, layer, catalog) {
|
|
402
|
+
var pointArray = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : null;
|
|
403
|
+
if (isEmpty(currentObject)) return null;
|
|
404
|
+
var updatedPayload = currentObject.toJS();
|
|
405
|
+
if (isEmpty(layer) || isEmpty(catalog)) return updatedPayload;
|
|
406
|
+
if ((currentObject === null || currentObject === void 0 ? void 0 : currentObject.prototype) === 'lines') {
|
|
407
|
+
// caculating length of selected line//
|
|
408
|
+
var v_a = layer.vertices.get(currentObject.vertices.get(0));
|
|
409
|
+
var v_b = layer.vertices.get(currentObject.vertices.get(1));
|
|
410
|
+
var distance = GeometryUtils.pointsDistance(v_a.x, v_a.y, v_b.x, v_b.y);
|
|
411
|
+
var _length = convert(distance).from('cm').to(layer.unit);
|
|
412
|
+
updatedPayload.length = _length;
|
|
413
|
+
//////////////////////////////////////
|
|
414
|
+
} else if ((currentObject === null || currentObject === void 0 ? void 0 : currentObject.prototype) === 'items') {
|
|
415
|
+
var _catalog$elements$cur;
|
|
416
|
+
// check this cabinet has warning box
|
|
417
|
+
updatedPayload.isWarning = isWarningItem(currentObject);
|
|
418
|
+
// check this item is available molding
|
|
419
|
+
updatedPayload.isMoldingAvailable = MoldingUtils.isEnableItemForMolding(layer, currentObject);
|
|
420
|
+
// check this item is snapped to wall
|
|
421
|
+
updatedPayload.isAttachedWall = MoldingUtils.isAttachedWall(layer, currentObject);
|
|
422
|
+
// update distArray
|
|
423
|
+
if (pointArray) updatedPayload.distArray = pointArray;
|
|
424
|
+
|
|
425
|
+
// update sku_number using sku_array
|
|
426
|
+
var currentDoorColorId = currentObject.getIn(['doorStyle', 'id']);
|
|
427
|
+
var skuArray = catalog === null || catalog === void 0 || (_catalog$elements$cur = catalog.elements[currentObject.get('name')]) === null || _catalog$elements$cur === void 0 || (_catalog$elements$cur = _catalog$elements$cur.obj) === null || _catalog$elements$cur === void 0 ? void 0 : _catalog$elements$cur.skuArray;
|
|
428
|
+
var correctSKU = skuArray === null || skuArray === void 0 ? void 0 : skuArray.find(function (sku) {
|
|
429
|
+
return sku.door_color_id === currentDoorColorId;
|
|
430
|
+
});
|
|
431
|
+
if (correctSKU) {
|
|
432
|
+
updatedPayload.sku_number = correctSKU.sku;
|
|
433
|
+
}
|
|
434
|
+
}
|
|
435
|
+
return updatedPayload;
|
|
399
436
|
}
|
|
@@ -15,6 +15,7 @@ import { GeometryUtils, MathUtils } from "./export";
|
|
|
15
15
|
import { returnReplaceableDeepSearchType } from "../components/viewer2d/utils";
|
|
16
16
|
import { SVGLoader } from 'three/addons/loaders/SVGLoader';
|
|
17
17
|
import { getMoldingDataOfScene } from "./molding";
|
|
18
|
+
import { Scene, State } from "../models";
|
|
18
19
|
var PRECISION = 2;
|
|
19
20
|
function loadJSON(_x) {
|
|
20
21
|
return _loadJSON.apply(this, arguments);
|
|
@@ -1151,7 +1152,7 @@ export function handleExternalEvent(_x10) {
|
|
|
1151
1152
|
function _handleExternalEvent() {
|
|
1152
1153
|
_handleExternalEvent = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee9(props) {
|
|
1153
1154
|
var _evt$payload3, _evt$payload4;
|
|
1154
|
-
var evt, state, layerId, layer, _evt$payload, cdsItems, itemKeys, _loop3, i, _props$onInternalEven, sLineCnt, element, _state$viewer2D, _evt$payload$initialP, mouseX, mouseY, v2d, vPosX, vPosY, layerID, defaulTitle, _Object$keys, _evt$payload5, doorStyle, itemCDS, isAll, _layerId, _cdsItems, allItems, selectedItemId, _itemKeys, _loop4, _i2, _props$onInternalEven2, _evt$payload6, roomShapeType, width, height, _doorStyle, value, _value, _evt$payload7, moldingInfo, isGlobal, distElement, _distElement, _evt$payload8, option, _value2, _layerId2, _layer, _layer$getIn, selectedLines, selectedHoles, selectedItems, _i4, _i5, _i6, _evt$payload9, _evt$payload0, _evt$payload1, _evt$payload10, _layerID, _layer2, orginalItemInfo, originalItem, originalItemPos, replaceItem, _props$onInternalEven3, sceneData, currentTexture, _t5, _t6;
|
|
1155
|
+
var evt, state, layerId, layer, _evt$payload, cdsItems, itemKeys, _loop3, i, newScene, _props$onInternalEven, sLineCnt, element, _state$viewer2D, _evt$payload$initialP, mouseX, mouseY, v2d, vPosX, vPosY, layerID, defaulTitle, _Object$keys, _evt$payload5, doorStyle, itemCDS, isAll, _layerId, _cdsItems, allItems, selectedItemId, _itemKeys, _loop4, _i2, _props$onInternalEven2, _evt$payload6, roomShapeType, width, height, _doorStyle, value, _value, _evt$payload7, moldingInfo, isGlobal, distElement, _distElement, _evt$payload8, option, _value2, _layerId2, _layer, _layer$getIn, selectedLines, selectedHoles, selectedItems, _i4, _i5, _i6, _evt$payload9, _evt$payload0, _evt$payload1, _evt$payload10, _layerID, _layer2, orginalItemInfo, originalItem, originalItemPos, replaceItem, _props$onInternalEven3, sceneData, currentTexture, _t5, _t6;
|
|
1155
1156
|
return _regeneratorRuntime.wrap(function (_context1) {
|
|
1156
1157
|
while (1) switch (_context1.prev = _context1.next) {
|
|
1157
1158
|
case 0:
|
|
@@ -1161,9 +1162,13 @@ function _handleExternalEvent() {
|
|
|
1161
1162
|
layerId = state.getIn(['scene', 'selectedLayer']);
|
|
1162
1163
|
layer = state.getIn(['scene', 'layers', layerId]);
|
|
1163
1164
|
_t5 = evt === null || evt === void 0 ? void 0 : evt.type;
|
|
1164
|
-
_context1.next = _t5 === EXTERNAL_EVENT_LOAD_PROJECT ? 1 : _t5 === EXTERNAL_EVENT_TOGGLE_TO_3D ?
|
|
1165
|
+
_context1.next = _t5 === EXTERNAL_EVENT_LOAD_PROJECT ? 1 : _t5 === EXTERNAL_EVENT_TOGGLE_TO_3D ? 6 : _t5 === EXTERNAL_EVENT_TOGGLE_TO_2D ? 7 : _t5 === EXTERNAL_EVENT_TOGGLE_TO_ELEVATION ? 8 : _t5 === EXTERNAL_EVENT_ADD_WALL ? 9 : _t5 === EXTERNAL_EVENT_ADD_ITEM ? 10 : _t5 === EXTERNAL_EVENT_ADD_HOLE ? 13 : _t5 === EXTERNAL_EVENT_ROTATE_PAN ? 14 : _t5 === EXTERNAL_EVENT_MOVE_PAN ? 14 : _t5 === EXTERNAL_EVENT_NEW_PROJECT ? 15 : _t5 === EXTERNAL_EVENT_CHANGE_DOORSTYLE ? 16 : _t5 === EXTERNAL_EVENT_ADD_ROOM_SHAPE ? 20 : _t5 === EXTERNAL_EVENT_ZOOM_IN ? 21 : _t5 === EXTERNAL_EVENT_ZOOM_OUT ? 22 : _t5 === EXTERNAL_EVENT_CENTERING_2D ? 23 : _t5 === EXTERNAL_EVENT_UNDO ? 24 : _t5 === EXTERNAL_EVENT_REDO ? 25 : _t5 === EXTERNAL_EVENT_SET_MOLDING ? 26 : _t5 === EXTERNAL_EVENT_DUPLICATE_ELEMENT ? 28 : _t5 === EXTERNAL_EVENT_DELETE_ELEMENT ? 29 : _t5 === EXTERNAL_EVENT_PROJECT_SETTING ? 30 : _t5 === EXTERNAL_EVENT_UPDATE_ATTRIBUTE ? 39 : _t5 === EXTERNAL_EVENT_UPDATE_PROPERTY ? 39 : _t5 === EXTERNAL_EVENT_REPLACE_CABINET ? 40 : _t5 === EXTERNAL_EVENT_SET_FINISHING ? 42 : _t5 === EXTERNAL_EVENT_SYNC_SCENE ? 43 : 44;
|
|
1165
1166
|
break;
|
|
1166
1167
|
case 1:
|
|
1168
|
+
if (!(evt !== null && evt !== void 0 && evt.payload)) {
|
|
1169
|
+
_context1.next = 5;
|
|
1170
|
+
break;
|
|
1171
|
+
}
|
|
1167
1172
|
// prepare item data request
|
|
1168
1173
|
cdsItems = [];
|
|
1169
1174
|
itemKeys = Object.keys(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 ? void 0 : _evt$payload.items) || [];
|
|
@@ -1208,6 +1213,10 @@ function _handleExternalEvent() {
|
|
|
1208
1213
|
_context1.next = 2;
|
|
1209
1214
|
break;
|
|
1210
1215
|
case 4:
|
|
1216
|
+
newScene = new Scene(evt === null || evt === void 0 ? void 0 : evt.payload);
|
|
1217
|
+
state = new State({
|
|
1218
|
+
scene: newScene.toJS()
|
|
1219
|
+
});
|
|
1211
1220
|
// request item catalog data to host app
|
|
1212
1221
|
if (cdsItems.length > 0) {
|
|
1213
1222
|
(_props$onInternalEven = props.onInternalEvent) === null || _props$onInternalEven === void 0 || _props$onInternalEven.call(props, {
|
|
@@ -1246,32 +1255,33 @@ function _handleExternalEvent() {
|
|
|
1246
1255
|
};
|
|
1247
1256
|
}());
|
|
1248
1257
|
}
|
|
1249
|
-
return _context1.abrupt("continue", 43);
|
|
1250
1258
|
case 5:
|
|
1251
|
-
|
|
1252
|
-
return _context1.abrupt("continue", 43);
|
|
1259
|
+
return _context1.abrupt("continue", 44);
|
|
1253
1260
|
case 6:
|
|
1254
|
-
props.projectActions.setMode(
|
|
1255
|
-
return _context1.abrupt("continue",
|
|
1261
|
+
props.projectActions.setMode(MODE_IDLE_3D);
|
|
1262
|
+
return _context1.abrupt("continue", 44);
|
|
1256
1263
|
case 7:
|
|
1264
|
+
props.projectActions.setMode(MODE_IDLE);
|
|
1265
|
+
return _context1.abrupt("continue", 44);
|
|
1266
|
+
case 8:
|
|
1257
1267
|
sLineCnt = layer.selected.lines.size;
|
|
1258
1268
|
if (sLineCnt > 0) props.projectActions.setMode(MODE_ELEVATION_VIEW);
|
|
1259
|
-
return _context1.abrupt("continue",
|
|
1260
|
-
case
|
|
1269
|
+
return _context1.abrupt("continue", 44);
|
|
1270
|
+
case 9:
|
|
1261
1271
|
if (state.mode === MODE_IDLE || state.mode === MODE_2D_PAN) props.linesActions.selectToolDrawingLine('wall');else {
|
|
1262
1272
|
props.projectActions.setMode(MODE_IDLE);
|
|
1263
1273
|
props.linesActions.selectToolDrawingLine('wall');
|
|
1264
1274
|
}
|
|
1265
|
-
return _context1.abrupt("continue",
|
|
1266
|
-
case
|
|
1275
|
+
return _context1.abrupt("continue", 44);
|
|
1276
|
+
case 10:
|
|
1267
1277
|
if (isEmpty(evt === null || evt === void 0 ? void 0 : evt.payload)) {
|
|
1268
|
-
_context1.next =
|
|
1278
|
+
_context1.next = 12;
|
|
1269
1279
|
break;
|
|
1270
1280
|
}
|
|
1271
1281
|
element = evt.payload;
|
|
1272
|
-
_context1.next =
|
|
1282
|
+
_context1.next = 11;
|
|
1273
1283
|
return addItemToCatalog(element, state, props.catalog, props.projectActions);
|
|
1274
|
-
case
|
|
1284
|
+
case 11:
|
|
1275
1285
|
// start drawing item
|
|
1276
1286
|
if (ARRAY_3D_MODES.includes(state.mode)) {
|
|
1277
1287
|
// in 3d view
|
|
@@ -1292,20 +1302,20 @@ function _handleExternalEvent() {
|
|
|
1292
1302
|
}
|
|
1293
1303
|
props.projectActions.pushLastSelectedCatalogElementToHistory(element);
|
|
1294
1304
|
props.projectActions.setIsCabinetDrawing(true);
|
|
1295
|
-
case 11:
|
|
1296
|
-
return _context1.abrupt("continue", 43);
|
|
1297
1305
|
case 12:
|
|
1298
|
-
|
|
1299
|
-
return _context1.abrupt("continue", 43);
|
|
1306
|
+
return _context1.abrupt("continue", 44);
|
|
1300
1307
|
case 13:
|
|
1301
|
-
|
|
1302
|
-
return _context1.abrupt("continue",
|
|
1308
|
+
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);
|
|
1309
|
+
return _context1.abrupt("continue", 44);
|
|
1303
1310
|
case 14:
|
|
1311
|
+
moveAndRotatePan2D3D(evt.type, props, evt.payload, state);
|
|
1312
|
+
return _context1.abrupt("continue", 44);
|
|
1313
|
+
case 15:
|
|
1304
1314
|
defaulTitle = 'Untitle';
|
|
1305
1315
|
props.projectActions.newProject();
|
|
1306
1316
|
props.projectActions.rename(defaulTitle);
|
|
1307
|
-
return _context1.abrupt("continue",
|
|
1308
|
-
case
|
|
1317
|
+
return _context1.abrupt("continue", 44);
|
|
1318
|
+
case 16:
|
|
1309
1319
|
_evt$payload5 = evt.payload, doorStyle = _evt$payload5.doorStyle, itemCDS = _evt$payload5.itemCDS, isAll = _evt$payload5.isAll; // prepare item data request
|
|
1310
1320
|
_layerId = state.getIn(['scene', 'selectedLayer']);
|
|
1311
1321
|
_cdsItems = [];
|
|
@@ -1340,17 +1350,17 @@ function _handleExternalEvent() {
|
|
|
1340
1350
|
}, _loop4);
|
|
1341
1351
|
});
|
|
1342
1352
|
_i2 = 0;
|
|
1343
|
-
case
|
|
1353
|
+
case 17:
|
|
1344
1354
|
if (!(_i2 < _itemKeys.length)) {
|
|
1345
|
-
_context1.next =
|
|
1355
|
+
_context1.next = 19;
|
|
1346
1356
|
break;
|
|
1347
1357
|
}
|
|
1348
|
-
return _context1.delegateYield(_loop4(), "t1",
|
|
1349
|
-
case
|
|
1358
|
+
return _context1.delegateYield(_loop4(), "t1", 18);
|
|
1359
|
+
case 18:
|
|
1350
1360
|
_i2++;
|
|
1351
|
-
_context1.next =
|
|
1361
|
+
_context1.next = 17;
|
|
1352
1362
|
break;
|
|
1353
|
-
case
|
|
1363
|
+
case 19:
|
|
1354
1364
|
// request item catalog data to host app
|
|
1355
1365
|
if (_cdsItems.length > 0) {
|
|
1356
1366
|
(_props$onInternalEven2 = props.onInternalEvent) === null || _props$onInternalEven2 === void 0 || _props$onInternalEven2.call(props, {
|
|
@@ -1389,94 +1399,94 @@ function _handleExternalEvent() {
|
|
|
1389
1399
|
};
|
|
1390
1400
|
}());
|
|
1391
1401
|
} else props.itemsActions.setDoorStyle(doorStyle, itemCDS, isAll);
|
|
1392
|
-
return _context1.abrupt("continue",
|
|
1393
|
-
case
|
|
1402
|
+
return _context1.abrupt("continue", 44);
|
|
1403
|
+
case 20:
|
|
1394
1404
|
_evt$payload6 = evt.payload, roomShapeType = _evt$payload6.roomShapeType, width = _evt$payload6.width, height = _evt$payload6.height, _doorStyle = _evt$payload6.doorStyle;
|
|
1395
1405
|
props.projectActions.createRoomWithShape(roomShapeType, width, height, _doorStyle);
|
|
1396
|
-
return _context1.abrupt("continue",
|
|
1397
|
-
case
|
|
1406
|
+
return _context1.abrupt("continue", 44);
|
|
1407
|
+
case 21:
|
|
1398
1408
|
value = state.getIn(['viewer2D']).toJS();
|
|
1399
1409
|
value.a += 0.1;
|
|
1400
1410
|
value.d += 0.1;
|
|
1401
1411
|
value.e -= value.SVGWidth * 0.1 / 2;
|
|
1402
1412
|
value.f -= value.SVGHeight * 0.1 / 2;
|
|
1403
1413
|
updateViwer2D(value, props.viewer2DActions);
|
|
1404
|
-
return _context1.abrupt("continue",
|
|
1405
|
-
case
|
|
1414
|
+
return _context1.abrupt("continue", 44);
|
|
1415
|
+
case 22:
|
|
1406
1416
|
_value = state.getIn(['viewer2D']).toJS();
|
|
1407
1417
|
_value.a -= 0.1;
|
|
1408
1418
|
_value.d -= 0.1;
|
|
1409
1419
|
_value.e += _value.SVGWidth * 0.1 / 2;
|
|
1410
1420
|
_value.f += _value.SVGHeight * 0.1 / 2;
|
|
1411
1421
|
updateViwer2D(_value, props.viewer2DActions);
|
|
1412
|
-
return _context1.abrupt("continue",
|
|
1413
|
-
case 22:
|
|
1414
|
-
centering2D(state, props.viewer2DActions);
|
|
1415
|
-
return _context1.abrupt("continue", 43);
|
|
1422
|
+
return _context1.abrupt("continue", 44);
|
|
1416
1423
|
case 23:
|
|
1417
|
-
props.
|
|
1418
|
-
return _context1.abrupt("continue",
|
|
1424
|
+
centering2D(state, props.viewer2DActions);
|
|
1425
|
+
return _context1.abrupt("continue", 44);
|
|
1419
1426
|
case 24:
|
|
1420
|
-
props.projectActions.
|
|
1421
|
-
return _context1.abrupt("continue",
|
|
1427
|
+
props.projectActions.undo();
|
|
1428
|
+
return _context1.abrupt("continue", 44);
|
|
1422
1429
|
case 25:
|
|
1430
|
+
props.projectActions.redo();
|
|
1431
|
+
return _context1.abrupt("continue", 44);
|
|
1432
|
+
case 26:
|
|
1423
1433
|
_evt$payload7 = evt.payload, moldingInfo = _evt$payload7.moldingInfo, isGlobal = _evt$payload7.isGlobal;
|
|
1424
|
-
_context1.next =
|
|
1434
|
+
_context1.next = 27;
|
|
1425
1435
|
return loadMoldingSvg(moldingInfo);
|
|
1426
|
-
case 26:
|
|
1427
|
-
props.itemsActions.setMolding(moldingInfo, isGlobal);
|
|
1428
|
-
return _context1.abrupt("continue", 43);
|
|
1429
1436
|
case 27:
|
|
1437
|
+
props.itemsActions.setMolding(moldingInfo, isGlobal);
|
|
1438
|
+
return _context1.abrupt("continue", 44);
|
|
1439
|
+
case 28:
|
|
1430
1440
|
distElement = getElement(evt.payload, state);
|
|
1431
1441
|
if (distElement) props.itemsActions.duplicateSelected(distElement, props.onInternalEvent);
|
|
1432
|
-
return _context1.abrupt("continue",
|
|
1433
|
-
case
|
|
1442
|
+
return _context1.abrupt("continue", 44);
|
|
1443
|
+
case 29:
|
|
1434
1444
|
_distElement = getElement(evt.payload, state);
|
|
1435
1445
|
if (_distElement) props.projectActions.remove(_distElement);
|
|
1436
|
-
return _context1.abrupt("continue",
|
|
1437
|
-
case
|
|
1446
|
+
return _context1.abrupt("continue", 44);
|
|
1447
|
+
case 30:
|
|
1438
1448
|
_evt$payload8 = evt.payload, option = _evt$payload8.option, _value2 = _evt$payload8.value;
|
|
1439
1449
|
_t6 = option;
|
|
1440
|
-
_context1.next = _t6 === PROJECT_SETTING_OPTION.CHANGE_MEASUREMENT_UNIT ?
|
|
1450
|
+
_context1.next = _t6 === PROJECT_SETTING_OPTION.CHANGE_MEASUREMENT_UNIT ? 31 : _t6 === PROJECT_SETTING_OPTION.UPDATE_CEIL_HEIGHT ? 32 : _t6 === PROJECT_SETTING_OPTION.CHANGE_WALL_LENGTH_MEASURE ? 33 : _t6 === PROJECT_SETTING_OPTION.CHANGE_BASE_CABINET_MEASURE ? 34 : _t6 === PROJECT_SETTING_OPTION.CHANGE_WALL_CABINET_MEASURE ? 35 : _t6 === PROJECT_SETTING_OPTION.CHANGE_WINDOW_DOOR_MEASURE ? 36 : 37;
|
|
1441
1451
|
break;
|
|
1442
|
-
case 30:
|
|
1443
|
-
props.viewer2DActions.updateCeilHeightUnit(_value2);
|
|
1444
1452
|
case 31:
|
|
1453
|
+
props.viewer2DActions.updateCeilHeightUnit(_value2);
|
|
1454
|
+
case 32:
|
|
1445
1455
|
props.viewer2DActions.updateCeilHeight(_value2);
|
|
1446
1456
|
props.viewer3DActions.update3DCeilHeight(_value2);
|
|
1447
|
-
return _context1.abrupt("continue",
|
|
1448
|
-
case 32:
|
|
1449
|
-
props.viewer2DActions.changeWallLengthMeasure(_value2);
|
|
1450
|
-
return _context1.abrupt("continue", 37);
|
|
1457
|
+
return _context1.abrupt("continue", 38);
|
|
1451
1458
|
case 33:
|
|
1452
|
-
props.viewer2DActions.
|
|
1453
|
-
return _context1.abrupt("continue",
|
|
1459
|
+
props.viewer2DActions.changeWallLengthMeasure(_value2);
|
|
1460
|
+
return _context1.abrupt("continue", 38);
|
|
1454
1461
|
case 34:
|
|
1455
|
-
props.viewer2DActions.
|
|
1456
|
-
return _context1.abrupt("continue",
|
|
1462
|
+
props.viewer2DActions.changeBaseCabinetMeasure(_value2);
|
|
1463
|
+
return _context1.abrupt("continue", 38);
|
|
1457
1464
|
case 35:
|
|
1458
|
-
props.viewer2DActions.
|
|
1459
|
-
return _context1.abrupt("continue",
|
|
1465
|
+
props.viewer2DActions.changeWallCabinetMeasure(_value2);
|
|
1466
|
+
return _context1.abrupt("continue", 38);
|
|
1460
1467
|
case 36:
|
|
1461
|
-
|
|
1468
|
+
props.viewer2DActions.changeWindowDoorMeasure(_value2);
|
|
1469
|
+
return _context1.abrupt("continue", 38);
|
|
1462
1470
|
case 37:
|
|
1463
|
-
return _context1.abrupt("continue",
|
|
1471
|
+
return _context1.abrupt("continue", 38);
|
|
1464
1472
|
case 38:
|
|
1473
|
+
return _context1.abrupt("continue", 44);
|
|
1474
|
+
case 39:
|
|
1465
1475
|
_layerId2 = state.getIn(['scene', 'selectedLayer']);
|
|
1466
1476
|
_layer = state.getIn(['scene', 'layers', _layerId2]);
|
|
1467
1477
|
_layer$getIn = _layer.getIn(['selected']), selectedLines = _layer$getIn.lines, selectedHoles = _layer$getIn.holes, selectedItems = _layer$getIn.items;
|
|
1468
1478
|
for (_i4 = 0; _i4 < selectedLines.size; _i4++) (evt === null || evt === void 0 ? void 0 : evt.type) === EXTERNAL_EVENT_UPDATE_ATTRIBUTE ? updateAttributeOfSelectedElement(_layer.getIn(['lines', selectedLines.get(_i4)]), evt.payload, state, _layer, props.catalog, props.projectActions, evt.callback) : updatePropertyOfSelectedElement(_layer.getIn(['lines', selectedLines.get(_i4)]), evt.payload, props.catalog, props.projectActions, evt.callback);
|
|
1469
1479
|
for (_i5 = 0; _i5 < selectedHoles.size; _i5++) (evt === null || evt === void 0 ? void 0 : evt.type) === EXTERNAL_EVENT_UPDATE_ATTRIBUTE ? updateAttributeOfSelectedElement(_layer.getIn(['holes', selectedHoles.get(_i5)]), evt.payload, state, _layer, props.catalog, props.projectActions, evt.callback) : updatePropertyOfSelectedElement(_layer.getIn(['holes', selectedHoles.get(_i5)]), evt.payload, props.catalog, props.projectActions, evt.callback);
|
|
1470
1480
|
for (_i6 = 0; _i6 < selectedItems.size; _i6++) (evt === null || evt === void 0 ? void 0 : evt.type) === EXTERNAL_EVENT_UPDATE_ATTRIBUTE ? updateAttributeOfSelectedElement(_layer.getIn(['items', selectedItems.get(_i6)]), evt.payload, state, _layer, props.catalog, props.projectActions, evt.callback) : updatePropertyOfSelectedElement(_layer.getIn(['items', selectedItems.get(_i6)]), evt.payload, props.catalog, props.projectActions, evt.callback);
|
|
1471
|
-
return _context1.abrupt("continue",
|
|
1472
|
-
case
|
|
1481
|
+
return _context1.abrupt("continue", 44);
|
|
1482
|
+
case 40:
|
|
1473
1483
|
_layerID = state.scene.selectedLayer;
|
|
1474
1484
|
_layer2 = state.scene.getIn(['layers', _layerID]).toJS();
|
|
1475
1485
|
orginalItemInfo = evt === null || evt === void 0 || (_evt$payload9 = evt.payload) === null || _evt$payload9 === void 0 ? void 0 : _evt$payload9.orginalItemInfo;
|
|
1476
1486
|
originalItem = _layer2 === null || _layer2 === void 0 ? void 0 : _layer2.items[orginalItemInfo.id];
|
|
1477
|
-
_context1.next =
|
|
1487
|
+
_context1.next = 41;
|
|
1478
1488
|
return addItemToCatalog(evt.payload.replaceItemInfo, state, props.catalog, props.projectActions);
|
|
1479
|
-
case
|
|
1489
|
+
case 41:
|
|
1480
1490
|
originalItemPos = {
|
|
1481
1491
|
rotation: originalItem.rotation,
|
|
1482
1492
|
selectedItemId: originalItem.id,
|
|
@@ -1491,11 +1501,11 @@ function _handleExternalEvent() {
|
|
|
1491
1501
|
}
|
|
1492
1502
|
};
|
|
1493
1503
|
props.itemsActions.replaceItem(originalItemPos, originalItem, replaceItem);
|
|
1494
|
-
return _context1.abrupt("continue",
|
|
1495
|
-
case 41:
|
|
1496
|
-
setFinishing(props, state, evt.payload);
|
|
1497
|
-
return _context1.abrupt("continue", 43);
|
|
1504
|
+
return _context1.abrupt("continue", 44);
|
|
1498
1505
|
case 42:
|
|
1506
|
+
setFinishing(props, state, evt.payload);
|
|
1507
|
+
return _context1.abrupt("continue", 44);
|
|
1508
|
+
case 43:
|
|
1499
1509
|
sceneData = state.scene.toJS(); // get molding data for "ReviewForQuote"
|
|
1500
1510
|
currentTexture = layer.doorStyle !== null || layer.doorStyle !== undefined ? layer.doorStyle : props.state.doorStyle.toJS();
|
|
1501
1511
|
sceneData.layers[layerId].moldingData = getMoldingDataOfScene(layer, props.catalog, currentTexture);
|
|
@@ -1506,8 +1516,8 @@ function _handleExternalEvent() {
|
|
|
1506
1516
|
scene: sceneData
|
|
1507
1517
|
}
|
|
1508
1518
|
});
|
|
1509
|
-
return _context1.abrupt("continue",
|
|
1510
|
-
case
|
|
1519
|
+
return _context1.abrupt("continue", 44);
|
|
1520
|
+
case 44:
|
|
1511
1521
|
case "end":
|
|
1512
1522
|
return _context1.stop();
|
|
1513
1523
|
}
|