kitchen-simulator 3.1.2 → 4.0.0-react-18
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 +0 -3
- package/es/AppContext.js +1 -1
- package/es/LiteKitchenConfigurator.js +15 -25
- package/es/LiteRenderer.js +2 -5
- package/es/actions/export.js +12 -25
- package/es/catalog/catalog.js +5 -21
- package/es/components/content.js +2 -5
- package/es/components/export.js +6 -4
- package/es/components/style/export.js +2 -28
- package/es/components/style/form-number-input.js +22 -11
- package/es/components/viewer2d/group.js +4 -5
- package/es/components/viewer2d/item.js +4 -5
- package/es/components/viewer2d/layer.js +1 -1
- package/es/components/viewer2d/line.js +47 -17
- package/es/components/viewer2d/rulerX.js +0 -3
- package/es/components/viewer2d/rulerY.js +0 -3
- package/es/components/viewer2d/scene.js +1 -4
- package/es/components/viewer2d/state.js +1 -1
- package/es/components/viewer2d/viewer2d.js +43 -28
- package/es/components/viewer3d/viewer3d-first-person.js +0 -8
- package/es/components/viewer3d/viewer3d.js +0 -9
- package/es/devLiteRenderer.js +148 -317
- package/es/index.js +12 -4
- package/es/mocks/appliancePayload.json +27 -0
- package/es/mocks/cabinetPayload.json +1914 -0
- package/es/mocks/cabinetPayload2.json +76 -0
- package/es/mocks/dataBundle2.json +4 -0
- package/es/mocks/distancePayload.json +6 -0
- package/es/mocks/doorStylePayload2.json +84 -0
- package/es/mocks/furnishingPayload.json +23 -0
- package/es/mocks/itemCDSPayload.json +27 -0
- package/es/mocks/lightingPayload.json +23 -0
- package/es/mocks/mockProps.json +43 -0
- package/es/mocks/mockProps2.json +9 -0
- package/es/mocks/moldingPayload.json +19 -0
- package/es/mocks/projectItemsCatalog.json +133 -0
- package/es/mocks/rectangleShape.json +238 -0
- package/es/mocks/replaceCabinetPayload.json +81 -0
- package/es/mocks/roomShapePayload.json +5 -0
- package/es/useAppContext.js +8 -0
- package/lib/AppContext.js +1 -1
- package/lib/LiteKitchenConfigurator.js +15 -25
- package/lib/LiteRenderer.js +2 -5
- package/lib/actions/export.js +39 -35
- package/lib/catalog/catalog.js +4 -20
- package/lib/components/content.js +2 -5
- package/lib/components/export.js +26 -6
- package/lib/components/style/export.js +1 -105
- package/lib/components/style/form-number-input.js +22 -11
- package/lib/components/viewer2d/group.js +4 -5
- package/lib/components/viewer2d/item.js +4 -5
- package/lib/components/viewer2d/layer.js +1 -1
- package/lib/components/viewer2d/line.js +47 -17
- package/lib/components/viewer2d/rulerX.js +0 -3
- package/lib/components/viewer2d/rulerY.js +0 -3
- package/lib/components/viewer2d/scene.js +1 -4
- package/lib/components/viewer2d/state.js +1 -1
- package/lib/components/viewer2d/viewer2d.js +42 -27
- package/lib/components/viewer3d/viewer3d-first-person.js +0 -8
- package/lib/components/viewer3d/viewer3d.js +0 -9
- package/lib/devLiteRenderer.js +147 -316
- package/lib/index.js +12 -4
- package/lib/mocks/appliancePayload.json +27 -0
- package/lib/mocks/cabinetPayload.json +1914 -0
- package/lib/mocks/cabinetPayload2.json +76 -0
- package/lib/mocks/dataBundle2.json +4 -0
- package/lib/mocks/distancePayload.json +6 -0
- package/lib/mocks/doorStylePayload2.json +84 -0
- package/lib/mocks/furnishingPayload.json +23 -0
- package/lib/mocks/itemCDSPayload.json +27 -0
- package/lib/mocks/lightingPayload.json +23 -0
- package/lib/mocks/mockProps.json +43 -0
- package/lib/mocks/mockProps2.json +9 -0
- package/lib/mocks/moldingPayload.json +19 -0
- package/lib/mocks/projectItemsCatalog.json +133 -0
- package/lib/mocks/rectangleShape.json +238 -0
- package/lib/mocks/replaceCabinetPayload.json +81 -0
- package/lib/mocks/roomShapePayload.json +5 -0
- package/lib/useAppContext.js +16 -0
- package/package.json +16 -21
- 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/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-submit-button.js +0 -25
- package/es/components/style/form-text-input.js +0 -69
- package/es/plugins/SVGLoader.js +0 -1414
- package/es/styles/export.js +0 -5
- package/es/styles/tabs.css +0 -40
- 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/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-submit-button.js +0 -35
- package/lib/components/style/form-text-input.js +0 -78
- package/lib/plugins/SVGLoader.js +0 -1419
- package/lib/styles/export.js +0 -13
- package/lib/styles/tabs.css +0 -40
package/README.md
CHANGED
|
@@ -44,15 +44,12 @@ You need to check **webpack.config.js** to change the API server.
|
|
|
44
44
|
Webpack is used as the module bundler. The source code is in the **src** folder.
|
|
45
45
|
|
|
46
46
|
entry: {
|
|
47
|
-
// app: './src/renderer.jsx', // For production build WITH API
|
|
48
47
|
app: './src/devLiteRenderer.jsx', // For development of LiteRenderer
|
|
49
48
|
vendor: VENDORS_LIBRARIES
|
|
50
49
|
},
|
|
51
50
|
|
|
52
51
|
- **index.html**: The main HTML file.
|
|
53
52
|
|
|
54
|
-
- **[renderer.jsx](src/renderer.jsx)**: The main JavaScript file that bootstraps the React application. WTH API CALLS
|
|
55
|
-
|
|
56
53
|
- **[devLiteRenderer.jsx](src/devLiteRenderer.jsx).jsx**: The main JavaScript file that bootstraps the React application. For development lite version without API calls. WITH MOCKS
|
|
57
54
|
- **[LiteRenderer.js](src/LiteRenderer.js)**: The Lite React component that uses mock data and creates the store / catalog etc
|
|
58
55
|
- [LiteKitchenConfigurator.jsx](src/LiteKitchenConfigurator.jsx)
|
package/es/AppContext.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
3
|
-
import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
|
|
4
3
|
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
4
|
+
import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
|
|
5
5
|
import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
|
|
6
6
|
import _createClass from "@babel/runtime/helpers/esm/createClass";
|
|
7
7
|
import _possibleConstructorReturn from "@babel/runtime/helpers/esm/possibleConstructorReturn";
|
|
@@ -12,7 +12,6 @@ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbol
|
|
|
12
12
|
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
13
|
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
14
14
|
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
15
|
-
import axios from 'axios';
|
|
16
15
|
import { convert } from "./utils/convert-units-lite";
|
|
17
16
|
import PropTypes from 'prop-types';
|
|
18
17
|
import React, { Component } from 'react';
|
|
@@ -27,6 +26,7 @@ import Translator from "./translator/translator";
|
|
|
27
26
|
import { objectsMap } from "./utils/objects-utils";
|
|
28
27
|
import { VERSION } from "./version";
|
|
29
28
|
import { handleExternalEvent } from "./utils/isolate-event-handler";
|
|
29
|
+
import AppContext from "./AppContext";
|
|
30
30
|
var toolbarW = 0;
|
|
31
31
|
var wrapperStyle = {
|
|
32
32
|
display: 'flex',
|
|
@@ -301,21 +301,9 @@ var LiteKitchenConfigurator = /*#__PURE__*/function (_Component) {
|
|
|
301
301
|
this.setState({});
|
|
302
302
|
document.getElementById('review_quote_inactive').parentElement.parentElement.style.zIndex = 6;
|
|
303
303
|
}
|
|
304
|
-
}, {
|
|
305
|
-
key: "getChildContext",
|
|
306
|
-
value: function getChildContext() {
|
|
307
|
-
var _this2 = this;
|
|
308
|
-
return _objectSpread(_objectSpread({}, objectsMap(actions, function (actionNamespace) {
|
|
309
|
-
return _this2.props[actionNamespace];
|
|
310
|
-
})), {}, {
|
|
311
|
-
translator: this.props.translator,
|
|
312
|
-
catalog: this.props.catalog
|
|
313
|
-
});
|
|
314
|
-
}
|
|
315
304
|
}, {
|
|
316
305
|
key: "componentDidMount",
|
|
317
306
|
value: function componentDidMount() {
|
|
318
|
-
console.log('context =>', this.context);
|
|
319
307
|
window.forRedo = [];
|
|
320
308
|
var store = this.context.store;
|
|
321
309
|
var _this$props = this.props,
|
|
@@ -357,6 +345,15 @@ var LiteKitchenConfigurator = /*#__PURE__*/function (_Component) {
|
|
|
357
345
|
}, {
|
|
358
346
|
key: "render",
|
|
359
347
|
value: function render() {
|
|
348
|
+
var _this2 = this;
|
|
349
|
+
var actionsFromProps = objectsMap(actions, function (ns) {
|
|
350
|
+
return _this2.props[ns];
|
|
351
|
+
});
|
|
352
|
+
var appCtxValue = _objectSpread(_objectSpread({}, actionsFromProps), {}, {
|
|
353
|
+
translator: this.props.translator,
|
|
354
|
+
// instance (defaultProps already gives one)
|
|
355
|
+
catalog: this.props.catalog
|
|
356
|
+
});
|
|
360
357
|
var _this$props2 = this.props,
|
|
361
358
|
width = _this$props2.width,
|
|
362
359
|
height = _this$props2.height,
|
|
@@ -404,7 +401,9 @@ var LiteKitchenConfigurator = /*#__PURE__*/function (_Component) {
|
|
|
404
401
|
extractedState = extractedState.merge({
|
|
405
402
|
viewer2D: _viewer2D
|
|
406
403
|
});
|
|
407
|
-
return /*#__PURE__*/React.createElement(
|
|
404
|
+
return /*#__PURE__*/React.createElement(AppContext.Provider, {
|
|
405
|
+
value: appCtxValue
|
|
406
|
+
}, /*#__PURE__*/React.createElement("section", null, /*#__PURE__*/React.createElement("div", {
|
|
408
407
|
style: _objectSpread(_objectSpread({}, wrapperStyle), {}, {
|
|
409
408
|
height: height,
|
|
410
409
|
display: 'flex',
|
|
@@ -424,7 +423,7 @@ var LiteKitchenConfigurator = /*#__PURE__*/function (_Component) {
|
|
|
424
423
|
return event.preventDefault();
|
|
425
424
|
},
|
|
426
425
|
onInternalEvent: this.props.onInternalEvent
|
|
427
|
-
}))));
|
|
426
|
+
})))));
|
|
428
427
|
}
|
|
429
428
|
}]);
|
|
430
429
|
}(Component);
|
|
@@ -445,15 +444,6 @@ LiteKitchenConfigurator.propTypes = {
|
|
|
445
444
|
configData: PropTypes.object,
|
|
446
445
|
onInternalEvent: PropTypes.func
|
|
447
446
|
};
|
|
448
|
-
LiteKitchenConfigurator.contextTypes = {
|
|
449
|
-
store: PropTypes.object.isRequired
|
|
450
|
-
};
|
|
451
|
-
LiteKitchenConfigurator.childContextTypes = _objectSpread(_objectSpread({}, objectsMap(actions, function () {
|
|
452
|
-
return PropTypes.object;
|
|
453
|
-
})), {}, {
|
|
454
|
-
translator: PropTypes.object,
|
|
455
|
-
catalog: PropTypes.object
|
|
456
|
-
});
|
|
457
447
|
LiteKitchenConfigurator.defaultProps = {
|
|
458
448
|
translator: new Translator(),
|
|
459
449
|
catalog: new Catalog(),
|
package/es/LiteRenderer.js
CHANGED
|
@@ -20,10 +20,7 @@ import { createStore } from 'redux';
|
|
|
20
20
|
import * as Models from "./models";
|
|
21
21
|
import { State } from "./models";
|
|
22
22
|
import PlannerReducer from "./reducers/reducer";
|
|
23
|
-
import AppContext from "./AppContext";
|
|
24
23
|
import Catalog from "./catalog/catalog";
|
|
25
|
-
import { SVGLoader } from 'three/addons/loaders/SVGLoader';
|
|
26
|
-
import { TOE_KICK_MOLDING } from "./constants";
|
|
27
24
|
import * as Areas from "./catalog/areas/area/planner-element";
|
|
28
25
|
import * as Lines from "./catalog/lines/wall/planner-element";
|
|
29
26
|
import * as Holes from "./catalog/holes/export";
|
|
@@ -282,7 +279,7 @@ export default function LiteRenderer(props) {
|
|
|
282
279
|
initCatalog();
|
|
283
280
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
284
281
|
}, [id]);
|
|
285
|
-
return /*#__PURE__*/React.createElement(
|
|
282
|
+
return /*#__PURE__*/React.createElement(Provider, {
|
|
286
283
|
store: store
|
|
287
284
|
}, /*#__PURE__*/React.createElement(ToolErrorBoundary, {
|
|
288
285
|
pushError: pushError
|
|
@@ -299,7 +296,7 @@ export default function LiteRenderer(props) {
|
|
|
299
296
|
configData: configData,
|
|
300
297
|
externalEvent: externalEvent,
|
|
301
298
|
onInternalEvent: onInternalEvent
|
|
302
|
-
}, passThrough))))
|
|
299
|
+
}, passThrough))));
|
|
303
300
|
}
|
|
304
301
|
|
|
305
302
|
/* ============================== prop types ============================== */
|
package/es/actions/export.js
CHANGED
|
@@ -8,29 +8,16 @@ import * as verticesActions from "./vertices-actions";
|
|
|
8
8
|
import * as itemsActions from "./items-actions";
|
|
9
9
|
import * as areaActions from "./area-actions";
|
|
10
10
|
import * as groupsActions from "./groups-actions";
|
|
11
|
-
|
|
12
|
-
export {
|
|
13
|
-
projectActions,
|
|
14
|
-
viewer2DActions,
|
|
15
|
-
viewer3DActions,
|
|
16
|
-
linesActions,
|
|
17
|
-
holesActions,
|
|
18
|
-
sceneActions,
|
|
19
|
-
verticesActions,
|
|
20
|
-
itemsActions,
|
|
21
|
-
areaActions,
|
|
22
|
-
groupsActions
|
|
23
|
-
};
|
|
24
|
-
|
|
11
|
+
export { projectActions, viewer2DActions, viewer3DActions, linesActions, holesActions, sceneActions, verticesActions, itemsActions, areaActions, groupsActions };
|
|
25
12
|
export default {
|
|
26
|
-
projectActions,
|
|
27
|
-
viewer2DActions,
|
|
28
|
-
viewer3DActions,
|
|
29
|
-
linesActions,
|
|
30
|
-
holesActions,
|
|
31
|
-
sceneActions,
|
|
32
|
-
verticesActions,
|
|
33
|
-
itemsActions,
|
|
34
|
-
areaActions,
|
|
35
|
-
groupsActions
|
|
36
|
-
};
|
|
13
|
+
projectActions: projectActions,
|
|
14
|
+
viewer2DActions: viewer2DActions,
|
|
15
|
+
viewer3DActions: viewer3DActions,
|
|
16
|
+
linesActions: linesActions,
|
|
17
|
+
holesActions: holesActions,
|
|
18
|
+
sceneActions: sceneActions,
|
|
19
|
+
verticesActions: verticesActions,
|
|
20
|
+
itemsActions: itemsActions,
|
|
21
|
+
areaActions: areaActions,
|
|
22
|
+
groupsActions: groupsActions
|
|
23
|
+
};
|
package/es/catalog/catalog.js
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
|
|
2
2
|
import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
|
|
3
3
|
import _createClass from "@babel/runtime/helpers/esm/createClass";
|
|
4
|
-
import {
|
|
5
|
-
import { UNIT_CENTIMETER, UNIT_INCH } from "../constants";
|
|
4
|
+
import { UNIT_CENTIMETER } from "../constants";
|
|
6
5
|
import { returnReplaceableDeepSearchType } from "../components/viewer2d/utils";
|
|
7
6
|
var Catalog = /*#__PURE__*/function () {
|
|
8
7
|
function Catalog() {
|
|
@@ -19,7 +18,6 @@ var Catalog = /*#__PURE__*/function () {
|
|
|
19
18
|
};
|
|
20
19
|
this.propertyTypes = {};
|
|
21
20
|
this.unit = unit;
|
|
22
|
-
this.registerMultiplePropertyType([['color', PropertyColor, PropertyColor], ['enum', PropertyEnum, PropertyEnum], ['string', PropertyString, PropertyString], ['number', PropertyNumber, PropertyNumber], ['length-measure', PropertyLengthMeasure, PropertyLengthMeasure], ['toggle', PropertyToggle, PropertyToggle], ['checkbox', PropertyCheckbox, PropertyCheckbox], ['hidden', PropertyHidden, PropertyHidden], ['read-only', PropertyReadOnly, PropertyReadOnly]]);
|
|
23
21
|
}
|
|
24
22
|
|
|
25
23
|
/**
|
|
@@ -85,20 +83,6 @@ var Catalog = /*#__PURE__*/function () {
|
|
|
85
83
|
}
|
|
86
84
|
}
|
|
87
85
|
|
|
88
|
-
/**
|
|
89
|
-
* @description Register multiple elements
|
|
90
|
-
* @param {array} [elementArray] Array of elements
|
|
91
|
-
* @return {void}
|
|
92
|
-
*/
|
|
93
|
-
}, {
|
|
94
|
-
key: "registerMultipleElements",
|
|
95
|
-
value: function registerMultipleElements(elementArray) {
|
|
96
|
-
var _this = this;
|
|
97
|
-
elementArray.forEach(function (el) {
|
|
98
|
-
return _this.registerElement(el);
|
|
99
|
-
});
|
|
100
|
-
}
|
|
101
|
-
|
|
102
86
|
/**
|
|
103
87
|
* @description Register a new property
|
|
104
88
|
* @param {string} type Type of property
|
|
@@ -124,9 +108,9 @@ var Catalog = /*#__PURE__*/function () {
|
|
|
124
108
|
}, {
|
|
125
109
|
key: "registerMultiplePropertyType",
|
|
126
110
|
value: function registerMultiplePropertyType(propertyTypeArray) {
|
|
127
|
-
var
|
|
111
|
+
var _this = this;
|
|
128
112
|
propertyTypeArray.forEach(function (el) {
|
|
129
|
-
return
|
|
113
|
+
return _this.registerPropertyType.apply(_this, _toConsumableArray(el));
|
|
130
114
|
});
|
|
131
115
|
}
|
|
132
116
|
|
|
@@ -179,7 +163,7 @@ var Catalog = /*#__PURE__*/function () {
|
|
|
179
163
|
}, {
|
|
180
164
|
key: "registerCategory",
|
|
181
165
|
value: function registerCategory(name, label, childs) {
|
|
182
|
-
var
|
|
166
|
+
var _this2 = this;
|
|
183
167
|
if (this.validateCategory(name, label)) {
|
|
184
168
|
this.categories[name] = {
|
|
185
169
|
name: name,
|
|
@@ -190,7 +174,7 @@ var Catalog = /*#__PURE__*/function () {
|
|
|
190
174
|
this.categories.root.categories.push(this.categories[name]);
|
|
191
175
|
if (childs && childs.length) {
|
|
192
176
|
childs.forEach(function (el) {
|
|
193
|
-
return
|
|
177
|
+
return _this2.addToCategory(name, el);
|
|
194
178
|
});
|
|
195
179
|
}
|
|
196
180
|
return this.categories[name];
|
package/es/components/content.js
CHANGED
|
@@ -7,7 +7,8 @@ import Viewer3DFirstPerson from "./viewer3d/viewer3d-first-person";
|
|
|
7
7
|
// import ProjectConfigurator from './configurator/project-configurator';
|
|
8
8
|
import * as constants from "../constants";
|
|
9
9
|
import Front3D from "./viewer3d/front3D";
|
|
10
|
-
|
|
10
|
+
import { useAppContext } from "../useAppContext";
|
|
11
|
+
export default function Content(_ref) {
|
|
11
12
|
var width = _ref.width,
|
|
12
13
|
height = _ref.height,
|
|
13
14
|
state = _ref.state,
|
|
@@ -18,7 +19,6 @@ export default function Content(_ref, _ref2) {
|
|
|
18
19
|
keyDownEnable = _ref.keyDownEnable,
|
|
19
20
|
catalog = _ref.catalog,
|
|
20
21
|
onInternalEvent = _ref.onInternalEvent;
|
|
21
|
-
var projectActions = _ref2.projectActions;
|
|
22
22
|
var mode = state.get('mode');
|
|
23
23
|
|
|
24
24
|
// Internal Event for unselect_all
|
|
@@ -133,7 +133,4 @@ Content.propTypes = {
|
|
|
133
133
|
height: PropTypes.number.isRequired,
|
|
134
134
|
replaceCabinet: PropTypes.func.isRequired,
|
|
135
135
|
onInternalEvent: PropTypes.func.isRequired
|
|
136
|
-
};
|
|
137
|
-
Content.contextTypes = {
|
|
138
|
-
projectActions: PropTypes.object.isRequired
|
|
139
136
|
};
|
package/es/components/export.js
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import Content from "./content";
|
|
2
2
|
import Viewer2DComponents from "./viewer2d/export";
|
|
3
3
|
import StyleComponents from "./style/export";
|
|
4
|
-
|
|
5
|
-
export {
|
|
6
|
-
|
|
7
|
-
|
|
4
|
+
export { Content, Viewer2DComponents };
|
|
5
|
+
export default {
|
|
6
|
+
Content: Content,
|
|
7
|
+
Viewer2DComponents: Viewer2DComponents,
|
|
8
|
+
StyleComponents: StyleComponents
|
|
9
|
+
};
|
|
@@ -1,31 +1,5 @@
|
|
|
1
|
-
import Button from "./button";
|
|
2
|
-
import CancelButton from "./cancel-button";
|
|
3
|
-
import ContentContainer from "./content-container";
|
|
4
|
-
import ContentTitle from "./content-title";
|
|
5
|
-
import DeleteButton from "./delete-button";
|
|
6
|
-
import FormBlock from "./form-block";
|
|
7
|
-
import FormColorInput from "./form-color-input";
|
|
8
|
-
import FormLabel from "./form-label";
|
|
9
1
|
import FormNumberInput from "./form-number-input";
|
|
10
|
-
|
|
11
|
-
import FormSlider from "./form-slider";
|
|
12
|
-
import FormSubmitButton from "./form-submit-button";
|
|
13
|
-
import FormTextInput from "./form-text-input";
|
|
14
|
-
import FormNumberInput2 from "./form-number-input_2";
|
|
15
|
-
export { Button, CancelButton, ContentContainer, ContentTitle, DeleteButton, FormBlock, FormColorInput, FormLabel, FormNumberInput, FormSelect, FormSlider, FormSubmitButton, FormTextInput, FormNumberInput2 };
|
|
2
|
+
export { FormNumberInput };
|
|
16
3
|
export default {
|
|
17
|
-
|
|
18
|
-
CancelButton: CancelButton,
|
|
19
|
-
ContentContainer: ContentContainer,
|
|
20
|
-
ContentTitle: ContentTitle,
|
|
21
|
-
DeleteButton: DeleteButton,
|
|
22
|
-
FormBlock: FormBlock,
|
|
23
|
-
FormColorInput: FormColorInput,
|
|
24
|
-
FormLabel: FormLabel,
|
|
25
|
-
FormNumberInput: FormNumberInput,
|
|
26
|
-
FormSelect: FormSelect,
|
|
27
|
-
FormSlider: FormSlider,
|
|
28
|
-
FormSubmitButton: FormSubmitButton,
|
|
29
|
-
FormTextInput: FormTextInput,
|
|
30
|
-
FormNumberInput2: FormNumberInput2
|
|
4
|
+
FormNumberInput: FormNumberInput
|
|
31
5
|
};
|
|
@@ -1,18 +1,17 @@
|
|
|
1
|
+
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
1
2
|
import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
|
|
2
3
|
import _createClass from "@babel/runtime/helpers/esm/createClass";
|
|
3
4
|
import _possibleConstructorReturn from "@babel/runtime/helpers/esm/possibleConstructorReturn";
|
|
4
5
|
import _getPrototypeOf from "@babel/runtime/helpers/esm/getPrototypeOf";
|
|
5
6
|
import _inherits from "@babel/runtime/helpers/esm/inherits";
|
|
6
|
-
|
|
7
|
-
var
|
|
7
|
+
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; }
|
|
8
|
+
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
9
|
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
9
10
|
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
10
11
|
import React, { Component } from 'react';
|
|
11
12
|
import PropTypes from 'prop-types';
|
|
12
13
|
import { KEYBOARD_BUTTON_CODE, TEXT_COLOR_NEUTRAL_0, SECONDARY_PURPLE_COLOR, DEFAULT_FONT_FAMILY } from "../../constants";
|
|
13
|
-
import styled from 'styled-components';
|
|
14
14
|
import { isValidNumber } from "../../utils/helper";
|
|
15
|
-
var StyledInput = styled.input(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n display: block;\n padding: 15px 25px 12px 0px;\n width: 120px;\n color: ", ";\n background-color: rgb(255, 255, 255);\n border: 2px solid;\n text-align: right;\n float: right;\n font-family: ", ";\n font-size: 16px;\n font-weight: 600;\n line-height: 17px;\n border-radius: 5px;\n outline: 0;\n :focus {\n border-color: ", ";\n }\n"])), TEXT_COLOR_NEUTRAL_0, DEFAULT_FONT_FAMILY, SECONDARY_PURPLE_COLOR);
|
|
16
15
|
var FormNumberInput = /*#__PURE__*/function (_Component) {
|
|
17
16
|
function FormNumberInput(props, context) {
|
|
18
17
|
var _this;
|
|
@@ -104,13 +103,30 @@ var FormNumberInput = /*#__PURE__*/function (_Component) {
|
|
|
104
103
|
});
|
|
105
104
|
}
|
|
106
105
|
};
|
|
107
|
-
|
|
106
|
+
var baseInputStyle = {
|
|
107
|
+
display: 'block',
|
|
108
|
+
padding: '15px 25px 12px 0px',
|
|
109
|
+
width: '120px',
|
|
110
|
+
color: TEXT_COLOR_NEUTRAL_0,
|
|
111
|
+
backgroundColor: 'rgb(255, 255, 255)',
|
|
112
|
+
border: '2px solid',
|
|
113
|
+
textAlign: 'right',
|
|
114
|
+
"float": 'right',
|
|
115
|
+
fontFamily: DEFAULT_FONT_FAMILY,
|
|
116
|
+
fontSize: '16px',
|
|
117
|
+
fontWeight: 600,
|
|
118
|
+
lineHeight: '17px',
|
|
119
|
+
borderRadius: '5px',
|
|
120
|
+
outline: 0,
|
|
121
|
+
borderColor: this.state.focusOn ? SECONDARY_PURPLE_COLOR : undefined
|
|
122
|
+
};
|
|
123
|
+
return /*#__PURE__*/React.createElement("input", {
|
|
108
124
|
id: "form_number_input",
|
|
109
125
|
autoFocus: this.state.focusOn,
|
|
110
126
|
readOnly: !!this.props.disabled,
|
|
111
127
|
type: "text",
|
|
112
128
|
value: currValue,
|
|
113
|
-
style: style,
|
|
129
|
+
style: _objectSpread(_objectSpread({}, baseInputStyle), style),
|
|
114
130
|
onChange: function onChange(evt) {
|
|
115
131
|
_this2.context.projectActions.copyProperties('ddddd');
|
|
116
132
|
var valid = regexp.test(evt.nativeEvent.target.value);
|
|
@@ -167,11 +183,6 @@ FormNumberInput.propTypes = {
|
|
|
167
183
|
labelName: PropTypes.string,
|
|
168
184
|
isCeiling: PropTypes.string
|
|
169
185
|
};
|
|
170
|
-
FormNumberInput.contextTypes = {
|
|
171
|
-
translator: PropTypes.object.isRequired,
|
|
172
|
-
projectActions: PropTypes.object.isRequired,
|
|
173
|
-
linesActions: PropTypes.object.isRequired
|
|
174
|
-
};
|
|
175
186
|
FormNumberInput.defaultProps = {
|
|
176
187
|
value: 0,
|
|
177
188
|
style: {},
|
|
@@ -2,6 +2,7 @@ import React from 'react';
|
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
3
|
import If from "../../utils/react-if";
|
|
4
4
|
import * as sharedStyles from "../../shared-style";
|
|
5
|
+
import { useAppContext } from "../../useAppContext";
|
|
5
6
|
var cx = 0;
|
|
6
7
|
var cy = 0;
|
|
7
8
|
var radius = 5;
|
|
@@ -10,12 +11,13 @@ var STYLE_CIRCLE = {
|
|
|
10
11
|
stroke: sharedStyles.MATERIAL_COLORS[500].orange,
|
|
11
12
|
cursor: 'default'
|
|
12
13
|
};
|
|
13
|
-
export default function Group(_ref
|
|
14
|
+
export default function Group(_ref) {
|
|
14
15
|
var layer = _ref.layer,
|
|
15
16
|
group = _ref.group,
|
|
16
17
|
scene = _ref.scene,
|
|
17
18
|
catalog = _ref.catalog;
|
|
18
|
-
var
|
|
19
|
+
var _useAppContext = useAppContext(),
|
|
20
|
+
translator = _useAppContext.translator;
|
|
19
21
|
return /*#__PURE__*/React.createElement("g", {
|
|
20
22
|
"data-element-root": true,
|
|
21
23
|
"data-prototype": group.prototype,
|
|
@@ -47,7 +49,4 @@ Group.propTypes = {
|
|
|
47
49
|
layer: PropTypes.object.isRequired,
|
|
48
50
|
scene: PropTypes.object.isRequired,
|
|
49
51
|
catalog: PropTypes.object.isRequired
|
|
50
|
-
};
|
|
51
|
-
Group.contextTypes = {
|
|
52
|
-
translator: PropTypes.object.isRequired
|
|
53
52
|
};
|
|
@@ -7,6 +7,7 @@ import { GeometryUtils } from "../../utils/export";
|
|
|
7
7
|
import { MODE_ROTATING_ITEM, WALL_CABINET_LAYOUTPOS } from "../../constants";
|
|
8
8
|
import { isEmpty, isWarningItem, returnReplaceableDeepSearchType } from "./utils";
|
|
9
9
|
import { findCatalogElement } from "../../utils/geometry";
|
|
10
|
+
import { useAppContext } from "../../useAppContext";
|
|
10
11
|
var STYLE_LINE = {
|
|
11
12
|
fill: '#0096fd',
|
|
12
13
|
stroke: '#0096fd'
|
|
@@ -21,14 +22,15 @@ var STYLE_CIRCLE2 = {
|
|
|
21
22
|
stroke: '#0096fd',
|
|
22
23
|
cursor: 'ew-resize'
|
|
23
24
|
};
|
|
24
|
-
export default function Item(_ref
|
|
25
|
+
export default function Item(_ref) {
|
|
25
26
|
var _element$render2D;
|
|
26
27
|
var layer = _ref.layer,
|
|
27
28
|
item = _ref.item,
|
|
28
29
|
scene = _ref.scene,
|
|
29
30
|
catalog = _ref.catalog,
|
|
30
31
|
mode = _ref.mode;
|
|
31
|
-
var
|
|
32
|
+
var _useAppContext = useAppContext(),
|
|
33
|
+
itemsActions = _useAppContext.itemsActions;
|
|
32
34
|
var x = item.x,
|
|
33
35
|
y = item.y,
|
|
34
36
|
rotation = item.rotation,
|
|
@@ -449,7 +451,4 @@ Item.propTypes = {
|
|
|
449
451
|
layer: PropTypes.object.isRequired,
|
|
450
452
|
scene: PropTypes.object.isRequired,
|
|
451
453
|
catalog: PropTypes.object.isRequired
|
|
452
|
-
};
|
|
453
|
-
Item.contextTypes = {
|
|
454
|
-
itemsActions: PropTypes.object.isRequired
|
|
455
454
|
};
|
|
@@ -116,7 +116,7 @@ export default function Layer(_ref) {
|
|
|
116
116
|
var lineData = [];
|
|
117
117
|
lines.sort(function compare(a, b) {
|
|
118
118
|
return a.createdDateTime - b.createdDateTime;
|
|
119
|
-
}).valueSeq().forEach(function (line) {
|
|
119
|
+
}).valueSeq().forEach(function (line, index) {
|
|
120
120
|
lineData.push(/*#__PURE__*/React.createElement(Line, {
|
|
121
121
|
key: line.id,
|
|
122
122
|
layer: layer,
|
|
@@ -247,11 +247,13 @@ export default function Line(_ref) {
|
|
|
247
247
|
if (!showWallCabinetMeasure || wall_posArray.length <= 2) {
|
|
248
248
|
wallSpace = 0;
|
|
249
249
|
}
|
|
250
|
-
wallRuler = wall_posAndwidth.map(function (pAw) {
|
|
250
|
+
wallRuler = wall_posAndwidth.map(function (pAw, idx) {
|
|
251
251
|
if (pAw.length > 1) {
|
|
252
252
|
if (Math.sin(angle) === 0 || GeometryUtils.almostEqual(y1, y2)) {
|
|
253
253
|
if (x1 - x2 > 0) {
|
|
254
|
-
return /*#__PURE__*/React.createElement("g",
|
|
254
|
+
return /*#__PURE__*/React.createElement("g", {
|
|
255
|
+
key: "wallRuler-".concat(idx)
|
|
256
|
+
}, /*#__PURE__*/React.createElement("line", {
|
|
255
257
|
x1: pAw.pos.x + pAw.length,
|
|
256
258
|
y1: pAw.pos.y,
|
|
257
259
|
x2: pAw.pos.x + pAw.length,
|
|
@@ -273,7 +275,9 @@ export default function Line(_ref) {
|
|
|
273
275
|
style: STYLE_DASH
|
|
274
276
|
}));
|
|
275
277
|
} else {
|
|
276
|
-
return /*#__PURE__*/React.createElement("g",
|
|
278
|
+
return /*#__PURE__*/React.createElement("g", {
|
|
279
|
+
key: "wallRuler-".concat(idx)
|
|
280
|
+
}, /*#__PURE__*/React.createElement("line", {
|
|
277
281
|
x1: pAw.pos.x + pAw.length,
|
|
278
282
|
y1: pAw.pos.y,
|
|
279
283
|
x2: pAw.pos.x + pAw.length,
|
|
@@ -298,7 +302,9 @@ export default function Line(_ref) {
|
|
|
298
302
|
} else {
|
|
299
303
|
if (y1 - y2 > 0) {
|
|
300
304
|
if (x1 - x2 < 0 || GeometryUtils.almostEqual(x1, x2)) {
|
|
301
|
-
return /*#__PURE__*/React.createElement("g",
|
|
305
|
+
return /*#__PURE__*/React.createElement("g", {
|
|
306
|
+
key: "wallRuler-".concat(idx)
|
|
307
|
+
}, /*#__PURE__*/React.createElement("line", {
|
|
302
308
|
x1: pAw.pos.x - pAw.length * Math.cos(angle / 180 * Math.PI),
|
|
303
309
|
y1: pAw.pos.y - pAw.length * Math.sin(angle / 180 * Math.PI),
|
|
304
310
|
x2: pAw.pos.x - pAw.length * Math.cos(angle / 180 * Math.PI) - (thickness / 2 + wallSpace) * Math.sin(angle / 180 * Math.PI),
|
|
@@ -320,7 +326,9 @@ export default function Line(_ref) {
|
|
|
320
326
|
style: STYLE_DASH
|
|
321
327
|
}));
|
|
322
328
|
} else {
|
|
323
|
-
return /*#__PURE__*/React.createElement("g",
|
|
329
|
+
return /*#__PURE__*/React.createElement("g", {
|
|
330
|
+
key: "wallRuler-".concat(idx)
|
|
331
|
+
}, /*#__PURE__*/React.createElement("line", {
|
|
324
332
|
x1: pAw.pos.x,
|
|
325
333
|
y1: pAw.pos.y,
|
|
326
334
|
x2: pAw.pos.x - (thickness / 2 + wallSpace) * Math.sin(angle / 180 * Math.PI),
|
|
@@ -344,7 +352,9 @@ export default function Line(_ref) {
|
|
|
344
352
|
}
|
|
345
353
|
} else {
|
|
346
354
|
if (x1 - x2 < 0 || GeometryUtils.almostEqual(x1, x2)) {
|
|
347
|
-
return /*#__PURE__*/React.createElement("g",
|
|
355
|
+
return /*#__PURE__*/React.createElement("g", {
|
|
356
|
+
key: "wallRuler-".concat(idx)
|
|
357
|
+
}, /*#__PURE__*/React.createElement("line", {
|
|
348
358
|
x1: pAw.pos.x,
|
|
349
359
|
y1: pAw.pos.y,
|
|
350
360
|
x2: pAw.pos.x - (thickness / 2 + wallSpace) * Math.sin(angle / 180 * Math.PI),
|
|
@@ -366,7 +376,9 @@ export default function Line(_ref) {
|
|
|
366
376
|
style: STYLE_DASH
|
|
367
377
|
}));
|
|
368
378
|
} else {
|
|
369
|
-
return /*#__PURE__*/React.createElement("g",
|
|
379
|
+
return /*#__PURE__*/React.createElement("g", {
|
|
380
|
+
key: "wallRuler-".concat(idx)
|
|
381
|
+
}, /*#__PURE__*/React.createElement("line", {
|
|
370
382
|
x1: pAw.pos.x + pAw.length * Math.cos(angle / 180 * Math.PI),
|
|
371
383
|
y1: pAw.pos.y + pAw.length * Math.sin(angle / 180 * Math.PI),
|
|
372
384
|
x2: pAw.pos.x + pAw.length * Math.cos(angle / 180 * Math.PI) - (thickness / 2 + wallSpace) * Math.sin(angle / 180 * Math.PI),
|
|
@@ -459,11 +471,13 @@ export default function Line(_ref) {
|
|
|
459
471
|
if (!showBaseCabinetMeasure || base_posArray.length <= 2) {
|
|
460
472
|
baseSpace -= STEP;
|
|
461
473
|
}
|
|
462
|
-
baseRuler = base_posAndwidth.map(function (pAw) {
|
|
474
|
+
baseRuler = base_posAndwidth.map(function (pAw, idx) {
|
|
463
475
|
if (pAw.length > 1) {
|
|
464
476
|
if (Math.sin(angle) === 0 || GeometryUtils.almostEqual(y1, y2)) {
|
|
465
477
|
if (x1 - x2 > 0) {
|
|
466
|
-
return /*#__PURE__*/React.createElement("g",
|
|
478
|
+
return /*#__PURE__*/React.createElement("g", {
|
|
479
|
+
key: "baseRuler-".concat(idx)
|
|
480
|
+
}, /*#__PURE__*/React.createElement("line", {
|
|
467
481
|
x1: pAw.pos.x + pAw.length,
|
|
468
482
|
y1: pAw.pos.y,
|
|
469
483
|
x2: pAw.pos.x + pAw.length,
|
|
@@ -485,7 +499,9 @@ export default function Line(_ref) {
|
|
|
485
499
|
style: STYLE_DASH
|
|
486
500
|
}));
|
|
487
501
|
} else {
|
|
488
|
-
return /*#__PURE__*/React.createElement("g",
|
|
502
|
+
return /*#__PURE__*/React.createElement("g", {
|
|
503
|
+
key: "baseRuler-".concat(idx)
|
|
504
|
+
}, /*#__PURE__*/React.createElement("line", {
|
|
489
505
|
x1: pAw.pos.x + pAw.length,
|
|
490
506
|
y1: pAw.pos.y,
|
|
491
507
|
x2: pAw.pos.x + pAw.length,
|
|
@@ -510,7 +526,9 @@ export default function Line(_ref) {
|
|
|
510
526
|
} else {
|
|
511
527
|
if (y1 - y2 > 0) {
|
|
512
528
|
if (x1 - x2 < 0 || GeometryUtils.almostEqual(x1, x2)) {
|
|
513
|
-
return /*#__PURE__*/React.createElement("g",
|
|
529
|
+
return /*#__PURE__*/React.createElement("g", {
|
|
530
|
+
key: "baseRuler-".concat(idx)
|
|
531
|
+
}, /*#__PURE__*/React.createElement("line", {
|
|
514
532
|
x1: pAw.pos.x - pAw.length * Math.cos(angle / 180 * Math.PI),
|
|
515
533
|
y1: pAw.pos.y - pAw.length * Math.sin(angle / 180 * Math.PI),
|
|
516
534
|
x2: pAw.pos.x - pAw.length * Math.cos(angle / 180 * Math.PI) - (thickness / 2 + baseSpace) * Math.sin(angle / 180 * Math.PI),
|
|
@@ -532,7 +550,9 @@ export default function Line(_ref) {
|
|
|
532
550
|
style: STYLE_DASH
|
|
533
551
|
}));
|
|
534
552
|
} else {
|
|
535
|
-
return /*#__PURE__*/React.createElement("g",
|
|
553
|
+
return /*#__PURE__*/React.createElement("g", {
|
|
554
|
+
key: "baseRuler-".concat(idx)
|
|
555
|
+
}, /*#__PURE__*/React.createElement("line", {
|
|
536
556
|
x1: pAw.pos.x,
|
|
537
557
|
y1: pAw.pos.y,
|
|
538
558
|
x2: pAw.pos.x - (thickness / 2 + baseSpace) * Math.sin(angle / 180 * Math.PI),
|
|
@@ -556,7 +576,9 @@ export default function Line(_ref) {
|
|
|
556
576
|
}
|
|
557
577
|
} else {
|
|
558
578
|
if (x1 - x2 < 0 || GeometryUtils.almostEqual(x1, x2)) {
|
|
559
|
-
return /*#__PURE__*/React.createElement("g",
|
|
579
|
+
return /*#__PURE__*/React.createElement("g", {
|
|
580
|
+
key: "baseRuler-".concat(idx)
|
|
581
|
+
}, /*#__PURE__*/React.createElement("line", {
|
|
560
582
|
x1: pAw.pos.x,
|
|
561
583
|
y1: pAw.pos.y,
|
|
562
584
|
x2: pAw.pos.x - (thickness / 2 + baseSpace) * Math.sin(angle / 180 * Math.PI),
|
|
@@ -578,7 +600,9 @@ export default function Line(_ref) {
|
|
|
578
600
|
style: STYLE_DASH
|
|
579
601
|
}));
|
|
580
602
|
} else {
|
|
581
|
-
return /*#__PURE__*/React.createElement("g",
|
|
603
|
+
return /*#__PURE__*/React.createElement("g", {
|
|
604
|
+
key: "baseRuler-".concat(idx)
|
|
605
|
+
}, /*#__PURE__*/React.createElement("line", {
|
|
582
606
|
x1: pAw.pos.x + pAw.length * Math.cos(angle / 180 * Math.PI),
|
|
583
607
|
y1: pAw.pos.y + pAw.length * Math.sin(angle / 180 * Math.PI),
|
|
584
608
|
x2: pAw.pos.x + pAw.length * Math.cos(angle / 180 * Math.PI) - (thickness / 2 + baseSpace) * Math.sin(angle / 180 * Math.PI),
|
|
@@ -652,7 +676,9 @@ export default function Line(_ref) {
|
|
|
652
676
|
//the space from the dimensioning line to the bottom
|
|
653
677
|
var lineSpacedimension2 = 14;
|
|
654
678
|
if (compareVertices(vertex0, vertex1) >= 0 && vertex0.x !== vertex1.x) {
|
|
655
|
-
renderedRuler.push(/*#__PURE__*/React.createElement("g",
|
|
679
|
+
renderedRuler.push(/*#__PURE__*/React.createElement("g", {
|
|
680
|
+
key: 'ruler_' + line.id
|
|
681
|
+
}, /*#__PURE__*/React.createElement("line", {
|
|
656
682
|
x1: length,
|
|
657
683
|
y1: lineSpace + lineSpacedimension1,
|
|
658
684
|
x2: length,
|
|
@@ -674,7 +700,9 @@ export default function Line(_ref) {
|
|
|
674
700
|
style: STYLE_ROOM_SHAPE
|
|
675
701
|
})));
|
|
676
702
|
} else {
|
|
677
|
-
renderedRuler.push(/*#__PURE__*/React.createElement("g",
|
|
703
|
+
renderedRuler.push(/*#__PURE__*/React.createElement("g", {
|
|
704
|
+
key: 'ruler_' + line.id
|
|
705
|
+
}, /*#__PURE__*/React.createElement("line", {
|
|
678
706
|
x1: 0,
|
|
679
707
|
y1: lineSpace + lineSpacedimension1,
|
|
680
708
|
x2: 0,
|
|
@@ -773,7 +801,9 @@ export default function Line(_ref) {
|
|
|
773
801
|
}
|
|
774
802
|
});
|
|
775
803
|
}
|
|
776
|
-
return /*#__PURE__*/React.createElement("g",
|
|
804
|
+
return /*#__PURE__*/React.createElement("g", {
|
|
805
|
+
key: line.id
|
|
806
|
+
}, /*#__PURE__*/React.createElement("g", {
|
|
777
807
|
transform: "translate(".concat(x1, ", ").concat(y1, ") rotate(").concat(angle, ", 0, 0)"),
|
|
778
808
|
"data-element-root": true,
|
|
779
809
|
"data-prototype": 'ruler',
|