kitchen-simulator 1.1.1-test.7 → 1.1.1-test.71
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/KitchenConfigurator.js +34 -54
- package/es/KitchenConfiguratorApp.js +63 -81
- package/es/actions/holes-actions.js +1 -1
- package/es/actions/items-actions.js +1 -1
- package/es/actions/lines-actions.js +1 -1
- package/es/actions/project-actions.js +1 -1
- package/es/actions/scene-actions.js +1 -1
- package/es/actions/vertices-actions.js +1 -1
- package/es/actions/viewer2d-actions.js +1 -1
- package/es/actions/viewer3d-actions.js +1 -1
- package/es/catalog/areas/area/planner-element.js +10 -7
- package/es/catalog/catalog.js +3 -12
- package/es/catalog/factories/area-factory.js +1 -4
- package/es/catalog/factories/wall-factory-3d.js +1 -1
- package/es/catalog/holes/export.js +13 -13
- package/es/catalog/lines/wall/planner-element.js +13 -10
- package/es/catalog/properties/property-checkbox.js +64 -22
- package/es/catalog/properties/property-enum.js +52 -15
- package/es/catalog/properties/property-lenght-measure.js +4 -5
- package/es/catalog/properties/property-length-measure.js +55 -12
- package/es/catalog/properties/property-length-measure_hole.js +4 -5
- package/es/catalog/utils/FuseUtils.js +3 -6
- package/es/catalog/utils/exporter.js +2 -5
- package/es/catalog/utils/item-loader.js +4 -11
- package/es/catalog/utils/mtl-loader.js +3 -2
- package/es/catalog/utils/obj-loader.js +3 -2
- package/es/class/FuseUtils.js +3 -6
- package/es/class/area.js +4 -8
- package/es/class/group.js +6 -15
- package/es/class/guide.js +2 -6
- package/es/class/hole.js +7 -12
- package/es/class/item.js +12 -23
- package/es/class/layer.js +4 -8
- package/es/class/line.js +3 -12
- package/es/class/project.js +7 -11
- package/es/class/vertex.js +3 -7
- package/es/components/content.js +1 -0
- package/es/components/disclaimer/disclaimer.js +66 -86
- package/es/components/style/button.js +7 -14
- package/es/components/style/cancel-button.js +2 -3
- package/es/components/style/content-container.js +1 -4
- package/es/components/style/content-title.js +3 -7
- package/es/components/style/delete-button.js +2 -3
- package/es/components/style/form-block.js +3 -7
- package/es/components/style/form-color-input.js +2 -3
- package/es/components/style/form-label.js +3 -7
- package/es/components/style/form-number-input.js +36 -18
- package/es/components/style/form-number-input_2.js +6 -12
- package/es/components/style/form-select.js +50 -11
- package/es/components/style/form-slider.js +24 -9
- package/es/components/style/form-submit-button.js +2 -3
- package/es/components/style/form-text-input.js +38 -26
- package/es/components/viewer2d/area.js +4 -4
- package/es/components/viewer2d/grids/grid-horizontal-streak.js +0 -1
- package/es/components/viewer2d/grids/grid-streak.js +0 -1
- package/es/components/viewer2d/grids/grid-vertical-streak.js +0 -1
- package/es/components/viewer2d/grids/grids.js +1 -6
- package/es/components/viewer2d/item.js +4 -11
- package/es/components/viewer2d/line.js +2 -5
- package/es/components/viewer2d/ruler.js +2 -3
- package/es/components/viewer2d/rulerDist.js +1 -1
- package/es/components/viewer2d/rulerX.js +6 -12
- package/es/components/viewer2d/rulerY.js +6 -12
- package/es/components/viewer2d/scene.js +15 -27
- package/es/components/viewer2d/state.js +1 -6
- package/es/components/viewer2d/utils.js +33 -2
- package/es/components/viewer2d/viewer2d.js +13 -18
- package/es/components/viewer3d/camera-controls-module/camera-controls.module.js +6 -13
- package/es/components/viewer3d/front3D.js +1 -6
- package/es/components/viewer3d/libs/mtl-loader.js +2 -2
- package/es/components/viewer3d/libs/obj-loader.js +2 -2
- package/es/components/viewer3d/libs/orbit-controls.js +6 -5
- package/es/components/viewer3d/libs/pointer-lock-controls.js +5 -4
- package/es/components/viewer3d/ruler-utils/itemRect.js +1 -1
- package/es/components/viewer3d/ruler-utils/layer3D.js +2 -2
- package/es/components/viewer3d/ruler-utils/ruler3D.js +1 -4
- package/es/components/viewer3d/ruler-utils/scene3D.js +2 -3
- package/es/components/viewer3d/scene-creator.js +5 -11
- package/es/components/viewer3d/viewer3d-first-person.js +5 -11
- package/es/components/viewer3d/viewer3d.js +19 -26
- package/es/index.js +13 -14
- package/es/models.js +10 -15
- package/es/plugins/console-debugger.js +1 -4
- package/es/plugins/keyboard.js +2 -2
- package/es/reducers/holes-reducer.js +1 -1
- package/es/reducers/items-reducer.js +2 -5
- package/es/reducers/lines-reducer.js +1 -1
- package/es/reducers/project-reducer.js +1 -1
- package/es/reducers/reducer.js +2 -2
- package/es/reducers/scene-reducer.js +1 -1
- package/es/reducers/user-reducer.js +1 -2
- package/es/reducers/vertices-reducer.js +1 -1
- package/es/reducers/viewer2d-reducer.js +2 -2
- package/es/reducers/viewer3d-reducer.js +2 -2
- package/es/translator/translator.js +2 -6
- package/es/utils/convert-units-lite.js +29 -0
- package/es/utils/geometry.js +7 -16
- package/es/utils/get-edges-of-subgraphs.js +2 -1
- package/es/utils/graph-cycles.js +2 -3
- package/es/utils/graph.js +4 -7
- package/es/utils/helper.js +3 -73
- package/es/utils/id-broker.js +4 -8
- package/es/utils/molding.js +36 -42
- package/es/utils/name-generator.js +2 -6
- package/es/utils/objects-utils.js +1 -1
- package/es/utils/process-black-list.js +1 -4
- package/es/utils/snap-scene.js +1 -6
- package/es/utils/snap.js +6 -12
- package/es/utils/threeCSG.es6.js +2 -6
- package/lib/@history.js +3 -2
- package/lib/AppContext.js +3 -2
- package/lib/KitchenConfigurator.js +70 -88
- package/lib/KitchenConfiguratorApp.js +98 -113
- package/lib/actions/export.js +1 -1
- package/lib/catalog/areas/area/planner-element.js +13 -8
- package/lib/catalog/catalog.js +9 -16
- package/lib/catalog/factories/area-factory-3d.js +1 -1
- package/lib/catalog/factories/area-factory.js +6 -7
- package/lib/catalog/factories/export.js +1 -1
- package/lib/catalog/factories/wall-factory-3d.js +4 -4
- package/lib/catalog/factories/wall-factory.js +4 -3
- package/lib/catalog/holes/door-closet/planner-element.js +4 -3
- package/lib/catalog/holes/door-double/planner-element.js +4 -3
- package/lib/catalog/holes/door-exterior/planner-element.js +4 -3
- package/lib/catalog/holes/door-interior/planner-element.js +4 -3
- package/lib/catalog/holes/door-panic/planner-element.js +4 -3
- package/lib/catalog/holes/door-panic-double/planner-element.js +4 -3
- package/lib/catalog/holes/door-sliding/planner-element.js +4 -3
- package/lib/catalog/holes/doorway-framed/planner-element.js +4 -3
- package/lib/catalog/holes/doorway-frameless/planner-element.js +4 -3
- package/lib/catalog/holes/export.js +14 -14
- package/lib/catalog/holes/window-clear/planner-element.js +4 -3
- package/lib/catalog/holes/window-cross/planner-element.js +4 -3
- package/lib/catalog/holes/window-double-hung/planner-element.js +4 -3
- package/lib/catalog/holes/window-vertical/planner-element.js +4 -3
- package/lib/catalog/lines/wall/planner-element.js +16 -11
- package/lib/catalog/molding/molding-dcm/planner-element.js +4 -3
- package/lib/catalog/molding/molding-fbm/planner-element.js +4 -3
- package/lib/catalog/molding/molding-lrm/planner-element.js +4 -3
- package/lib/catalog/properties/export.js +1 -1
- package/lib/catalog/properties/property-checkbox.js +68 -25
- package/lib/catalog/properties/property-color.js +3 -2
- package/lib/catalog/properties/property-enum.js +54 -16
- package/lib/catalog/properties/property-hidden.js +3 -2
- package/lib/catalog/properties/property-lenght-measure.js +10 -10
- package/lib/catalog/properties/property-length-measure.js +61 -17
- package/lib/catalog/properties/property-length-measure_hole.js +10 -10
- package/lib/catalog/properties/property-number.js +3 -2
- package/lib/catalog/properties/property-read-only.js +3 -2
- package/lib/catalog/properties/property-string.js +3 -2
- package/lib/catalog/properties/property-toggle.js +3 -2
- package/lib/catalog/properties/shared-property-style.js +2 -1
- package/lib/catalog/utils/FuseUtils.js +10 -11
- package/lib/catalog/utils/exporter.js +10 -12
- package/lib/catalog/utils/geom-utils.js +1 -1
- package/lib/catalog/utils/item-loader.js +29 -35
- package/lib/catalog/utils/mtl-loader.js +7 -3
- package/lib/catalog/utils/obj-loader.js +7 -3
- package/lib/class/FuseUtils.js +10 -11
- package/lib/class/area.js +9 -11
- package/lib/class/export.js +1 -1
- package/lib/class/group.js +13 -20
- package/lib/class/guide.js +9 -12
- package/lib/class/hole.js +7 -9
- package/lib/class/item.js +25 -35
- package/lib/class/layer.js +7 -9
- package/lib/class/line.js +14 -20
- package/lib/class/project.js +10 -11
- package/lib/class/vertex.js +9 -11
- package/lib/components/content.js +5 -3
- package/lib/components/disclaimer/disclaimer.js +69 -88
- package/lib/components/export.js +1 -1
- package/lib/components/style/button.js +17 -22
- package/lib/components/style/cancel-button.js +7 -7
- package/lib/components/style/content-container.js +5 -7
- package/lib/components/style/content-title.js +10 -12
- package/lib/components/style/delete-button.js +8 -8
- package/lib/components/style/export.js +1 -1
- package/lib/components/style/form-block.js +9 -12
- package/lib/components/style/form-color-input.js +7 -7
- package/lib/components/style/form-label.js +9 -12
- package/lib/components/style/form-number-input.js +43 -23
- package/lib/components/style/form-number-input_2.js +15 -19
- package/lib/components/style/form-select.js +53 -15
- package/lib/components/style/form-slider.js +28 -12
- package/lib/components/style/form-submit-button.js +8 -8
- package/lib/components/style/form-text-input.js +46 -32
- package/lib/components/viewer2d/area.js +8 -7
- package/lib/components/viewer2d/export.js +1 -1
- package/lib/components/viewer2d/grids/grid-horizontal-streak.js +3 -3
- package/lib/components/viewer2d/grids/grid-streak.js +3 -3
- package/lib/components/viewer2d/grids/grid-vertical-streak.js +3 -3
- package/lib/components/viewer2d/grids/grids.js +6 -10
- package/lib/components/viewer2d/group.js +4 -3
- package/lib/components/viewer2d/item.js +14 -19
- package/lib/components/viewer2d/layer.js +3 -2
- package/lib/components/viewer2d/line.js +4 -7
- package/lib/components/viewer2d/ruler.js +9 -9
- package/lib/components/viewer2d/rulerDist.js +7 -6
- package/lib/components/viewer2d/rulerX.js +15 -19
- package/lib/components/viewer2d/rulerY.js +15 -19
- package/lib/components/viewer2d/scene.js +24 -34
- package/lib/components/viewer2d/snap.js +4 -3
- package/lib/components/viewer2d/state.js +7 -11
- package/lib/components/viewer2d/utils.js +35 -2
- package/lib/components/viewer2d/vertex.js +4 -3
- package/lib/components/viewer2d/viewer2d.js +40 -41
- package/lib/components/viewer3d/camera-controls-module/camera-controls.module.js +14 -20
- package/lib/components/viewer3d/dcm.js +2 -1
- package/lib/components/viewer3d/fbm.js +2 -1
- package/lib/components/viewer3d/front3D.js +6 -10
- package/lib/components/viewer3d/grid-creator.js +4 -3
- package/lib/components/viewer3d/grids/grid-horizontal-streak.js +3 -2
- package/lib/components/viewer3d/grids/grid-streak.js +3 -2
- package/lib/components/viewer3d/grids/grid-vertical-streak.js +3 -2
- package/lib/components/viewer3d/libs/mtl-loader.js +7 -2
- package/lib/components/viewer3d/libs/obj-loader.js +7 -2
- package/lib/components/viewer3d/libs/orbit-controls.js +10 -5
- package/lib/components/viewer3d/libs/pointer-lock-controls.js +9 -4
- package/lib/components/viewer3d/lrm.js +2 -1
- package/lib/components/viewer3d/pointer-lock-navigation.js +1 -1
- package/lib/components/viewer3d/ruler-utils/itemRect.js +10 -9
- package/lib/components/viewer3d/ruler-utils/layer3D.js +35 -34
- package/lib/components/viewer3d/ruler-utils/ruler3D.js +5 -7
- package/lib/components/viewer3d/ruler-utils/scene3D.js +4 -5
- package/lib/components/viewer3d/ruler-utils/state3D.js +3 -2
- package/lib/components/viewer3d/scene-creator.js +40 -45
- package/lib/components/viewer3d/three-memory-cleaner.js +1 -1
- package/lib/components/viewer3d/viewer3d-first-person.js +13 -17
- package/lib/components/viewer3d/viewer3d.js +34 -38
- package/lib/index.js +16 -88
- package/lib/models.js +58 -63
- package/lib/plugins/autosave.js +2 -1
- package/lib/plugins/console-debugger.js +5 -7
- package/lib/plugins/export.js +1 -1
- package/lib/plugins/keyboard.js +2 -1
- package/lib/reducers/areas-reducer.js +2 -1
- package/lib/reducers/export.js +1 -1
- package/lib/reducers/groups-reducer.js +2 -1
- package/lib/reducers/holes-reducer.js +2 -1
- package/lib/reducers/items-reducer.js +2 -1
- package/lib/reducers/lines-reducer.js +2 -1
- package/lib/reducers/project-reducer.js +2 -1
- package/lib/reducers/scene-reducer.js +2 -1
- package/lib/reducers/user-reducer.js +2 -2
- package/lib/reducers/vertices-reducer.js +2 -1
- package/lib/reducers/viewer2d-reducer.js +5 -5
- package/lib/reducers/viewer3d-reducer.js +5 -5
- package/lib/styles/export.js +1 -1
- package/lib/translator/en.js +2 -1
- package/lib/translator/it.js +2 -1
- package/lib/translator/ru.js +2 -1
- package/lib/translator/translator.js +7 -10
- package/lib/utils/convert-units-lite.js +35 -0
- package/lib/utils/export.js +2 -2
- package/lib/utils/geometry.js +20 -28
- package/lib/utils/get-edges-of-subgraphs.js +7 -1
- package/lib/utils/graph-cycles.js +9 -9
- package/lib/utils/graph-inner-cycles.js +1 -1
- package/lib/utils/graph.js +15 -12
- package/lib/utils/helper.js +14 -83
- package/lib/utils/history.js +1 -1
- package/lib/utils/id-broker.js +7 -10
- package/lib/utils/molding.js +66 -71
- package/lib/utils/name-generator.js +7 -9
- package/lib/utils/objects-utils.js +5 -3
- package/lib/utils/process-black-list.js +3 -5
- package/lib/utils/react-if.js +3 -2
- package/lib/utils/snap-scene.js +3 -7
- package/lib/utils/snap.js +22 -26
- package/lib/utils/threeCSG.es6.js +16 -15
- package/package.json +26 -54
- package/es/analytics/ga4.js +0 -191
- package/es/analytics/posthog.js +0 -60
- package/lib/analytics/ga4.js +0 -197
- package/lib/analytics/posthog.js +0 -68
package/es/models.js
CHANGED
|
@@ -1,24 +1,18 @@
|
|
|
1
|
-
|
|
1
|
+
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
2
|
+
import _createClass from "@babel/runtime/helpers/esm/createClass";
|
|
3
|
+
import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
|
|
4
|
+
import _possibleConstructorReturn from "@babel/runtime/helpers/esm/possibleConstructorReturn";
|
|
5
|
+
import _getPrototypeOf from "@babel/runtime/helpers/esm/getPrototypeOf";
|
|
6
|
+
import _inherits from "@babel/runtime/helpers/esm/inherits";
|
|
2
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; }
|
|
3
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; }
|
|
4
|
-
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
5
|
-
function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }
|
|
6
|
-
function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
|
|
7
|
-
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
8
|
-
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
9
|
-
function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
|
|
10
9
|
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
11
|
-
function _possibleConstructorReturn(t, e) { if (e && ("object" == _typeof(e) || "function" == typeof e)) return e; if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined"); return _assertThisInitialized(t); }
|
|
12
|
-
function _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e; }
|
|
13
10
|
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
14
|
-
|
|
15
|
-
function _inherits(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && _setPrototypeOf(t, e); }
|
|
16
|
-
function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }
|
|
17
|
-
import { Record, List, Map, fromJS } from 'immutable';
|
|
11
|
+
import { fromJS, List, Map, Record } from 'immutable';
|
|
18
12
|
import { MODE_IDLE, UNIT_INCH } from "./constants";
|
|
19
13
|
import { SNAP_MASK } from "./utils/snap";
|
|
20
14
|
import { isEmpty } from "./utils/helper";
|
|
21
|
-
import convert from
|
|
15
|
+
import { convert } from "./utils/convert-units-lite";
|
|
22
16
|
var safeLoadMapList = function safeLoadMapList(mapList, Model, defaultMap) {
|
|
23
17
|
return mapList ? new Map(mapList).map(function (m) {
|
|
24
18
|
return new Model(m);
|
|
@@ -507,4 +501,5 @@ export var State = /*#__PURE__*/function (_Record12) {
|
|
|
507
501
|
userId: 0,
|
|
508
502
|
isHelp: false,
|
|
509
503
|
isCabinetDrawing: false
|
|
510
|
-
}, 'State'));
|
|
504
|
+
}, 'State'));
|
|
505
|
+
export default State;
|
|
@@ -1,9 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
2
2
|
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; }
|
|
3
3
|
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; }
|
|
4
|
-
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
5
|
-
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
6
|
-
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
7
4
|
import actions from "../actions/export";
|
|
8
5
|
export default function consoleDebugger() {
|
|
9
6
|
return function (store, stateExtractor) {
|
package/es/plugins/keyboard.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { KEYBOARD_BUTTON_CODE, MODE_3D_FIRST_PERSON, MODE_3D_VIEW, MODE_DRAGGING_ITEM_3D, MODE_DRAWING_ITEM, MODE_DRAWING_ITEM_3D, MODE_IDLE, MODE_IDLE_3D, MODE_ROTATING_ITEM_3D, MODE_SNAPPING } from "../constants";
|
|
2
|
+
import { copyProperties, pasteProperties, recreate, redo, remove, rollback, shift2doff, shift2don, toggleSnap, uncreate, undo } from "../actions/project-actions";
|
|
3
3
|
export default function keyboard() {
|
|
4
4
|
return function (store, stateExtractor) {
|
|
5
5
|
window.addEventListener('keydown', function (event) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Hole } from "../class/export";
|
|
2
2
|
import { history } from "../utils/export";
|
|
3
|
-
import {
|
|
3
|
+
import { BEGIN_DRAGGING_HOLE, BEGIN_DRAGGING_HOLE_3D, END_CREATING_HOLE, END_DRAGGING_HOLE, END_DRAGGING_HOLE_3D, END_DRAWING_HOLE, END_DRAWING_HOLE_3D, SELECT_HOLE, SELECT_TOOL_DRAWING_HOLE, SELECT_TOOL_DRAWING_HOLE_3D, UPDATE_DRAGGING_HOLE, UPDATE_DRAGGING_HOLE_CHANGED, UPDATE_DRAGGING_HOLE_RULER_CHANGED, UPDATE_DRAWING_HOLE, UPDATE_DRAWING_HOLE_3D, UPDATE_POPUP_OPEN } from "../constants";
|
|
4
4
|
export default function (state, action) {
|
|
5
5
|
switch (action.type) {
|
|
6
6
|
case UPDATE_DRAGGING_HOLE_RULER_CHANGED:
|
|
@@ -1,9 +1,6 @@
|
|
|
1
|
-
import { Item
|
|
1
|
+
import { Item } from "../class/export";
|
|
2
2
|
import { history } from "../utils/export";
|
|
3
|
-
import {
|
|
4
|
-
// SET_MOVE_STATUS,
|
|
5
|
-
// SET_ROTATE_STATUS
|
|
6
|
-
} from "../constants";
|
|
3
|
+
import { ANIMATE_OBJECT, BEGIN_DRAGGING_ITEM, BEGIN_DRAGGING_ITEM_3D, BEGIN_ROTATING_ITEM, BEGIN_ROTATING_ITEM_3D, DUPLICATE_SELECTED, EDIT_WIDTH, END_CREATING_CABINET, END_DRAGGING_ITEM, END_DRAGGING_ITEM_3D, END_DRAWING_ITEM, END_LOADING, END_ROTATING_ITEM, END_ROTATING_ITEM_3D, ITEM_MOVE_UP, REMOVE_REPLACE_SUBMODULE, REPLACE_ITEM, REPLACE_SUBMODULE, SELECT_ITEM, SELECT_TOOL_DRAWING_ITEM, SELECT_TOOL_DRAWING_ITEM_3D, SET_APPLIANCE_MATERIAL, SET_BACKSPLASH, SET_BACKSPLASH_VISIBLE, SET_COUNTER_TOP, SET_DOOR_HANDLE, SET_DOOR_STYLE, SET_HANDLE_MATERIAL, SET_INITIAL_DOOR_STYLE, SET_MODELLING, SET_MOLDING, SET_WALL_COLOR, STORE_DIST_ARRAY, TOGGLE_LOADING_CABINET, UPDATE_DRAGGING_ITEM, UPDATE_DRAGGING_ITEM_3DX, UPDATE_DRAGGING_ITEM_3DY, UPDATE_DRAGGING_ITEM_CHANGED, UPDATE_DRAWING_ITEM, UPDATE_ITEM_POSITION, UPDATE_MOLDING, UPDATE_POPUP_OPEN, UPDATE_ROTATING_ITEM, UPDATE_ROTATING_ITEM_CHANGED, VALIDATE_ITEM_POSTIONS } from "../constants";
|
|
7
4
|
export default function (state, action) {
|
|
8
5
|
switch (action.type) {
|
|
9
6
|
case STORE_DIST_ARRAY:
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Line } from "../class/export";
|
|
2
2
|
import { history } from "../utils/export";
|
|
3
|
-
import {
|
|
3
|
+
import { BEGIN_DRAGGING_LINE, BEGIN_DRAWING_LINE, END_DRAGGING_LINE, END_DRAWING_LINE, SELECT_LINE, SELECT_TOOL_DRAWING_LINE, SET_RELATED_LINE, STOP_DRAWING_LINE, UPDATE_DRAGGING_LINE, UPDATE_DRAWING_LINE } from "../constants";
|
|
4
4
|
export default function (state, action) {
|
|
5
5
|
switch (action.type) {
|
|
6
6
|
case SELECT_TOOL_DRAWING_LINE:
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { history } from "../utils/export";
|
|
2
|
-
import {
|
|
2
|
+
import { ADD_CIRCULAR_GUIDE, ADD_HORIZONTAL_GUIDE, ADD_VERTICAL_GUIDE, ALTERATE_STATE, CHANGE_CATALOG_PAGE, COPY_PROPERTIES, GO_BACK_TO_CATALOG_PAGE, INIT_CATALOG, LOAD_PROJECT, MODE_DRAWING_LINE, MODE_IDLE, NEW_PROJECT, OPEN_CATALOG, OPEN_PROJECT_CONFIGURATOR, PASTE_PROPERTIES, PROJECT_RE_NAME, PUSH_LAST_SELECTED_CATALOG_ELEMENT_TO_HISTORY, RECREATE, REDO, REMOVE, REMOVE_CIRCULAR_GUIDE, REMOVE_DRAWING_SUPPORT, REMOVE_HORIZONTAL_GUIDE, REMOVE_VERTICAL_GUIDE, ROLLBACK, SELECT_ALL, SELECT_TOOL_EDIT, SET_HOLES_ATTRIBUTES, SET_IS_CABINET_DRAWING, SET_IS_HELP, SET_ITEMS_ATTRIBUTES, SET_LINES_ATTRIBUTES, SET_MODE, SET_PROJECT_ID, SET_PROJECT_PROPERTIES, SET_PROPERTIES, SET_STATE_PROPERTIES, SHIFT2DOFF, SHIFT2DON, THROW_ERROR, THROW_WARNING, TOGGLE_SNAP, UNCREATE, UNDO, UNSELECT_ALL, UPDATE_MOUSE_COORDS, UPDATE_ZOOM_SCALE } from "../constants";
|
|
3
3
|
import { Project } from "../class/export";
|
|
4
4
|
export default function (state, action) {
|
|
5
5
|
switch (action.type) {
|
package/es/reducers/reducer.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { KitchenConfiguratorAreasReducer, KitchenConfiguratorHolesReducer, KitchenConfiguratorItemsReducer, KitchenConfiguratorLinesReducer,
|
|
1
|
+
import { AREA_ACTIONS, GROUP_ACTIONS, HOLE_ACTIONS, ITEMS_ACTIONS, LINE_ACTIONS, PROJECT_ACTIONS, SCENE_ACTIONS, USER_ACTIONS, VERTEX_ACTIONS, VIEWER2D_ACTIONS, VIEWER3D_ACTIONS } from "../constants";
|
|
2
|
+
import { KitchenConfiguratorAreasReducer, KitchenConfiguratorGroupsReducer, KitchenConfiguratorHolesReducer, KitchenConfiguratorItemsReducer, KitchenConfiguratorLinesReducer, KitchenConfiguratorProjectReducer, KitchenConfiguratorSceneReducer, KitchenConfiguratorUserReducer, KitchenConfiguratorVerticesReducer, KitchenConfiguratorViewer2dReducer, KitchenConfiguratorViewer3dReducer } from "./export";
|
|
3
3
|
import { State } from "../models";
|
|
4
4
|
export var initialState = new State();
|
|
5
5
|
export default function appReducer(state, action) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Layer } from "../class/export";
|
|
2
2
|
import { history } from "../utils/export";
|
|
3
|
-
import { ADD_LAYER, SELECT_LAYER, SET_LAYER_PROPERTIES,
|
|
3
|
+
import { ADD_LAYER, REMOVE_LAYER, SELECT_LAYER, SET_LAYER_PROPERTIES, UPDATE_MOVING_STATE } from "../constants";
|
|
4
4
|
export default function (state, action) {
|
|
5
5
|
var saveHistory = function saveHistory() {
|
|
6
6
|
return state = state.merge({
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { BEGIN_DRAGGING_VERTEX,
|
|
1
|
+
import { BEGIN_DRAGGING_VERTEX, END_DRAGGING_VERTEX, UPDATE_DRAGGING_VERTEX } from "../constants";
|
|
2
2
|
import { history } from "../utils/export";
|
|
3
3
|
import { Vertex } from "../class/export";
|
|
4
4
|
export default function (state, action) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import convert from
|
|
1
|
+
import { CHANGE_BASE_CABINET_MEASURE, CHANGE_WALL_CABINET_MEASURE, CHANGE_WALL_LENGTH_MEASURE, CHANGE_WINDOW_DOOR_MEASURE, MODE_2D_PAN, MODE_2D_ZOOM_IN, MODE_2D_ZOOM_OUT, SELECT_TOOL_PAN, SELECT_TOOL_ZOOM_IN, SELECT_TOOL_ZOOM_OUT, UPDATE_2D_CAMERA, UPDATE_CEIL_HEIGHT, UPDATE_CEIL_HEIGHT_UNIT } from "../constants";
|
|
2
|
+
import { convert } from "../utils/convert-units-lite";
|
|
3
3
|
export default function (state, action) {
|
|
4
4
|
var _state = state,
|
|
5
5
|
scene = _state.scene;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { MODE_3D_VIEW,
|
|
1
|
+
import { MODE_3D_FIRST_PERSON, MODE_3D_VIEW, SELECT_TOOL_3D_FIRST_PERSON, SELECT_TOOL_3D_VIEW, UPDATE_3D_CEIL_HEIGHT, UPDATE_3D_CEIL_HEIGHT_UNIT } from "../constants";
|
|
2
2
|
import { Project } from "../class/export";
|
|
3
3
|
import { history } from "../utils/export";
|
|
4
|
-
import convert from
|
|
4
|
+
import { convert } from "../utils/convert-units-lite";
|
|
5
5
|
export default function (state, action) {
|
|
6
6
|
state = state.merge({
|
|
7
7
|
sceneHistory: history.historyPush(state.sceneHistory, state.scene)
|
|
@@ -1,9 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }
|
|
4
|
-
function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
|
|
5
|
-
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
6
|
-
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
1
|
+
import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
|
|
2
|
+
import _createClass from "@babel/runtime/helpers/esm/createClass";
|
|
7
3
|
import EN from "./en";
|
|
8
4
|
import IT from "./it";
|
|
9
5
|
import RU from "./ru";
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
var lengthFactors = {
|
|
2
|
+
m: 1,
|
|
3
|
+
cm: 100,
|
|
4
|
+
mm: 1000,
|
|
5
|
+
"in": 39.3701,
|
|
6
|
+
ft: 3.28084,
|
|
7
|
+
m2: 1,
|
|
8
|
+
cm2: 10000,
|
|
9
|
+
// (100^2)
|
|
10
|
+
mm2: 1000000,
|
|
11
|
+
// (1000^2)
|
|
12
|
+
in2: 1550.0031,
|
|
13
|
+
// (39.3701^2)
|
|
14
|
+
ft2: 10.7639 // (3.28084^2)
|
|
15
|
+
};
|
|
16
|
+
export function convert(value) {
|
|
17
|
+
return {
|
|
18
|
+
from: function from(fromUnit) {
|
|
19
|
+
return {
|
|
20
|
+
to: function to(toUnit) {
|
|
21
|
+
if (!(fromUnit in lengthFactors) || !(toUnit in lengthFactors)) {
|
|
22
|
+
throw new Error("Unsupported unit conversion: ".concat(fromUnit, " \u2192 ").concat(toUnit));
|
|
23
|
+
}
|
|
24
|
+
return value / lengthFactors[fromUnit] * lengthFactors[toUnit];
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
}
|
package/es/utils/geometry.js
CHANGED
|
@@ -1,20 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
function _iterableToArray(r) { if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r); }
|
|
5
|
-
function _arrayWithoutHoles(r) { if (Array.isArray(r)) return _arrayLikeToArray(r); }
|
|
1
|
+
import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
|
|
2
|
+
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
3
|
+
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
6
4
|
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; }
|
|
7
5
|
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
|
-
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
9
|
-
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
10
|
-
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
11
6
|
function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; }
|
|
12
|
-
function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
|
|
13
|
-
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
14
7
|
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
15
8
|
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
16
|
-
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
17
|
-
function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
|
|
18
9
|
/** @description Determines the distance between two points
|
|
19
10
|
* @param {number} x0 Vertex 0 x
|
|
20
11
|
* @param {number} y0 Vertex 0 y
|
|
@@ -22,9 +13,9 @@ function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
|
|
|
22
13
|
* @param {number} y1 Vertex 1 y
|
|
23
14
|
* @return {number}
|
|
24
15
|
*/
|
|
25
|
-
import {
|
|
26
|
-
import { BASE_CABINET_LAYOUTPOS, EPSILON, LINE_THICKNESS, MEPSILON, OVERLAP_INCLUDED, OVERLAP_LINK, OVERLAP_NONE, OVERLAP_SAME, OVERLAP_SOME,
|
|
27
|
-
import convert from
|
|
16
|
+
import { fAbs, toFixedFloat } from "./math.js";
|
|
17
|
+
import { BASE_CABINET_LAYOUTPOS, EPSILON, LINE_THICKNESS, MEPSILON, OVERLAP_INCLUDED, OVERLAP_LINK, OVERLAP_NONE, OVERLAP_SAME, OVERLAP_SOME, UNIT_ANGLE, WALL_CABINET_LAYOUTPOS } from "../constants";
|
|
18
|
+
import { convert } from "./convert-units-lite";
|
|
28
19
|
import * as Three from 'three';
|
|
29
20
|
import { returnReplaceableDeepSearchType } from "../components/viewer2d/utils.js";
|
|
30
21
|
import { isEmpty } from "./helper.js";
|
|
@@ -2042,7 +2033,7 @@ export function isRightWall(v0, v1) {
|
|
|
2042
2033
|
* OVERLAP_LINK: two lines are linked at the common point, so they can be merged to one line
|
|
2043
2034
|
* OVERLAP_INCLUDED: destLine includes srcLine
|
|
2044
2035
|
* OVERLAP_SOME: two lines are overlapped with some common range, then returns the trimmed segments of srcLine
|
|
2045
|
-
*
|
|
2036
|
+
*
|
|
2046
2037
|
* //////// test - start /////////////
|
|
2047
2038
|
const p1 = { x1: 1413.1313131313132, y1: 1044.949494949495 };
|
|
2048
2039
|
const p2 = { x1: 1476.2626262626263, y1: 1108.0808080808079 };
|
package/es/utils/graph-cycles.js
CHANGED
|
@@ -200,9 +200,8 @@ function find_inner_cycles(V, EV) {
|
|
|
200
200
|
ev_mapping: cycles.ev_mapping
|
|
201
201
|
};
|
|
202
202
|
}
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
module.exports = find_inner_cycles;
|
|
203
|
+
export default find_inner_cycles;
|
|
204
|
+
export { find_inner_cycles, find_cycles, compute_ev_mapping, compute_incidences };
|
|
206
205
|
|
|
207
206
|
/**
|
|
208
207
|
* DATA
|
package/es/utils/graph.js
CHANGED
|
@@ -1,9 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
|
|
4
|
-
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
5
|
-
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
6
|
-
function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
|
|
1
|
+
import _createClass from "@babel/runtime/helpers/esm/createClass";
|
|
2
|
+
import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
|
|
7
3
|
//JS porting of this code http://www.geeksforgeeks.org/biconnected-components/
|
|
8
4
|
|
|
9
5
|
function create_array(length) {
|
|
@@ -146,4 +142,5 @@ var Graph = /*#__PURE__*/function () {
|
|
|
146
142
|
}
|
|
147
143
|
}]);
|
|
148
144
|
}();
|
|
149
|
-
|
|
145
|
+
export default Graph;
|
|
146
|
+
export { Graph, Edge, create_array };
|
package/es/utils/helper.js
CHANGED
|
@@ -1,87 +1,17 @@
|
|
|
1
|
-
|
|
1
|
+
import _typeof from "@babel/runtime/helpers/esm/typeof";
|
|
2
|
+
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
2
3
|
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; }
|
|
3
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; }
|
|
4
|
-
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
5
|
-
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
6
|
-
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
7
5
|
import { HDRCubeTextureLoader } from 'three/examples/jsm/loaders/HDRCubeTextureLoader.js';
|
|
8
6
|
import { ANIMATE_OBJECT_OPEN_DOOR_ROTATION_UNIT, ANIMATE_STEP_MAX, DECIMAL_PLACES_2, HDR_URLS, MODE_ELEVATION_VIEW } from "../constants";
|
|
9
7
|
import * as Three from 'three';
|
|
10
8
|
import { returnReplaceableDeepSearchType } from "./../components/viewer2d/utils";
|
|
11
|
-
import convert from
|
|
9
|
+
import { convert } from "./convert-units-lite";
|
|
12
10
|
import { formatNumber } from "./math";
|
|
13
|
-
var AWS = require('aws-sdk');
|
|
14
|
-
var s3 = new AWS.S3({
|
|
15
|
-
accessKeyId: process.env.REACT_APP_AWS_ID,
|
|
16
|
-
secretAccessKey: process.env.REACT_APP_AWS_SECRET
|
|
17
|
-
});
|
|
18
|
-
var s3ParseUrl = function s3ParseUrl(url) {
|
|
19
|
-
var _decodedUrl = decodeURIComponent(url);
|
|
20
|
-
var _result = null;
|
|
21
|
-
|
|
22
|
-
// http://s3.amazonaws.com/bucket/key1/key2
|
|
23
|
-
var match = decodedUrl.match(/^https?:\/\/s3.amazonaws.com\/([^\/]+)\/?(.*?)$/);
|
|
24
|
-
if (_match) {
|
|
25
|
-
_result = {
|
|
26
|
-
bucket: _match[1],
|
|
27
|
-
key: _match[2],
|
|
28
|
-
region: ''
|
|
29
|
-
};
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
// http://s3-aws-region.amazonaws.com/bucket/key1/key2
|
|
33
|
-
match = decodedUrl.match(/^https?:\/\/s3-([^.]+).amazonaws.com\/([^\/]+)\/?(.*?)$/);
|
|
34
|
-
if (_match) {
|
|
35
|
-
_result = {
|
|
36
|
-
bucket: _match[2],
|
|
37
|
-
key: _match[3],
|
|
38
|
-
region: _match[1]
|
|
39
|
-
};
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
// http://bucket.s3.amazonaws.com/key1/key2
|
|
43
|
-
match = decodedUrl.match(/^https?:\/\/([^.]+).s3.amazonaws.com\/?(.*?)$/);
|
|
44
|
-
if (_match) {
|
|
45
|
-
_result = {
|
|
46
|
-
bucket: _match[1],
|
|
47
|
-
key: _match[2],
|
|
48
|
-
region: ''
|
|
49
|
-
};
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
// http://bucket.s3-aws-region.amazonaws.com/key1/key2 or,
|
|
53
|
-
// http://bucket.s3.aws-region.amazonaws.com/key1/key2
|
|
54
|
-
match = decodedUrl.match(/^https?:\/\/([^.]+).(?:s3-|s3\.)([^.]+).amazonaws.com\/?(.*?)$/);
|
|
55
|
-
if (_match) {
|
|
56
|
-
_result = {
|
|
57
|
-
bucket: _match[1],
|
|
58
|
-
key: _match[3],
|
|
59
|
-
region: _match[2]
|
|
60
|
-
};
|
|
61
|
-
}
|
|
62
|
-
return _result;
|
|
63
|
-
};
|
|
64
11
|
export var textureCube = new HDRCubeTextureLoader().setPath('/catalog/envMap/').load(HDR_URLS, function () {
|
|
65
12
|
textureCube.magFilter = Three.LinearFilter;
|
|
66
13
|
textureCube.needsUpdate = true;
|
|
67
14
|
});
|
|
68
|
-
export var getSignedUrl = function getSignedUrl(url) {
|
|
69
|
-
if (!url) return url;
|
|
70
|
-
var signedUrl = url;
|
|
71
|
-
try {
|
|
72
|
-
var _s3ParseUrl = s3ParseUrl(url),
|
|
73
|
-
bucket = _s3ParseUrl.bucket,
|
|
74
|
-
key = _s3ParseUrl.key;
|
|
75
|
-
signedUrl = s3.getSignedUrl('getObject', {
|
|
76
|
-
Bucket: bucket,
|
|
77
|
-
Key: key,
|
|
78
|
-
ResponseCacheControl: 'no-cache'
|
|
79
|
-
});
|
|
80
|
-
} catch (e) {
|
|
81
|
-
signedUrl = url;
|
|
82
|
-
}
|
|
83
|
-
return signedUrl;
|
|
84
|
-
};
|
|
85
15
|
export var base64Decode = function base64Decode(targetStr) {
|
|
86
16
|
if (!targetStr) return null;
|
|
87
17
|
try {
|
package/es/utils/id-broker.js
CHANGED
|
@@ -1,10 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
|
|
5
|
-
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
6
|
-
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
7
|
-
var shortid = require('shortid');
|
|
1
|
+
import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
|
|
2
|
+
import _createClass from "@babel/runtime/helpers/esm/createClass";
|
|
3
|
+
import { nanoid } from 'nanoid';
|
|
8
4
|
export var IDBroker = /*#__PURE__*/function () {
|
|
9
5
|
function IDBroker() {
|
|
10
6
|
_classCallCheck(this, IDBroker);
|
|
@@ -12,7 +8,7 @@ export var IDBroker = /*#__PURE__*/function () {
|
|
|
12
8
|
return _createClass(IDBroker, null, [{
|
|
13
9
|
key: "acquireID",
|
|
14
10
|
value: function acquireID() {
|
|
15
|
-
return
|
|
11
|
+
return nanoid();
|
|
16
12
|
}
|
|
17
13
|
}]);
|
|
18
14
|
}();
|
package/es/utils/molding.js
CHANGED
|
@@ -1,19 +1,13 @@
|
|
|
1
|
-
|
|
1
|
+
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
2
|
+
import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
|
|
2
3
|
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; }
|
|
3
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; }
|
|
4
|
-
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
5
|
-
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
6
|
-
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
7
|
-
function _toConsumableArray(r) { return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread(); }
|
|
8
|
-
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
9
|
-
function _iterableToArray(r) { if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r); }
|
|
10
|
-
function _arrayWithoutHoles(r) { if (Array.isArray(r)) return _arrayLikeToArray(r); }
|
|
11
5
|
function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; }
|
|
12
6
|
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
13
7
|
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
14
8
|
import { BASE_CABINET_LAYOUTPOS, BOTTOM_MOLDING_LOCATION, EPSILON, MIDDLE_MOLDING_LOCATION, MOLDING_LOCATIONS, OVERLAP_INCLUDED, OVERLAP_LINK, OVERLAP_SAME, OVERLAP_SOME, TALL_CABINET_LAYOUTPOS, TOP_MOLDING_LOCATION, WALL_CABINET_LAYOUTPOS } from "../constants";
|
|
15
9
|
import * as Three from 'three';
|
|
16
|
-
import convert from
|
|
10
|
+
import { convert } from "./convert-units-lite";
|
|
17
11
|
import IDBroker from "./id-broker";
|
|
18
12
|
import { returnReplaceableDeepSearchType } from "../components/viewer2d/utils";
|
|
19
13
|
import { GeometryUtils } from "./export";
|
|
@@ -69,16 +63,16 @@ export function isEnableItemForMolding(layer, selItem) {
|
|
|
69
63
|
else return result && hasMoldingLayout(molding, selItem.layoutpos);
|
|
70
64
|
}
|
|
71
65
|
|
|
72
|
-
/**
|
|
73
|
-
* Check two line segments are overlap. The direction of the two line segments must be opposite.
|
|
74
|
-
* s1 c2 s2 c1
|
|
75
|
-
* |--------|------|-----------|
|
|
76
|
-
* Decision Formular: L(s1,c1) + L(s2, c2) = L(s1, s2) + L(c1, c2)
|
|
77
|
-
* @param {*} selRectPos1
|
|
78
|
-
* @param {*} selRectPos2
|
|
79
|
-
* @param {*} curRectPos1
|
|
80
|
-
* @param {*} curRectPos2
|
|
81
|
-
* @returns L(s1,c1) + L(s2, c2) - L(s1, s2) - L(c1, c2)
|
|
66
|
+
/**
|
|
67
|
+
* Check two line segments are overlap. The direction of the two line segments must be opposite.
|
|
68
|
+
* s1 c2 s2 c1
|
|
69
|
+
* |--------|------|-----------|
|
|
70
|
+
* Decision Formular: L(s1,c1) + L(s2, c2) = L(s1, s2) + L(c1, c2)
|
|
71
|
+
* @param {*} selRectPos1
|
|
72
|
+
* @param {*} selRectPos2
|
|
73
|
+
* @param {*} curRectPos1
|
|
74
|
+
* @param {*} curRectPos2
|
|
75
|
+
* @returns L(s1,c1) + L(s2, c2) - L(s1, s2) - L(c1, c2)
|
|
82
76
|
*/
|
|
83
77
|
function getDelta(selRectPos1, selRectPos2, curRectPos1, curRectPos2) {
|
|
84
78
|
return (
|
|
@@ -168,11 +162,11 @@ function tryMergeItemWithLocation(curItem, itemGroup, location) {
|
|
|
168
162
|
});
|
|
169
163
|
}
|
|
170
164
|
|
|
171
|
-
/**
|
|
172
|
-
* Make the molding group array with [items].
|
|
173
|
-
* @param {*} layer
|
|
174
|
-
* @param {*} items - Mergable snapped item group, if [items] is null then get all MG array of layer
|
|
175
|
-
* @returns MG array
|
|
165
|
+
/**
|
|
166
|
+
* Make the molding group array with [items].
|
|
167
|
+
* @param {*} layer
|
|
168
|
+
* @param {*} items - Mergable snapped item group, if [items] is null then get all MG array of layer
|
|
169
|
+
* @returns MG array
|
|
176
170
|
*/
|
|
177
171
|
export function getAllMoldingGroups(layer) {
|
|
178
172
|
var items = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
|
|
@@ -347,12 +341,12 @@ export function mergeOverlappedLines(line1, line2) {
|
|
|
347
341
|
}
|
|
348
342
|
}
|
|
349
343
|
|
|
350
|
-
/**
|
|
351
|
-
* Get the contour line array of moldingGroup items
|
|
352
|
-
* @param {*} moldingGroup
|
|
353
|
-
* @param {*} layer
|
|
354
|
-
* @param {*} catalog
|
|
355
|
-
* @returns contour line array of moldingGroup items
|
|
344
|
+
/**
|
|
345
|
+
* Get the contour line array of moldingGroup items
|
|
346
|
+
* @param {*} moldingGroup
|
|
347
|
+
* @param {*} layer
|
|
348
|
+
* @param {*} catalog
|
|
349
|
+
* @returns contour line array of moldingGroup items
|
|
356
350
|
*/
|
|
357
351
|
export function getLinesFromItems2(moldingGroup, layer, catalog) {
|
|
358
352
|
// wall lines
|
|
@@ -507,13 +501,13 @@ export function getLinesFromItems2(moldingGroup, layer, catalog) {
|
|
|
507
501
|
return newMGlines;
|
|
508
502
|
}
|
|
509
503
|
|
|
510
|
-
/**
|
|
511
|
-
* Get the line that colinear linked with [line], and merge them to a new line
|
|
512
|
-
* @param {*} line
|
|
513
|
-
* @param {*} MGlines
|
|
514
|
-
* @returns
|
|
515
|
-
* - returns merged new line
|
|
516
|
-
* - returns filtered new line group (remove linked line from [MGlines])
|
|
504
|
+
/**
|
|
505
|
+
* Get the line that colinear linked with [line], and merge them to a new line
|
|
506
|
+
* @param {*} line
|
|
507
|
+
* @param {*} MGlines
|
|
508
|
+
* @returns
|
|
509
|
+
* - returns merged new line
|
|
510
|
+
* - returns filtered new line group (remove linked line from [MGlines])
|
|
517
511
|
*/
|
|
518
512
|
function getMergedLine(line, MGlines, cnt) {
|
|
519
513
|
try {
|
|
@@ -566,11 +560,11 @@ function getMergedLine(line, MGlines, cnt) {
|
|
|
566
560
|
}
|
|
567
561
|
}
|
|
568
562
|
|
|
569
|
-
/**
|
|
570
|
-
* Get the contour line segments from [lineSegs]
|
|
571
|
-
* @param {*} lineSegs
|
|
572
|
-
* @param {*} otherLines
|
|
573
|
-
* @returns
|
|
563
|
+
/**
|
|
564
|
+
* Get the contour line segments from [lineSegs]
|
|
565
|
+
* @param {*} lineSegs
|
|
566
|
+
* @param {*} otherLines
|
|
567
|
+
* @returns
|
|
574
568
|
*/
|
|
575
569
|
function getTrimmedContourLineSegs(lineSegs, otherLines, cnt) {
|
|
576
570
|
try {
|
|
@@ -1,9 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }
|
|
4
|
-
function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
|
|
5
|
-
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
6
|
-
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
1
|
+
import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
|
|
2
|
+
import _createClass from "@babel/runtime/helpers/esm/createClass";
|
|
7
3
|
var NameGenerator = /*#__PURE__*/function () {
|
|
8
4
|
function NameGenerator() {
|
|
9
5
|
_classCallCheck(this, NameGenerator);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
import _typeof from "@babel/runtime/helpers/esm/typeof";
|
|
2
2
|
import * as Three from 'three';
|
|
3
3
|
String.prototype.isLeftPlaceholder = function () {
|
|
4
4
|
return this.match(/_L$|_L_\d$/) != null;
|
|
@@ -1,9 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
2
2
|
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; }
|
|
3
3
|
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; }
|
|
4
|
-
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
5
|
-
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
6
|
-
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
7
4
|
export var buildCurrentCabinetObject = function buildCurrentCabinetObject(cabinet, texture) {
|
|
8
5
|
return {
|
|
9
6
|
type: cabinet.name,
|
package/es/utils/snap-scene.js
CHANGED
|
@@ -1,9 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
3
|
-
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
4
|
-
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
5
|
-
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
6
|
-
function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
|
|
1
|
+
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
7
2
|
import { SNAP_POINT, SNAP_LINE, SNAP_SEGMENT, SNAP_GRID, SNAP_GUIDE, addPointSnap, addLineSnap, addLineSegmentSnap, addGridSnap } from "./snap";
|
|
8
3
|
import { GeometryUtils } from "./export";
|
|
9
4
|
import { Map, List } from 'immutable';
|