kitchen-simulator 3.11.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/components/viewer3d/viewer3d.js +4 -1
- package/es/index.js +17 -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/components/viewer3d/viewer3d.js +3 -0
- package/lib/index.js +17 -1
- package/lib/utils/isolate-event-handler.js +85 -75
- package/package.json +1 -1
|
@@ -7,12 +7,14 @@ import _createClass from "@babel/runtime/helpers/esm/createClass";
|
|
|
7
7
|
import _possibleConstructorReturn from "@babel/runtime/helpers/esm/possibleConstructorReturn";
|
|
8
8
|
import _getPrototypeOf from "@babel/runtime/helpers/esm/getPrototypeOf";
|
|
9
9
|
import _inherits from "@babel/runtime/helpers/esm/inherits";
|
|
10
|
+
import _taggedTemplateLiteral from "@babel/runtime/helpers/esm/taggedTemplateLiteral";
|
|
10
11
|
var _excluded = ["width", "height", "state", "stateExtractor", "measurementUnit"];
|
|
12
|
+
var _templateObject, _templateObject2;
|
|
11
13
|
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; }
|
|
12
14
|
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; }
|
|
13
15
|
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
14
16
|
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
15
|
-
import
|
|
17
|
+
import styled from 'styled-components';
|
|
16
18
|
import { convert } from "./utils/convert-units-lite";
|
|
17
19
|
import PropTypes from 'prop-types';
|
|
18
20
|
import React, { Component } from 'react';
|
|
@@ -32,6 +34,10 @@ var wrapperStyle = {
|
|
|
32
34
|
display: 'flex',
|
|
33
35
|
flexFlow: 'row nowrap'
|
|
34
36
|
};
|
|
37
|
+
var WarningItem = styled.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n opacity: 0.8;\n position: absolute;\n border-radius: 6px;\n z-index: 11;\n background-color: #ff7400;\n width: max-content;\n align-items: center;\n padding: 10px;\n display: none;\n box-shadow: 0px 3px 5px -1px rgba(0, 0, 0, 0.2),\n 0px 6px 10px 0px rgba(0, 0, 0, 0.39), 0px 1px 18px 0px rgba(0, 0, 0, 0.12);\n top: -50px;\n left: 5px;\n color: white;\n"])));
|
|
38
|
+
var SubCategoryItemImage = styled.img(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n background-color: ", ";\n height: 30px;\n width: 30px;\n -webkit-mask-image: url(", ");\n -webkit-mask-size: calc(100% - 2px) calc(100% - 2px);\n -webkit-mask-repeat: no-repeat;\n -webkit-mask-position: 1px 1px;\n"])), constants.SECONDARY_PURPLE_COLOR, function (props) {
|
|
39
|
+
return props.maskImage + '?nocache=2025';
|
|
40
|
+
});
|
|
35
41
|
var LiteKitchenConfigurator = /*#__PURE__*/function (_Component) {
|
|
36
42
|
function LiteKitchenConfigurator(props) {
|
|
37
43
|
var _utmRequestData2, _utmRequestData3, _utmRequestData4, _utmRequestData5, _utmRequestData6, _utmRequestData7, _utmRequestData8, _utmRequestData9, _utmRequestData0;
|
|
@@ -426,7 +432,20 @@ var LiteKitchenConfigurator = /*#__PURE__*/function (_Component) {
|
|
|
426
432
|
return event.preventDefault();
|
|
427
433
|
},
|
|
428
434
|
onInternalEvent: this.props.onInternalEvent
|
|
429
|
-
}))
|
|
435
|
+
})), /*#__PURE__*/React.createElement(WarningItem, {
|
|
436
|
+
id: "warning_box_2d",
|
|
437
|
+
style: {
|
|
438
|
+
display: 'none'
|
|
439
|
+
}
|
|
440
|
+
}, /*#__PURE__*/React.createElement(SubCategoryItemImage, {
|
|
441
|
+
maskImage: "/assets/img/svg/3d_item_warning_info.svg",
|
|
442
|
+
style: {
|
|
443
|
+
backgroundColor: constants.BG_COLOR_1,
|
|
444
|
+
marginRight: 10,
|
|
445
|
+
height: 30,
|
|
446
|
+
width: 30
|
|
447
|
+
}
|
|
448
|
+
}), "This item is not available in the current door style. Replace it with another one.")));
|
|
430
449
|
}
|
|
431
450
|
}]);
|
|
432
451
|
}(Component);
|
|
@@ -1,6 +1,13 @@
|
|
|
1
|
-
<svg width="
|
|
2
|
-
<path
|
|
3
|
-
<path d="
|
|
4
|
-
<path d="
|
|
5
|
-
<path d="M8
|
|
1
|
+
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<g clip-path="url(#clip0_1516_100789)">
|
|
3
|
+
<path d="M4.25 6L2 7.125L8 10.125L14 7.125L11.75 6" stroke="rgba(58, 11, 128, 1)" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
|
|
4
|
+
<path d="M2 10.125L8 13.125L14 10.125" stroke="rgba(58, 11, 128, 1)" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
|
|
5
|
+
<path d="M8 7.125V1.875" stroke="rgba(58, 11, 128, 1)" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
|
|
6
|
+
<path d="M5.75 4.125L8 1.875L10.25 4.125" stroke="rgba(58, 11, 128, 1)" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
|
|
7
|
+
</g>
|
|
8
|
+
<defs>
|
|
9
|
+
<clipPath id="clip0_1516_100789">
|
|
10
|
+
<rect width="16" height="16" fill="white"/>
|
|
11
|
+
</clipPath>
|
|
12
|
+
</defs>
|
|
6
13
|
</svg>
|
|
@@ -19,7 +19,7 @@ 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";
|
|
@@ -1460,6 +1460,9 @@ var Scene3DViewer = /*#__PURE__*/function (_React$Component) {
|
|
|
1460
1460
|
var replaceInfo = intersects[_i10].object.parent.parent.userData;
|
|
1461
1461
|
_this2.context.itemsActions.selectItem(replaceInfo.layerId, replaceInfo.itemId);
|
|
1462
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);
|
|
1463
1466
|
return;
|
|
1464
1467
|
}
|
|
1465
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).
|
|
@@ -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
|
}
|
|
@@ -15,7 +15,8 @@ var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/creat
|
|
|
15
15
|
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
|
|
16
16
|
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
17
17
|
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
18
|
-
var
|
|
18
|
+
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
|
19
|
+
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
19
20
|
var _convertUnitsLite = require("./utils/convert-units-lite");
|
|
20
21
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
21
22
|
var _react = _interopRequireWildcard(require("react"));
|
|
@@ -31,6 +32,7 @@ var _objectsUtils = require("./utils/objects-utils");
|
|
|
31
32
|
var _version = require("./version");
|
|
32
33
|
var _isolateEventHandler = require("./utils/isolate-event-handler");
|
|
33
34
|
var _excluded = ["width", "height", "state", "stateExtractor", "measurementUnit"];
|
|
35
|
+
var _templateObject, _templateObject2;
|
|
34
36
|
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, "default": e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
|
|
35
37
|
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; }
|
|
36
38
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2["default"])(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
@@ -41,6 +43,10 @@ var wrapperStyle = {
|
|
|
41
43
|
display: 'flex',
|
|
42
44
|
flexFlow: 'row nowrap'
|
|
43
45
|
};
|
|
46
|
+
var WarningItem = _styledComponents["default"].div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2["default"])(["\n opacity: 0.8;\n position: absolute;\n border-radius: 6px;\n z-index: 11;\n background-color: #ff7400;\n width: max-content;\n align-items: center;\n padding: 10px;\n display: none;\n box-shadow: 0px 3px 5px -1px rgba(0, 0, 0, 0.2),\n 0px 6px 10px 0px rgba(0, 0, 0, 0.39), 0px 1px 18px 0px rgba(0, 0, 0, 0.12);\n top: -50px;\n left: 5px;\n color: white;\n"])));
|
|
47
|
+
var SubCategoryItemImage = _styledComponents["default"].img(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2["default"])(["\n background-color: ", ";\n height: 30px;\n width: 30px;\n -webkit-mask-image: url(", ");\n -webkit-mask-size: calc(100% - 2px) calc(100% - 2px);\n -webkit-mask-repeat: no-repeat;\n -webkit-mask-position: 1px 1px;\n"])), constants.SECONDARY_PURPLE_COLOR, function (props) {
|
|
48
|
+
return props.maskImage + '?nocache=2025';
|
|
49
|
+
});
|
|
44
50
|
var LiteKitchenConfigurator = /*#__PURE__*/function (_Component) {
|
|
45
51
|
function LiteKitchenConfigurator(props) {
|
|
46
52
|
var _utmRequestData2, _utmRequestData3, _utmRequestData4, _utmRequestData5, _utmRequestData6, _utmRequestData7, _utmRequestData8, _utmRequestData9, _utmRequestData0;
|
|
@@ -435,7 +441,20 @@ var LiteKitchenConfigurator = /*#__PURE__*/function (_Component) {
|
|
|
435
441
|
return event.preventDefault();
|
|
436
442
|
},
|
|
437
443
|
onInternalEvent: this.props.onInternalEvent
|
|
438
|
-
}))
|
|
444
|
+
})), /*#__PURE__*/_react["default"].createElement(WarningItem, {
|
|
445
|
+
id: "warning_box_2d",
|
|
446
|
+
style: {
|
|
447
|
+
display: 'none'
|
|
448
|
+
}
|
|
449
|
+
}, /*#__PURE__*/_react["default"].createElement(SubCategoryItemImage, {
|
|
450
|
+
maskImage: "/assets/img/svg/3d_item_warning_info.svg",
|
|
451
|
+
style: {
|
|
452
|
+
backgroundColor: constants.BG_COLOR_1,
|
|
453
|
+
marginRight: 10,
|
|
454
|
+
height: 30,
|
|
455
|
+
width: 30
|
|
456
|
+
}
|
|
457
|
+
}), "This item is not available in the current door style. Replace it with another one.")));
|
|
439
458
|
}
|
|
440
459
|
}]);
|
|
441
460
|
}(_react.Component);
|
|
@@ -1,6 +1,13 @@
|
|
|
1
|
-
<svg width="
|
|
2
|
-
<path
|
|
3
|
-
<path d="
|
|
4
|
-
<path d="
|
|
5
|
-
<path d="M8
|
|
1
|
+
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<g clip-path="url(#clip0_1516_100789)">
|
|
3
|
+
<path d="M4.25 6L2 7.125L8 10.125L14 7.125L11.75 6" stroke="rgba(58, 11, 128, 1)" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
|
|
4
|
+
<path d="M2 10.125L8 13.125L14 10.125" stroke="rgba(58, 11, 128, 1)" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
|
|
5
|
+
<path d="M8 7.125V1.875" stroke="rgba(58, 11, 128, 1)" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
|
|
6
|
+
<path d="M5.75 4.125L8 1.875L10.25 4.125" stroke="rgba(58, 11, 128, 1)" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
|
|
7
|
+
</g>
|
|
8
|
+
<defs>
|
|
9
|
+
<clipPath id="clip0_1516_100789">
|
|
10
|
+
<rect width="16" height="16" fill="white"/>
|
|
11
|
+
</clipPath>
|
|
12
|
+
</defs>
|
|
6
13
|
</svg>
|
|
@@ -1467,6 +1467,9 @@ var Scene3DViewer = exports["default"] = /*#__PURE__*/function (_React$Component
|
|
|
1467
1467
|
var replaceInfo = intersects[_i10].object.parent.parent.userData;
|
|
1468
1468
|
_this2.context.itemsActions.selectItem(replaceInfo.layerId, replaceInfo.itemId);
|
|
1469
1469
|
!_this2.props.downloadFlag && _this2.props.replaceCabinet(true);
|
|
1470
|
+
internalType = _constants.INTERNAL_EVENT_REPLACE_CABINET;
|
|
1471
|
+
var replaceElement = _this2.props.state.scene.layers.get(replaceInfo.layerId).items.get(replaceInfo.itemId);
|
|
1472
|
+
sendInternalEvent(internalType, replaceElement);
|
|
1470
1473
|
return;
|
|
1471
1474
|
}
|
|
1472
1475
|
}
|
package/lib/index.js
CHANGED
|
@@ -7,6 +7,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
exports["default"] = void 0;
|
|
8
8
|
exports.renderKitchenSimulator = renderKitchenSimulator;
|
|
9
9
|
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
10
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
10
11
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
11
12
|
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
12
13
|
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
@@ -17,6 +18,8 @@ var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/
|
|
|
17
18
|
var _react = _interopRequireDefault(require("react"));
|
|
18
19
|
var _LiteRenderer = _interopRequireDefault(require("./LiteRenderer"));
|
|
19
20
|
var _client = require("react-dom/client");
|
|
21
|
+
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; }
|
|
22
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2["default"])(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
20
23
|
function _callSuper(t, o, e) { return o = (0, _getPrototypeOf2["default"])(o), (0, _possibleConstructorReturn2["default"])(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], (0, _getPrototypeOf2["default"])(t).constructor) : o.apply(t, e)); }
|
|
21
24
|
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
22
25
|
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; } } }; }
|
|
@@ -452,10 +455,23 @@ function renderKitchenSimulator(container) {
|
|
|
452
455
|
}
|
|
453
456
|
}]);
|
|
454
457
|
}(_react["default"].Component);
|
|
458
|
+
var lastProps = _objectSpread({}, props);
|
|
455
459
|
var api = {
|
|
456
460
|
// internal: rerender wrapper with latest props if host calls renderKitchenSimulator again
|
|
457
461
|
__render: function __render(nextProps) {
|
|
458
|
-
|
|
462
|
+
lastProps = _objectSpread(_objectSpread({}, lastProps), nextProps);
|
|
463
|
+
root.render(/*#__PURE__*/_react["default"].createElement(Wrapper, lastProps));
|
|
464
|
+
},
|
|
465
|
+
updateContainerDimensions: function updateContainerDimensions(width, height) {
|
|
466
|
+
var extraProps = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
467
|
+
if (destroyed) return false;
|
|
468
|
+
|
|
469
|
+
// optional: accept numbers or strings, up to you
|
|
470
|
+
api.__render(_objectSpread(_objectSpread(_objectSpread({}, lastProps), extraProps), {}, {
|
|
471
|
+
width: width,
|
|
472
|
+
height: height
|
|
473
|
+
}));
|
|
474
|
+
return true;
|
|
459
475
|
},
|
|
460
476
|
/**
|
|
461
477
|
* Send one or many events (in order).
|
|
@@ -20,6 +20,7 @@ var _export = require("./export");
|
|
|
20
20
|
var _utils = require("../components/viewer2d/utils");
|
|
21
21
|
var _SVGLoader = require("three/addons/loaders/SVGLoader");
|
|
22
22
|
var _molding = require("./molding");
|
|
23
|
+
var _models = require("../models");
|
|
23
24
|
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; }
|
|
24
25
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2["default"])(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
25
26
|
var PRECISION = 2;
|
|
@@ -1158,7 +1159,7 @@ function handleExternalEvent(_x10) {
|
|
|
1158
1159
|
function _handleExternalEvent() {
|
|
1159
1160
|
_handleExternalEvent = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee9(props) {
|
|
1160
1161
|
var _evt$payload3, _evt$payload4;
|
|
1161
|
-
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;
|
|
1162
|
+
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;
|
|
1162
1163
|
return _regenerator["default"].wrap(function (_context1) {
|
|
1163
1164
|
while (1) switch (_context1.prev = _context1.next) {
|
|
1164
1165
|
case 0:
|
|
@@ -1168,9 +1169,13 @@ function _handleExternalEvent() {
|
|
|
1168
1169
|
layerId = state.getIn(['scene', 'selectedLayer']);
|
|
1169
1170
|
layer = state.getIn(['scene', 'layers', layerId]);
|
|
1170
1171
|
_t5 = evt === null || evt === void 0 ? void 0 : evt.type;
|
|
1171
|
-
_context1.next = _t5 === _constants.EXTERNAL_EVENT_LOAD_PROJECT ? 1 : _t5 === _constants.EXTERNAL_EVENT_TOGGLE_TO_3D ?
|
|
1172
|
+
_context1.next = _t5 === _constants.EXTERNAL_EVENT_LOAD_PROJECT ? 1 : _t5 === _constants.EXTERNAL_EVENT_TOGGLE_TO_3D ? 6 : _t5 === _constants.EXTERNAL_EVENT_TOGGLE_TO_2D ? 7 : _t5 === _constants.EXTERNAL_EVENT_TOGGLE_TO_ELEVATION ? 8 : _t5 === _constants.EXTERNAL_EVENT_ADD_WALL ? 9 : _t5 === _constants.EXTERNAL_EVENT_ADD_ITEM ? 10 : _t5 === _constants.EXTERNAL_EVENT_ADD_HOLE ? 13 : _t5 === _constants.EXTERNAL_EVENT_ROTATE_PAN ? 14 : _t5 === _constants.EXTERNAL_EVENT_MOVE_PAN ? 14 : _t5 === _constants.EXTERNAL_EVENT_NEW_PROJECT ? 15 : _t5 === _constants.EXTERNAL_EVENT_CHANGE_DOORSTYLE ? 16 : _t5 === _constants.EXTERNAL_EVENT_ADD_ROOM_SHAPE ? 20 : _t5 === _constants.EXTERNAL_EVENT_ZOOM_IN ? 21 : _t5 === _constants.EXTERNAL_EVENT_ZOOM_OUT ? 22 : _t5 === _constants.EXTERNAL_EVENT_CENTERING_2D ? 23 : _t5 === _constants.EXTERNAL_EVENT_UNDO ? 24 : _t5 === _constants.EXTERNAL_EVENT_REDO ? 25 : _t5 === _constants.EXTERNAL_EVENT_SET_MOLDING ? 26 : _t5 === _constants.EXTERNAL_EVENT_DUPLICATE_ELEMENT ? 28 : _t5 === _constants.EXTERNAL_EVENT_DELETE_ELEMENT ? 29 : _t5 === _constants.EXTERNAL_EVENT_PROJECT_SETTING ? 30 : _t5 === _constants.EXTERNAL_EVENT_UPDATE_ATTRIBUTE ? 39 : _t5 === _constants.EXTERNAL_EVENT_UPDATE_PROPERTY ? 39 : _t5 === _constants.EXTERNAL_EVENT_REPLACE_CABINET ? 40 : _t5 === _constants.EXTERNAL_EVENT_SET_FINISHING ? 42 : _t5 === _constants.EXTERNAL_EVENT_SYNC_SCENE ? 43 : 44;
|
|
1172
1173
|
break;
|
|
1173
1174
|
case 1:
|
|
1175
|
+
if (!(evt !== null && evt !== void 0 && evt.payload)) {
|
|
1176
|
+
_context1.next = 5;
|
|
1177
|
+
break;
|
|
1178
|
+
}
|
|
1174
1179
|
// prepare item data request
|
|
1175
1180
|
cdsItems = [];
|
|
1176
1181
|
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) || [];
|
|
@@ -1215,6 +1220,10 @@ function _handleExternalEvent() {
|
|
|
1215
1220
|
_context1.next = 2;
|
|
1216
1221
|
break;
|
|
1217
1222
|
case 4:
|
|
1223
|
+
newScene = new _models.Scene(evt === null || evt === void 0 ? void 0 : evt.payload);
|
|
1224
|
+
state = new _models.State({
|
|
1225
|
+
scene: newScene.toJS()
|
|
1226
|
+
});
|
|
1218
1227
|
// request item catalog data to host app
|
|
1219
1228
|
if (cdsItems.length > 0) {
|
|
1220
1229
|
(_props$onInternalEven = props.onInternalEvent) === null || _props$onInternalEven === void 0 || _props$onInternalEven.call(props, {
|
|
@@ -1253,32 +1262,33 @@ function _handleExternalEvent() {
|
|
|
1253
1262
|
};
|
|
1254
1263
|
}());
|
|
1255
1264
|
}
|
|
1256
|
-
return _context1.abrupt("continue", 43);
|
|
1257
1265
|
case 5:
|
|
1258
|
-
|
|
1259
|
-
return _context1.abrupt("continue", 43);
|
|
1266
|
+
return _context1.abrupt("continue", 44);
|
|
1260
1267
|
case 6:
|
|
1261
|
-
props.projectActions.setMode(_constants.
|
|
1262
|
-
return _context1.abrupt("continue",
|
|
1268
|
+
props.projectActions.setMode(_constants.MODE_IDLE_3D);
|
|
1269
|
+
return _context1.abrupt("continue", 44);
|
|
1263
1270
|
case 7:
|
|
1271
|
+
props.projectActions.setMode(_constants.MODE_IDLE);
|
|
1272
|
+
return _context1.abrupt("continue", 44);
|
|
1273
|
+
case 8:
|
|
1264
1274
|
sLineCnt = layer.selected.lines.size;
|
|
1265
1275
|
if (sLineCnt > 0) props.projectActions.setMode(_constants.MODE_ELEVATION_VIEW);
|
|
1266
|
-
return _context1.abrupt("continue",
|
|
1267
|
-
case
|
|
1276
|
+
return _context1.abrupt("continue", 44);
|
|
1277
|
+
case 9:
|
|
1268
1278
|
if (state.mode === _constants.MODE_IDLE || state.mode === _constants.MODE_2D_PAN) props.linesActions.selectToolDrawingLine('wall');else {
|
|
1269
1279
|
props.projectActions.setMode(_constants.MODE_IDLE);
|
|
1270
1280
|
props.linesActions.selectToolDrawingLine('wall');
|
|
1271
1281
|
}
|
|
1272
|
-
return _context1.abrupt("continue",
|
|
1273
|
-
case
|
|
1282
|
+
return _context1.abrupt("continue", 44);
|
|
1283
|
+
case 10:
|
|
1274
1284
|
if ((0, _helper.isEmpty)(evt === null || evt === void 0 ? void 0 : evt.payload)) {
|
|
1275
|
-
_context1.next =
|
|
1285
|
+
_context1.next = 12;
|
|
1276
1286
|
break;
|
|
1277
1287
|
}
|
|
1278
1288
|
element = evt.payload;
|
|
1279
|
-
_context1.next =
|
|
1289
|
+
_context1.next = 11;
|
|
1280
1290
|
return addItemToCatalog(element, state, props.catalog, props.projectActions);
|
|
1281
|
-
case
|
|
1291
|
+
case 11:
|
|
1282
1292
|
// start drawing item
|
|
1283
1293
|
if (_constants.ARRAY_3D_MODES.includes(state.mode)) {
|
|
1284
1294
|
// in 3d view
|
|
@@ -1299,20 +1309,20 @@ function _handleExternalEvent() {
|
|
|
1299
1309
|
}
|
|
1300
1310
|
props.projectActions.pushLastSelectedCatalogElementToHistory(element);
|
|
1301
1311
|
props.projectActions.setIsCabinetDrawing(true);
|
|
1302
|
-
case 11:
|
|
1303
|
-
return _context1.abrupt("continue", 43);
|
|
1304
1312
|
case 12:
|
|
1305
|
-
|
|
1306
|
-
return _context1.abrupt("continue", 43);
|
|
1313
|
+
return _context1.abrupt("continue", 44);
|
|
1307
1314
|
case 13:
|
|
1308
|
-
|
|
1309
|
-
return _context1.abrupt("continue",
|
|
1315
|
+
_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);
|
|
1316
|
+
return _context1.abrupt("continue", 44);
|
|
1310
1317
|
case 14:
|
|
1318
|
+
moveAndRotatePan2D3D(evt.type, props, evt.payload, state);
|
|
1319
|
+
return _context1.abrupt("continue", 44);
|
|
1320
|
+
case 15:
|
|
1311
1321
|
defaulTitle = 'Untitle';
|
|
1312
1322
|
props.projectActions.newProject();
|
|
1313
1323
|
props.projectActions.rename(defaulTitle);
|
|
1314
|
-
return _context1.abrupt("continue",
|
|
1315
|
-
case
|
|
1324
|
+
return _context1.abrupt("continue", 44);
|
|
1325
|
+
case 16:
|
|
1316
1326
|
_evt$payload5 = evt.payload, doorStyle = _evt$payload5.doorStyle, itemCDS = _evt$payload5.itemCDS, isAll = _evt$payload5.isAll; // prepare item data request
|
|
1317
1327
|
_layerId = state.getIn(['scene', 'selectedLayer']);
|
|
1318
1328
|
_cdsItems = [];
|
|
@@ -1347,17 +1357,17 @@ function _handleExternalEvent() {
|
|
|
1347
1357
|
}, _loop4);
|
|
1348
1358
|
});
|
|
1349
1359
|
_i2 = 0;
|
|
1350
|
-
case
|
|
1360
|
+
case 17:
|
|
1351
1361
|
if (!(_i2 < _itemKeys.length)) {
|
|
1352
|
-
_context1.next =
|
|
1362
|
+
_context1.next = 19;
|
|
1353
1363
|
break;
|
|
1354
1364
|
}
|
|
1355
|
-
return _context1.delegateYield(_loop4(), "t1",
|
|
1356
|
-
case
|
|
1365
|
+
return _context1.delegateYield(_loop4(), "t1", 18);
|
|
1366
|
+
case 18:
|
|
1357
1367
|
_i2++;
|
|
1358
|
-
_context1.next =
|
|
1368
|
+
_context1.next = 17;
|
|
1359
1369
|
break;
|
|
1360
|
-
case
|
|
1370
|
+
case 19:
|
|
1361
1371
|
// request item catalog data to host app
|
|
1362
1372
|
if (_cdsItems.length > 0) {
|
|
1363
1373
|
(_props$onInternalEven2 = props.onInternalEvent) === null || _props$onInternalEven2 === void 0 || _props$onInternalEven2.call(props, {
|
|
@@ -1396,94 +1406,94 @@ function _handleExternalEvent() {
|
|
|
1396
1406
|
};
|
|
1397
1407
|
}());
|
|
1398
1408
|
} else props.itemsActions.setDoorStyle(doorStyle, itemCDS, isAll);
|
|
1399
|
-
return _context1.abrupt("continue",
|
|
1400
|
-
case
|
|
1409
|
+
return _context1.abrupt("continue", 44);
|
|
1410
|
+
case 20:
|
|
1401
1411
|
_evt$payload6 = evt.payload, roomShapeType = _evt$payload6.roomShapeType, width = _evt$payload6.width, height = _evt$payload6.height, _doorStyle = _evt$payload6.doorStyle;
|
|
1402
1412
|
props.projectActions.createRoomWithShape(roomShapeType, width, height, _doorStyle);
|
|
1403
|
-
return _context1.abrupt("continue",
|
|
1404
|
-
case
|
|
1413
|
+
return _context1.abrupt("continue", 44);
|
|
1414
|
+
case 21:
|
|
1405
1415
|
value = state.getIn(['viewer2D']).toJS();
|
|
1406
1416
|
value.a += 0.1;
|
|
1407
1417
|
value.d += 0.1;
|
|
1408
1418
|
value.e -= value.SVGWidth * 0.1 / 2;
|
|
1409
1419
|
value.f -= value.SVGHeight * 0.1 / 2;
|
|
1410
1420
|
(0, _helper.updateViwer2D)(value, props.viewer2DActions);
|
|
1411
|
-
return _context1.abrupt("continue",
|
|
1412
|
-
case
|
|
1421
|
+
return _context1.abrupt("continue", 44);
|
|
1422
|
+
case 22:
|
|
1413
1423
|
_value = state.getIn(['viewer2D']).toJS();
|
|
1414
1424
|
_value.a -= 0.1;
|
|
1415
1425
|
_value.d -= 0.1;
|
|
1416
1426
|
_value.e += _value.SVGWidth * 0.1 / 2;
|
|
1417
1427
|
_value.f += _value.SVGHeight * 0.1 / 2;
|
|
1418
1428
|
(0, _helper.updateViwer2D)(_value, props.viewer2DActions);
|
|
1419
|
-
return _context1.abrupt("continue",
|
|
1420
|
-
case 22:
|
|
1421
|
-
(0, _helper.centering2D)(state, props.viewer2DActions);
|
|
1422
|
-
return _context1.abrupt("continue", 43);
|
|
1429
|
+
return _context1.abrupt("continue", 44);
|
|
1423
1430
|
case 23:
|
|
1424
|
-
props.
|
|
1425
|
-
return _context1.abrupt("continue",
|
|
1431
|
+
(0, _helper.centering2D)(state, props.viewer2DActions);
|
|
1432
|
+
return _context1.abrupt("continue", 44);
|
|
1426
1433
|
case 24:
|
|
1427
|
-
props.projectActions.
|
|
1428
|
-
return _context1.abrupt("continue",
|
|
1434
|
+
props.projectActions.undo();
|
|
1435
|
+
return _context1.abrupt("continue", 44);
|
|
1429
1436
|
case 25:
|
|
1437
|
+
props.projectActions.redo();
|
|
1438
|
+
return _context1.abrupt("continue", 44);
|
|
1439
|
+
case 26:
|
|
1430
1440
|
_evt$payload7 = evt.payload, moldingInfo = _evt$payload7.moldingInfo, isGlobal = _evt$payload7.isGlobal;
|
|
1431
|
-
_context1.next =
|
|
1441
|
+
_context1.next = 27;
|
|
1432
1442
|
return loadMoldingSvg(moldingInfo);
|
|
1433
|
-
case 26:
|
|
1434
|
-
props.itemsActions.setMolding(moldingInfo, isGlobal);
|
|
1435
|
-
return _context1.abrupt("continue", 43);
|
|
1436
1443
|
case 27:
|
|
1444
|
+
props.itemsActions.setMolding(moldingInfo, isGlobal);
|
|
1445
|
+
return _context1.abrupt("continue", 44);
|
|
1446
|
+
case 28:
|
|
1437
1447
|
distElement = getElement(evt.payload, state);
|
|
1438
1448
|
if (distElement) props.itemsActions.duplicateSelected(distElement, props.onInternalEvent);
|
|
1439
|
-
return _context1.abrupt("continue",
|
|
1440
|
-
case
|
|
1449
|
+
return _context1.abrupt("continue", 44);
|
|
1450
|
+
case 29:
|
|
1441
1451
|
_distElement = getElement(evt.payload, state);
|
|
1442
1452
|
if (_distElement) props.projectActions.remove(_distElement);
|
|
1443
|
-
return _context1.abrupt("continue",
|
|
1444
|
-
case
|
|
1453
|
+
return _context1.abrupt("continue", 44);
|
|
1454
|
+
case 30:
|
|
1445
1455
|
_evt$payload8 = evt.payload, option = _evt$payload8.option, _value2 = _evt$payload8.value;
|
|
1446
1456
|
_t6 = option;
|
|
1447
|
-
_context1.next = _t6 === _constants.PROJECT_SETTING_OPTION.CHANGE_MEASUREMENT_UNIT ?
|
|
1457
|
+
_context1.next = _t6 === _constants.PROJECT_SETTING_OPTION.CHANGE_MEASUREMENT_UNIT ? 31 : _t6 === _constants.PROJECT_SETTING_OPTION.UPDATE_CEIL_HEIGHT ? 32 : _t6 === _constants.PROJECT_SETTING_OPTION.CHANGE_WALL_LENGTH_MEASURE ? 33 : _t6 === _constants.PROJECT_SETTING_OPTION.CHANGE_BASE_CABINET_MEASURE ? 34 : _t6 === _constants.PROJECT_SETTING_OPTION.CHANGE_WALL_CABINET_MEASURE ? 35 : _t6 === _constants.PROJECT_SETTING_OPTION.CHANGE_WINDOW_DOOR_MEASURE ? 36 : 37;
|
|
1448
1458
|
break;
|
|
1449
|
-
case 30:
|
|
1450
|
-
props.viewer2DActions.updateCeilHeightUnit(_value2);
|
|
1451
1459
|
case 31:
|
|
1460
|
+
props.viewer2DActions.updateCeilHeightUnit(_value2);
|
|
1461
|
+
case 32:
|
|
1452
1462
|
props.viewer2DActions.updateCeilHeight(_value2);
|
|
1453
1463
|
props.viewer3DActions.update3DCeilHeight(_value2);
|
|
1454
|
-
return _context1.abrupt("continue",
|
|
1455
|
-
case 32:
|
|
1456
|
-
props.viewer2DActions.changeWallLengthMeasure(_value2);
|
|
1457
|
-
return _context1.abrupt("continue", 37);
|
|
1464
|
+
return _context1.abrupt("continue", 38);
|
|
1458
1465
|
case 33:
|
|
1459
|
-
props.viewer2DActions.
|
|
1460
|
-
return _context1.abrupt("continue",
|
|
1466
|
+
props.viewer2DActions.changeWallLengthMeasure(_value2);
|
|
1467
|
+
return _context1.abrupt("continue", 38);
|
|
1461
1468
|
case 34:
|
|
1462
|
-
props.viewer2DActions.
|
|
1463
|
-
return _context1.abrupt("continue",
|
|
1469
|
+
props.viewer2DActions.changeBaseCabinetMeasure(_value2);
|
|
1470
|
+
return _context1.abrupt("continue", 38);
|
|
1464
1471
|
case 35:
|
|
1465
|
-
props.viewer2DActions.
|
|
1466
|
-
return _context1.abrupt("continue",
|
|
1472
|
+
props.viewer2DActions.changeWallCabinetMeasure(_value2);
|
|
1473
|
+
return _context1.abrupt("continue", 38);
|
|
1467
1474
|
case 36:
|
|
1468
|
-
|
|
1475
|
+
props.viewer2DActions.changeWindowDoorMeasure(_value2);
|
|
1476
|
+
return _context1.abrupt("continue", 38);
|
|
1469
1477
|
case 37:
|
|
1470
|
-
return _context1.abrupt("continue",
|
|
1478
|
+
return _context1.abrupt("continue", 38);
|
|
1471
1479
|
case 38:
|
|
1480
|
+
return _context1.abrupt("continue", 44);
|
|
1481
|
+
case 39:
|
|
1472
1482
|
_layerId2 = state.getIn(['scene', 'selectedLayer']);
|
|
1473
1483
|
_layer = state.getIn(['scene', 'layers', _layerId2]);
|
|
1474
1484
|
_layer$getIn = _layer.getIn(['selected']), selectedLines = _layer$getIn.lines, selectedHoles = _layer$getIn.holes, selectedItems = _layer$getIn.items;
|
|
1475
1485
|
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);
|
|
1476
1486
|
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);
|
|
1477
1487
|
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);
|
|
1478
|
-
return _context1.abrupt("continue",
|
|
1479
|
-
case
|
|
1488
|
+
return _context1.abrupt("continue", 44);
|
|
1489
|
+
case 40:
|
|
1480
1490
|
_layerID = state.scene.selectedLayer;
|
|
1481
1491
|
_layer2 = state.scene.getIn(['layers', _layerID]).toJS();
|
|
1482
1492
|
orginalItemInfo = evt === null || evt === void 0 || (_evt$payload9 = evt.payload) === null || _evt$payload9 === void 0 ? void 0 : _evt$payload9.orginalItemInfo;
|
|
1483
1493
|
originalItem = _layer2 === null || _layer2 === void 0 ? void 0 : _layer2.items[orginalItemInfo.id];
|
|
1484
|
-
_context1.next =
|
|
1494
|
+
_context1.next = 41;
|
|
1485
1495
|
return addItemToCatalog(evt.payload.replaceItemInfo, state, props.catalog, props.projectActions);
|
|
1486
|
-
case
|
|
1496
|
+
case 41:
|
|
1487
1497
|
originalItemPos = {
|
|
1488
1498
|
rotation: originalItem.rotation,
|
|
1489
1499
|
selectedItemId: originalItem.id,
|
|
@@ -1498,11 +1508,11 @@ function _handleExternalEvent() {
|
|
|
1498
1508
|
}
|
|
1499
1509
|
};
|
|
1500
1510
|
props.itemsActions.replaceItem(originalItemPos, originalItem, replaceItem);
|
|
1501
|
-
return _context1.abrupt("continue",
|
|
1502
|
-
case 41:
|
|
1503
|
-
setFinishing(props, state, evt.payload);
|
|
1504
|
-
return _context1.abrupt("continue", 43);
|
|
1511
|
+
return _context1.abrupt("continue", 44);
|
|
1505
1512
|
case 42:
|
|
1513
|
+
setFinishing(props, state, evt.payload);
|
|
1514
|
+
return _context1.abrupt("continue", 44);
|
|
1515
|
+
case 43:
|
|
1506
1516
|
sceneData = state.scene.toJS(); // get molding data for "ReviewForQuote"
|
|
1507
1517
|
currentTexture = layer.doorStyle !== null || layer.doorStyle !== undefined ? layer.doorStyle : props.state.doorStyle.toJS();
|
|
1508
1518
|
sceneData.layers[layerId].moldingData = (0, _molding.getMoldingDataOfScene)(layer, props.catalog, currentTexture);
|
|
@@ -1513,8 +1523,8 @@ function _handleExternalEvent() {
|
|
|
1513
1523
|
scene: sceneData
|
|
1514
1524
|
}
|
|
1515
1525
|
});
|
|
1516
|
-
return _context1.abrupt("continue",
|
|
1517
|
-
case
|
|
1526
|
+
return _context1.abrupt("continue", 44);
|
|
1527
|
+
case 44:
|
|
1518
1528
|
case "end":
|
|
1519
1529
|
return _context1.stop();
|
|
1520
1530
|
}
|