kitchen-simulator 1.1.1-test.6 → 1.1.1-test.61
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/@history.js +10 -2
- package/es/AppContext.js +10 -3
- package/es/KitchenConfigurator.js +95 -106
- package/es/KitchenConfiguratorApp.js +145 -154
- package/es/actions/area-actions.js +12 -5
- package/es/actions/export.js +29 -12
- package/es/actions/groups-actions.js +45 -27
- package/es/actions/holes-actions.js +55 -34
- package/es/actions/items-actions.js +145 -94
- package/es/actions/lines-actions.js +36 -21
- package/es/actions/project-actions.js +145 -94
- package/es/actions/scene-actions.js +21 -11
- package/es/actions/vertices-actions.js +15 -7
- package/es/actions/viewer2d-actions.js +36 -21
- package/es/actions/viewer3d-actions.js +18 -9
- package/es/catalog/areas/area/planner-element.js +18 -8
- package/es/catalog/catalog.js +21 -24
- package/es/catalog/factories/area-factory-3d.js +31 -22
- package/es/catalog/factories/area-factory.js +20 -14
- package/es/catalog/factories/export.js +24 -6
- package/es/catalog/factories/wall-factory-3d.js +41 -31
- package/es/catalog/factories/wall-factory.js +31 -21
- package/es/catalog/holes/door-closet/planner-element.js +24 -15
- package/es/catalog/holes/door-double/planner-element.js +24 -15
- package/es/catalog/holes/door-exterior/planner-element.js +25 -16
- package/es/catalog/holes/door-interior/planner-element.js +25 -16
- package/es/catalog/holes/door-panic/planner-element.js +16 -7
- package/es/catalog/holes/door-panic-double/planner-element.js +24 -15
- package/es/catalog/holes/door-sliding/planner-element.js +25 -16
- package/es/catalog/holes/doorway-framed/planner-element.js +20 -11
- package/es/catalog/holes/doorway-frameless/planner-element.js +16 -7
- package/es/catalog/holes/export.js +97 -13
- package/es/catalog/holes/window-clear/planner-element.js +19 -10
- package/es/catalog/holes/window-cross/planner-element.js +19 -10
- package/es/catalog/holes/window-double-hung/planner-element.js +19 -10
- package/es/catalog/holes/window-vertical/planner-element.js +19 -10
- package/es/catalog/lines/wall/planner-element.js +21 -11
- package/es/catalog/molding/molding-dcm/planner-element.js +14 -5
- package/es/catalog/molding/molding-fbm/planner-element.js +14 -5
- package/es/catalog/molding/molding-lrm/planner-element.js +14 -5
- package/es/catalog/properties/export.js +80 -20
- package/es/catalog/properties/property-checkbox.js +84 -35
- package/es/catalog/properties/property-color.js +23 -16
- package/es/catalog/properties/property-enum.js +72 -28
- package/es/catalog/properties/property-hidden.js +16 -9
- package/es/catalog/properties/property-lenght-measure.js +45 -39
- package/es/catalog/properties/property-length-measure.js +84 -34
- package/es/catalog/properties/property-length-measure_hole.js +45 -39
- package/es/catalog/properties/property-number.js +24 -17
- package/es/catalog/properties/property-read-only.js +23 -16
- package/es/catalog/properties/property-string.js +23 -16
- package/es/catalog/properties/property-toggle.js +23 -16
- package/es/catalog/properties/shared-property-style.js +7 -1
- package/es/catalog/utils/FuseUtils.js +15 -11
- package/es/catalog/utils/exporter.js +15 -11
- package/es/catalog/utils/geom-utils.js +29 -13
- package/es/catalog/utils/item-loader.js +97 -91
- package/es/catalog/utils/load-obj.js +28 -20
- package/es/catalog/utils/mtl-loader.js +9 -3
- package/es/catalog/utils/obj-loader.js +9 -3
- package/es/class/FuseUtils.js +15 -11
- package/es/class/area.js +28 -26
- package/es/class/export.js +95 -23
- package/es/class/group.js +59 -62
- package/es/class/guide.js +21 -19
- package/es/class/hole.js +89 -88
- package/es/class/item.js +150 -155
- package/es/class/layer.js +65 -63
- package/es/class/line.js +143 -144
- package/es/class/project.js +98 -94
- package/es/class/vertex.js +35 -33
- package/es/components/content.js +29 -19
- package/es/components/disclaimer/disclaimer.js +80 -92
- package/es/components/export.js +32 -8
- package/es/components/style/button.js +31 -30
- package/es/components/style/cancel-button.js +14 -8
- package/es/components/style/content-container.js +16 -12
- package/es/components/style/content-title.js +20 -15
- package/es/components/style/delete-button.js +17 -9
- package/es/components/style/export.js +120 -30
- package/es/components/style/form-block.js +15 -12
- package/es/components/style/form-color-input.js +14 -8
- package/es/components/style/form-label.js +15 -12
- package/es/components/style/form-number-input.js +73 -47
- package/es/components/style/form-number-input_2.js +44 -42
- package/es/components/style/form-select.js +60 -14
- package/es/components/style/form-slider.js +38 -16
- package/es/components/style/form-submit-button.js +17 -9
- package/es/components/style/form-text-input.js +57 -37
- package/es/components/viewer2d/area.js +24 -17
- package/es/components/viewer2d/export.js +120 -30
- package/es/components/viewer2d/grids/grid-horizontal-streak.js +17 -11
- package/es/components/viewer2d/grids/grid-streak.js +17 -11
- package/es/components/viewer2d/grids/grid-vertical-streak.js +17 -11
- package/es/components/viewer2d/grids/grids.js +19 -15
- package/es/components/viewer2d/group.js +24 -15
- package/es/components/viewer2d/item.js +70 -68
- package/es/components/viewer2d/layer.js +30 -23
- package/es/components/viewer2d/line.js +111 -104
- package/es/components/viewer2d/ruler.js +29 -23
- package/es/components/viewer2d/rulerDist.js +28 -21
- package/es/components/viewer2d/rulerX.js +47 -45
- package/es/components/viewer2d/rulerY.js +45 -43
- package/es/components/viewer2d/scene.js +42 -46
- package/es/components/viewer2d/snap.js +22 -13
- package/es/components/viewer2d/state.js +27 -23
- package/es/components/viewer2d/utils.js +65 -21
- package/es/components/viewer2d/vertex.js +17 -8
- package/es/components/viewer2d/viewer2d.js +171 -166
- package/es/components/viewer3d/camera-controls-module/camera-controls.module.js +23 -24
- package/es/components/viewer3d/dcm.js +7 -1
- package/es/components/viewer3d/fbm.js +7 -1
- package/es/components/viewer3d/front3D.js +21 -17
- package/es/components/viewer3d/grid-creator.js +17 -8
- package/es/components/viewer3d/grids/grid-horizontal-streak.js +14 -6
- package/es/components/viewer3d/grids/grid-streak.js +13 -5
- package/es/components/viewer3d/grids/grid-vertical-streak.js +14 -6
- package/es/components/viewer3d/libs/first-person-controls.js +9 -2
- package/es/components/viewer3d/libs/helvetiker_regular.typeface.js +7 -1
- package/es/components/viewer3d/libs/mtl-loader.js +8 -2
- package/es/components/viewer3d/libs/obj-loader.js +8 -2
- package/es/components/viewer3d/libs/orbit-controls.js +12 -5
- package/es/components/viewer3d/libs/pointer-lock-controls.js +11 -4
- package/es/components/viewer3d/lrm.js +7 -1
- package/es/components/viewer3d/model.js +7 -1
- package/es/components/viewer3d/pointer-lock-navigation.js +10 -3
- package/es/components/viewer3d/ruler-utils/itemRect.js +25 -18
- package/es/components/viewer3d/ruler-utils/layer3D.js +66 -59
- package/es/components/viewer3d/ruler-utils/ruler3D.js +46 -42
- package/es/components/viewer3d/ruler-utils/scene3D.js +18 -11
- package/es/components/viewer3d/ruler-utils/state3D.js +11 -4
- package/es/components/viewer3d/scene-creator.js +227 -198
- package/es/components/viewer3d/three-memory-cleaner.js +12 -3
- package/es/components/viewer3d/viewer3d-first-person.js +46 -46
- package/es/components/viewer3d/viewer3d.js +208 -209
- package/es/constants.js +358 -349
- package/es/index.js +28 -15
- package/es/models.js +185 -183
- package/es/plugins/SVGLoader.js +53 -48
- package/es/plugins/autosave.js +9 -3
- package/es/plugins/console-debugger.js +12 -8
- package/es/plugins/export.js +32 -8
- package/es/plugins/keyboard.js +35 -29
- package/es/reducers/areas-reducer.js +13 -7
- package/es/reducers/export.js +96 -24
- package/es/reducers/groups-reducer.js +37 -31
- package/es/reducers/holes-reducer.js +49 -43
- package/es/reducers/items-reducer.js +112 -109
- package/es/reducers/lines-reducer.js +34 -28
- package/es/reducers/project-reducer.js +111 -105
- package/es/reducers/reducer.js +23 -16
- package/es/reducers/scene-reducer.js +21 -15
- package/es/reducers/user-reducer.js +11 -6
- package/es/reducers/vertices-reducer.js +17 -11
- package/es/reducers/viewer2d-reducer.js +24 -18
- package/es/reducers/viewer3d-reducer.js +22 -16
- package/es/shared-style.js +16 -10
- package/es/styles/export.js +11 -3
- package/es/translator/en.js +7 -1
- package/es/translator/it.js +7 -1
- package/es/translator/ru.js +7 -1
- package/es/translator/translator.js +19 -17
- package/es/utils/browser.js +9 -2
- package/es/utils/convert-units-lite.js +35 -0
- package/es/utils/email-validator.js +7 -1
- package/es/utils/export.js +46 -15
- package/es/utils/geometry.js +279 -191
- package/es/utils/get-edges-of-subgraphs.js +9 -1
- package/es/utils/graph-cycles.js +11 -9
- package/es/utils/graph-inner-cycles.js +18 -10
- package/es/utils/graph.js +17 -12
- package/es/utils/helper.js +63 -109
- package/es/utils/history.js +15 -8
- package/es/utils/id-broker.js +15 -12
- package/es/utils/logger.js +7 -1
- package/es/utils/math.js +12 -5
- package/es/utils/molding.js +177 -158
- package/es/utils/name-generator.js +13 -11
- package/es/utils/objects-utils.js +19 -7
- package/es/utils/phone-validator.js +7 -1
- package/es/utils/process-black-list.js +10 -6
- package/es/utils/react-if.js +12 -6
- package/es/utils/snap-scene.js +34 -32
- package/es/utils/snap.js +59 -51
- package/es/utils/summarizeCart.js +7 -1
- package/es/utils/threeCSG.es6.js +22 -17
- package/es/version.js +7 -1
- package/lib/@history.js +1 -1
- package/lib/AppContext.js +1 -1
- package/lib/KitchenConfigurator.js +68 -87
- package/lib/KitchenConfiguratorApp.js +94 -110
- package/lib/actions/export.js +1 -1
- package/lib/catalog/areas/area/planner-element.js +12 -8
- package/lib/catalog/catalog.js +7 -15
- package/lib/catalog/factories/area-factory-3d.js +1 -1
- package/lib/catalog/factories/area-factory.js +4 -6
- 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 +2 -2
- package/lib/catalog/holes/door-closet/planner-element.js +2 -2
- package/lib/catalog/holes/door-double/planner-element.js +2 -2
- package/lib/catalog/holes/door-exterior/planner-element.js +2 -2
- package/lib/catalog/holes/door-interior/planner-element.js +2 -2
- package/lib/catalog/holes/door-panic/planner-element.js +2 -2
- package/lib/catalog/holes/door-panic-double/planner-element.js +2 -2
- package/lib/catalog/holes/door-sliding/planner-element.js +2 -2
- package/lib/catalog/holes/doorway-framed/planner-element.js +2 -2
- package/lib/catalog/holes/doorway-frameless/planner-element.js +2 -2
- package/lib/catalog/holes/export.js +14 -14
- package/lib/catalog/holes/window-clear/planner-element.js +2 -2
- package/lib/catalog/holes/window-cross/planner-element.js +2 -2
- package/lib/catalog/holes/window-double-hung/planner-element.js +2 -2
- package/lib/catalog/holes/window-vertical/planner-element.js +2 -2
- package/lib/catalog/lines/wall/planner-element.js +15 -11
- package/lib/catalog/molding/molding-dcm/planner-element.js +2 -2
- package/lib/catalog/molding/molding-fbm/planner-element.js +2 -2
- package/lib/catalog/molding/molding-lrm/planner-element.js +2 -2
- package/lib/catalog/properties/export.js +1 -1
- package/lib/catalog/properties/property-checkbox.js +66 -24
- package/lib/catalog/properties/property-color.js +1 -1
- package/lib/catalog/properties/property-enum.js +52 -15
- package/lib/catalog/properties/property-hidden.js +1 -1
- package/lib/catalog/properties/property-lenght-measure.js +8 -9
- package/lib/catalog/properties/property-length-measure.js +59 -16
- package/lib/catalog/properties/property-length-measure_hole.js +8 -9
- package/lib/catalog/properties/property-number.js +1 -1
- package/lib/catalog/properties/property-read-only.js +1 -1
- package/lib/catalog/properties/property-string.js +1 -1
- package/lib/catalog/properties/property-toggle.js +1 -1
- package/lib/catalog/utils/FuseUtils.js +8 -10
- package/lib/catalog/utils/exporter.js +8 -11
- 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 +8 -10
- package/lib/class/area.js +7 -10
- package/lib/class/export.js +1 -1
- package/lib/class/group.js +11 -19
- package/lib/class/guide.js +9 -12
- package/lib/class/hole.js +5 -8
- package/lib/class/item.js +23 -34
- package/lib/class/layer.js +5 -8
- package/lib/class/line.js +12 -19
- package/lib/class/project.js +8 -10
- package/lib/class/vertex.js +7 -10
- package/lib/components/content.js +3 -2
- package/lib/components/disclaimer/disclaimer.js +67 -87
- package/lib/components/export.js +1 -1
- package/lib/components/style/button.js +15 -21
- package/lib/components/style/cancel-button.js +5 -6
- package/lib/components/style/content-container.js +3 -6
- package/lib/components/style/content-title.js +8 -11
- package/lib/components/style/delete-button.js +6 -7
- package/lib/components/style/export.js +1 -1
- package/lib/components/style/form-block.js +7 -11
- package/lib/components/style/form-color-input.js +5 -6
- package/lib/components/style/form-label.js +7 -11
- package/lib/components/style/form-number-input.js +41 -22
- package/lib/components/style/form-number-input_2.js +13 -18
- package/lib/components/style/form-select.js +51 -14
- package/lib/components/style/form-slider.js +26 -11
- package/lib/components/style/form-submit-button.js +6 -7
- package/lib/components/style/form-text-input.js +44 -31
- package/lib/components/viewer2d/area.js +6 -6
- package/lib/components/viewer2d/export.js +1 -1
- package/lib/components/viewer2d/grids/grid-horizontal-streak.js +1 -2
- package/lib/components/viewer2d/grids/grid-streak.js +1 -2
- package/lib/components/viewer2d/grids/grid-vertical-streak.js +1 -2
- package/lib/components/viewer2d/grids/grids.js +4 -9
- package/lib/components/viewer2d/group.js +2 -2
- package/lib/components/viewer2d/item.js +12 -18
- package/lib/components/viewer2d/layer.js +1 -1
- package/lib/components/viewer2d/line.js +4 -7
- package/lib/components/viewer2d/ruler.js +7 -8
- package/lib/components/viewer2d/rulerDist.js +5 -5
- package/lib/components/viewer2d/rulerX.js +13 -18
- package/lib/components/viewer2d/rulerY.js +13 -18
- package/lib/components/viewer2d/scene.js +22 -33
- package/lib/components/viewer2d/snap.js +2 -2
- package/lib/components/viewer2d/state.js +5 -10
- package/lib/components/viewer2d/utils.js +35 -2
- package/lib/components/viewer2d/vertex.js +2 -2
- package/lib/components/viewer2d/viewer2d.js +38 -40
- package/lib/components/viewer3d/camera-controls-module/camera-controls.module.js +14 -20
- package/lib/components/viewer3d/front3D.js +4 -9
- package/lib/components/viewer3d/grid-creator.js +2 -2
- package/lib/components/viewer3d/grids/grid-horizontal-streak.js +1 -1
- package/lib/components/viewer3d/grids/grid-streak.js +1 -1
- package/lib/components/viewer3d/grids/grid-vertical-streak.js +1 -1
- package/lib/components/viewer3d/libs/mtl-loader.js +6 -2
- package/lib/components/viewer3d/libs/obj-loader.js +6 -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/pointer-lock-navigation.js +1 -1
- package/lib/components/viewer3d/ruler-utils/itemRect.js +8 -8
- package/lib/components/viewer3d/ruler-utils/layer3D.js +33 -33
- package/lib/components/viewer3d/ruler-utils/ruler3D.js +3 -6
- package/lib/components/viewer3d/ruler-utils/scene3D.js +4 -5
- package/lib/components/viewer3d/ruler-utils/state3D.js +1 -1
- 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 +11 -16
- package/lib/components/viewer3d/viewer3d.js +32 -37
- package/lib/index.js +22 -88
- package/lib/models.js +58 -63
- package/lib/plugins/console-debugger.js +3 -6
- package/lib/plugins/export.js +1 -1
- package/lib/reducers/export.js +1 -1
- package/lib/reducers/user-reducer.js +0 -1
- package/lib/reducers/viewer2d-reducer.js +3 -4
- package/lib/reducers/viewer3d-reducer.js +3 -4
- package/lib/styles/export.js +1 -1
- package/lib/translator/translator.js +5 -9
- 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 +5 -8
- package/lib/utils/objects-utils.js +5 -3
- package/lib/utils/process-black-list.js +3 -5
- package/lib/utils/react-if.js +1 -1
- package/lib/utils/snap-scene.js +3 -7
- package/lib/utils/snap.js +22 -26
- package/lib/utils/threeCSG.es6.js +14 -14
- package/package.json +24 -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/index.js
CHANGED
|
@@ -1,15 +1,28 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports["default"] = renderKitchenSimulator;
|
|
8
|
+
var _react = _interopRequireDefault(require("react"));
|
|
9
|
+
var _client = _interopRequireDefault(require("react-dom/client"));
|
|
10
|
+
var _KitchenConfiguratorApp = _interopRequireDefault(require("./KitchenConfiguratorApp"));
|
|
11
|
+
// src/index.js
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Mounts the Kitchen Configurator micro-frontend into a DOM container.
|
|
15
|
+
* Returns an unmount() function for cleanup.
|
|
16
|
+
*/
|
|
17
|
+
function renderKitchenSimulator(container) {
|
|
18
|
+
var props = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
19
|
+
if (!container) throw new Error('Container element is required');
|
|
20
|
+
var root = _client["default"].createRoot(container);
|
|
21
|
+
root.render(/*#__PURE__*/_react["default"].createElement(_KitchenConfiguratorApp["default"], props));
|
|
22
|
+
return {
|
|
23
|
+
root: root,
|
|
24
|
+
unmount: function unmount() {
|
|
25
|
+
root.unmount();
|
|
26
|
+
}
|
|
27
|
+
};
|
|
28
|
+
}
|
package/es/models.js
CHANGED
|
@@ -1,45 +1,46 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports["default"] = exports.Vertex = exports.State = exports.Scene = exports.Line = exports.Layer = exports.Item = exports.Hole = exports.HistoryStructure = exports.Group = exports.Grid = exports.ElementsSet = exports.DefaultLayers = exports.DefaultGrids = exports.CatalogElement = exports.Catalog = exports.Area = void 0;
|
|
8
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
9
|
+
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
10
|
+
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
11
|
+
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
|
|
12
|
+
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
13
|
+
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
14
|
+
var _immutable = require("immutable");
|
|
15
|
+
var _constants = require("./constants");
|
|
16
|
+
var _snap = require("./utils/snap");
|
|
17
|
+
var _helper = require("./utils/helper");
|
|
18
|
+
var _convertUnitsLite = require("./utils/convert-units-lite");
|
|
2
19
|
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
|
-
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) {
|
|
4
|
-
function
|
|
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
|
-
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; }
|
|
20
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2["default"])(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
21
|
+
function _callSuper(t, o, e) { return o = (0, _getPrototypeOf2["default"])(o), (0, _possibleConstructorReturn2["default"])(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], (0, _getPrototypeOf2["default"])(t).constructor) : o.apply(t, e)); }
|
|
13
22
|
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
14
|
-
function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); }
|
|
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';
|
|
18
|
-
import { MODE_IDLE, UNIT_INCH } from "./constants";
|
|
19
|
-
import { SNAP_MASK } from "./utils/snap";
|
|
20
|
-
import { isEmpty } from "./utils/helper";
|
|
21
|
-
import convert from 'convert-units';
|
|
22
23
|
var safeLoadMapList = function safeLoadMapList(mapList, Model, defaultMap) {
|
|
23
|
-
return mapList ? new Map(mapList).map(function (m) {
|
|
24
|
+
return mapList ? new _immutable.Map(mapList).map(function (m) {
|
|
24
25
|
return new Model(m);
|
|
25
|
-
}).toMap() : defaultMap || new Map();
|
|
26
|
+
}).toMap() : defaultMap || new _immutable.Map();
|
|
26
27
|
};
|
|
27
|
-
|
|
28
|
+
var Grid = exports.Grid = /*#__PURE__*/function (_Record) {
|
|
28
29
|
function Grid() {
|
|
29
30
|
var json = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
30
|
-
|
|
31
|
+
(0, _classCallCheck2["default"])(this, Grid);
|
|
31
32
|
return _callSuper(this, Grid, [_objectSpread(_objectSpread({}, json), {}, {
|
|
32
|
-
properties: fromJS(json.properties || {})
|
|
33
|
+
properties: (0, _immutable.fromJS)(json.properties || {})
|
|
33
34
|
})]);
|
|
34
35
|
}
|
|
35
|
-
|
|
36
|
-
return
|
|
37
|
-
}(Record({
|
|
36
|
+
(0, _inherits2["default"])(Grid, _Record);
|
|
37
|
+
return (0, _createClass2["default"])(Grid);
|
|
38
|
+
}((0, _immutable.Record)({
|
|
38
39
|
id: '',
|
|
39
40
|
type: '',
|
|
40
|
-
properties: Map()
|
|
41
|
+
properties: (0, _immutable.Map)()
|
|
41
42
|
}, 'Grid'));
|
|
42
|
-
|
|
43
|
+
var DefaultGrids = exports.DefaultGrids = new _immutable.Map({
|
|
43
44
|
h1: new Grid({
|
|
44
45
|
id: 'h1',
|
|
45
46
|
type: 'horizontal-streak',
|
|
@@ -57,94 +58,94 @@ export var DefaultGrids = new Map({
|
|
|
57
58
|
}
|
|
58
59
|
})
|
|
59
60
|
});
|
|
60
|
-
|
|
61
|
+
var ElementsSet = exports.ElementsSet = /*#__PURE__*/function (_Record2) {
|
|
61
62
|
function ElementsSet() {
|
|
62
63
|
var json = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
63
|
-
|
|
64
|
+
(0, _classCallCheck2["default"])(this, ElementsSet);
|
|
64
65
|
return _callSuper(this, ElementsSet, [{
|
|
65
|
-
vertices: new List(json.vertices || []),
|
|
66
|
-
lines: new List(json.lines || []),
|
|
67
|
-
holes: new List(json.holes || []),
|
|
68
|
-
areas: new List(json.areas || []),
|
|
69
|
-
items: new List(json.items || [])
|
|
66
|
+
vertices: new _immutable.List(json.vertices || []),
|
|
67
|
+
lines: new _immutable.List(json.lines || []),
|
|
68
|
+
holes: new _immutable.List(json.holes || []),
|
|
69
|
+
areas: new _immutable.List(json.areas || []),
|
|
70
|
+
items: new _immutable.List(json.items || [])
|
|
70
71
|
}]);
|
|
71
72
|
}
|
|
72
|
-
|
|
73
|
-
return
|
|
74
|
-
}(Record({
|
|
75
|
-
vertices: new List(),
|
|
76
|
-
lines: new List(),
|
|
77
|
-
holes: new List(),
|
|
78
|
-
areas: new List(),
|
|
79
|
-
items: new List()
|
|
73
|
+
(0, _inherits2["default"])(ElementsSet, _Record2);
|
|
74
|
+
return (0, _createClass2["default"])(ElementsSet);
|
|
75
|
+
}((0, _immutable.Record)({
|
|
76
|
+
vertices: new _immutable.List(),
|
|
77
|
+
lines: new _immutable.List(),
|
|
78
|
+
holes: new _immutable.List(),
|
|
79
|
+
areas: new _immutable.List(),
|
|
80
|
+
items: new _immutable.List()
|
|
80
81
|
}, 'ElementsSet'));
|
|
81
82
|
var sharedAttributes = {
|
|
82
83
|
id: '',
|
|
83
84
|
type: '',
|
|
84
85
|
prototype: '',
|
|
85
86
|
name: '',
|
|
86
|
-
misc: new Map(),
|
|
87
|
+
misc: new _immutable.Map(),
|
|
87
88
|
selected: false,
|
|
88
|
-
properties: new Map(),
|
|
89
|
+
properties: new _immutable.Map(),
|
|
89
90
|
style: '',
|
|
90
91
|
category: '',
|
|
91
92
|
visible: true
|
|
92
93
|
};
|
|
93
|
-
|
|
94
|
+
var Vertex = exports.Vertex = /*#__PURE__*/function (_Record3) {
|
|
94
95
|
function Vertex() {
|
|
95
96
|
var json = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
96
|
-
|
|
97
|
+
(0, _classCallCheck2["default"])(this, Vertex);
|
|
97
98
|
return _callSuper(this, Vertex, [_objectSpread(_objectSpread({}, json), {}, {
|
|
98
|
-
lines: new List(json.lines || []),
|
|
99
|
-
areas: new List(json.areas || [])
|
|
99
|
+
lines: new _immutable.List(json.lines || []),
|
|
100
|
+
areas: new _immutable.List(json.areas || [])
|
|
100
101
|
})]);
|
|
101
102
|
}
|
|
102
|
-
|
|
103
|
-
return
|
|
104
|
-
}(Record(_objectSpread(_objectSpread({}, sharedAttributes), {}, {
|
|
103
|
+
(0, _inherits2["default"])(Vertex, _Record3);
|
|
104
|
+
return (0, _createClass2["default"])(Vertex);
|
|
105
|
+
}((0, _immutable.Record)(_objectSpread(_objectSpread({}, sharedAttributes), {}, {
|
|
105
106
|
x: -1,
|
|
106
107
|
y: -1,
|
|
107
108
|
prototype: 'vertices',
|
|
108
|
-
lines: new List(),
|
|
109
|
-
areas: new List()
|
|
109
|
+
lines: new _immutable.List(),
|
|
110
|
+
areas: new _immutable.List()
|
|
110
111
|
}), 'Vertex'));
|
|
111
|
-
|
|
112
|
+
var Line = exports.Line = /*#__PURE__*/function (_Record4) {
|
|
112
113
|
function Line() {
|
|
113
114
|
var json = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
114
|
-
|
|
115
|
+
(0, _classCallCheck2["default"])(this, Line);
|
|
115
116
|
return _callSuper(this, Line, [_objectSpread(_objectSpread({}, json), {}, {
|
|
116
117
|
createdDateTime: json.createdDateTime !== undefined ? json.createdDateTime : new Date().getTime(),
|
|
117
|
-
properties: fromJS(json.properties || {}),
|
|
118
|
-
vertices: new List(json.vertices || []),
|
|
119
|
-
holes: new List(json.holes || []),
|
|
120
|
-
relatedVertices: new List(json.relatedVertices || []),
|
|
118
|
+
properties: (0, _immutable.fromJS)(json.properties || {}),
|
|
119
|
+
vertices: new _immutable.List(json.vertices || []),
|
|
120
|
+
holes: new _immutable.List(json.holes || []),
|
|
121
|
+
relatedVertices: new _immutable.List(json.relatedVertices || []),
|
|
121
122
|
userData: {}
|
|
122
123
|
})]);
|
|
123
124
|
}
|
|
124
|
-
|
|
125
|
-
return
|
|
126
|
-
}(Record(_objectSpread(_objectSpread({}, sharedAttributes), {}, {
|
|
125
|
+
(0, _inherits2["default"])(Line, _Record4);
|
|
126
|
+
return (0, _createClass2["default"])(Line);
|
|
127
|
+
}((0, _immutable.Record)(_objectSpread(_objectSpread({}, sharedAttributes), {}, {
|
|
127
128
|
createdDateTime: new Date().getTime(),
|
|
128
129
|
prototype: 'lines',
|
|
129
|
-
vertices: new List(),
|
|
130
|
-
relatedVertices: new List(),
|
|
131
|
-
holes: new List(),
|
|
130
|
+
vertices: new _immutable.List(),
|
|
131
|
+
relatedVertices: new _immutable.List(),
|
|
132
|
+
holes: new _immutable.List(),
|
|
132
133
|
focus: false,
|
|
133
134
|
wallColor: '#dddddd',
|
|
134
135
|
userData: {}
|
|
135
136
|
}), 'Line'));
|
|
136
|
-
|
|
137
|
+
var Hole = exports.Hole = /*#__PURE__*/function (_Record5) {
|
|
137
138
|
function Hole() {
|
|
138
139
|
var json = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
139
|
-
|
|
140
|
+
(0, _classCallCheck2["default"])(this, Hole);
|
|
140
141
|
return _callSuper(this, Hole, [_objectSpread(_objectSpread({}, json), {}, {
|
|
141
|
-
properties: fromJS(json.properties || {}),
|
|
142
|
+
properties: (0, _immutable.fromJS)(json.properties || {}),
|
|
142
143
|
userData: {}
|
|
143
144
|
})]);
|
|
144
145
|
}
|
|
145
|
-
|
|
146
|
-
return
|
|
147
|
-
}(Record(_objectSpread(_objectSpread({}, sharedAttributes), {}, {
|
|
146
|
+
(0, _inherits2["default"])(Hole, _Record5);
|
|
147
|
+
return (0, _createClass2["default"])(Hole);
|
|
148
|
+
}((0, _immutable.Record)(_objectSpread(_objectSpread({}, sharedAttributes), {}, {
|
|
148
149
|
prototype: 'holes',
|
|
149
150
|
offset: -1,
|
|
150
151
|
x: 0,
|
|
@@ -154,45 +155,45 @@ export var Hole = /*#__PURE__*/function (_Record5) {
|
|
|
154
155
|
url: '',
|
|
155
156
|
userData: {}
|
|
156
157
|
}), 'Hole'));
|
|
157
|
-
|
|
158
|
+
var Area = exports.Area = /*#__PURE__*/function (_Record6) {
|
|
158
159
|
function Area() {
|
|
159
160
|
var json = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
160
|
-
|
|
161
|
+
(0, _classCallCheck2["default"])(this, Area);
|
|
161
162
|
return _callSuper(this, Area, [_objectSpread(_objectSpread({}, json), {}, {
|
|
162
|
-
properties: fromJS(json.properties || {}),
|
|
163
|
-
vertices: new List(json.vertices || [])
|
|
163
|
+
properties: (0, _immutable.fromJS)(json.properties || {}),
|
|
164
|
+
vertices: new _immutable.List(json.vertices || [])
|
|
164
165
|
})]);
|
|
165
166
|
}
|
|
166
|
-
|
|
167
|
-
return
|
|
168
|
-
}(Record(_objectSpread(_objectSpread({}, sharedAttributes), {}, {
|
|
167
|
+
(0, _inherits2["default"])(Area, _Record6);
|
|
168
|
+
return (0, _createClass2["default"])(Area);
|
|
169
|
+
}((0, _immutable.Record)(_objectSpread(_objectSpread({}, sharedAttributes), {}, {
|
|
169
170
|
prototype: 'areas',
|
|
170
|
-
vertices: new List(),
|
|
171
|
-
holes: new List(),
|
|
171
|
+
vertices: new _immutable.List(),
|
|
172
|
+
holes: new _immutable.List(),
|
|
172
173
|
texture: {
|
|
173
174
|
roughness: 0.9,
|
|
174
175
|
metalness: 0,
|
|
175
176
|
uri: ''
|
|
176
177
|
}
|
|
177
178
|
}), 'Area'));
|
|
178
|
-
|
|
179
|
+
var Item = exports.Item = /*#__PURE__*/function (_Record7) {
|
|
179
180
|
function Item() {
|
|
180
181
|
var json = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
181
|
-
|
|
182
|
+
(0, _classCallCheck2["default"])(this, Item);
|
|
182
183
|
return _callSuper(this, Item, [_objectSpread(_objectSpread({}, json), {}, {
|
|
183
|
-
properties: fromJS(json.properties || {})
|
|
184
|
+
properties: (0, _immutable.fromJS)(json.properties || {})
|
|
184
185
|
})]);
|
|
185
186
|
}
|
|
186
|
-
|
|
187
|
-
return
|
|
188
|
-
}(Record(_objectSpread(_objectSpread({}, sharedAttributes), {}, {
|
|
187
|
+
(0, _inherits2["default"])(Item, _Record7);
|
|
188
|
+
return (0, _createClass2["default"])(Item);
|
|
189
|
+
}((0, _immutable.Record)(_objectSpread(_objectSpread({}, sharedAttributes), {}, {
|
|
189
190
|
prototype: 'items',
|
|
190
191
|
x: 0,
|
|
191
192
|
y: 0,
|
|
192
193
|
rotation: 0,
|
|
193
|
-
submodule: new List(),
|
|
194
|
-
normalMap: new List(),
|
|
195
|
-
doorStyle: new Map(),
|
|
194
|
+
submodule: new _immutable.List(),
|
|
195
|
+
normalMap: new _immutable.List(),
|
|
196
|
+
doorStyle: new _immutable.Map(),
|
|
196
197
|
animate: 0,
|
|
197
198
|
animValue: 0,
|
|
198
199
|
itemID: -1,
|
|
@@ -212,10 +213,10 @@ export var Item = /*#__PURE__*/function (_Record7) {
|
|
|
212
213
|
},
|
|
213
214
|
distArray: [[0, 0], [0, 0], [0, 0], [0, 0]]
|
|
214
215
|
}), 'Item'));
|
|
215
|
-
|
|
216
|
+
var Layer = exports.Layer = /*#__PURE__*/function (_Record8) {
|
|
216
217
|
function Layer() {
|
|
217
218
|
var json = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
218
|
-
|
|
219
|
+
(0, _classCallCheck2["default"])(this, Layer);
|
|
219
220
|
return _callSuper(this, Layer, [_objectSpread(_objectSpread({}, json), {}, {
|
|
220
221
|
vertices: safeLoadMapList(json.vertices, Vertex),
|
|
221
222
|
lines: safeLoadMapList(json.lines, Line),
|
|
@@ -226,20 +227,20 @@ export var Layer = /*#__PURE__*/function (_Record8) {
|
|
|
226
227
|
selected: new ElementsSet(json.selected)
|
|
227
228
|
})]);
|
|
228
229
|
}
|
|
229
|
-
|
|
230
|
-
return
|
|
231
|
-
}(Record({
|
|
230
|
+
(0, _inherits2["default"])(Layer, _Record8);
|
|
231
|
+
return (0, _createClass2["default"])(Layer);
|
|
232
|
+
}((0, _immutable.Record)({
|
|
232
233
|
id: '',
|
|
233
234
|
altitude: 0,
|
|
234
235
|
order: 0,
|
|
235
236
|
opacity: 1,
|
|
236
237
|
name: '',
|
|
237
238
|
visible: true,
|
|
238
|
-
vertices: new Map(),
|
|
239
|
-
lines: new Map(),
|
|
240
|
-
holes: new Map(),
|
|
241
|
-
areas: new Map(),
|
|
242
|
-
items: new Map(),
|
|
239
|
+
vertices: new _immutable.Map(),
|
|
240
|
+
lines: new _immutable.Map(),
|
|
241
|
+
holes: new _immutable.Map(),
|
|
242
|
+
areas: new _immutable.Map(),
|
|
243
|
+
items: new _immutable.Map(),
|
|
243
244
|
selected: new ElementsSet(),
|
|
244
245
|
counterTop: {},
|
|
245
246
|
wallColor: {},
|
|
@@ -254,36 +255,36 @@ export var Layer = /*#__PURE__*/function (_Record8) {
|
|
|
254
255
|
},
|
|
255
256
|
backsplashApplied: false,
|
|
256
257
|
ceilHeight: 96,
|
|
257
|
-
unit: UNIT_INCH
|
|
258
|
+
unit: _constants.UNIT_INCH
|
|
258
259
|
}, 'Layer'));
|
|
259
|
-
|
|
260
|
+
var Group = exports.Group = /*#__PURE__*/function (_Record9) {
|
|
260
261
|
function Group() {
|
|
261
262
|
var json = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
262
|
-
|
|
263
|
+
(0, _classCallCheck2["default"])(this, Group);
|
|
263
264
|
return _callSuper(this, Group, [_objectSpread(_objectSpread({}, json), {}, {
|
|
264
|
-
properties: fromJS(json.properties || {}),
|
|
265
|
-
elements: fromJS(json.elements || {})
|
|
265
|
+
properties: (0, _immutable.fromJS)(json.properties || {}),
|
|
266
|
+
elements: (0, _immutable.fromJS)(json.elements || {})
|
|
266
267
|
})]);
|
|
267
268
|
}
|
|
268
|
-
|
|
269
|
-
return
|
|
270
|
-
}(Record(_objectSpread(_objectSpread({}, sharedAttributes), {}, {
|
|
269
|
+
(0, _inherits2["default"])(Group, _Record9);
|
|
270
|
+
return (0, _createClass2["default"])(Group);
|
|
271
|
+
}((0, _immutable.Record)(_objectSpread(_objectSpread({}, sharedAttributes), {}, {
|
|
271
272
|
prototype: 'groups',
|
|
272
273
|
x: 0,
|
|
273
274
|
y: 0,
|
|
274
275
|
rotation: 0,
|
|
275
|
-
elements: new Map()
|
|
276
|
+
elements: new _immutable.Map()
|
|
276
277
|
}), 'Group'));
|
|
277
|
-
|
|
278
|
+
var DefaultLayers = exports.DefaultLayers = new _immutable.Map({
|
|
278
279
|
'layer-1': new Layer({
|
|
279
280
|
id: 'layer-1',
|
|
280
281
|
name: 'default'
|
|
281
282
|
})
|
|
282
283
|
});
|
|
283
|
-
|
|
284
|
+
var Scene = exports.Scene = /*#__PURE__*/function (_Record0) {
|
|
284
285
|
function Scene() {
|
|
285
286
|
var json = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
286
|
-
|
|
287
|
+
(0, _classCallCheck2["default"])(this, Scene);
|
|
287
288
|
var layers = safeLoadMapList(json.layers, Layer, DefaultLayers);
|
|
288
289
|
return _callSuper(this, Scene, [_objectSpread(_objectSpread({}, json), {}, {
|
|
289
290
|
// grids: safeLoadMapList(json.grids, Grid, DefaultGrids),
|
|
@@ -291,28 +292,28 @@ export var Scene = /*#__PURE__*/function (_Record0) {
|
|
|
291
292
|
layers: layers,
|
|
292
293
|
selectedLayer: layers.first().id,
|
|
293
294
|
groups: safeLoadMapList(json.groups || {}, Group),
|
|
294
|
-
meta: json.meta ? fromJS(json.meta) : new Map(),
|
|
295
|
-
guides: !isEmpty(json.guides) ? fromJS(json.guides) : new Map({
|
|
296
|
-
horizontal: new Map(),
|
|
297
|
-
vertical: new Map(),
|
|
298
|
-
circular: new Map()
|
|
295
|
+
meta: json.meta ? (0, _immutable.fromJS)(json.meta) : new _immutable.Map(),
|
|
296
|
+
guides: !(0, _helper.isEmpty)(json.guides) ? (0, _immutable.fromJS)(json.guides) : new _immutable.Map({
|
|
297
|
+
horizontal: new _immutable.Map(),
|
|
298
|
+
vertical: new _immutable.Map(),
|
|
299
|
+
circular: new _immutable.Map()
|
|
299
300
|
})
|
|
300
301
|
})]);
|
|
301
302
|
}
|
|
302
|
-
|
|
303
|
-
return
|
|
304
|
-
}(Record({
|
|
303
|
+
(0, _inherits2["default"])(Scene, _Record0);
|
|
304
|
+
return (0, _createClass2["default"])(Scene);
|
|
305
|
+
}((0, _immutable.Record)({
|
|
305
306
|
unit: 'cm',
|
|
306
307
|
rulerUnit: 'in',
|
|
307
|
-
layers: new Map(),
|
|
308
|
-
grids: new Map(),
|
|
308
|
+
layers: new _immutable.Map(),
|
|
309
|
+
grids: new _immutable.Map(),
|
|
309
310
|
selectedLayer: null,
|
|
310
|
-
groups: new Map(),
|
|
311
|
+
groups: new _immutable.Map(),
|
|
311
312
|
width: 3000,
|
|
312
313
|
height: 2000,
|
|
313
|
-
meta: new Map(),
|
|
314
|
+
meta: new _immutable.Map(),
|
|
314
315
|
//additional info
|
|
315
|
-
guides: new Map(),
|
|
316
|
+
guides: new _immutable.Map(),
|
|
316
317
|
title: '',
|
|
317
318
|
currentProjectID: null,
|
|
318
319
|
showfg: true,
|
|
@@ -325,39 +326,39 @@ export var Scene = /*#__PURE__*/function (_Record0) {
|
|
|
325
326
|
isEndDragging: false,
|
|
326
327
|
setLineAttributes: false
|
|
327
328
|
}, 'Scene'));
|
|
328
|
-
|
|
329
|
+
var CatalogElement = exports.CatalogElement = /*#__PURE__*/function (_Record1) {
|
|
329
330
|
function CatalogElement() {
|
|
330
331
|
var json = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
331
|
-
|
|
332
|
+
(0, _classCallCheck2["default"])(this, CatalogElement);
|
|
332
333
|
return _callSuper(this, CatalogElement, [_objectSpread(_objectSpread({}, json), {}, {
|
|
333
|
-
info: fromJS(json.info),
|
|
334
|
-
properties: fromJS(json.properties),
|
|
335
|
-
obj: fromJS(json.obj)
|
|
334
|
+
info: (0, _immutable.fromJS)(json.info),
|
|
335
|
+
properties: (0, _immutable.fromJS)(json.properties),
|
|
336
|
+
obj: (0, _immutable.fromJS)(json.obj)
|
|
336
337
|
})]);
|
|
337
338
|
}
|
|
338
|
-
|
|
339
|
-
return
|
|
340
|
-
}(Record({
|
|
339
|
+
(0, _inherits2["default"])(CatalogElement, _Record1);
|
|
340
|
+
return (0, _createClass2["default"])(CatalogElement);
|
|
341
|
+
}((0, _immutable.Record)({
|
|
341
342
|
itemID: -1,
|
|
342
343
|
name: '',
|
|
343
344
|
prototype: '',
|
|
344
|
-
info: new Map(),
|
|
345
|
-
properties: new Map(),
|
|
346
|
-
obj: new Map(),
|
|
345
|
+
info: new _immutable.Map(),
|
|
346
|
+
properties: new _immutable.Map(),
|
|
347
|
+
obj: new _immutable.Map(),
|
|
347
348
|
type: ''
|
|
348
349
|
}, 'CatalogElement'));
|
|
349
|
-
|
|
350
|
+
var Catalog = exports.Catalog = /*#__PURE__*/function (_Record10) {
|
|
350
351
|
function Catalog() {
|
|
351
352
|
var json = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
352
|
-
|
|
353
|
+
(0, _classCallCheck2["default"])(this, Catalog);
|
|
353
354
|
var elements = safeLoadMapList(json.elements, CatalogElement);
|
|
354
355
|
return _callSuper(this, Catalog, [{
|
|
355
356
|
elements: elements,
|
|
356
357
|
ready: !elements.isEmpty()
|
|
357
358
|
}]);
|
|
358
359
|
}
|
|
359
|
-
|
|
360
|
-
return
|
|
360
|
+
(0, _inherits2["default"])(Catalog, _Record10);
|
|
361
|
+
return (0, _createClass2["default"])(Catalog, [{
|
|
361
362
|
key: "factoryElement",
|
|
362
363
|
value: function factoryElement(type, options, initialProperties, state) {
|
|
363
364
|
if (!this.elements.has(type)) {
|
|
@@ -391,20 +392,20 @@ export var Catalog = /*#__PURE__*/function (_Record10) {
|
|
|
391
392
|
depth: element.getIn(['info', 'sizeinfo', 'depth'])
|
|
392
393
|
};
|
|
393
394
|
var _sizeinfo = {
|
|
394
|
-
width: new Map({
|
|
395
|
+
width: new _immutable.Map({
|
|
395
396
|
_length: temp.width,
|
|
396
397
|
_unit: 'in',
|
|
397
|
-
length: convert(temp.width).from('in').to('cm')
|
|
398
|
+
length: (0, _convertUnitsLite.convert)(temp.width).from('in').to('cm')
|
|
398
399
|
}),
|
|
399
|
-
height: new Map({
|
|
400
|
+
height: new _immutable.Map({
|
|
400
401
|
_length: temp.height,
|
|
401
402
|
_unit: 'in',
|
|
402
|
-
length: convert(temp.height).from('in').to('cm')
|
|
403
|
+
length: (0, _convertUnitsLite.convert)(temp.height).from('in').to('cm')
|
|
403
404
|
}),
|
|
404
|
-
depth: new Map({
|
|
405
|
+
depth: new _immutable.Map({
|
|
405
406
|
_length: temp.depth,
|
|
406
407
|
_unit: 'in',
|
|
407
|
-
length: convert(temp.depth).from('in').to('cm')
|
|
408
|
+
length: (0, _convertUnitsLite.convert)(temp.depth).from('in').to('cm')
|
|
408
409
|
})
|
|
409
410
|
};
|
|
410
411
|
properties = properties.set('width', _sizeinfo.width).set('height', _sizeinfo.height).set('depth', _sizeinfo.depth);
|
|
@@ -432,72 +433,72 @@ export var Catalog = /*#__PURE__*/function (_Record10) {
|
|
|
432
433
|
}
|
|
433
434
|
}
|
|
434
435
|
}]);
|
|
435
|
-
}(Record({
|
|
436
|
+
}((0, _immutable.Record)({
|
|
436
437
|
ready: false,
|
|
437
438
|
page: 'root',
|
|
438
|
-
path: new List(),
|
|
439
|
-
elements: new Map()
|
|
439
|
+
path: new _immutable.List(),
|
|
440
|
+
elements: new _immutable.Map()
|
|
440
441
|
}, 'Catalog'));
|
|
441
|
-
|
|
442
|
+
var HistoryStructure = exports.HistoryStructure = /*#__PURE__*/function (_Record11) {
|
|
442
443
|
function HistoryStructure() {
|
|
443
444
|
var json = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
444
|
-
|
|
445
|
+
(0, _classCallCheck2["default"])(this, HistoryStructure);
|
|
445
446
|
return _callSuper(this, HistoryStructure, [{
|
|
446
|
-
list: fromJS(json.list || []),
|
|
447
|
+
list: (0, _immutable.fromJS)(json.list || []),
|
|
447
448
|
first: new Scene(json.scene),
|
|
448
449
|
last: new Scene(json.last || json.scene)
|
|
449
450
|
}]);
|
|
450
451
|
}
|
|
451
|
-
|
|
452
|
-
return
|
|
453
|
-
}(Record({
|
|
454
|
-
list: new List(),
|
|
452
|
+
(0, _inherits2["default"])(HistoryStructure, _Record11);
|
|
453
|
+
return (0, _createClass2["default"])(HistoryStructure);
|
|
454
|
+
}((0, _immutable.Record)({
|
|
455
|
+
list: new _immutable.List(),
|
|
455
456
|
first: null,
|
|
456
457
|
last: null
|
|
457
458
|
}, 'HistoryStructure'));
|
|
458
|
-
|
|
459
|
+
var State = exports.State = /*#__PURE__*/function (_Record12) {
|
|
459
460
|
function State() {
|
|
460
461
|
var json = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
461
|
-
|
|
462
|
+
(0, _classCallCheck2["default"])(this, State);
|
|
462
463
|
return _callSuper(this, State, [_objectSpread(_objectSpread({}, json), {}, {
|
|
463
464
|
scene: new Scene(json.scene),
|
|
464
465
|
sceneHistory: new HistoryStructure(json),
|
|
465
466
|
catalog: new Catalog(json.catalog || {}),
|
|
466
|
-
viewer2D: new Map(json.viewer2D || {}),
|
|
467
|
-
replacingSupport: new Map(json.drawingSupport || {}),
|
|
468
|
-
drawingSupport: new Map(json.drawingSupport || {}),
|
|
469
|
-
draggingSupport: new Map(json.draggingSupport || {}),
|
|
470
|
-
rotatingSupport: new Map(json.rotatingSupport || {}),
|
|
471
|
-
misc: json.misc ? fromJS(json.misc) : new Map()
|
|
467
|
+
viewer2D: new _immutable.Map(json.viewer2D || {}),
|
|
468
|
+
replacingSupport: new _immutable.Map(json.drawingSupport || {}),
|
|
469
|
+
drawingSupport: new _immutable.Map(json.drawingSupport || {}),
|
|
470
|
+
draggingSupport: new _immutable.Map(json.draggingSupport || {}),
|
|
471
|
+
rotatingSupport: new _immutable.Map(json.rotatingSupport || {}),
|
|
472
|
+
misc: json.misc ? (0, _immutable.fromJS)(json.misc) : new _immutable.Map()
|
|
472
473
|
})]);
|
|
473
474
|
}
|
|
474
|
-
|
|
475
|
-
return
|
|
476
|
-
}(Record({
|
|
477
|
-
mode: MODE_IDLE,
|
|
475
|
+
(0, _inherits2["default"])(State, _Record12);
|
|
476
|
+
return (0, _createClass2["default"])(State);
|
|
477
|
+
}((0, _immutable.Record)({
|
|
478
|
+
mode: _constants.MODE_IDLE,
|
|
478
479
|
scene: new Scene(),
|
|
479
480
|
sceneHistory: new HistoryStructure(),
|
|
480
481
|
catalog: new Catalog(),
|
|
481
|
-
viewer2D: new Map(),
|
|
482
|
-
mouse: new Map({
|
|
482
|
+
viewer2D: new _immutable.Map(),
|
|
483
|
+
mouse: new _immutable.Map({
|
|
483
484
|
x: 0,
|
|
484
485
|
y: 0
|
|
485
486
|
}),
|
|
486
487
|
zoom: 0,
|
|
487
|
-
snapMask: SNAP_MASK,
|
|
488
|
-
snapElements: new List(),
|
|
488
|
+
snapMask: _snap.SNAP_MASK,
|
|
489
|
+
snapElements: new _immutable.List(),
|
|
489
490
|
activeSnapElement: null,
|
|
490
|
-
replacingSupport: new Map(),
|
|
491
|
-
drawingSupport: new Map(),
|
|
492
|
-
draggingSupport: new Map(),
|
|
493
|
-
rotatingSupport: new Map(),
|
|
491
|
+
replacingSupport: new _immutable.Map(),
|
|
492
|
+
drawingSupport: new _immutable.Map(),
|
|
493
|
+
draggingSupport: new _immutable.Map(),
|
|
494
|
+
rotatingSupport: new _immutable.Map(),
|
|
494
495
|
doorStyle: null,
|
|
495
496
|
oStyle: null,
|
|
496
|
-
errors: new List(),
|
|
497
|
-
warnings: new List(),
|
|
498
|
-
clipboardProperties: new Map(),
|
|
499
|
-
selectedElementsHistory: new List(),
|
|
500
|
-
misc: new Map(),
|
|
497
|
+
errors: new _immutable.List(),
|
|
498
|
+
warnings: new _immutable.List(),
|
|
499
|
+
clipboardProperties: new _immutable.Map(),
|
|
500
|
+
selectedElementsHistory: new _immutable.List(),
|
|
501
|
+
misc: new _immutable.Map(),
|
|
501
502
|
//additional info
|
|
502
503
|
alterate: false,
|
|
503
504
|
isOpen: false,
|
|
@@ -507,4 +508,5 @@ export var State = /*#__PURE__*/function (_Record12) {
|
|
|
507
508
|
userId: 0,
|
|
508
509
|
isHelp: false,
|
|
509
510
|
isCabinetDrawing: false
|
|
510
|
-
}, 'State'));
|
|
511
|
+
}, 'State'));
|
|
512
|
+
var _default = exports["default"] = State;
|