kitchen-simulator 4.0.6-react-18 → 4.0.7-measurement-unit-payload
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/README.md +3 -0
- package/es/AppContext.js +1 -1
- package/es/LiteKitchenConfigurator.js +162 -107
- package/es/LiteRenderer.js +162 -137
- package/es/actions/export.js +25 -12
- package/es/actions/project-actions.js +2 -1
- package/es/assets/gltf/door_sliding.bin +0 -0
- package/es/assets/img/png/helper/video_preview_start.png +0 -0
- package/es/assets/img/svg/bottombar/elevation.svg +12 -5
- package/es/catalog/catalog.js +21 -5
- package/es/catalog/factories/wall-factory.js +1 -1
- package/es/catalog/holes/window-clear/planner-element.js +2 -2
- package/es/catalog/properties/export.js +21 -0
- package/es/catalog/properties/property-checkbox.js +68 -0
- package/es/catalog/properties/property-color.js +39 -0
- package/es/catalog/properties/property-enum.js +50 -0
- package/es/catalog/properties/property-hidden.js +19 -0
- package/es/catalog/properties/property-lenght-measure.js +100 -0
- package/es/catalog/properties/property-length-measure.js +84 -0
- package/es/catalog/properties/property-length-measure_hole.js +100 -0
- package/es/catalog/properties/property-number.js +48 -0
- package/es/catalog/properties/property-read-only.js +26 -0
- package/es/catalog/properties/property-string.js +48 -0
- package/es/catalog/properties/property-toggle.js +39 -0
- package/es/catalog/properties/shared-property-style.js +14 -0
- package/es/catalog/utils/exporter.js +24 -11
- package/es/catalog/utils/item-loader.js +38 -34
- package/es/class/hole.js +0 -2
- package/es/class/item.js +99 -70
- package/es/class/layer.js +1 -1
- package/es/class/line.js +4 -8
- package/es/class/project.js +96 -81
- package/es/components/content.js +5 -93
- package/es/components/export.js +4 -6
- package/es/components/style/button.js +106 -0
- package/es/components/style/cancel-button.js +21 -0
- package/es/components/style/content-container.js +30 -0
- package/es/components/style/content-title.js +25 -0
- package/es/components/style/delete-button.js +24 -0
- package/es/components/style/export.js +28 -2
- package/es/components/style/form-block.js +20 -0
- package/es/components/style/form-color-input.js +26 -0
- package/es/components/style/form-label.js +22 -0
- package/es/components/style/form-number-input.js +29 -27
- package/es/components/style/form-number-input_2.js +200 -0
- package/es/components/style/form-select.js +19 -0
- package/es/components/style/form-slider.js +60 -0
- package/es/components/style/form-submit-button.js +25 -0
- package/es/components/style/form-text-input.js +69 -0
- package/es/components/viewer2d/grids/grid-streak.js +1 -1
- package/es/components/viewer2d/group.js +5 -4
- package/es/components/viewer2d/item.js +155 -359
- package/es/components/viewer2d/layer.js +1 -1
- package/es/components/viewer2d/line.js +22 -52
- package/es/components/viewer2d/ruler.js +16 -11
- package/es/components/viewer2d/rulerDist.js +38 -51
- package/es/components/viewer2d/rulerX.js +4 -2
- package/es/components/viewer2d/rulerY.js +3 -0
- package/es/components/viewer2d/scene.js +17 -12
- package/es/components/viewer2d/state.js +1 -1
- package/es/components/viewer2d/utils.js +2 -2
- package/es/components/viewer2d/vertex.js +3 -2
- package/es/components/viewer2d/viewer2d.js +56 -87
- package/es/components/viewer3d/ruler-utils/scene3D.js +1 -1
- package/es/components/viewer3d/scene-creator.js +270 -69
- package/es/components/viewer3d/viewer3d-first-person.js +24 -26
- package/es/components/viewer3d/viewer3d.js +115 -120
- package/es/constants.js +7 -2
- package/es/devLiteRenderer.js +491 -150
- package/es/index.js +627 -1
- package/es/models.js +13 -8
- package/es/plugins/SVGLoader.js +1414 -0
- package/es/plugins/console-debugger.js +34 -0
- package/es/plugins/export.js +7 -0
- package/es/plugins/keyboard.js +110 -0
- package/es/reducers/project-reducer.js +4 -1
- package/es/reducers/viewer2d-reducer.js +3 -1
- package/es/reducers/viewer3d-reducer.js +3 -1
- package/es/styles/export.js +5 -0
- package/es/styles/tabs.css +40 -0
- package/es/utils/geometry.js +77 -119
- package/es/utils/helper.js +38 -1
- package/es/utils/isolate-event-handler.js +829 -609
- package/es/utils/molding.js +459 -11
- package/es/utils/ruler.js +58 -0
- package/lib/AppContext.js +1 -1
- package/lib/LiteKitchenConfigurator.js +161 -107
- package/lib/LiteRenderer.js +161 -137
- package/lib/actions/export.js +35 -39
- package/lib/actions/project-actions.js +2 -1
- package/lib/assets/gltf/door_sliding.bin +0 -0
- package/lib/assets/img/png/helper/video_preview_start.png +0 -0
- package/lib/assets/img/svg/bottombar/elevation.svg +12 -5
- package/lib/catalog/catalog.js +20 -4
- package/lib/catalog/factories/wall-factory.js +1 -1
- package/lib/catalog/holes/window-clear/planner-element.js +2 -2
- package/lib/catalog/properties/export.js +81 -0
- package/lib/catalog/properties/property-checkbox.js +76 -0
- package/lib/catalog/properties/property-color.js +47 -0
- package/lib/catalog/properties/property-enum.js +58 -0
- package/lib/catalog/properties/property-hidden.js +27 -0
- package/lib/catalog/properties/property-lenght-measure.js +108 -0
- package/lib/catalog/properties/property-length-measure.js +92 -0
- package/lib/catalog/properties/property-length-measure_hole.js +108 -0
- package/lib/catalog/properties/property-number.js +56 -0
- package/lib/catalog/properties/property-read-only.js +34 -0
- package/lib/catalog/properties/property-string.js +56 -0
- package/lib/catalog/properties/property-toggle.js +47 -0
- package/lib/catalog/properties/shared-property-style.js +21 -0
- package/lib/catalog/utils/exporter.js +24 -11
- package/lib/catalog/utils/item-loader.js +38 -34
- package/lib/class/hole.js +0 -2
- package/lib/class/item.js +97 -68
- package/lib/class/layer.js +1 -1
- package/lib/class/line.js +3 -7
- package/lib/class/project.js +96 -81
- package/lib/components/content.js +5 -93
- package/lib/components/export.js +6 -26
- package/lib/components/style/button.js +115 -0
- package/lib/components/style/cancel-button.js +29 -0
- package/lib/components/style/content-container.js +38 -0
- package/lib/components/style/content-title.js +35 -0
- package/lib/components/style/delete-button.js +34 -0
- package/lib/components/style/export.js +105 -1
- package/lib/components/style/form-block.js +28 -0
- package/lib/components/style/form-color-input.js +34 -0
- package/lib/components/style/form-label.js +30 -0
- package/lib/components/style/form-number-input.js +29 -27
- package/lib/components/style/form-number-input_2.js +209 -0
- package/lib/components/style/form-select.js +29 -0
- package/lib/components/style/form-slider.js +68 -0
- package/lib/components/style/form-submit-button.js +35 -0
- package/lib/components/style/form-text-input.js +78 -0
- package/lib/components/viewer2d/grids/grid-streak.js +1 -1
- package/lib/components/viewer2d/group.js +5 -4
- package/lib/components/viewer2d/item.js +152 -356
- package/lib/components/viewer2d/layer.js +1 -1
- package/lib/components/viewer2d/line.js +22 -52
- package/lib/components/viewer2d/ruler.js +15 -10
- package/lib/components/viewer2d/rulerDist.js +38 -51
- package/lib/components/viewer2d/rulerX.js +4 -2
- package/lib/components/viewer2d/rulerY.js +3 -0
- package/lib/components/viewer2d/scene.js +17 -12
- package/lib/components/viewer2d/state.js +1 -1
- package/lib/components/viewer2d/utils.js +2 -2
- package/lib/components/viewer2d/vertex.js +3 -2
- package/lib/components/viewer2d/viewer2d.js +54 -84
- package/lib/components/viewer3d/ruler-utils/scene3D.js +1 -1
- package/lib/components/viewer3d/scene-creator.js +267 -66
- package/lib/components/viewer3d/viewer3d-first-person.js +24 -26
- package/lib/components/viewer3d/viewer3d.js +112 -116
- package/lib/constants.js +12 -7
- package/lib/devLiteRenderer.js +489 -148
- package/lib/index.js +630 -6
- package/lib/models.js +13 -8
- package/lib/plugins/SVGLoader.js +1419 -0
- package/lib/plugins/console-debugger.js +42 -0
- package/lib/plugins/export.js +25 -0
- package/lib/plugins/keyboard.js +117 -0
- package/lib/reducers/project-reducer.js +4 -1
- package/lib/reducers/viewer2d-reducer.js +3 -1
- package/lib/reducers/viewer3d-reducer.js +3 -1
- package/lib/styles/export.js +13 -0
- package/lib/styles/tabs.css +40 -0
- package/lib/utils/geometry.js +77 -119
- package/lib/utils/helper.js +40 -1
- package/lib/utils/isolate-event-handler.js +829 -608
- package/lib/utils/molding.js +460 -9
- package/lib/utils/ruler.js +63 -0
- package/package.json +21 -20
- package/es/mocks/appliancePayload.json +0 -27
- package/es/mocks/cabinetPayload.json +0 -1914
- package/es/mocks/cabinetPayload2.json +0 -76
- package/es/mocks/dataBundle2.json +0 -4
- package/es/mocks/distancePayload.json +0 -6
- package/es/mocks/doorStylePayload2.json +0 -84
- package/es/mocks/furnishingPayload.json +0 -23
- package/es/mocks/itemCDSPayload.json +0 -27
- package/es/mocks/lightingPayload.json +0 -23
- package/es/mocks/mockProps.json +0 -43
- package/es/mocks/mockProps2.json +0 -9
- package/es/mocks/moldingPayload.json +0 -19
- package/es/mocks/projectItemsCatalog.json +0 -133
- package/es/mocks/rectangleShape.json +0 -238
- package/es/mocks/replaceCabinetPayload.json +0 -81
- package/es/mocks/roomShapePayload.json +0 -5
- package/es/useAppContext.js +0 -8
- package/lib/mocks/appliancePayload.json +0 -27
- package/lib/mocks/cabinetPayload.json +0 -1914
- package/lib/mocks/cabinetPayload2.json +0 -76
- package/lib/mocks/dataBundle2.json +0 -4
- package/lib/mocks/distancePayload.json +0 -6
- package/lib/mocks/doorStylePayload2.json +0 -84
- package/lib/mocks/furnishingPayload.json +0 -23
- package/lib/mocks/itemCDSPayload.json +0 -27
- package/lib/mocks/lightingPayload.json +0 -23
- package/lib/mocks/mockProps.json +0 -43
- package/lib/mocks/mockProps2.json +0 -9
- package/lib/mocks/moldingPayload.json +0 -19
- package/lib/mocks/projectItemsCatalog.json +0 -133
- package/lib/mocks/rectangleShape.json +0 -238
- package/lib/mocks/replaceCabinetPayload.json +0 -81
- package/lib/mocks/roomShapePayload.json +0 -5
- package/lib/useAppContext.js +0 -16
|
@@ -4,7 +4,7 @@ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbol
|
|
|
4
4
|
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; }
|
|
5
5
|
import React, { useEffect, useRef, useState } from 'react';
|
|
6
6
|
import PropTypes from 'prop-types';
|
|
7
|
-
import {
|
|
7
|
+
import { ReactSVGPanZoom, TOOL_AUTO, TOOL_NONE, TOOL_PAN, TOOL_ZOOM_IN, TOOL_ZOOM_OUT } from 'react-svg-pan-zoom';
|
|
8
8
|
import * as constants from "../../constants";
|
|
9
9
|
import { DECIMAL_PLACES_2, LINE_THICKNESS, MIN_ANGLE_DISALLOW_DRAW_WALL, MODE_ELEVATION_VIEW, MODE_IDLE, UNIT_ANGLE, INTERNAL_EVENT_SELECT_ELEMENT, INTERNAL_EVENT_DRAG_ELEMENT, INTERNAL_EVENT_DRAW_ELEMENT, INTERNAL_EVENT_ROTATE_ELEMENT } from "../../constants";
|
|
10
10
|
import State from "./state";
|
|
@@ -15,10 +15,8 @@ import FormNumberInput from "../style/form-number-input";
|
|
|
15
15
|
import { convert } from "../../utils/convert-units-lite";
|
|
16
16
|
import { Map } from 'immutable';
|
|
17
17
|
import { formatNumber } from "../../utils/math";
|
|
18
|
-
import { isEmpty } from "../../utils/helper"; // variables
|
|
18
|
+
import { isEmpty, updatePayloadOfInternalEvent } from "../../utils/helper"; // variables
|
|
19
19
|
import { isWarningItem } from "./utils";
|
|
20
|
-
import { MoldingUtils } from "../../utils/export";
|
|
21
|
-
import { useAppContext } from "../../useAppContext";
|
|
22
20
|
// variables
|
|
23
21
|
var pinFlag = false;
|
|
24
22
|
var sFlag = false; //for all object move
|
|
@@ -122,22 +120,21 @@ function extractElementData(node) {
|
|
|
122
120
|
direct: node.attributes.getNamedItem('data-direct') ? node.attributes.getNamedItem('data-direct').value : 0
|
|
123
121
|
};
|
|
124
122
|
}
|
|
125
|
-
export default function Viewer2D(_ref) {
|
|
123
|
+
export default function Viewer2D(_ref, _ref2) {
|
|
126
124
|
var state = _ref.state,
|
|
127
125
|
width = _ref.width,
|
|
128
126
|
height = _ref.height,
|
|
129
127
|
setToolbar = _ref.setToolbar,
|
|
130
128
|
replaceCabinet = _ref.replaceCabinet,
|
|
131
129
|
onInternalEvent = _ref.onInternalEvent;
|
|
132
|
-
var
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
catalog = _useAppContext.catalog;
|
|
130
|
+
var viewer2DActions = _ref2.viewer2DActions,
|
|
131
|
+
linesActions = _ref2.linesActions,
|
|
132
|
+
holesActions = _ref2.holesActions,
|
|
133
|
+
verticesActions = _ref2.verticesActions,
|
|
134
|
+
itemsActions = _ref2.itemsActions,
|
|
135
|
+
areaActions = _ref2.areaActions,
|
|
136
|
+
projectActions = _ref2.projectActions,
|
|
137
|
+
catalog = _ref2.catalog;
|
|
141
138
|
var _useState = useState(null),
|
|
142
139
|
_useState2 = _slicedToArray(_useState, 2),
|
|
143
140
|
rulerEdit = _useState2[0],
|
|
@@ -160,26 +157,6 @@ export default function Viewer2D(_ref) {
|
|
|
160
157
|
_useState8 = _slicedToArray(_useState7, 2),
|
|
161
158
|
drawStart = _useState8[0],
|
|
162
159
|
setdrawStart = _useState8[1];
|
|
163
|
-
var _useState9 = useState(function () {
|
|
164
|
-
return viewer2D && !viewer2D.isEmpty() ? viewer2D.toJS() : INITIAL_VALUE;
|
|
165
|
-
}),
|
|
166
|
-
_useState0 = _slicedToArray(_useState9, 2),
|
|
167
|
-
svgValue = _useState0[0],
|
|
168
|
-
setSvgValue = _useState0[1];
|
|
169
|
-
var _useState1 = useState(function () {
|
|
170
|
-
return mode2Tool(mode);
|
|
171
|
-
}),
|
|
172
|
-
_useState10 = _slicedToArray(_useState1, 2),
|
|
173
|
-
svgTool = _useState10[0],
|
|
174
|
-
setSvgTool = _useState10[1];
|
|
175
|
-
useEffect(function () {
|
|
176
|
-
// keep tool controlled from app mode
|
|
177
|
-
setSvgTool(mode2Tool(mode));
|
|
178
|
-
}, [mode]);
|
|
179
|
-
useEffect(function () {
|
|
180
|
-
// keep value controlled from store, but never null
|
|
181
|
-
if (viewer2D && !viewer2D.isEmpty()) setSvgValue(viewer2D.toJS());
|
|
182
|
-
}, [viewer2D]);
|
|
183
160
|
useEffect(function () {
|
|
184
161
|
// move viewer point to center
|
|
185
162
|
var selectedLayer = state.scene.layers.get(state.scene.selectedLayer);
|
|
@@ -204,9 +181,9 @@ export default function Viewer2D(_ref) {
|
|
|
204
181
|
var layerID = scene.selectedLayer;
|
|
205
182
|
var wall_thickness = LINE_THICKNESS / 2;
|
|
206
183
|
var layer = scene.getIn(['layers', layerID]);
|
|
207
|
-
var mapCursorPosition = function mapCursorPosition(
|
|
208
|
-
var x =
|
|
209
|
-
y =
|
|
184
|
+
var mapCursorPosition = function mapCursorPosition(_ref3) {
|
|
185
|
+
var x = _ref3.x,
|
|
186
|
+
y = _ref3.y;
|
|
210
187
|
return {
|
|
211
188
|
x: x,
|
|
212
189
|
y: -y + scene.height
|
|
@@ -855,15 +832,21 @@ export default function Viewer2D(_ref) {
|
|
|
855
832
|
var onMouseUp = function onMouseUp(viewerEvent) {
|
|
856
833
|
//set move all flag false
|
|
857
834
|
sFlag = false;
|
|
858
|
-
// //////////////////////
|
|
859
|
-
// setRulerEdit(null);
|
|
860
835
|
var event = viewerEvent.originalEvent;
|
|
861
|
-
var
|
|
836
|
+
var parent = document.querySelector('#kitchen-simulator-container');
|
|
837
|
+
var targetRect = event.target.getBoundingClientRect();
|
|
838
|
+
var left = targetRect.left;
|
|
839
|
+
var top = targetRect.top;
|
|
840
|
+
if (!isEmpty(parent)) {
|
|
841
|
+
var parentRect = parent.getBoundingClientRect();
|
|
842
|
+
left = targetRect.left - parentRect.left;
|
|
843
|
+
top = targetRect.top - parentRect.top;
|
|
844
|
+
left = left - (200 - targetRect.width) / 2;
|
|
845
|
+
top = top - (50 - targetRect.height) / 2;
|
|
846
|
+
}
|
|
862
847
|
if (!mode.includes('ING')) {
|
|
863
848
|
setToolbar('');
|
|
864
849
|
}
|
|
865
|
-
// bbox.width = event.target.getBBox().width;
|
|
866
|
-
// bbox.height = event.target.getBBox().height;
|
|
867
850
|
if (event.target.tagName === 'rect') {
|
|
868
851
|
if (event.target.id) {
|
|
869
852
|
setRulerEditID(event.target.id);
|
|
@@ -952,6 +935,7 @@ export default function Viewer2D(_ref) {
|
|
|
952
935
|
// handle action when click elevation about selected line
|
|
953
936
|
var _mode = MODE_ELEVATION_VIEW;
|
|
954
937
|
projectActions.setMode(_mode);
|
|
938
|
+
internalType = constants.INTERNAL_EVENT_TOGGLE_TO_ELEVATION;
|
|
955
939
|
break;
|
|
956
940
|
} else {
|
|
957
941
|
var tlines = [];
|
|
@@ -995,8 +979,8 @@ export default function Viewer2D(_ref) {
|
|
|
995
979
|
id: "ruler_numberInput",
|
|
996
980
|
style: {
|
|
997
981
|
position: 'absolute',
|
|
998
|
-
left:
|
|
999
|
-
top:
|
|
982
|
+
left: left,
|
|
983
|
+
top: top,
|
|
1000
984
|
zIndex: 1000
|
|
1001
985
|
}
|
|
1002
986
|
}, /*#__PURE__*/React.createElement(FormNumberInput, {
|
|
@@ -1027,8 +1011,8 @@ export default function Viewer2D(_ref) {
|
|
|
1027
1011
|
id: "ruler_numberInput",
|
|
1028
1012
|
style: {
|
|
1029
1013
|
position: 'absolute',
|
|
1030
|
-
left:
|
|
1031
|
-
top:
|
|
1014
|
+
left: left,
|
|
1015
|
+
top: top,
|
|
1032
1016
|
zIndex: 1000
|
|
1033
1017
|
}
|
|
1034
1018
|
}, /*#__PURE__*/React.createElement(FormNumberInput, {
|
|
@@ -1060,8 +1044,8 @@ export default function Viewer2D(_ref) {
|
|
|
1060
1044
|
id: "ruler_numberInput",
|
|
1061
1045
|
style: {
|
|
1062
1046
|
position: 'absolute',
|
|
1063
|
-
left:
|
|
1064
|
-
top:
|
|
1047
|
+
left: left,
|
|
1048
|
+
top: top,
|
|
1065
1049
|
zIndex: 1000
|
|
1066
1050
|
}
|
|
1067
1051
|
}, /*#__PURE__*/React.createElement(FormNumberInput, {
|
|
@@ -1093,8 +1077,8 @@ export default function Viewer2D(_ref) {
|
|
|
1093
1077
|
id: "ruler_numberInput",
|
|
1094
1078
|
style: {
|
|
1095
1079
|
position: 'absolute',
|
|
1096
|
-
left:
|
|
1097
|
-
top:
|
|
1080
|
+
left: left,
|
|
1081
|
+
top: top,
|
|
1098
1082
|
zIndex: 1000
|
|
1099
1083
|
}
|
|
1100
1084
|
}, /*#__PURE__*/React.createElement(FormNumberInput, {
|
|
@@ -1126,8 +1110,8 @@ export default function Viewer2D(_ref) {
|
|
|
1126
1110
|
id: "ruler_numberInput",
|
|
1127
1111
|
style: {
|
|
1128
1112
|
position: 'absolute',
|
|
1129
|
-
left:
|
|
1130
|
-
top:
|
|
1113
|
+
left: left,
|
|
1114
|
+
top: top,
|
|
1131
1115
|
zIndex: 1000
|
|
1132
1116
|
}
|
|
1133
1117
|
}, /*#__PURE__*/React.createElement(FormNumberInput, {
|
|
@@ -1159,8 +1143,8 @@ export default function Viewer2D(_ref) {
|
|
|
1159
1143
|
id: "ruler_numberInput",
|
|
1160
1144
|
style: {
|
|
1161
1145
|
position: 'absolute',
|
|
1162
|
-
left:
|
|
1163
|
-
top:
|
|
1146
|
+
left: left,
|
|
1147
|
+
top: top,
|
|
1164
1148
|
zIndex: 1000
|
|
1165
1149
|
}
|
|
1166
1150
|
}, /*#__PURE__*/React.createElement(FormNumberInput, {
|
|
@@ -1191,8 +1175,8 @@ export default function Viewer2D(_ref) {
|
|
|
1191
1175
|
id: "ruler_numberInput",
|
|
1192
1176
|
style: {
|
|
1193
1177
|
position: 'absolute',
|
|
1194
|
-
left:
|
|
1195
|
-
top:
|
|
1178
|
+
left: left,
|
|
1179
|
+
top: top,
|
|
1196
1180
|
zIndex: 1000
|
|
1197
1181
|
}
|
|
1198
1182
|
}, /*#__PURE__*/React.createElement(FormNumberInput, {
|
|
@@ -1273,24 +1257,7 @@ export default function Viewer2D(_ref) {
|
|
|
1273
1257
|
_currentObject = state.getIn(['scene', 'layers', layerID, elementPrototype, elementID]);
|
|
1274
1258
|
}
|
|
1275
1259
|
if (_currentObject) {
|
|
1276
|
-
var
|
|
1277
|
-
var payload = (_currentObject3 = _currentObject) === null || _currentObject3 === void 0 ? void 0 : _currentObject3.toJS();
|
|
1278
|
-
if (((_currentObject4 = _currentObject) === null || _currentObject4 === void 0 ? void 0 : _currentObject4.prototype) === 'lines') {
|
|
1279
|
-
// caculating length of selected line//
|
|
1280
|
-
var v_a = layer.vertices.get(_currentObject.vertices.get(0));
|
|
1281
|
-
var v_b = layer.vertices.get(_currentObject.vertices.get(1));
|
|
1282
|
-
var distance = GeometryUtils.pointsDistance(v_a.x, v_a.y, v_b.x, v_b.y);
|
|
1283
|
-
var _length3 = convert(distance).from('cm').to('in');
|
|
1284
|
-
payload.length = _length3;
|
|
1285
|
-
//////////////////////////////////////
|
|
1286
|
-
} else if (((_currentObject5 = _currentObject) === null || _currentObject5 === void 0 ? void 0 : _currentObject5.prototype) === 'items') {
|
|
1287
|
-
// check this cabinet has warning box
|
|
1288
|
-
payload.isWarning = isWarningItem(_currentObject);
|
|
1289
|
-
// check this item is available molding
|
|
1290
|
-
payload.isMoldingAvailable = MoldingUtils.isEnableItemForMolding(layer, _currentObject);
|
|
1291
|
-
// check this item is snapped to wall
|
|
1292
|
-
payload.isAttachedWall = MoldingUtils.isAttachedWall(layer, _currentObject);
|
|
1293
|
-
}
|
|
1260
|
+
var payload = updatePayloadOfInternalEvent(_currentObject, layer, catalog);
|
|
1294
1261
|
|
|
1295
1262
|
// send selection event befor replace event
|
|
1296
1263
|
if (internalType === constants.INTERNAL_EVENT_REPLACE_CABINET) {
|
|
@@ -1309,7 +1276,6 @@ export default function Viewer2D(_ref) {
|
|
|
1309
1276
|
};
|
|
1310
1277
|
var onChangeValue = function onChangeValue(value) {
|
|
1311
1278
|
if (sFlag) return;
|
|
1312
|
-
setSvgValue(value);
|
|
1313
1279
|
var _zoomValue = parseInt((value.a - 0.5) / constants.ZOOM_VARIABLE);
|
|
1314
1280
|
if (_zoomValue > constants.MAX_ZOOM_IN_SCALE) return;
|
|
1315
1281
|
if (_zoomValue < 0 || Number.isNaN(_zoomValue)) return;
|
|
@@ -1322,8 +1288,6 @@ export default function Viewer2D(_ref) {
|
|
|
1322
1288
|
var bbox;
|
|
1323
1289
|
if (_rect && _rulerEdit) {
|
|
1324
1290
|
bbox = _rect.getBoundingClientRect();
|
|
1325
|
-
// bbox.width = _rect.getBBox().width;
|
|
1326
|
-
// bbox.height = _rect.getBBox().height;
|
|
1327
1291
|
_rulerEdit.style.left = "".concat(bbox.left - (150 - bbox.width) / 2, "px");
|
|
1328
1292
|
_rulerEdit.style.top = "".concat(bbox.top - (50 - bbox.height) / 2, "px");
|
|
1329
1293
|
}
|
|
@@ -1341,7 +1305,6 @@ export default function Viewer2D(_ref) {
|
|
|
1341
1305
|
}
|
|
1342
1306
|
};
|
|
1343
1307
|
var onChangeTool = function onChangeTool(tool) {
|
|
1344
|
-
setSvgTool(tool);
|
|
1345
1308
|
switch (tool) {
|
|
1346
1309
|
case TOOL_NONE:
|
|
1347
1310
|
projectActions.selectToolEdit();
|
|
@@ -1440,23 +1403,19 @@ export default function Viewer2D(_ref) {
|
|
|
1440
1403
|
},
|
|
1441
1404
|
width: width - rulerSize,
|
|
1442
1405
|
height: height - rulerSize,
|
|
1443
|
-
value:
|
|
1444
|
-
tool: svgTool,
|
|
1406
|
+
value: viewer2D.isEmpty() ? null : viewer2D.toJS(),
|
|
1445
1407
|
onChangeValue: onChangeValue,
|
|
1408
|
+
tool: mode2Tool(mode),
|
|
1446
1409
|
onChangeTool: onChangeTool,
|
|
1447
1410
|
detectAutoPan: mode2DetectAutopan(mode),
|
|
1448
1411
|
onMouseDown: onMouseDown,
|
|
1449
1412
|
onMouseMove: onMouseMove,
|
|
1450
1413
|
onMouseUp: onMouseUp,
|
|
1414
|
+
miniaturePosition: "none",
|
|
1415
|
+
toolbarPosition: "none",
|
|
1451
1416
|
detectPinchGesture: false,
|
|
1452
1417
|
disableDoubleClickZoomWithToolAuto: true,
|
|
1453
|
-
ref: Viewer
|
|
1454
|
-
miniatureProps: {
|
|
1455
|
-
position: POSITION_NONE
|
|
1456
|
-
},
|
|
1457
|
-
toolbarProps: {
|
|
1458
|
-
position: POSITION_NONE
|
|
1459
|
-
}
|
|
1418
|
+
ref: Viewer
|
|
1460
1419
|
}, /*#__PURE__*/React.createElement("svg", {
|
|
1461
1420
|
width: scene.width,
|
|
1462
1421
|
height: scene.height
|
|
@@ -1491,4 +1450,14 @@ Viewer2D.propTypes = {
|
|
|
1491
1450
|
state: PropTypes.object.isRequired,
|
|
1492
1451
|
width: PropTypes.number.isRequired,
|
|
1493
1452
|
height: PropTypes.number.isRequired
|
|
1453
|
+
};
|
|
1454
|
+
Viewer2D.contextTypes = {
|
|
1455
|
+
viewer2DActions: PropTypes.object.isRequired,
|
|
1456
|
+
linesActions: PropTypes.object.isRequired,
|
|
1457
|
+
holesActions: PropTypes.object.isRequired,
|
|
1458
|
+
verticesActions: PropTypes.object.isRequired,
|
|
1459
|
+
itemsActions: PropTypes.object.isRequired,
|
|
1460
|
+
areaActions: PropTypes.object.isRequired,
|
|
1461
|
+
projectActions: PropTypes.object.isRequired,
|
|
1462
|
+
catalog: PropTypes.object.isRequired
|
|
1494
1463
|
};
|
|
@@ -14,7 +14,7 @@ export default function Scene3D(_ref) {
|
|
|
14
14
|
downloadFlag = _ref.downloadFlag;
|
|
15
15
|
var layers = scene.layers;
|
|
16
16
|
var selectedLayer = layers.get(scene.selectedLayer);
|
|
17
|
-
var ceilHeight = selectedLayer.ceilHeight;
|
|
17
|
+
var ceilHeight = Number(selectedLayer.ceilHeight);
|
|
18
18
|
var selectedLine = selectedLayer.lines.get(selectedLayer.selected.lines.toJS()[0]);
|
|
19
19
|
var vertex0 = selectedLayer.vertices.get(selectedLine.vertices.get(0));
|
|
20
20
|
var vertex1 = selectedLayer.vertices.get(selectedLine.vertices.get(1));
|