kitchen-simulator 5.0.0-new-api → 5.0.0-new-api.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/LiteKitchenConfigurator.js +1 -1
- package/es/assets/Window.hdr +2100 -0
- package/es/assets/img/default/maple.jpg +0 -0
- package/es/assets/img/default/steel.jpg +0 -0
- package/es/catalog/catalog.js +0 -2
- package/es/catalog/utils/exporter.js +2 -0
- package/es/class/area.js +0 -1
- package/es/class/export.js +1 -3
- package/es/components/content.js +1 -3
- package/es/components/style/export.js +2 -28
- package/es/components/viewer2d/line.js +2 -2
- package/es/components/viewer2d/viewer2d.js +0 -1
- package/es/components/viewer3d/front3D.js +1 -2
- package/es/components/viewer3d/pointer-lock-navigation.js +0 -90
- package/es/components/viewer3d/scene-creator.js +7 -5
- package/es/components/viewer3d/three-memory-cleaner.js +0 -14
- package/es/components/viewer3d/viewer3d.js +1 -1
- package/es/constants.js +3 -3
- package/es/devLiteRenderer.js +119 -61
- package/es/events/external/handleExternalEvent.js +140 -0
- package/es/{utils/isolate-event-handler.js → events/external/handleExternalEvent.util.js} +17 -563
- package/es/events/external/handlers.addItem.js +47 -0
- package/es/events/external/handlers.changeDoorStyle.js +131 -0
- package/es/events/external/handlers.elementOps.js +8 -0
- package/es/events/external/handlers.finishing.js +26 -0
- package/es/events/external/handlers.hole.js +4 -0
- package/es/events/external/handlers.loadProject.js +117 -0
- package/es/events/external/handlers.molding.js +24 -0
- package/es/events/external/handlers.projectLifecycle.js +11 -0
- package/es/events/external/handlers.projectSettings.js +32 -0
- package/es/events/external/handlers.replaceCabinet.js +41 -0
- package/es/events/external/handlers.roomShape.js +8 -0
- package/es/events/external/handlers.syncScene.js +21 -0
- package/es/events/external/handlers.updateSelectedElements.js +11 -0
- package/es/events/external/handlers.viewMode.js +11 -0
- package/es/events/external/handlers.viewerNavigation.js +108 -0
- package/es/events/external/handlers.wall.js +7 -0
- package/es/mappings/external-events/mappers/ccdfMapper.js +2 -2
- package/es/mappings/external-events/mappers/changeDoorStyleMapper.js +1 -29
- package/es/plugins/keyboard.js +1 -1
- package/es/reducers/export.js +2 -4
- package/es/reducers/items-reducer.js +1 -1
- package/es/reducers/project-reducer.js +1 -1
- package/es/reducers/reducer.js +2 -3
- package/es/shared/objects/immutable.js +3 -0
- package/es/utils/geometry.js +276 -74
- package/es/utils/history.js +2 -2
- package/es/utils/molding.js +6 -20
- package/lib/LiteKitchenConfigurator.js +2 -2
- package/lib/assets/Window.hdr +2100 -0
- package/lib/assets/img/default/maple.jpg +0 -0
- package/lib/assets/img/default/steel.jpg +0 -0
- package/lib/catalog/catalog.js +0 -2
- package/lib/catalog/utils/exporter.js +2 -0
- package/lib/class/area.js +0 -1
- package/lib/class/export.js +0 -8
- package/lib/components/content.js +1 -3
- package/lib/components/style/export.js +1 -105
- package/lib/components/viewer2d/line.js +1 -1
- package/lib/components/viewer2d/viewer2d.js +0 -1
- package/lib/components/viewer3d/front3D.js +1 -2
- package/lib/components/viewer3d/pointer-lock-navigation.js +0 -90
- package/lib/components/viewer3d/scene-creator.js +7 -5
- package/lib/components/viewer3d/three-memory-cleaner.js +0 -14
- package/lib/constants.js +8 -8
- package/lib/devLiteRenderer.js +118 -60
- package/lib/events/external/handleExternalEvent.js +147 -0
- package/lib/{utils/isolate-event-handler.js → events/external/handleExternalEvent.util.js} +14 -557
- package/lib/events/external/handlers.addItem.js +54 -0
- package/lib/events/external/handlers.changeDoorStyle.js +138 -0
- package/lib/events/external/handlers.elementOps.js +15 -0
- package/lib/events/external/handlers.finishing.js +32 -0
- package/lib/events/external/handlers.hole.js +10 -0
- package/lib/events/external/handlers.loadProject.js +124 -0
- package/lib/events/external/handlers.molding.js +31 -0
- package/lib/events/external/handlers.projectLifecycle.js +19 -0
- package/lib/events/external/handlers.projectSettings.js +38 -0
- package/lib/events/external/handlers.replaceCabinet.js +48 -0
- package/lib/events/external/handlers.roomShape.js +14 -0
- package/lib/events/external/handlers.syncScene.js +27 -0
- package/lib/events/external/handlers.updateSelectedElements.js +17 -0
- package/lib/events/external/handlers.viewMode.js +19 -0
- package/lib/events/external/handlers.viewerNavigation.js +117 -0
- package/lib/events/external/handlers.wall.js +13 -0
- package/lib/mappings/external-events/mappers/ccdfMapper.js +2 -2
- package/lib/mappings/external-events/mappers/changeDoorStyleMapper.js +1 -29
- package/lib/reducers/export.js +1 -9
- package/lib/reducers/reducer.js +0 -1
- package/lib/shared/objects/immutable.js +9 -0
- package/lib/utils/geometry.js +276 -74
- package/lib/utils/history.js +1 -1
- package/lib/utils/molding.js +6 -20
- package/package.json +1 -1
- package/es/assets/gltf/door_closet.bin +0 -0
- package/es/assets/gltf/door_closet.fbx +0 -0
- package/es/assets/gltf/door_exterior.bin +0 -0
- package/es/assets/gltf/door_exterior.fbx +0 -0
- package/es/assets/gltf/door_interior.bin +0 -0
- package/es/assets/gltf/door_interior.fbx +0 -0
- package/es/assets/gltf/door_sliding.bin +0 -0
- package/es/assets/gltf/door_sliding.fbx +0 -0
- package/es/assets/img/png/helper/video_preview_3d.png +0 -0
- package/es/assets/img/png/helper/video_preview_start.png +0 -0
- package/es/assets/img/svg/color/Brown.svg +0 -9
- package/es/assets/img/svg/color/Dark.svg +0 -9
- package/es/assets/img/svg/color/Light.svg +0 -9
- package/es/assets/img/svg/color/Medium.svg +0 -9
- package/es/assets/img/svg/color/Unfinished.svg +0 -9
- package/es/catalog/lines/wall/textures/bricks-normal2.jpg +0 -0
- package/es/catalog/lines/wall/textures/bricks3.jpg +0 -0
- package/es/catalog/properties/export.js +0 -21
- package/es/catalog/properties/property-checkbox.js +0 -68
- package/es/catalog/properties/property-color.js +0 -39
- package/es/catalog/properties/property-enum.js +0 -50
- package/es/catalog/properties/property-hidden.js +0 -19
- package/es/catalog/properties/property-lenght-measure.js +0 -100
- package/es/catalog/properties/property-length-measure.js +0 -84
- package/es/catalog/properties/property-length-measure_hole.js +0 -100
- package/es/catalog/properties/property-number.js +0 -48
- package/es/catalog/properties/property-read-only.js +0 -26
- package/es/catalog/properties/property-string.js +0 -48
- package/es/catalog/properties/property-toggle.js +0 -39
- package/es/catalog/properties/shared-property-style.js +0 -14
- package/es/catalog/utils/FuseUtils.js +0 -79
- package/es/class/FuseUtils.js +0 -79
- package/es/components/style/button.js +0 -106
- package/es/components/style/cancel-button.js +0 -21
- package/es/components/style/content-container.js +0 -30
- package/es/components/style/content-title.js +0 -25
- package/es/components/style/delete-button.js +0 -24
- package/es/components/style/form-block.js +0 -20
- package/es/components/style/form-color-input.js +0 -26
- package/es/components/style/form-label.js +0 -22
- package/es/components/style/form-number-input_2.js +0 -200
- package/es/components/style/form-select.js +0 -19
- package/es/components/style/form-slider.js +0 -60
- package/es/components/style/form-text-input.js +0 -69
- package/es/reducers/user-reducer.js +0 -41
- package/es/styles/export.js +0 -5
- package/es/styles/tabs.css +0 -40
- package/lib/assets/gltf/door_closet.bin +0 -0
- package/lib/assets/gltf/door_closet.fbx +0 -0
- package/lib/assets/gltf/door_exterior.bin +0 -0
- package/lib/assets/gltf/door_exterior.fbx +0 -0
- package/lib/assets/gltf/door_interior.bin +0 -0
- package/lib/assets/gltf/door_interior.fbx +0 -0
- package/lib/assets/gltf/door_sliding.bin +0 -0
- package/lib/assets/gltf/door_sliding.fbx +0 -0
- package/lib/assets/img/png/helper/video_preview_3d.png +0 -0
- package/lib/assets/img/png/helper/video_preview_start.png +0 -0
- package/lib/assets/img/svg/color/Brown.svg +0 -9
- package/lib/assets/img/svg/color/Dark.svg +0 -9
- package/lib/assets/img/svg/color/Light.svg +0 -9
- package/lib/assets/img/svg/color/Medium.svg +0 -9
- package/lib/assets/img/svg/color/Unfinished.svg +0 -9
- package/lib/catalog/lines/wall/textures/bricks-normal2.jpg +0 -0
- package/lib/catalog/lines/wall/textures/bricks3.jpg +0 -0
- package/lib/catalog/properties/export.js +0 -81
- package/lib/catalog/properties/property-checkbox.js +0 -76
- package/lib/catalog/properties/property-color.js +0 -47
- package/lib/catalog/properties/property-enum.js +0 -58
- package/lib/catalog/properties/property-hidden.js +0 -27
- package/lib/catalog/properties/property-lenght-measure.js +0 -108
- package/lib/catalog/properties/property-length-measure.js +0 -92
- package/lib/catalog/properties/property-length-measure_hole.js +0 -108
- package/lib/catalog/properties/property-number.js +0 -56
- package/lib/catalog/properties/property-read-only.js +0 -34
- package/lib/catalog/properties/property-string.js +0 -56
- package/lib/catalog/properties/property-toggle.js +0 -47
- package/lib/catalog/properties/shared-property-style.js +0 -21
- package/lib/catalog/utils/FuseUtils.js +0 -87
- package/lib/class/FuseUtils.js +0 -87
- package/lib/components/style/button.js +0 -115
- package/lib/components/style/cancel-button.js +0 -29
- package/lib/components/style/content-container.js +0 -38
- package/lib/components/style/content-title.js +0 -35
- package/lib/components/style/delete-button.js +0 -34
- package/lib/components/style/form-block.js +0 -28
- package/lib/components/style/form-color-input.js +0 -34
- package/lib/components/style/form-label.js +0 -30
- package/lib/components/style/form-number-input_2.js +0 -209
- package/lib/components/style/form-select.js +0 -29
- package/lib/components/style/form-slider.js +0 -68
- package/lib/components/style/form-text-input.js +0 -78
- package/lib/reducers/user-reducer.js +0 -48
- package/lib/styles/export.js +0 -13
- package/lib/styles/tabs.css +0 -40
|
@@ -6,22 +6,15 @@ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbol
|
|
|
6
6
|
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; }
|
|
7
7
|
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
8
8
|
import { Map } from 'immutable';
|
|
9
|
-
import {
|
|
10
|
-
import { isEmpty
|
|
11
|
-
import exporter from "
|
|
12
|
-
import { render2DItem, render3DItem, render3DApplianceItem, render3DLightingItem } from "
|
|
13
|
-
import { convert } from "
|
|
14
|
-
import { GeometryUtils, MathUtils } from "
|
|
15
|
-
import { returnReplaceableDeepSearchType } from "
|
|
9
|
+
import { MODE_DRAWING_LINE, ATT_ITEM_POS, ATT_LINE_LENGTH, ATT_VERTEXT_ONE, ATT_VERTEXT_TWO, ATT_HOLE_OFFSET_A, ATT_HOLE_OFFSET_B, UNIT_CENTIMETER, UNIT_INCH, PROP_FLIP_DOOR_HANDLE, PROP_OPEN_DOORS, ELEMENT_HOLE, ELEMENT_ITEM, ELEMENT_LINE } from "../../constants";
|
|
10
|
+
import { isEmpty } from "../../utils/helper";
|
|
11
|
+
import exporter from "../../catalog/utils/exporter";
|
|
12
|
+
import { render2DItem, render3DItem, render3DApplianceItem, render3DLightingItem } from "../../catalog/utils/item-loader";
|
|
13
|
+
import { convert } from "../../utils/convert-units-lite";
|
|
14
|
+
import { GeometryUtils, MathUtils } from "../../utils/export";
|
|
15
|
+
import { returnReplaceableDeepSearchType } from "../../components/viewer2d/utils";
|
|
16
16
|
import { SVGLoader } from 'three/addons/loaders/SVGLoader';
|
|
17
|
-
import {
|
|
18
|
-
import { Scene, State } from "../models";
|
|
19
|
-
import { calcDistancesFromHoleToNearestOneOrWall } from "./geometry";
|
|
20
|
-
import { computeSkinPanels } from "./skinPanelEngine";
|
|
21
|
-
import { mapExternalEventPayload } from "../mappings/external-events/mapExternalEventPayload";
|
|
22
|
-
import { ccdfMapper } from "../mappings/external-events/mappers/ccdfMapper";
|
|
23
|
-
import { mapFromCCDFToCDS } from "../mappings/external-events/mappers/ccdfToCDSMapper";
|
|
24
|
-
import { updateProjectWithCDSList } from "../mappings/external-events/mappers/loadProjectMapper";
|
|
17
|
+
import { calcDistancesFromHoleToNearestOneOrWall } from "../../utils/geometry";
|
|
25
18
|
var PRECISION = 2;
|
|
26
19
|
|
|
27
20
|
// ---- compatibility: supports old + optimized props shapes ----
|
|
@@ -560,9 +553,11 @@ var loadSVGsByItem = /*#__PURE__*/function () {
|
|
|
560
553
|
return _ref.apply(this, arguments);
|
|
561
554
|
};
|
|
562
555
|
}();
|
|
563
|
-
function addItemToCatalog(_x5, _x6, _x7, _x8) {
|
|
556
|
+
export function addItemToCatalog(_x5, _x6, _x7, _x8) {
|
|
564
557
|
return _addItemToCatalog.apply(this, arguments);
|
|
565
|
-
}
|
|
558
|
+
}
|
|
559
|
+
|
|
560
|
+
// Get attributs of current selected element
|
|
566
561
|
function _addItemToCatalog() {
|
|
567
562
|
_addItemToCatalog = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee6(element, state, catalogInstance, projectActions) {
|
|
568
563
|
var _elementJs, _elementJs3;
|
|
@@ -808,7 +803,7 @@ function initPropData(element, catalog) {
|
|
|
808
803
|
}
|
|
809
804
|
return new Map(mapped);
|
|
810
805
|
}
|
|
811
|
-
function updateAttributeOfSelectedElement(element, attrPayload, state, layer, catalog, projectActions) {
|
|
806
|
+
export function updateAttributeOfSelectedElement(element, attrPayload, state, layer, catalog, projectActions) {
|
|
812
807
|
var _attributesFormData;
|
|
813
808
|
var callback = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : null;
|
|
814
809
|
var layerID = state.scene.selectedLayer;
|
|
@@ -976,7 +971,7 @@ function updateAttributeOfSelectedElement(element, attrPayload, state, layer, ca
|
|
|
976
971
|
// invoke callback
|
|
977
972
|
if (callback) callback((_attributesFormData = attributesFormData) === null || _attributesFormData === void 0 ? void 0 : _attributesFormData.toJS());
|
|
978
973
|
}
|
|
979
|
-
function updatePropertyOfSelectedElement(element, propertyPayload, catalog,
|
|
974
|
+
export function updatePropertyOfSelectedElement(element, propertyPayload, catalog,
|
|
980
975
|
// class instance of Catalog, get from props
|
|
981
976
|
projectActions) {
|
|
982
977
|
var _propertiesFormData;
|
|
@@ -1002,7 +997,7 @@ projectActions) {
|
|
|
1002
997
|
// invoke callback
|
|
1003
998
|
if (callback) callback((_propertiesFormData = propertiesFormData) === null || _propertiesFormData === void 0 ? void 0 : _propertiesFormData.toJS());
|
|
1004
999
|
}
|
|
1005
|
-
function getElement(objProps, state) {
|
|
1000
|
+
export function getElement(objProps, state) {
|
|
1006
1001
|
var layerID = state.scene.selectedLayer;
|
|
1007
1002
|
var curObject = null;
|
|
1008
1003
|
if (!isEmpty(objProps === null || objProps === void 0 ? void 0 : objProps.elementPrototype) && !isEmpty(objProps === null || objProps === void 0 ? void 0 : objProps.elementId)) curObject = state.getIn(['scene', 'layers', layerID, objProps.elementPrototype, objProps.elementId]);else {
|
|
@@ -1038,7 +1033,7 @@ function getElement(objProps, state) {
|
|
|
1038
1033
|
}
|
|
1039
1034
|
return curObject;
|
|
1040
1035
|
}
|
|
1041
|
-
function loadMoldingSvg(_x9) {
|
|
1036
|
+
export function loadMoldingSvg(_x9) {
|
|
1042
1037
|
return _loadMoldingSvg.apply(this, arguments);
|
|
1043
1038
|
}
|
|
1044
1039
|
function _loadMoldingSvg() {
|
|
@@ -1074,119 +1069,7 @@ function _loadMoldingSvg() {
|
|
|
1074
1069
|
}));
|
|
1075
1070
|
return _loadMoldingSvg.apply(this, arguments);
|
|
1076
1071
|
}
|
|
1077
|
-
function
|
|
1078
|
-
switch (payload.category) {
|
|
1079
|
-
case FINISHING_TYPE.WALL_COLOR:
|
|
1080
|
-
if (state.mode !== MODE_ELEVATION_VIEW) props.itemsActions.setWallColor(payload.color);
|
|
1081
|
-
break;
|
|
1082
|
-
case FINISHING_TYPE.COUNTER_TOP:
|
|
1083
|
-
props.itemsActions.setCounterTop({
|
|
1084
|
-
uri: payload.texture
|
|
1085
|
-
});
|
|
1086
|
-
break;
|
|
1087
|
-
case FINISHING_TYPE.FLOOR_STYLE:
|
|
1088
|
-
if (state.mode !== MODE_ELEVATION_VIEW) props.areaActions.setFloorStyles({
|
|
1089
|
-
uri: payload.texture
|
|
1090
|
-
});
|
|
1091
|
-
break;
|
|
1092
|
-
case FINISHING_TYPE.BACKSPLASH:
|
|
1093
|
-
if (state.mode !== MODE_ELEVATION_VIEW) props.itemsActions.setBacksplash({
|
|
1094
|
-
uri: payload.texture
|
|
1095
|
-
});
|
|
1096
|
-
break;
|
|
1097
|
-
case FINISHING_TYPE.DOOR_HANDLE:
|
|
1098
|
-
props.itemsActions.setDoorHandle(payload.gltf);
|
|
1099
|
-
break;
|
|
1100
|
-
}
|
|
1101
|
-
}
|
|
1102
|
-
function moveAndRotatePan2D3D(eventType, props, payload, state) {
|
|
1103
|
-
if (eventType === EXTERNAL_EVENT_MOVE_PAN) {
|
|
1104
|
-
var moveType = payload.moveType,
|
|
1105
|
-
moveValue = payload.moveValue;
|
|
1106
|
-
var value = state.getIn(['viewer2D']).toJS();
|
|
1107
|
-
if (state.mode === MODE_IDLE) {
|
|
1108
|
-
switch (moveType) {
|
|
1109
|
-
case TOP:
|
|
1110
|
-
value.f -= moveValue;
|
|
1111
|
-
break;
|
|
1112
|
-
case BOTTOM:
|
|
1113
|
-
value.f += moveValue;
|
|
1114
|
-
break;
|
|
1115
|
-
case RIGHT:
|
|
1116
|
-
value.e += moveValue;
|
|
1117
|
-
break;
|
|
1118
|
-
case LEFT:
|
|
1119
|
-
value.e -= moveValue;
|
|
1120
|
-
break;
|
|
1121
|
-
}
|
|
1122
|
-
updateViwer2D(value, props.viewer2DActions);
|
|
1123
|
-
} else if (state.mode === MODE_IDLE_3D) {
|
|
1124
|
-
switch (moveType) {
|
|
1125
|
-
case TOP:
|
|
1126
|
-
window.interval = setTimeout(function () {
|
|
1127
|
-
window.tDKeyDown({
|
|
1128
|
-
keyCode: 38
|
|
1129
|
-
});
|
|
1130
|
-
}, 50);
|
|
1131
|
-
break;
|
|
1132
|
-
case BOTTOM:
|
|
1133
|
-
window.interval = setTimeout(function () {
|
|
1134
|
-
window.tDKeyDown({
|
|
1135
|
-
keyCode: 40
|
|
1136
|
-
});
|
|
1137
|
-
}, 50);
|
|
1138
|
-
break;
|
|
1139
|
-
case RIGHT:
|
|
1140
|
-
window.interval = setTimeout(function () {
|
|
1141
|
-
window.tDKeyDown({
|
|
1142
|
-
keyCode: 37
|
|
1143
|
-
});
|
|
1144
|
-
}, 50);
|
|
1145
|
-
break;
|
|
1146
|
-
case LEFT:
|
|
1147
|
-
window.interval = setTimeout(function () {
|
|
1148
|
-
window.tDKeyDown({
|
|
1149
|
-
keyCode: 39
|
|
1150
|
-
});
|
|
1151
|
-
}, 50);
|
|
1152
|
-
break;
|
|
1153
|
-
}
|
|
1154
|
-
}
|
|
1155
|
-
} else if (eventType === EXTERNAL_EVENT_ROTATE_PAN) {
|
|
1156
|
-
var rotateType = payload.rotateType;
|
|
1157
|
-
switch (rotateType) {
|
|
1158
|
-
case TOP:
|
|
1159
|
-
window.interval = setTimeout(function () {
|
|
1160
|
-
window.SPKeyDown({
|
|
1161
|
-
keyCode: 87
|
|
1162
|
-
});
|
|
1163
|
-
}, 50);
|
|
1164
|
-
break;
|
|
1165
|
-
case BOTTOM:
|
|
1166
|
-
window.interval = setTimeout(function () {
|
|
1167
|
-
window.SPKeyDown({
|
|
1168
|
-
keyCode: 83
|
|
1169
|
-
});
|
|
1170
|
-
}, 50);
|
|
1171
|
-
break;
|
|
1172
|
-
case RIGHT:
|
|
1173
|
-
window.interval = setTimeout(function () {
|
|
1174
|
-
window.SPKeyDown({
|
|
1175
|
-
keyCode: 68
|
|
1176
|
-
});
|
|
1177
|
-
}, 50);
|
|
1178
|
-
break;
|
|
1179
|
-
case LEFT:
|
|
1180
|
-
window.interval = setTimeout(function () {
|
|
1181
|
-
window.SPKeyDown({
|
|
1182
|
-
keyCode: 65
|
|
1183
|
-
});
|
|
1184
|
-
}, 50);
|
|
1185
|
-
break;
|
|
1186
|
-
}
|
|
1187
|
-
}
|
|
1188
|
-
}
|
|
1189
|
-
function mergeSameElements(projectItemsCatalog) {
|
|
1072
|
+
export function mergeSameElements(projectItemsCatalog) {
|
|
1190
1073
|
var result = [];
|
|
1191
1074
|
var _loop = function _loop(i) {
|
|
1192
1075
|
var idx = result.findIndex(function (v) {
|
|
@@ -1210,433 +1093,4 @@ function mergeSameElements(projectItemsCatalog) {
|
|
|
1210
1093
|
_loop(i);
|
|
1211
1094
|
}
|
|
1212
1095
|
return result;
|
|
1213
|
-
}
|
|
1214
|
-
export function handleExternalEvent(_x0) {
|
|
1215
|
-
return _handleExternalEvent.apply(this, arguments);
|
|
1216
|
-
}
|
|
1217
|
-
function _handleExternalEvent() {
|
|
1218
|
-
_handleExternalEvent = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee0(props) {
|
|
1219
|
-
var _evt$payload4, _evt$payload5;
|
|
1220
|
-
var state, evt, layerId, layer, _evt$payload, _state$catalog, cdsItems, itemKeys, _loop6, i, newScene, tempState, _props$onInternalEven, sLineCnt, element, _state$viewer2D, _evt$payload$initialP, mouseX, mouseY, v2d, vPosX, vPosY, layerID, defaulTitle, _evt$payload6, doorStyle, applyScope, itemCDS, _evt$payload6$itemIds, itemIds, _layerId, allItems, targetItems, idSet, selectedItemIds, ccdf_list, _loop7, _i2, _props$onInternalEven2, _evt$payload7, roomShapeType, width, height, measurementUnit, _doorStyle, value, _value, _evt$payload8, moldingInfo, isGlobal, distElement, _distElement, _evt$payload9, option, _value2, _layerId2, _layer, _layer$getIn, selectedLines, selectedHoles, selectedItems, _i4, _i5, _i6, _evt$payload0, _evt$payload1, _evt$payload10, _evt$payload11, _layerID, _layer2, orginalItemInfo, originalItem, originalItemPos, replaceItem, _layer$doorStyle, _currentTexture, _props$configData$mol, _props$configData, _props$configData$ski, _props$configData2, _props$onInternalEven3, sceneData, currentTexture, moldingPieceLength, skinPanelExclusionSKUs, _t5, _t6, _t7;
|
|
1221
|
-
return _regeneratorRuntime.wrap(function (_context11) {
|
|
1222
|
-
while (1) switch (_context11.prev = _context11.next) {
|
|
1223
|
-
case 0:
|
|
1224
|
-
// console.log('***external event****', props.externalEvent);
|
|
1225
|
-
state = getPlannerStateFromProps(props);
|
|
1226
|
-
if (state) {
|
|
1227
|
-
_context11.next = 1;
|
|
1228
|
-
break;
|
|
1229
|
-
}
|
|
1230
|
-
return _context11.abrupt("return");
|
|
1231
|
-
case 1:
|
|
1232
|
-
evt = mapExternalEventPayload(props.externalEvent, state);
|
|
1233
|
-
layerId = state.getIn(['scene', 'selectedLayer']);
|
|
1234
|
-
layer = state.getIn(['scene', 'layers', layerId]);
|
|
1235
|
-
_t5 = evt === null || evt === void 0 ? void 0 : evt.type;
|
|
1236
|
-
_context11.next = _t5 === EXTERNAL_EVENT_LOAD_PROJECT ? 2 : _t5 === EXTERNAL_EVENT_TOGGLE_TO_3D ? 7 : _t5 === EXTERNAL_EVENT_TOGGLE_TO_2D ? 8 : _t5 === EXTERNAL_EVENT_TOGGLE_TO_ELEVATION ? 9 : _t5 === EXTERNAL_EVENT_ADD_WALL ? 10 : _t5 === EXTERNAL_EVENT_ADD_ITEM ? 11 : _t5 === EXTERNAL_EVENT_ADD_HOLE ? 14 : _t5 === EXTERNAL_EVENT_ROTATE_PAN ? 15 : _t5 === EXTERNAL_EVENT_MOVE_PAN ? 15 : _t5 === EXTERNAL_EVENT_NEW_PROJECT ? 16 : _t5 === EXTERNAL_EVENT_CHANGE_DOORSTYLE ? 17 : _t5 === EXTERNAL_EVENT_ADD_ROOM_SHAPE ? 25 : _t5 === EXTERNAL_EVENT_ZOOM_IN ? 26 : _t5 === EXTERNAL_EVENT_ZOOM_OUT ? 27 : _t5 === EXTERNAL_EVENT_CENTERING_2D ? 28 : _t5 === EXTERNAL_EVENT_UNDO ? 29 : _t5 === EXTERNAL_EVENT_REDO ? 30 : _t5 === EXTERNAL_EVENT_SET_MOLDING ? 31 : _t5 === EXTERNAL_EVENT_DUPLICATE_ELEMENT ? 33 : _t5 === EXTERNAL_EVENT_DELETE_ELEMENT ? 34 : _t5 === EXTERNAL_EVENT_PROJECT_SETTING ? 35 : _t5 === EXTERNAL_EVENT_UPDATE_ATTRIBUTE ? 44 : _t5 === EXTERNAL_EVENT_UPDATE_PROPERTY ? 44 : _t5 === EXTERNAL_EVENT_REPLACE_CABINET ? 45 : _t5 === EXTERNAL_EVENT_SET_FINISHING ? 47 : _t5 === EXTERNAL_EVENT_SYNC_SCENE ? 48 : 49;
|
|
1237
|
-
break;
|
|
1238
|
-
case 2:
|
|
1239
|
-
if (!(evt !== null && evt !== void 0 && evt.payload)) {
|
|
1240
|
-
_context11.next = 6;
|
|
1241
|
-
break;
|
|
1242
|
-
}
|
|
1243
|
-
// prepare item data request
|
|
1244
|
-
cdsItems = [];
|
|
1245
|
-
itemKeys = evt !== null && evt !== void 0 && (_evt$payload = evt.payload) !== null && _evt$payload !== void 0 && (_evt$payload = _evt$payload.layers['layer-1']) !== null && _evt$payload !== void 0 && _evt$payload.items ? Object.keys(evt.payload.layers['layer-1'].items) : [];
|
|
1246
|
-
_loop6 = /*#__PURE__*/_regeneratorRuntime.mark(function _loop6() {
|
|
1247
|
-
var _evt$payload3, _it$properties, _it$properties2, _it$properties3, _it$doorStyle2;
|
|
1248
|
-
var it;
|
|
1249
|
-
return _regeneratorRuntime.wrap(function (_context0) {
|
|
1250
|
-
while (1) switch (_context0.prev = _context0.next) {
|
|
1251
|
-
case 0:
|
|
1252
|
-
it = evt === null || evt === void 0 || (_evt$payload3 = evt.payload) === null || _evt$payload3 === void 0 || (_evt$payload3 = _evt$payload3.layers['layer-1']) === null || _evt$payload3 === void 0 ? void 0 : _evt$payload3.items[itemKeys[i]]; //////// check altitude of item property and change length from _length (convert length from 'in' fo 'cm')
|
|
1253
|
-
if (it !== null && it !== void 0 && (_it$properties = it.properties) !== null && _it$properties !== void 0 && (_it$properties = _it$properties.altitude) !== null && _it$properties !== void 0 && _it$properties.length && it !== null && it !== void 0 && (_it$properties2 = it.properties) !== null && _it$properties2 !== void 0 && (_it$properties2 = _it$properties2.altitude) !== null && _it$properties2 !== void 0 && _it$properties2._unit && it !== null && it !== void 0 && (_it$properties3 = it.properties) !== null && _it$properties3 !== void 0 && (_it$properties3 = _it$properties3.altitude) !== null && _it$properties3 !== void 0 && _it$properties3._length && it.properties.altitude.length !== convert(it.properties.altitude._length).from(it.properties.altitude._unit).to('cm')) {
|
|
1254
|
-
it.properties.altitude.length = convert(it.properties.altitude._length).from(it.properties.altitude._unit).to('cm');
|
|
1255
|
-
}
|
|
1256
|
-
/////////
|
|
1257
|
-
if (!cdsItems.some(function (v) {
|
|
1258
|
-
var _it$doorStyle;
|
|
1259
|
-
return it.itemID === v.itemID && it.name === v.name && ((_it$doorStyle = it.doorStyle) === null || _it$doorStyle === void 0 ? void 0 : _it$doorStyle.id) === v.dfId;
|
|
1260
|
-
})) cdsItems.push({
|
|
1261
|
-
itemID: it.itemID,
|
|
1262
|
-
prototype: it.prototype,
|
|
1263
|
-
category: it.category,
|
|
1264
|
-
name: it.name,
|
|
1265
|
-
type: it.type,
|
|
1266
|
-
sku_number: it.sku_number,
|
|
1267
|
-
dfId: (_it$doorStyle2 = it.doorStyle) === null || _it$doorStyle2 === void 0 ? void 0 : _it$doorStyle2.id
|
|
1268
|
-
});
|
|
1269
|
-
case 1:
|
|
1270
|
-
case "end":
|
|
1271
|
-
return _context0.stop();
|
|
1272
|
-
}
|
|
1273
|
-
}, _loop6);
|
|
1274
|
-
});
|
|
1275
|
-
i = 0;
|
|
1276
|
-
case 3:
|
|
1277
|
-
if (!(i < itemKeys.length)) {
|
|
1278
|
-
_context11.next = 5;
|
|
1279
|
-
break;
|
|
1280
|
-
}
|
|
1281
|
-
return _context11.delegateYield(_loop6(), "t0", 4);
|
|
1282
|
-
case 4:
|
|
1283
|
-
i++;
|
|
1284
|
-
_context11.next = 3;
|
|
1285
|
-
break;
|
|
1286
|
-
case 5:
|
|
1287
|
-
newScene = new Scene(evt === null || evt === void 0 ? void 0 : evt.payload);
|
|
1288
|
-
tempState = new State({
|
|
1289
|
-
scene: newScene.toJS(),
|
|
1290
|
-
catalog: (_state$catalog = state.catalog) === null || _state$catalog === void 0 ? void 0 : _state$catalog.toJS()
|
|
1291
|
-
}); // request item catalog data to host app
|
|
1292
|
-
if (cdsItems.length > 0) {
|
|
1293
|
-
(_props$onInternalEven = props.onInternalEvent) === null || _props$onInternalEven === void 0 || _props$onInternalEven.call(props, {
|
|
1294
|
-
type: INTERNAL_EVENT_ITEMS_CATALOG,
|
|
1295
|
-
value: {
|
|
1296
|
-
cdsItems: cdsItems
|
|
1297
|
-
}
|
|
1298
|
-
}, /*#__PURE__*/function () {
|
|
1299
|
-
var _ref3 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee8(result) {
|
|
1300
|
-
var _evt$payload2;
|
|
1301
|
-
var cdsList, cabinetDefinitionList, rt, _i;
|
|
1302
|
-
return _regeneratorRuntime.wrap(function (_context9) {
|
|
1303
|
-
while (1) switch (_context9.prev = _context9.next) {
|
|
1304
|
-
case 0:
|
|
1305
|
-
cdsList = mapFromCCDFToCDS(result === null || result === void 0 ? void 0 : result.ccdf_list);
|
|
1306
|
-
evt.payload = updateProjectWithCDSList(evt.payload, cdsList);
|
|
1307
|
-
cabinetDefinitionList = ccdfMapper(result === null || result === void 0 ? void 0 : result.ccdf_list, evt === null || evt === void 0 || (_evt$payload2 = evt.payload) === null || _evt$payload2 === void 0 ? void 0 : _evt$payload2.layers['layer-1']);
|
|
1308
|
-
rt = mergeSameElements(cabinetDefinitionList);
|
|
1309
|
-
_i = 0;
|
|
1310
|
-
case 1:
|
|
1311
|
-
if (!(_i < (rt === null || rt === void 0 ? void 0 : rt.length))) {
|
|
1312
|
-
_context9.next = 3;
|
|
1313
|
-
break;
|
|
1314
|
-
}
|
|
1315
|
-
_context9.next = 2;
|
|
1316
|
-
return addItemToCatalog(rt[_i], tempState, props.catalog, props.projectActions);
|
|
1317
|
-
case 2:
|
|
1318
|
-
_i++;
|
|
1319
|
-
_context9.next = 1;
|
|
1320
|
-
break;
|
|
1321
|
-
case 3:
|
|
1322
|
-
props.projectActions.loadProject(evt.payload);
|
|
1323
|
-
case 4:
|
|
1324
|
-
case "end":
|
|
1325
|
-
return _context9.stop();
|
|
1326
|
-
}
|
|
1327
|
-
}, _callee8);
|
|
1328
|
-
}));
|
|
1329
|
-
return function (_x1) {
|
|
1330
|
-
return _ref3.apply(this, arguments);
|
|
1331
|
-
};
|
|
1332
|
-
}());
|
|
1333
|
-
} else props.projectActions.loadProject(evt.payload);
|
|
1334
|
-
case 6:
|
|
1335
|
-
return _context11.abrupt("continue", 49);
|
|
1336
|
-
case 7:
|
|
1337
|
-
props.projectActions.unselectAll();
|
|
1338
|
-
props.projectActions.setMode(MODE_IDLE_3D);
|
|
1339
|
-
return _context11.abrupt("continue", 49);
|
|
1340
|
-
case 8:
|
|
1341
|
-
props.projectActions.setMode(MODE_IDLE);
|
|
1342
|
-
return _context11.abrupt("continue", 49);
|
|
1343
|
-
case 9:
|
|
1344
|
-
sLineCnt = layer.selected.lines.size;
|
|
1345
|
-
if (sLineCnt > 0) props.projectActions.setMode(MODE_ELEVATION_VIEW);
|
|
1346
|
-
return _context11.abrupt("continue", 49);
|
|
1347
|
-
case 10:
|
|
1348
|
-
if (state.mode === MODE_IDLE || state.mode === MODE_2D_PAN) props.linesActions.selectToolDrawingLine('wall');else {
|
|
1349
|
-
props.projectActions.setMode(MODE_IDLE);
|
|
1350
|
-
props.linesActions.selectToolDrawingLine('wall');
|
|
1351
|
-
}
|
|
1352
|
-
return _context11.abrupt("continue", 49);
|
|
1353
|
-
case 11:
|
|
1354
|
-
if (isEmpty(evt === null || evt === void 0 ? void 0 : evt.payload)) {
|
|
1355
|
-
_context11.next = 13;
|
|
1356
|
-
break;
|
|
1357
|
-
}
|
|
1358
|
-
element = evt.payload;
|
|
1359
|
-
_context11.next = 12;
|
|
1360
|
-
return addItemToCatalog(element, state, props.catalog, props.projectActions);
|
|
1361
|
-
case 12:
|
|
1362
|
-
// start drawing item
|
|
1363
|
-
if (ARRAY_3D_MODES.includes(state.mode)) {
|
|
1364
|
-
// in 3d view
|
|
1365
|
-
props.itemsActions.selectToolDrawingItem3D(element.name);
|
|
1366
|
-
} else {
|
|
1367
|
-
// in 2d view
|
|
1368
|
-
// create cabinet
|
|
1369
|
-
props.itemsActions.selectToolDrawingItem(element.name);
|
|
1370
|
-
// mapping the initial position of client coord to viewer2D coord
|
|
1371
|
-
_evt$payload$initialP = evt.payload.initialPosition, mouseX = _evt$payload$initialP.mouseX, mouseY = _evt$payload$initialP.mouseY;
|
|
1372
|
-
v2d = (_state$viewer2D = state.viewer2D) === null || _state$viewer2D === void 0 ? void 0 : _state$viewer2D.toJS();
|
|
1373
|
-
if (mouseX && mouseY && v2d) {
|
|
1374
|
-
vPosX = (mouseX - v2d.e) / v2d.a;
|
|
1375
|
-
vPosY = (mouseY - v2d.f) / v2d.d;
|
|
1376
|
-
layerID = state.scene.selectedLayer; // move cabinet to initial position
|
|
1377
|
-
props.itemsActions.updateDrawingItem(layerID, vPosX, -vPosY + state.scene.height, true);
|
|
1378
|
-
}
|
|
1379
|
-
}
|
|
1380
|
-
props.projectActions.pushLastSelectedCatalogElementToHistory(element);
|
|
1381
|
-
props.projectActions.setIsCabinetDrawing(true);
|
|
1382
|
-
case 13:
|
|
1383
|
-
return _context11.abrupt("continue", 49);
|
|
1384
|
-
case 14:
|
|
1385
|
-
ARRAY_3D_MODES.includes(state.mode) ? props.holesActions.selectToolDrawingHole3D(evt === null || evt === void 0 || (_evt$payload4 = evt.payload) === null || _evt$payload4 === void 0 ? void 0 : _evt$payload4.holeName) : props.holesActions.selectToolDrawingHole(evt === null || evt === void 0 || (_evt$payload5 = evt.payload) === null || _evt$payload5 === void 0 ? void 0 : _evt$payload5.holeName);
|
|
1386
|
-
return _context11.abrupt("continue", 49);
|
|
1387
|
-
case 15:
|
|
1388
|
-
moveAndRotatePan2D3D(evt.type, props, evt.payload, state);
|
|
1389
|
-
return _context11.abrupt("continue", 49);
|
|
1390
|
-
case 16:
|
|
1391
|
-
defaulTitle = 'Untitle';
|
|
1392
|
-
props.projectActions.newProject();
|
|
1393
|
-
props.projectActions.rename(defaulTitle);
|
|
1394
|
-
return _context11.abrupt("continue", 49);
|
|
1395
|
-
case 17:
|
|
1396
|
-
_evt$payload6 = evt.payload, doorStyle = _evt$payload6.doorStyle, applyScope = _evt$payload6.applyScope, itemCDS = _evt$payload6.itemCDS, _evt$payload6$itemIds = _evt$payload6.itemIds, itemIds = _evt$payload6$itemIds === void 0 ? [] : _evt$payload6$itemIds;
|
|
1397
|
-
_layerId = state.getIn(['scene', 'selectedLayer']);
|
|
1398
|
-
allItems = state.getIn(['scene', 'layers', _layerId, 'items']).toJS();
|
|
1399
|
-
targetItems = []; // Prepare idSet for SINGLE or MULTIPLE
|
|
1400
|
-
idSet = null;
|
|
1401
|
-
if (applyScope === DOORSTYLE_SCOPE_SINGLE) {
|
|
1402
|
-
selectedItemIds = state.getIn(['scene', 'layers', _layerId, 'selected', 'items']).toJS();
|
|
1403
|
-
idSet = new Set(selectedItemIds);
|
|
1404
|
-
}
|
|
1405
|
-
if (applyScope === DOORSTYLE_SCOPE_MULTIPLE) {
|
|
1406
|
-
// itemIds contains item.id (instance IDs)
|
|
1407
|
-
idSet = new Set(itemIds);
|
|
1408
|
-
}
|
|
1409
|
-
_t6 = applyScope;
|
|
1410
|
-
_context11.next = _t6 === DOORSTYLE_SCOPE_ALL ? 18 : _t6 === DOORSTYLE_SCOPE_SINGLE ? 19 : _t6 === DOORSTYLE_SCOPE_MULTIPLE ? 19 : 20;
|
|
1411
|
-
break;
|
|
1412
|
-
case 18:
|
|
1413
|
-
targetItems = Object.values(allItems);
|
|
1414
|
-
return _context11.abrupt("continue", 21);
|
|
1415
|
-
case 19:
|
|
1416
|
-
targetItems = Object.values(allItems).filter(function (item) {
|
|
1417
|
-
var _idSet;
|
|
1418
|
-
return (_idSet = idSet) === null || _idSet === void 0 ? void 0 : _idSet.has(item.id);
|
|
1419
|
-
});
|
|
1420
|
-
return _context11.abrupt("continue", 21);
|
|
1421
|
-
case 20:
|
|
1422
|
-
return _context11.abrupt("continue", 21);
|
|
1423
|
-
case 21:
|
|
1424
|
-
ccdf_list = [];
|
|
1425
|
-
_loop7 = /*#__PURE__*/_regeneratorRuntime.mark(function _loop7() {
|
|
1426
|
-
var item;
|
|
1427
|
-
return _regeneratorRuntime.wrap(function (_context10) {
|
|
1428
|
-
while (1) switch (_context10.prev = _context10.next) {
|
|
1429
|
-
case 0:
|
|
1430
|
-
item = targetItems[_i2];
|
|
1431
|
-
if (!ccdf_list.some(function (v) {
|
|
1432
|
-
return item.itemID === v.itemID && item.name === v.name && doorStyle.id === v.doorFinishId;
|
|
1433
|
-
})) {
|
|
1434
|
-
ccdf_list.push({
|
|
1435
|
-
itemID: item.itemID,
|
|
1436
|
-
prototype: item.prototype,
|
|
1437
|
-
category: item.category,
|
|
1438
|
-
name: item.name,
|
|
1439
|
-
type: item.type,
|
|
1440
|
-
sku_number: item.sku_number,
|
|
1441
|
-
doorFinishId: doorStyle.id
|
|
1442
|
-
});
|
|
1443
|
-
}
|
|
1444
|
-
case 1:
|
|
1445
|
-
case "end":
|
|
1446
|
-
return _context10.stop();
|
|
1447
|
-
}
|
|
1448
|
-
}, _loop7);
|
|
1449
|
-
});
|
|
1450
|
-
_i2 = 0;
|
|
1451
|
-
case 22:
|
|
1452
|
-
if (!(_i2 < targetItems.length)) {
|
|
1453
|
-
_context11.next = 24;
|
|
1454
|
-
break;
|
|
1455
|
-
}
|
|
1456
|
-
return _context11.delegateYield(_loop7(), "t1", 23);
|
|
1457
|
-
case 23:
|
|
1458
|
-
_i2++;
|
|
1459
|
-
_context11.next = 22;
|
|
1460
|
-
break;
|
|
1461
|
-
case 24:
|
|
1462
|
-
if (ccdf_list.length > 0) {
|
|
1463
|
-
(_props$onInternalEven2 = props.onInternalEvent) === null || _props$onInternalEven2 === void 0 || _props$onInternalEven2.call(props, {
|
|
1464
|
-
type: INTERNAL_EVENT_ITEMS_CATALOG,
|
|
1465
|
-
value: {
|
|
1466
|
-
ccdf_list: ccdf_list
|
|
1467
|
-
}
|
|
1468
|
-
},
|
|
1469
|
-
/*#__PURE__*/
|
|
1470
|
-
// result is ccdf_list
|
|
1471
|
-
function () {
|
|
1472
|
-
var _ref4 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee9(result) {
|
|
1473
|
-
var mappedCabinetDefinitionList, rt, _i3;
|
|
1474
|
-
return _regeneratorRuntime.wrap(function (_context1) {
|
|
1475
|
-
while (1) switch (_context1.prev = _context1.next) {
|
|
1476
|
-
case 0:
|
|
1477
|
-
mappedCabinetDefinitionList = ccdfMapper(result.ccdf_list, layer); // result: ccdf_list
|
|
1478
|
-
rt = mergeSameElements(mappedCabinetDefinitionList);
|
|
1479
|
-
_i3 = 0;
|
|
1480
|
-
case 1:
|
|
1481
|
-
if (!(_i3 < (rt === null || rt === void 0 ? void 0 : rt.length))) {
|
|
1482
|
-
_context1.next = 3;
|
|
1483
|
-
break;
|
|
1484
|
-
}
|
|
1485
|
-
_context1.next = 2;
|
|
1486
|
-
return addItemToCatalog(rt[_i3], state, props.catalog, props.projectActions);
|
|
1487
|
-
case 2:
|
|
1488
|
-
_i3++;
|
|
1489
|
-
_context1.next = 1;
|
|
1490
|
-
break;
|
|
1491
|
-
case 3:
|
|
1492
|
-
props.itemsActions.setDoorStyle(doorStyle, itemCDS, applyScope, itemIds);
|
|
1493
|
-
case 4:
|
|
1494
|
-
case "end":
|
|
1495
|
-
return _context1.stop();
|
|
1496
|
-
}
|
|
1497
|
-
}, _callee9);
|
|
1498
|
-
}));
|
|
1499
|
-
return function (_x10) {
|
|
1500
|
-
return _ref4.apply(this, arguments);
|
|
1501
|
-
};
|
|
1502
|
-
}());
|
|
1503
|
-
} else {
|
|
1504
|
-
props.itemsActions.setDoorStyle(doorStyle, itemCDS, applyScope, itemIds);
|
|
1505
|
-
}
|
|
1506
|
-
return _context11.abrupt("continue", 49);
|
|
1507
|
-
case 25:
|
|
1508
|
-
_evt$payload7 = evt.payload, roomShapeType = _evt$payload7.roomShapeType, width = _evt$payload7.width, height = _evt$payload7.height, measurementUnit = _evt$payload7.measurementUnit, _doorStyle = _evt$payload7.doorStyle;
|
|
1509
|
-
props.projectActions.createRoomWithShape(roomShapeType, width, height, measurementUnit, _doorStyle);
|
|
1510
|
-
return _context11.abrupt("continue", 49);
|
|
1511
|
-
case 26:
|
|
1512
|
-
value = state.getIn(['viewer2D']).toJS();
|
|
1513
|
-
value.a += 0.1;
|
|
1514
|
-
value.d += 0.1;
|
|
1515
|
-
value.e -= value.SVGWidth * 0.1 / 2;
|
|
1516
|
-
value.f -= value.SVGHeight * 0.1 / 2;
|
|
1517
|
-
updateViwer2D(value, props.viewer2DActions);
|
|
1518
|
-
return _context11.abrupt("continue", 49);
|
|
1519
|
-
case 27:
|
|
1520
|
-
_value = state.getIn(['viewer2D']).toJS();
|
|
1521
|
-
_value.a -= 0.1;
|
|
1522
|
-
_value.d -= 0.1;
|
|
1523
|
-
_value.e += _value.SVGWidth * 0.1 / 2;
|
|
1524
|
-
_value.f += _value.SVGHeight * 0.1 / 2;
|
|
1525
|
-
updateViwer2D(_value, props.viewer2DActions);
|
|
1526
|
-
return _context11.abrupt("continue", 49);
|
|
1527
|
-
case 28:
|
|
1528
|
-
centering2D(state, props.viewer2DActions);
|
|
1529
|
-
return _context11.abrupt("continue", 49);
|
|
1530
|
-
case 29:
|
|
1531
|
-
props.projectActions.undo();
|
|
1532
|
-
return _context11.abrupt("continue", 49);
|
|
1533
|
-
case 30:
|
|
1534
|
-
props.projectActions.redo();
|
|
1535
|
-
return _context11.abrupt("continue", 49);
|
|
1536
|
-
case 31:
|
|
1537
|
-
_evt$payload8 = evt.payload, moldingInfo = _evt$payload8.moldingInfo, isGlobal = _evt$payload8.isGlobal;
|
|
1538
|
-
_context11.next = 32;
|
|
1539
|
-
return loadMoldingSvg(moldingInfo);
|
|
1540
|
-
case 32:
|
|
1541
|
-
props.itemsActions.setMolding(moldingInfo, isGlobal);
|
|
1542
|
-
return _context11.abrupt("continue", 49);
|
|
1543
|
-
case 33:
|
|
1544
|
-
distElement = getElement(evt.payload, state);
|
|
1545
|
-
if (distElement) props.itemsActions.duplicateSelected(distElement, props.onInternalEvent);
|
|
1546
|
-
return _context11.abrupt("continue", 49);
|
|
1547
|
-
case 34:
|
|
1548
|
-
_distElement = getElement(evt.payload, state);
|
|
1549
|
-
if (_distElement) props.projectActions.remove(_distElement);
|
|
1550
|
-
return _context11.abrupt("continue", 49);
|
|
1551
|
-
case 35:
|
|
1552
|
-
_evt$payload9 = evt.payload, option = _evt$payload9.option, _value2 = _evt$payload9.value;
|
|
1553
|
-
_t7 = option;
|
|
1554
|
-
_context11.next = _t7 === PROJECT_SETTING_OPTION.CHANGE_MEASUREMENT_UNIT ? 36 : _t7 === PROJECT_SETTING_OPTION.UPDATE_CEIL_HEIGHT ? 37 : _t7 === PROJECT_SETTING_OPTION.CHANGE_WALL_LENGTH_MEASURE ? 38 : _t7 === PROJECT_SETTING_OPTION.CHANGE_BASE_CABINET_MEASURE ? 39 : _t7 === PROJECT_SETTING_OPTION.CHANGE_WALL_CABINET_MEASURE ? 40 : _t7 === PROJECT_SETTING_OPTION.CHANGE_WINDOW_DOOR_MEASURE ? 41 : 42;
|
|
1555
|
-
break;
|
|
1556
|
-
case 36:
|
|
1557
|
-
props.viewer2DActions.updateCeilHeight(convert(layer.ceilHeight).from(layer.unit).to(_value2));
|
|
1558
|
-
props.viewer2DActions.updateCeilHeightUnit(_value2);
|
|
1559
|
-
props.viewer3DActions.update3DCeilHeightUnit(_value2);
|
|
1560
|
-
props.viewer3DActions.update3DCeilHeight(convert(layer.ceilHeight).from(layer.unit).to(_value2));
|
|
1561
|
-
return _context11.abrupt("continue", 43);
|
|
1562
|
-
case 37:
|
|
1563
|
-
props.viewer2DActions.updateCeilHeight(_value2);
|
|
1564
|
-
props.viewer3DActions.update3DCeilHeight(_value2);
|
|
1565
|
-
return _context11.abrupt("continue", 43);
|
|
1566
|
-
case 38:
|
|
1567
|
-
props.viewer2DActions.changeWallLengthMeasure(_value2);
|
|
1568
|
-
return _context11.abrupt("continue", 43);
|
|
1569
|
-
case 39:
|
|
1570
|
-
props.viewer2DActions.changeBaseCabinetMeasure(_value2);
|
|
1571
|
-
return _context11.abrupt("continue", 43);
|
|
1572
|
-
case 40:
|
|
1573
|
-
props.viewer2DActions.changeWallCabinetMeasure(_value2);
|
|
1574
|
-
return _context11.abrupt("continue", 43);
|
|
1575
|
-
case 41:
|
|
1576
|
-
props.viewer2DActions.changeWindowDoorMeasure(_value2);
|
|
1577
|
-
return _context11.abrupt("continue", 43);
|
|
1578
|
-
case 42:
|
|
1579
|
-
return _context11.abrupt("continue", 43);
|
|
1580
|
-
case 43:
|
|
1581
|
-
return _context11.abrupt("continue", 49);
|
|
1582
|
-
case 44:
|
|
1583
|
-
_layerId2 = state.getIn(['scene', 'selectedLayer']);
|
|
1584
|
-
_layer = state.getIn(['scene', 'layers', _layerId2]);
|
|
1585
|
-
_layer$getIn = _layer.getIn(['selected']), selectedLines = _layer$getIn.lines, selectedHoles = _layer$getIn.holes, selectedItems = _layer$getIn.items;
|
|
1586
|
-
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);
|
|
1587
|
-
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);
|
|
1588
|
-
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);
|
|
1589
|
-
return _context11.abrupt("continue", 49);
|
|
1590
|
-
case 45:
|
|
1591
|
-
_layerID = state.scene.selectedLayer;
|
|
1592
|
-
_layer2 = state.scene.getIn(['layers', _layerID]).toJS();
|
|
1593
|
-
orginalItemInfo = evt === null || evt === void 0 || (_evt$payload0 = evt.payload) === null || _evt$payload0 === void 0 ? void 0 : _evt$payload0.orginalItemInfo;
|
|
1594
|
-
originalItem = _layer2 === null || _layer2 === void 0 ? void 0 : _layer2.items[orginalItemInfo.id];
|
|
1595
|
-
_context11.next = 46;
|
|
1596
|
-
return addItemToCatalog(evt.payload.replaceItemInfo, state, props.catalog, props.projectActions);
|
|
1597
|
-
case 46:
|
|
1598
|
-
originalItemPos = {
|
|
1599
|
-
rotation: originalItem.rotation,
|
|
1600
|
-
selectedItemId: originalItem.id,
|
|
1601
|
-
x: originalItem.x,
|
|
1602
|
-
y: originalItem.y
|
|
1603
|
-
};
|
|
1604
|
-
replaceItem = {
|
|
1605
|
-
name: evt === null || evt === void 0 || (_evt$payload1 = evt.payload) === null || _evt$payload1 === void 0 || (_evt$payload1 = _evt$payload1.replaceItemInfo) === null || _evt$payload1 === void 0 ? void 0 : _evt$payload1.name,
|
|
1606
|
-
info: {
|
|
1607
|
-
width: evt === null || evt === void 0 || (_evt$payload10 = evt.payload) === null || _evt$payload10 === void 0 || (_evt$payload10 = _evt$payload10.replaceItemInfo) === null || _evt$payload10 === void 0 || (_evt$payload10 = _evt$payload10.sizeinfo) === null || _evt$payload10 === void 0 ? void 0 : _evt$payload10.width,
|
|
1608
|
-
height: evt === null || evt === void 0 || (_evt$payload11 = evt.payload) === null || _evt$payload11 === void 0 || (_evt$payload11 = _evt$payload11.replaceItemInfo) === null || _evt$payload11 === void 0 || (_evt$payload11 = _evt$payload11.sizeinfo) === null || _evt$payload11 === void 0 ? void 0 : _evt$payload11.height
|
|
1609
|
-
}
|
|
1610
|
-
};
|
|
1611
|
-
props.itemsActions.replaceItem(originalItemPos, originalItem, replaceItem);
|
|
1612
|
-
return _context11.abrupt("continue", 49);
|
|
1613
|
-
case 47:
|
|
1614
|
-
setFinishing(props, state, evt.payload);
|
|
1615
|
-
return _context11.abrupt("continue", 49);
|
|
1616
|
-
case 48:
|
|
1617
|
-
sceneData = state.scene.toJS(); // get molding data for "ReviewForQuote"
|
|
1618
|
-
currentTexture = (_layer$doorStyle = layer === null || layer === void 0 ? void 0 : layer.doorStyle) !== null && _layer$doorStyle !== void 0 ? _layer$doorStyle : props.state.doorStyle;
|
|
1619
|
-
if (!isEmpty(currentTexture) && Map.isMap(currentTexture)) currentTexture = (_currentTexture = currentTexture) === null || _currentTexture === void 0 ? void 0 : _currentTexture.toJS();
|
|
1620
|
-
moldingPieceLength = (_props$configData$mol = props === null || props === void 0 || (_props$configData = props.configData) === null || _props$configData === void 0 ? void 0 : _props$configData.moldingPieceLength) !== null && _props$configData$mol !== void 0 ? _props$configData$mol : DEFAULT_MOLDING_PIECE_LENGTH;
|
|
1621
|
-
sceneData.layers[layerId].moldingData = getMoldingDataOfScene2(layer, props.catalog, currentTexture, moldingPieceLength);
|
|
1622
|
-
|
|
1623
|
-
// get skin panel data
|
|
1624
|
-
skinPanelExclusionSKUs = (_props$configData$ski = props === null || props === void 0 || (_props$configData2 = props.configData) === null || _props$configData2 === void 0 ? void 0 : _props$configData2.skinPanelExclusionSKUs) !== null && _props$configData$ski !== void 0 ? _props$configData$ski : [];
|
|
1625
|
-
sceneData.layers[layerId].skinPanelData = computeSkinPanels(layer, skinPanelExclusionSKUs, props.catalog);
|
|
1626
|
-
|
|
1627
|
-
// send scene object from 3DTool to HostApp using internalEvent
|
|
1628
|
-
(_props$onInternalEven3 = props.onInternalEvent) === null || _props$onInternalEven3 === void 0 || _props$onInternalEven3.call(props, {
|
|
1629
|
-
type: INTERNAL_EVENT_SYNC_SCENE,
|
|
1630
|
-
value: {
|
|
1631
|
-
scene: sceneData
|
|
1632
|
-
}
|
|
1633
|
-
});
|
|
1634
|
-
return _context11.abrupt("continue", 49);
|
|
1635
|
-
case 49:
|
|
1636
|
-
case "end":
|
|
1637
|
-
return _context11.stop();
|
|
1638
|
-
}
|
|
1639
|
-
}, _callee0);
|
|
1640
|
-
}));
|
|
1641
|
-
return _handleExternalEvent.apply(this, arguments);
|
|
1642
1096
|
}
|