kitchen-simulator 1.1.1-test.49 → 1.1.1-test.50
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 +2 -0
- package/es/AppContext.js +3 -0
- package/es/KitchenConfigurator.js +645 -0
- package/es/KitchenConfiguratorApp.js +480 -0
- package/es/actions/area-actions.js +14 -0
- package/es/actions/export.js +23 -0
- package/es/actions/groups-actions.js +89 -0
- package/es/actions/holes-actions.js +119 -0
- package/es/actions/items-actions.js +313 -0
- package/es/actions/lines-actions.js +81 -0
- package/es/actions/project-actions.js +281 -0
- package/es/actions/scene-actions.js +33 -0
- package/es/actions/vertices-actions.js +27 -0
- package/es/actions/viewer2d-actions.js +58 -0
- package/es/actions/viewer3d-actions.js +23 -0
- package/es/catalog/areas/area/planner-element.js +40 -0
- package/es/catalog/areas/area/textures/ceramic-tile.jpg +0 -0
- package/es/catalog/areas/area/textures/grass.jpg +0 -0
- package/es/catalog/areas/area/textures/parquet.jpg +0 -0
- package/es/catalog/areas/area/textures/strand-porcelain.jpg +0 -0
- package/es/catalog/areas/area/textures/tile1.jpg +0 -0
- package/es/catalog/catalog.js +277 -0
- package/es/catalog/envMap/nx.hdr +0 -0
- package/es/catalog/envMap/ny.hdr +0 -0
- package/es/catalog/envMap/nz.hdr +0 -0
- package/es/catalog/envMap/px.hdr +0 -0
- package/es/catalog/envMap/py.hdr +0 -0
- package/es/catalog/envMap/pz.hdr +0 -0
- package/es/catalog/factories/area-factory-3d.js +181 -0
- package/es/catalog/factories/area-factory.js +81 -0
- package/es/catalog/factories/export.js +7 -0
- package/es/catalog/factories/wall-factory-3d.js +202 -0
- package/es/catalog/factories/wall-factory.js +268 -0
- package/es/catalog/holes/door-closet/planner-element.js +222 -0
- package/es/catalog/holes/door-double/door_double.png +0 -0
- package/es/catalog/holes/door-double/planner-element.js +315 -0
- package/es/catalog/holes/door-exterior/planner-element.js +215 -0
- package/es/catalog/holes/door-interior/planner-element.js +227 -0
- package/es/catalog/holes/door-panic/panicDoor.png +0 -0
- package/es/catalog/holes/door-panic/planner-element.js +503 -0
- package/es/catalog/holes/door-panic-double/panicDoorDouble.png +0 -0
- package/es/catalog/holes/door-panic-double/planner-element.js +463 -0
- package/es/catalog/holes/door-sliding/planner-element.js +225 -0
- package/es/catalog/holes/doorway-framed/planner-element.js +145 -0
- package/es/catalog/holes/doorway-frameless/planner-element.js +104 -0
- package/es/catalog/holes/export.js +13 -0
- package/es/catalog/holes/gate/gate.jpg +0 -0
- package/es/catalog/holes/window-clear/planner-element.js +166 -0
- package/es/catalog/holes/window-clear/texture.png +0 -0
- package/es/catalog/holes/window-cross/planner-element.js +165 -0
- package/es/catalog/holes/window-cross/texture.png +0 -0
- package/es/catalog/holes/window-double-hung/planner-element.js +303 -0
- package/es/catalog/holes/window-double-hung/texture.png +0 -0
- package/es/catalog/holes/window-vertical/planner-element.js +276 -0
- package/es/catalog/holes/window-vertical/texture.png +0 -0
- package/es/catalog/lines/wall/planner-element.js +70 -0
- package/es/catalog/lines/wall/textures/bricks-normal.jpg +0 -0
- package/es/catalog/lines/wall/textures/bricks-normal2.jpg +0 -0
- package/es/catalog/lines/wall/textures/bricks.jpg +0 -0
- package/es/catalog/lines/wall/textures/bricks2.jpg +0 -0
- package/es/catalog/lines/wall/textures/bricks3.jpg +0 -0
- package/es/catalog/lines/wall/textures/morden-normal.jpg +0 -0
- package/es/catalog/lines/wall/textures/morden.jpg +0 -0
- package/es/catalog/lines/wall/textures/painted-normal.jpg +0 -0
- package/es/catalog/lines/wall/textures/painted.jpg +0 -0
- package/es/catalog/lines/wall/textures/plaster-normal.jpg +0 -0
- package/es/catalog/lines/wall/textures/plaster.jpg +0 -0
- package/es/catalog/lines/wall/wall.png +0 -0
- package/es/catalog/molding/molding-dcm/planner-element.js +28 -0
- package/es/catalog/molding/molding-dcm/texture.png +0 -0
- package/es/catalog/molding/molding-fbm/planner-element.js +28 -0
- package/es/catalog/molding/molding-fbm/texture.png +0 -0
- package/es/catalog/molding/molding-lrm/planner-element.js +28 -0
- package/es/catalog/molding/molding-lrm/texture.png +0 -0
- package/es/catalog/properties/export.js +21 -0
- package/es/catalog/properties/property-checkbox.js +116 -0
- package/es/catalog/properties/property-color.js +39 -0
- package/es/catalog/properties/property-enum.js +97 -0
- package/es/catalog/properties/property-hidden.js +19 -0
- package/es/catalog/properties/property-lenght-measure.js +101 -0
- package/es/catalog/properties/property-length-measure.js +134 -0
- package/es/catalog/properties/property-length-measure_hole.js +101 -0
- package/es/catalog/properties/property-number.js +48 -0
- package/es/catalog/properties/property-read-only.js +26 -0
- package/es/catalog/properties/property-string.js +48 -0
- package/es/catalog/properties/property-toggle.js +39 -0
- package/es/catalog/properties/shared-property-style.js +14 -0
- package/es/catalog/utils/FuseUtils.js +82 -0
- package/es/catalog/utils/exporter.js +148 -0
- package/es/catalog/utils/geom-utils.js +189 -0
- package/es/catalog/utils/item-loader.js +1521 -0
- package/es/catalog/utils/load-obj.js +91 -0
- package/es/catalog/utils/mtl-loader.js +358 -0
- package/es/catalog/utils/obj-loader.js +477 -0
- package/es/class/FuseUtils.js +82 -0
- package/es/class/area.js +145 -0
- package/es/class/export.js +24 -0
- package/es/class/group.js +440 -0
- package/es/class/guide.js +62 -0
- package/es/class/hole.js +929 -0
- package/es/class/item.js +1883 -0
- package/es/class/layer.js +667 -0
- package/es/class/line.js +1180 -0
- package/es/class/project.js +793 -0
- package/es/class/vertex.js +202 -0
- package/es/components/content.js +107 -0
- package/es/components/disclaimer/disclaimer.js +97 -0
- package/es/components/export.js +9 -0
- package/es/components/style/button.js +113 -0
- package/es/components/style/cancel-button.js +22 -0
- package/es/components/style/content-container.js +33 -0
- package/es/components/style/content-title.js +29 -0
- package/es/components/style/delete-button.js +25 -0
- package/es/components/style/export.js +31 -0
- package/es/components/style/form-block.js +24 -0
- package/es/components/style/form-color-input.js +27 -0
- package/es/components/style/form-label.js +26 -0
- package/es/components/style/form-number-input.js +213 -0
- package/es/components/style/form-number-input_2.js +206 -0
- package/es/components/style/form-select.js +68 -0
- package/es/components/style/form-slider.js +61 -0
- package/es/components/style/form-submit-button.js +26 -0
- package/es/components/style/form-text-input.js +95 -0
- package/es/components/viewer2d/area.js +81 -0
- package/es/components/viewer2d/export.js +31 -0
- package/es/components/viewer2d/grids/grid-horizontal-streak.js +37 -0
- package/es/components/viewer2d/grids/grid-streak.js +37 -0
- package/es/components/viewer2d/grids/grid-vertical-streak.js +37 -0
- package/es/components/viewer2d/grids/grids.js +35 -0
- package/es/components/viewer2d/group.js +53 -0
- package/es/components/viewer2d/item.js +513 -0
- package/es/components/viewer2d/layer.js +164 -0
- package/es/components/viewer2d/line.js +882 -0
- package/es/components/viewer2d/ruler.js +100 -0
- package/es/components/viewer2d/rulerDist.js +146 -0
- package/es/components/viewer2d/rulerX.js +151 -0
- package/es/components/viewer2d/rulerY.js +153 -0
- package/es/components/viewer2d/scene.js +140 -0
- package/es/components/viewer2d/snap.js +74 -0
- package/es/components/viewer2d/state.js +78 -0
- package/es/components/viewer2d/utils.js +198 -0
- package/es/components/viewer2d/vertex.js +65 -0
- package/es/components/viewer2d/viewer2d.js +1398 -0
- package/es/components/viewer3d/camera-controls-module/camera-controls.module.js +2592 -0
- package/es/components/viewer3d/dcm.js +401 -0
- package/es/components/viewer3d/fbm.js +414 -0
- package/es/components/viewer3d/front3D.js +66 -0
- package/es/components/viewer3d/grid-creator.js +25 -0
- package/es/components/viewer3d/grids/grid-horizontal-streak.js +36 -0
- package/es/components/viewer3d/grids/grid-streak.js +27 -0
- package/es/components/viewer3d/grids/grid-vertical-streak.js +36 -0
- package/es/components/viewer3d/libs/first-person-controls.js +67 -0
- package/es/components/viewer3d/libs/helvetiker_regular.typeface.js +1281 -0
- package/es/components/viewer3d/libs/mtl-loader.js +357 -0
- package/es/components/viewer3d/libs/obj-loader.js +462 -0
- package/es/components/viewer3d/libs/orbit-controls.js +699 -0
- package/es/components/viewer3d/libs/pointer-lock-controls.js +46 -0
- package/es/components/viewer3d/lrm.js +305 -0
- package/es/components/viewer3d/model.js +708 -0
- package/es/components/viewer3d/pointer-lock-navigation.js +115 -0
- package/es/components/viewer3d/ruler-utils/itemRect.js +61 -0
- package/es/components/viewer3d/ruler-utils/layer3D.js +495 -0
- package/es/components/viewer3d/ruler-utils/ruler3D.js +227 -0
- package/es/components/viewer3d/ruler-utils/scene3D.js +60 -0
- package/es/components/viewer3d/ruler-utils/state3D.js +18 -0
- package/es/components/viewer3d/scene-creator.js +3608 -0
- package/es/components/viewer3d/three-memory-cleaner.js +51 -0
- package/es/components/viewer3d/viewer3d-first-person.js +315 -0
- package/es/components/viewer3d/viewer3d.js +2527 -0
- package/es/constants.js +636 -0
- package/es/index.js +16 -0
- package/es/models.js +510 -0
- package/es/plugins/SVGLoader.js +1412 -0
- package/es/plugins/autosave.js +33 -0
- package/es/plugins/console-debugger.js +37 -0
- package/es/plugins/export.js +9 -0
- package/es/plugins/keyboard.js +101 -0
- package/es/reducers/areas-reducer.js +12 -0
- package/es/reducers/export.js +25 -0
- package/es/reducers/groups-reducer.js +38 -0
- package/es/reducers/holes-reducer.js +62 -0
- package/es/reducers/items-reducer.js +140 -0
- package/es/reducers/lines-reducer.js +45 -0
- package/es/reducers/project-reducer.js +129 -0
- package/es/reducers/reducer.js +19 -0
- package/es/reducers/scene-reducer.js +28 -0
- package/es/reducers/user-reducer.js +40 -0
- package/es/reducers/vertices-reducer.js +19 -0
- package/es/reducers/viewer2d-reducer.js +75 -0
- package/es/reducers/viewer3d-reducer.js +56 -0
- package/es/shared-style.js +66 -0
- package/es/styles/export.js +5 -0
- package/es/styles/tabs.css +40 -0
- package/es/translator/en.js +104 -0
- package/es/translator/it.js +79 -0
- package/es/translator/ru.js +79 -0
- package/es/translator/translator.js +84 -0
- package/es/utils/browser.js +33 -0
- package/es/utils/email-validator.js +4 -0
- package/es/utils/export.js +25 -0
- package/es/utils/geometry.js +2420 -0
- package/es/utils/get-edges-of-subgraphs.js +27 -0
- package/es/utils/graph-cycles.js +237 -0
- package/es/utils/graph-inner-cycles.js +46 -0
- package/es/utils/graph.js +150 -0
- package/es/utils/helper.js +268 -0
- package/es/utils/history.js +29 -0
- package/es/utils/id-broker.js +19 -0
- package/es/utils/logger.js +8 -0
- package/es/utils/math.js +50 -0
- package/es/utils/molding.js +871 -0
- package/es/utils/name-generator.js +18 -0
- package/es/utils/objects-utils.js +50 -0
- package/es/utils/phone-validator.js +4 -0
- package/es/utils/process-black-list.js +18 -0
- package/es/utils/react-if.js +18 -0
- package/es/utils/snap-scene.js +99 -0
- package/es/utils/snap.js +237 -0
- package/es/utils/summarizeCart.js +24 -0
- package/es/utils/threeCSG.es6.js +498 -0
- package/es/version.js +2 -0
- package/lib/catalog/properties/property-string.js +55 -0
- package/lib/catalog/properties/property-toggle.js +46 -0
- package/lib/catalog/properties/shared-property-style.js +20 -0
- package/lib/catalog/utils/FuseUtils.js +88 -0
- package/lib/catalog/utils/exporter.js +155 -0
- package/lib/catalog/utils/geom-utils.js +205 -0
- package/lib/catalog/utils/item-loader.js +1533 -0
- package/lib/catalog/utils/load-obj.js +99 -0
- package/lib/catalog/utils/mtl-loader.js +363 -0
- package/lib/catalog/utils/obj-loader.js +482 -0
- package/lib/class/FuseUtils.js +88 -0
- package/lib/class/area.js +150 -0
- package/lib/class/export.js +96 -0
- package/lib/class/group.js +445 -0
- package/lib/class/guide.js +67 -0
- package/lib/class/hole.js +934 -0
- package/lib/class/item.js +1889 -0
- package/lib/class/layer.js +672 -0
- package/lib/class/line.js +1186 -0
- package/lib/class/project.js +799 -0
- package/lib/class/vertex.js +207 -0
- package/lib/components/content.js +116 -0
- package/lib/components/disclaimer/disclaimer.js +105 -0
- package/lib/components/export.js +33 -0
- package/lib/components/style/button.js +120 -0
- package/lib/components/style/cancel-button.js +29 -0
- package/lib/components/style/content-container.js +40 -0
- package/lib/components/style/content-title.js +37 -0
- package/lib/components/style/delete-button.js +34 -0
- package/lib/components/style/export.js +121 -0
- package/lib/components/style/form-block.js +31 -0
- package/lib/components/style/form-color-input.js +34 -0
- package/lib/components/style/form-label.js +33 -0
- package/lib/components/style/form-number-input.js +220 -0
- package/lib/components/style/form-number-input_2.js +213 -0
- package/lib/components/style/form-select.js +75 -0
- package/lib/components/style/form-slider.js +68 -0
- package/lib/components/style/form-submit-button.js +35 -0
- package/lib/components/style/form-text-input.js +101 -0
- package/lib/components/viewer2d/area.js +88 -0
- package/lib/components/viewer2d/export.js +121 -0
- package/lib/components/viewer2d/grids/grid-horizontal-streak.js +44 -0
- package/lib/components/viewer2d/grids/grid-streak.js +44 -0
- package/lib/components/viewer2d/grids/grid-vertical-streak.js +44 -0
- package/lib/components/viewer2d/grids/grids.js +44 -0
- package/lib/components/viewer2d/group.js +62 -0
- package/lib/components/viewer2d/item.js +521 -0
- package/lib/components/viewer2d/layer.js +171 -0
- package/lib/components/viewer2d/line.js +892 -0
- package/lib/components/viewer2d/ruler.js +107 -0
- package/lib/components/viewer2d/rulerDist.js +153 -0
- package/lib/components/viewer2d/rulerX.js +158 -0
- package/lib/components/viewer2d/rulerY.js +160 -0
- package/lib/components/viewer2d/scene.js +147 -0
- package/lib/components/viewer2d/snap.js +83 -0
- package/lib/components/viewer2d/state.js +87 -0
- package/lib/components/viewer2d/utils.js +210 -0
- package/lib/components/viewer2d/vertex.js +74 -0
- package/lib/components/viewer2d/viewer2d.js +1405 -0
- package/lib/components/viewer3d/camera-controls-module/camera-controls.module.js +2597 -0
- package/lib/components/viewer3d/dcm.js +407 -0
- package/lib/components/viewer3d/fbm.js +420 -0
- package/lib/components/viewer3d/front3D.js +75 -0
- package/lib/components/viewer3d/grid-creator.js +34 -0
- package/lib/components/viewer3d/grids/grid-horizontal-streak.js +44 -0
- package/lib/components/viewer3d/grids/grid-streak.js +35 -0
- package/lib/components/viewer3d/grids/grid-vertical-streak.js +44 -0
- package/lib/components/viewer3d/libs/first-person-controls.js +74 -0
- package/lib/components/viewer3d/libs/helvetiker_regular.typeface.js +1287 -0
- package/lib/components/viewer3d/libs/mtl-loader.js +363 -0
- package/lib/components/viewer3d/libs/obj-loader.js +468 -0
- package/lib/components/viewer3d/libs/orbit-controls.js +705 -0
- package/lib/components/viewer3d/libs/pointer-lock-controls.js +52 -0
- package/lib/components/viewer3d/lrm.js +311 -0
- package/lib/components/viewer3d/model.js +714 -0
- package/lib/components/viewer3d/pointer-lock-navigation.js +122 -0
- package/lib/components/viewer3d/ruler-utils/itemRect.js +68 -0
- package/lib/components/viewer3d/ruler-utils/layer3D.js +502 -0
- package/lib/components/viewer3d/ruler-utils/ruler3D.js +234 -0
- package/lib/components/viewer3d/ruler-utils/scene3D.js +68 -0
- package/lib/components/viewer3d/ruler-utils/state3D.js +25 -0
- package/lib/components/viewer3d/scene-creator.js +3642 -0
- package/lib/components/viewer3d/three-memory-cleaner.js +60 -0
- package/lib/components/viewer3d/viewer3d-first-person.js +320 -0
- package/lib/components/viewer3d/viewer3d.js +2532 -0
- package/lib/constants.js +645 -0
- package/lib/index.js +96 -0
- package/lib/models.js +517 -0
- package/lib/plugins/SVGLoader.js +1417 -0
- package/lib/plugins/autosave.js +39 -0
- package/lib/plugins/console-debugger.js +44 -0
- package/lib/plugins/export.js +33 -0
- package/lib/plugins/keyboard.js +107 -0
- package/lib/reducers/areas-reducer.js +18 -0
- package/lib/reducers/export.js +97 -0
- package/lib/reducers/groups-reducer.js +44 -0
- package/lib/reducers/holes-reducer.js +68 -0
- package/lib/reducers/items-reducer.js +146 -0
- package/lib/reducers/lines-reducer.js +51 -0
- package/lib/reducers/project-reducer.js +135 -0
- package/lib/reducers/reducer.js +26 -0
- package/lib/reducers/scene-reducer.js +34 -0
- package/lib/reducers/user-reducer.js +46 -0
- package/lib/reducers/vertices-reducer.js +25 -0
- package/lib/reducers/viewer2d-reducer.js +82 -0
- package/lib/reducers/viewer3d-reducer.js +63 -0
- package/lib/shared-style.js +72 -0
- package/lib/styles/export.js +13 -0
- package/lib/translator/en.js +110 -0
- package/lib/translator/it.js +85 -0
- package/lib/translator/ru.js +85 -0
- package/lib/translator/translator.js +90 -0
- package/lib/utils/browser.js +40 -0
- package/lib/utils/email-validator.js +10 -0
- package/lib/utils/export.js +56 -0
- package/lib/utils/geometry.js +2516 -0
- package/lib/utils/get-edges-of-subgraphs.js +34 -0
- package/lib/utils/graph-cycles.js +240 -0
- package/lib/utils/graph-inner-cycles.js +54 -0
- package/lib/utils/graph.js +157 -0
- package/lib/utils/helper.js +291 -0
- package/lib/utils/history.js +36 -0
- package/lib/utils/id-broker.js +25 -0
- package/lib/utils/logger.js +14 -0
- package/lib/utils/math.js +57 -0
- package/lib/utils/molding.js +895 -0
- package/lib/utils/name-generator.js +23 -0
- package/lib/utils/objects-utils.js +60 -0
- package/lib/utils/phone-validator.js +10 -0
- package/lib/utils/process-black-list.js +24 -0
- package/lib/utils/react-if.js +24 -0
- package/lib/utils/snap-scene.js +105 -0
- package/lib/utils/snap.js +249 -0
- package/lib/utils/summarizeCart.js +30 -0
- package/lib/utils/threeCSG.es6.js +503 -0
- package/lib/version.js +8 -0
- package/package.json +3 -3
package/lib/index.js
ADDED
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
Object.defineProperty(exports, "Catalog", {
|
|
8
|
+
enumerable: true,
|
|
9
|
+
get: function get() {
|
|
10
|
+
return _catalog["default"];
|
|
11
|
+
}
|
|
12
|
+
});
|
|
13
|
+
Object.defineProperty(exports, "ElementsFactories", {
|
|
14
|
+
enumerable: true,
|
|
15
|
+
get: function get() {
|
|
16
|
+
return _export6["default"];
|
|
17
|
+
}
|
|
18
|
+
});
|
|
19
|
+
Object.defineProperty(exports, "KitchenConfiguratorActions", {
|
|
20
|
+
enumerable: true,
|
|
21
|
+
get: function get() {
|
|
22
|
+
return _export3["default"];
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
Object.defineProperty(exports, "KitchenConfiguratorApp", {
|
|
26
|
+
enumerable: true,
|
|
27
|
+
get: function get() {
|
|
28
|
+
return _KitchenConfiguratorApp["default"];
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
Object.defineProperty(exports, "KitchenConfiguratorClasses", {
|
|
32
|
+
enumerable: true,
|
|
33
|
+
get: function get() {
|
|
34
|
+
return _export5["default"];
|
|
35
|
+
}
|
|
36
|
+
});
|
|
37
|
+
Object.defineProperty(exports, "KitchenConfiguratorComponents", {
|
|
38
|
+
enumerable: true,
|
|
39
|
+
get: function get() {
|
|
40
|
+
return _export2["default"];
|
|
41
|
+
}
|
|
42
|
+
});
|
|
43
|
+
exports.KitchenConfiguratorConstants = void 0;
|
|
44
|
+
Object.defineProperty(exports, "KitchenConfiguratorReducers", {
|
|
45
|
+
enumerable: true,
|
|
46
|
+
get: function get() {
|
|
47
|
+
return _export4["default"];
|
|
48
|
+
}
|
|
49
|
+
});
|
|
50
|
+
exports.KitchenConfiguratorSharedStyle = void 0;
|
|
51
|
+
Object.defineProperty(exports, "KitchenConfiguratorUtils", {
|
|
52
|
+
enumerable: true,
|
|
53
|
+
get: function get() {
|
|
54
|
+
return _export7["default"];
|
|
55
|
+
}
|
|
56
|
+
});
|
|
57
|
+
exports.Models = void 0;
|
|
58
|
+
Object.defineProperty(exports, "Plugins", {
|
|
59
|
+
enumerable: true,
|
|
60
|
+
get: function get() {
|
|
61
|
+
return _export["default"];
|
|
62
|
+
}
|
|
63
|
+
});
|
|
64
|
+
Object.defineProperty(exports, "Translator", {
|
|
65
|
+
enumerable: true,
|
|
66
|
+
get: function get() {
|
|
67
|
+
return _translator["default"];
|
|
68
|
+
}
|
|
69
|
+
});
|
|
70
|
+
exports["default"] = void 0;
|
|
71
|
+
Object.defineProperty(exports, "reducer", {
|
|
72
|
+
enumerable: true,
|
|
73
|
+
get: function get() {
|
|
74
|
+
return _reducer["default"];
|
|
75
|
+
}
|
|
76
|
+
});
|
|
77
|
+
var _catalog = _interopRequireDefault(require("./catalog/catalog"));
|
|
78
|
+
var _translator = _interopRequireDefault(require("./translator/translator"));
|
|
79
|
+
var Models = _interopRequireWildcard(require("./models"));
|
|
80
|
+
exports.Models = Models;
|
|
81
|
+
var _reducer = _interopRequireDefault(require("./reducers/reducer"));
|
|
82
|
+
var _KitchenConfiguratorApp = _interopRequireDefault(require("./KitchenConfiguratorApp"));
|
|
83
|
+
var _export = _interopRequireDefault(require("./plugins/export"));
|
|
84
|
+
var KitchenConfiguratorConstants = _interopRequireWildcard(require("./constants"));
|
|
85
|
+
exports.KitchenConfiguratorConstants = KitchenConfiguratorConstants;
|
|
86
|
+
var KitchenConfiguratorSharedStyle = _interopRequireWildcard(require("./shared-style"));
|
|
87
|
+
exports.KitchenConfiguratorSharedStyle = KitchenConfiguratorSharedStyle;
|
|
88
|
+
var _export2 = _interopRequireDefault(require("./components/export"));
|
|
89
|
+
var _export3 = _interopRequireDefault(require("./actions/export"));
|
|
90
|
+
var _export4 = _interopRequireDefault(require("./reducers/export"));
|
|
91
|
+
var _export5 = _interopRequireDefault(require("./class/export"));
|
|
92
|
+
var _export6 = _interopRequireDefault(require("./catalog/factories/export"));
|
|
93
|
+
var _export7 = _interopRequireDefault(require("./utils/export"));
|
|
94
|
+
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, "default": e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
|
|
95
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
96
|
+
var _default = exports["default"] = _KitchenConfiguratorApp["default"];
|
package/lib/models.js
ADDED
|
@@ -0,0 +1,517 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
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 _immutable = require("immutable");
|
|
9
|
+
var _constants = require("./constants");
|
|
10
|
+
var _snap = require("./utils/snap");
|
|
11
|
+
var _helper = require("./utils/helper");
|
|
12
|
+
var _convertUnits = _interopRequireDefault(require("convert-units"));
|
|
13
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
14
|
+
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; }
|
|
15
|
+
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; }
|
|
16
|
+
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; }
|
|
17
|
+
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); } }
|
|
18
|
+
function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
|
|
19
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
20
|
+
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); }
|
|
21
|
+
function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
|
|
22
|
+
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
23
|
+
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); }
|
|
24
|
+
function _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e; }
|
|
25
|
+
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
26
|
+
function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); }
|
|
27
|
+
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); }
|
|
28
|
+
function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }
|
|
29
|
+
var safeLoadMapList = function safeLoadMapList(mapList, Model, defaultMap) {
|
|
30
|
+
return mapList ? new _immutable.Map(mapList).map(function (m) {
|
|
31
|
+
return new Model(m);
|
|
32
|
+
}).toMap() : defaultMap || new _immutable.Map();
|
|
33
|
+
};
|
|
34
|
+
var Grid = exports.Grid = /*#__PURE__*/function (_Record) {
|
|
35
|
+
function Grid() {
|
|
36
|
+
var json = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
37
|
+
_classCallCheck(this, Grid);
|
|
38
|
+
return _callSuper(this, Grid, [_objectSpread(_objectSpread({}, json), {}, {
|
|
39
|
+
properties: (0, _immutable.fromJS)(json.properties || {})
|
|
40
|
+
})]);
|
|
41
|
+
}
|
|
42
|
+
_inherits(Grid, _Record);
|
|
43
|
+
return _createClass(Grid);
|
|
44
|
+
}((0, _immutable.Record)({
|
|
45
|
+
id: '',
|
|
46
|
+
type: '',
|
|
47
|
+
properties: (0, _immutable.Map)()
|
|
48
|
+
}, 'Grid'));
|
|
49
|
+
var DefaultGrids = exports.DefaultGrids = new _immutable.Map({
|
|
50
|
+
h1: new Grid({
|
|
51
|
+
id: 'h1',
|
|
52
|
+
type: 'horizontal-streak',
|
|
53
|
+
properties: {
|
|
54
|
+
step: 30.48,
|
|
55
|
+
colors: ['#bbb', '#bbb', '#bbb', '#bbb', '#bbb'] // dot's color
|
|
56
|
+
}
|
|
57
|
+
}),
|
|
58
|
+
v1: new Grid({
|
|
59
|
+
id: 'v1',
|
|
60
|
+
type: 'vertical-streak',
|
|
61
|
+
properties: {
|
|
62
|
+
step: 30.48,
|
|
63
|
+
colors: ['#bbb', '#bbb', '#bbb', '#bbb', '#bbb'] // dot's color
|
|
64
|
+
}
|
|
65
|
+
})
|
|
66
|
+
});
|
|
67
|
+
var ElementsSet = exports.ElementsSet = /*#__PURE__*/function (_Record2) {
|
|
68
|
+
function ElementsSet() {
|
|
69
|
+
var json = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
70
|
+
_classCallCheck(this, ElementsSet);
|
|
71
|
+
return _callSuper(this, ElementsSet, [{
|
|
72
|
+
vertices: new _immutable.List(json.vertices || []),
|
|
73
|
+
lines: new _immutable.List(json.lines || []),
|
|
74
|
+
holes: new _immutable.List(json.holes || []),
|
|
75
|
+
areas: new _immutable.List(json.areas || []),
|
|
76
|
+
items: new _immutable.List(json.items || [])
|
|
77
|
+
}]);
|
|
78
|
+
}
|
|
79
|
+
_inherits(ElementsSet, _Record2);
|
|
80
|
+
return _createClass(ElementsSet);
|
|
81
|
+
}((0, _immutable.Record)({
|
|
82
|
+
vertices: new _immutable.List(),
|
|
83
|
+
lines: new _immutable.List(),
|
|
84
|
+
holes: new _immutable.List(),
|
|
85
|
+
areas: new _immutable.List(),
|
|
86
|
+
items: new _immutable.List()
|
|
87
|
+
}, 'ElementsSet'));
|
|
88
|
+
var sharedAttributes = {
|
|
89
|
+
id: '',
|
|
90
|
+
type: '',
|
|
91
|
+
prototype: '',
|
|
92
|
+
name: '',
|
|
93
|
+
misc: new _immutable.Map(),
|
|
94
|
+
selected: false,
|
|
95
|
+
properties: new _immutable.Map(),
|
|
96
|
+
style: '',
|
|
97
|
+
category: '',
|
|
98
|
+
visible: true
|
|
99
|
+
};
|
|
100
|
+
var Vertex = exports.Vertex = /*#__PURE__*/function (_Record3) {
|
|
101
|
+
function Vertex() {
|
|
102
|
+
var json = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
103
|
+
_classCallCheck(this, Vertex);
|
|
104
|
+
return _callSuper(this, Vertex, [_objectSpread(_objectSpread({}, json), {}, {
|
|
105
|
+
lines: new _immutable.List(json.lines || []),
|
|
106
|
+
areas: new _immutable.List(json.areas || [])
|
|
107
|
+
})]);
|
|
108
|
+
}
|
|
109
|
+
_inherits(Vertex, _Record3);
|
|
110
|
+
return _createClass(Vertex);
|
|
111
|
+
}((0, _immutable.Record)(_objectSpread(_objectSpread({}, sharedAttributes), {}, {
|
|
112
|
+
x: -1,
|
|
113
|
+
y: -1,
|
|
114
|
+
prototype: 'vertices',
|
|
115
|
+
lines: new _immutable.List(),
|
|
116
|
+
areas: new _immutable.List()
|
|
117
|
+
}), 'Vertex'));
|
|
118
|
+
var Line = exports.Line = /*#__PURE__*/function (_Record4) {
|
|
119
|
+
function Line() {
|
|
120
|
+
var json = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
121
|
+
_classCallCheck(this, Line);
|
|
122
|
+
return _callSuper(this, Line, [_objectSpread(_objectSpread({}, json), {}, {
|
|
123
|
+
createdDateTime: json.createdDateTime !== undefined ? json.createdDateTime : new Date().getTime(),
|
|
124
|
+
properties: (0, _immutable.fromJS)(json.properties || {}),
|
|
125
|
+
vertices: new _immutable.List(json.vertices || []),
|
|
126
|
+
holes: new _immutable.List(json.holes || []),
|
|
127
|
+
relatedVertices: new _immutable.List(json.relatedVertices || []),
|
|
128
|
+
userData: {}
|
|
129
|
+
})]);
|
|
130
|
+
}
|
|
131
|
+
_inherits(Line, _Record4);
|
|
132
|
+
return _createClass(Line);
|
|
133
|
+
}((0, _immutable.Record)(_objectSpread(_objectSpread({}, sharedAttributes), {}, {
|
|
134
|
+
createdDateTime: new Date().getTime(),
|
|
135
|
+
prototype: 'lines',
|
|
136
|
+
vertices: new _immutable.List(),
|
|
137
|
+
relatedVertices: new _immutable.List(),
|
|
138
|
+
holes: new _immutable.List(),
|
|
139
|
+
focus: false,
|
|
140
|
+
wallColor: '#dddddd',
|
|
141
|
+
userData: {}
|
|
142
|
+
}), 'Line'));
|
|
143
|
+
var Hole = exports.Hole = /*#__PURE__*/function (_Record5) {
|
|
144
|
+
function Hole() {
|
|
145
|
+
var json = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
146
|
+
_classCallCheck(this, Hole);
|
|
147
|
+
return _callSuper(this, Hole, [_objectSpread(_objectSpread({}, json), {}, {
|
|
148
|
+
properties: (0, _immutable.fromJS)(json.properties || {}),
|
|
149
|
+
userData: {}
|
|
150
|
+
})]);
|
|
151
|
+
}
|
|
152
|
+
_inherits(Hole, _Record5);
|
|
153
|
+
return _createClass(Hole);
|
|
154
|
+
}((0, _immutable.Record)(_objectSpread(_objectSpread({}, sharedAttributes), {}, {
|
|
155
|
+
prototype: 'holes',
|
|
156
|
+
offset: -1,
|
|
157
|
+
x: 0,
|
|
158
|
+
y: 0,
|
|
159
|
+
rotation: 0,
|
|
160
|
+
line: '',
|
|
161
|
+
url: '',
|
|
162
|
+
userData: {}
|
|
163
|
+
}), 'Hole'));
|
|
164
|
+
var Area = exports.Area = /*#__PURE__*/function (_Record6) {
|
|
165
|
+
function Area() {
|
|
166
|
+
var json = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
167
|
+
_classCallCheck(this, Area);
|
|
168
|
+
return _callSuper(this, Area, [_objectSpread(_objectSpread({}, json), {}, {
|
|
169
|
+
properties: (0, _immutable.fromJS)(json.properties || {}),
|
|
170
|
+
vertices: new _immutable.List(json.vertices || [])
|
|
171
|
+
})]);
|
|
172
|
+
}
|
|
173
|
+
_inherits(Area, _Record6);
|
|
174
|
+
return _createClass(Area);
|
|
175
|
+
}((0, _immutable.Record)(_objectSpread(_objectSpread({}, sharedAttributes), {}, {
|
|
176
|
+
prototype: 'areas',
|
|
177
|
+
vertices: new _immutable.List(),
|
|
178
|
+
holes: new _immutable.List(),
|
|
179
|
+
texture: {
|
|
180
|
+
roughness: 0.9,
|
|
181
|
+
metalness: 0,
|
|
182
|
+
uri: ''
|
|
183
|
+
}
|
|
184
|
+
}), 'Area'));
|
|
185
|
+
var Item = exports.Item = /*#__PURE__*/function (_Record7) {
|
|
186
|
+
function Item() {
|
|
187
|
+
var json = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
188
|
+
_classCallCheck(this, Item);
|
|
189
|
+
return _callSuper(this, Item, [_objectSpread(_objectSpread({}, json), {}, {
|
|
190
|
+
properties: (0, _immutable.fromJS)(json.properties || {})
|
|
191
|
+
})]);
|
|
192
|
+
}
|
|
193
|
+
_inherits(Item, _Record7);
|
|
194
|
+
return _createClass(Item);
|
|
195
|
+
}((0, _immutable.Record)(_objectSpread(_objectSpread({}, sharedAttributes), {}, {
|
|
196
|
+
prototype: 'items',
|
|
197
|
+
x: 0,
|
|
198
|
+
y: 0,
|
|
199
|
+
rotation: 0,
|
|
200
|
+
submodule: new _immutable.List(),
|
|
201
|
+
normalMap: new _immutable.List(),
|
|
202
|
+
doorStyle: new _immutable.Map(),
|
|
203
|
+
animate: 0,
|
|
204
|
+
animValue: 0,
|
|
205
|
+
itemID: -1,
|
|
206
|
+
sku_number: '',
|
|
207
|
+
layoutpos: '',
|
|
208
|
+
cabinet_category: '',
|
|
209
|
+
counterTop: {
|
|
210
|
+
roughness: 0.9,
|
|
211
|
+
metalness: 0.1,
|
|
212
|
+
uri: ''
|
|
213
|
+
},
|
|
214
|
+
molding: [],
|
|
215
|
+
backsplashVisible: false,
|
|
216
|
+
applianceMaterial: {
|
|
217
|
+
roughness: 0.4,
|
|
218
|
+
metalness: 0.3
|
|
219
|
+
},
|
|
220
|
+
distArray: [[0, 0], [0, 0], [0, 0], [0, 0]]
|
|
221
|
+
}), 'Item'));
|
|
222
|
+
var Layer = exports.Layer = /*#__PURE__*/function (_Record8) {
|
|
223
|
+
function Layer() {
|
|
224
|
+
var json = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
225
|
+
_classCallCheck(this, Layer);
|
|
226
|
+
return _callSuper(this, Layer, [_objectSpread(_objectSpread({}, json), {}, {
|
|
227
|
+
vertices: safeLoadMapList(json.vertices, Vertex),
|
|
228
|
+
lines: safeLoadMapList(json.lines, Line),
|
|
229
|
+
holes: safeLoadMapList(json.holes, Hole),
|
|
230
|
+
areas: safeLoadMapList(json.areas, Area),
|
|
231
|
+
items: safeLoadMapList(json.items, Item),
|
|
232
|
+
doorStyle: json.doorStyle !== null ? json.doorStyle : null,
|
|
233
|
+
selected: new ElementsSet(json.selected)
|
|
234
|
+
})]);
|
|
235
|
+
}
|
|
236
|
+
_inherits(Layer, _Record8);
|
|
237
|
+
return _createClass(Layer);
|
|
238
|
+
}((0, _immutable.Record)({
|
|
239
|
+
id: '',
|
|
240
|
+
altitude: 0,
|
|
241
|
+
order: 0,
|
|
242
|
+
opacity: 1,
|
|
243
|
+
name: '',
|
|
244
|
+
visible: true,
|
|
245
|
+
vertices: new _immutable.Map(),
|
|
246
|
+
lines: new _immutable.Map(),
|
|
247
|
+
holes: new _immutable.Map(),
|
|
248
|
+
areas: new _immutable.Map(),
|
|
249
|
+
items: new _immutable.Map(),
|
|
250
|
+
selected: new ElementsSet(),
|
|
251
|
+
counterTop: {},
|
|
252
|
+
wallColor: {},
|
|
253
|
+
floorStyle: {},
|
|
254
|
+
doorHandle: '',
|
|
255
|
+
doorStyle: null,
|
|
256
|
+
molding: [],
|
|
257
|
+
backsplash: {
|
|
258
|
+
roughness: 0.2,
|
|
259
|
+
metalness: 0.1,
|
|
260
|
+
uri: ''
|
|
261
|
+
},
|
|
262
|
+
backsplashApplied: false,
|
|
263
|
+
ceilHeight: 96,
|
|
264
|
+
unit: _constants.UNIT_INCH
|
|
265
|
+
}, 'Layer'));
|
|
266
|
+
var Group = exports.Group = /*#__PURE__*/function (_Record9) {
|
|
267
|
+
function Group() {
|
|
268
|
+
var json = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
269
|
+
_classCallCheck(this, Group);
|
|
270
|
+
return _callSuper(this, Group, [_objectSpread(_objectSpread({}, json), {}, {
|
|
271
|
+
properties: (0, _immutable.fromJS)(json.properties || {}),
|
|
272
|
+
elements: (0, _immutable.fromJS)(json.elements || {})
|
|
273
|
+
})]);
|
|
274
|
+
}
|
|
275
|
+
_inherits(Group, _Record9);
|
|
276
|
+
return _createClass(Group);
|
|
277
|
+
}((0, _immutable.Record)(_objectSpread(_objectSpread({}, sharedAttributes), {}, {
|
|
278
|
+
prototype: 'groups',
|
|
279
|
+
x: 0,
|
|
280
|
+
y: 0,
|
|
281
|
+
rotation: 0,
|
|
282
|
+
elements: new _immutable.Map()
|
|
283
|
+
}), 'Group'));
|
|
284
|
+
var DefaultLayers = exports.DefaultLayers = new _immutable.Map({
|
|
285
|
+
'layer-1': new Layer({
|
|
286
|
+
id: 'layer-1',
|
|
287
|
+
name: 'default'
|
|
288
|
+
})
|
|
289
|
+
});
|
|
290
|
+
var Scene = exports.Scene = /*#__PURE__*/function (_Record0) {
|
|
291
|
+
function Scene() {
|
|
292
|
+
var json = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
293
|
+
_classCallCheck(this, Scene);
|
|
294
|
+
var layers = safeLoadMapList(json.layers, Layer, DefaultLayers);
|
|
295
|
+
return _callSuper(this, Scene, [_objectSpread(_objectSpread({}, json), {}, {
|
|
296
|
+
// grids: safeLoadMapList(json.grids, Grid, DefaultGrids),
|
|
297
|
+
grids: DefaultGrids,
|
|
298
|
+
layers: layers,
|
|
299
|
+
selectedLayer: layers.first().id,
|
|
300
|
+
groups: safeLoadMapList(json.groups || {}, Group),
|
|
301
|
+
meta: json.meta ? (0, _immutable.fromJS)(json.meta) : new _immutable.Map(),
|
|
302
|
+
guides: !(0, _helper.isEmpty)(json.guides) ? (0, _immutable.fromJS)(json.guides) : new _immutable.Map({
|
|
303
|
+
horizontal: new _immutable.Map(),
|
|
304
|
+
vertical: new _immutable.Map(),
|
|
305
|
+
circular: new _immutable.Map()
|
|
306
|
+
})
|
|
307
|
+
})]);
|
|
308
|
+
}
|
|
309
|
+
_inherits(Scene, _Record0);
|
|
310
|
+
return _createClass(Scene);
|
|
311
|
+
}((0, _immutable.Record)({
|
|
312
|
+
unit: 'cm',
|
|
313
|
+
rulerUnit: 'in',
|
|
314
|
+
layers: new _immutable.Map(),
|
|
315
|
+
grids: new _immutable.Map(),
|
|
316
|
+
selectedLayer: null,
|
|
317
|
+
groups: new _immutable.Map(),
|
|
318
|
+
width: 3000,
|
|
319
|
+
height: 2000,
|
|
320
|
+
meta: new _immutable.Map(),
|
|
321
|
+
//additional info
|
|
322
|
+
guides: new _immutable.Map(),
|
|
323
|
+
title: '',
|
|
324
|
+
currentProjectID: null,
|
|
325
|
+
showfg: true,
|
|
326
|
+
showWallLengthMeasure: 1,
|
|
327
|
+
showBaseCabinetMeasure: 1,
|
|
328
|
+
showWallCabinetMeasure: 1,
|
|
329
|
+
showWindowDoorMeasure: 1,
|
|
330
|
+
isLoadingCabinet: false,
|
|
331
|
+
loadFlag: false,
|
|
332
|
+
isEndDragging: false,
|
|
333
|
+
setLineAttributes: false
|
|
334
|
+
}, 'Scene'));
|
|
335
|
+
var CatalogElement = exports.CatalogElement = /*#__PURE__*/function (_Record1) {
|
|
336
|
+
function CatalogElement() {
|
|
337
|
+
var json = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
338
|
+
_classCallCheck(this, CatalogElement);
|
|
339
|
+
return _callSuper(this, CatalogElement, [_objectSpread(_objectSpread({}, json), {}, {
|
|
340
|
+
info: (0, _immutable.fromJS)(json.info),
|
|
341
|
+
properties: (0, _immutable.fromJS)(json.properties),
|
|
342
|
+
obj: (0, _immutable.fromJS)(json.obj)
|
|
343
|
+
})]);
|
|
344
|
+
}
|
|
345
|
+
_inherits(CatalogElement, _Record1);
|
|
346
|
+
return _createClass(CatalogElement);
|
|
347
|
+
}((0, _immutable.Record)({
|
|
348
|
+
itemID: -1,
|
|
349
|
+
name: '',
|
|
350
|
+
prototype: '',
|
|
351
|
+
info: new _immutable.Map(),
|
|
352
|
+
properties: new _immutable.Map(),
|
|
353
|
+
obj: new _immutable.Map(),
|
|
354
|
+
type: ''
|
|
355
|
+
}, 'CatalogElement'));
|
|
356
|
+
var Catalog = exports.Catalog = /*#__PURE__*/function (_Record10) {
|
|
357
|
+
function Catalog() {
|
|
358
|
+
var json = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
359
|
+
_classCallCheck(this, Catalog);
|
|
360
|
+
var elements = safeLoadMapList(json.elements, CatalogElement);
|
|
361
|
+
return _callSuper(this, Catalog, [{
|
|
362
|
+
elements: elements,
|
|
363
|
+
ready: !elements.isEmpty()
|
|
364
|
+
}]);
|
|
365
|
+
}
|
|
366
|
+
_inherits(Catalog, _Record10);
|
|
367
|
+
return _createClass(Catalog, [{
|
|
368
|
+
key: "factoryElement",
|
|
369
|
+
value: function factoryElement(type, options, initialProperties, state) {
|
|
370
|
+
if (!this.elements.has(type)) {
|
|
371
|
+
var catList = this.elements.map(function (element) {
|
|
372
|
+
return element.name;
|
|
373
|
+
}).toArray();
|
|
374
|
+
throw new Error("Element ".concat(type, " does not exist in catalog ").concat(catList));
|
|
375
|
+
}
|
|
376
|
+
var element = this.elements.get(type);
|
|
377
|
+
var properties = element.properties.map(function (value, key) {
|
|
378
|
+
return initialProperties && initialProperties.has(key) ? initialProperties.get(key) : value.get('defaultValue');
|
|
379
|
+
});
|
|
380
|
+
if (options) {
|
|
381
|
+
if (options.isDuplication) {
|
|
382
|
+
var layerID = state.scene.selectedLayer;
|
|
383
|
+
var currentItemID = state.scene.getIn(['layers', layerID, 'selected', 'items'])._tail.array[0];
|
|
384
|
+
var currentItem = state.scene.getIn(['layers', layerID, 'items', currentItemID]);
|
|
385
|
+
var sizeinfo = {
|
|
386
|
+
width: currentItem.properties.get('width'),
|
|
387
|
+
height: currentItem.properties.get('height'),
|
|
388
|
+
depth: currentItem.properties.get('depth')
|
|
389
|
+
};
|
|
390
|
+
properties = properties.set('width', sizeinfo.width).set('height', sizeinfo.height).set('depth', sizeinfo.depth);
|
|
391
|
+
if (currentItem.properties.get('oldDepth') !== undefined) properties = properties.set('oldDepth', currentItem.properties.get('oldDepth'));
|
|
392
|
+
if (currentItem.properties.get('oldWidth') !== undefined) properties = properties.set('oldWidth', currentItem.properties.get('oldWidth'));
|
|
393
|
+
if (currentItem.properties.get('oldHeight') !== undefined) properties = properties.set('oldHeight', currentItem.properties.get('oldHeight'));
|
|
394
|
+
} else if (element.prototype === 'holes') {} else {
|
|
395
|
+
var temp = {
|
|
396
|
+
width: element.getIn(['info', 'sizeinfo', 'width']),
|
|
397
|
+
height: element.getIn(['info', 'sizeinfo', 'height']),
|
|
398
|
+
depth: element.getIn(['info', 'sizeinfo', 'depth'])
|
|
399
|
+
};
|
|
400
|
+
var _sizeinfo = {
|
|
401
|
+
width: new _immutable.Map({
|
|
402
|
+
_length: temp.width,
|
|
403
|
+
_unit: 'in',
|
|
404
|
+
length: (0, _convertUnits["default"])(temp.width).from('in').to('cm')
|
|
405
|
+
}),
|
|
406
|
+
height: new _immutable.Map({
|
|
407
|
+
_length: temp.height,
|
|
408
|
+
_unit: 'in',
|
|
409
|
+
length: (0, _convertUnits["default"])(temp.height).from('in').to('cm')
|
|
410
|
+
}),
|
|
411
|
+
depth: new _immutable.Map({
|
|
412
|
+
_length: temp.depth,
|
|
413
|
+
_unit: 'in',
|
|
414
|
+
length: (0, _convertUnits["default"])(temp.depth).from('in').to('cm')
|
|
415
|
+
})
|
|
416
|
+
};
|
|
417
|
+
properties = properties.set('width', _sizeinfo.width).set('height', _sizeinfo.height).set('depth', _sizeinfo.depth);
|
|
418
|
+
}
|
|
419
|
+
}
|
|
420
|
+
switch (element.prototype) {
|
|
421
|
+
case 'lines':
|
|
422
|
+
return new Line(options).merge({
|
|
423
|
+
properties: properties
|
|
424
|
+
});
|
|
425
|
+
case 'holes':
|
|
426
|
+
return new Hole(options).merge({
|
|
427
|
+
properties: properties
|
|
428
|
+
});
|
|
429
|
+
case 'areas':
|
|
430
|
+
return new Area(options).merge({
|
|
431
|
+
properties: properties
|
|
432
|
+
});
|
|
433
|
+
case 'items':
|
|
434
|
+
return new Item(options).merge({
|
|
435
|
+
properties: properties
|
|
436
|
+
});
|
|
437
|
+
default:
|
|
438
|
+
throw new Error('prototype not valid');
|
|
439
|
+
}
|
|
440
|
+
}
|
|
441
|
+
}]);
|
|
442
|
+
}((0, _immutable.Record)({
|
|
443
|
+
ready: false,
|
|
444
|
+
page: 'root',
|
|
445
|
+
path: new _immutable.List(),
|
|
446
|
+
elements: new _immutable.Map()
|
|
447
|
+
}, 'Catalog'));
|
|
448
|
+
var HistoryStructure = exports.HistoryStructure = /*#__PURE__*/function (_Record11) {
|
|
449
|
+
function HistoryStructure() {
|
|
450
|
+
var json = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
451
|
+
_classCallCheck(this, HistoryStructure);
|
|
452
|
+
return _callSuper(this, HistoryStructure, [{
|
|
453
|
+
list: (0, _immutable.fromJS)(json.list || []),
|
|
454
|
+
first: new Scene(json.scene),
|
|
455
|
+
last: new Scene(json.last || json.scene)
|
|
456
|
+
}]);
|
|
457
|
+
}
|
|
458
|
+
_inherits(HistoryStructure, _Record11);
|
|
459
|
+
return _createClass(HistoryStructure);
|
|
460
|
+
}((0, _immutable.Record)({
|
|
461
|
+
list: new _immutable.List(),
|
|
462
|
+
first: null,
|
|
463
|
+
last: null
|
|
464
|
+
}, 'HistoryStructure'));
|
|
465
|
+
var State = exports.State = /*#__PURE__*/function (_Record12) {
|
|
466
|
+
function State() {
|
|
467
|
+
var json = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
468
|
+
_classCallCheck(this, State);
|
|
469
|
+
return _callSuper(this, State, [_objectSpread(_objectSpread({}, json), {}, {
|
|
470
|
+
scene: new Scene(json.scene),
|
|
471
|
+
sceneHistory: new HistoryStructure(json),
|
|
472
|
+
catalog: new Catalog(json.catalog || {}),
|
|
473
|
+
viewer2D: new _immutable.Map(json.viewer2D || {}),
|
|
474
|
+
replacingSupport: new _immutable.Map(json.drawingSupport || {}),
|
|
475
|
+
drawingSupport: new _immutable.Map(json.drawingSupport || {}),
|
|
476
|
+
draggingSupport: new _immutable.Map(json.draggingSupport || {}),
|
|
477
|
+
rotatingSupport: new _immutable.Map(json.rotatingSupport || {}),
|
|
478
|
+
misc: json.misc ? (0, _immutable.fromJS)(json.misc) : new _immutable.Map()
|
|
479
|
+
})]);
|
|
480
|
+
}
|
|
481
|
+
_inherits(State, _Record12);
|
|
482
|
+
return _createClass(State);
|
|
483
|
+
}((0, _immutable.Record)({
|
|
484
|
+
mode: _constants.MODE_IDLE,
|
|
485
|
+
scene: new Scene(),
|
|
486
|
+
sceneHistory: new HistoryStructure(),
|
|
487
|
+
catalog: new Catalog(),
|
|
488
|
+
viewer2D: new _immutable.Map(),
|
|
489
|
+
mouse: new _immutable.Map({
|
|
490
|
+
x: 0,
|
|
491
|
+
y: 0
|
|
492
|
+
}),
|
|
493
|
+
zoom: 0,
|
|
494
|
+
snapMask: _snap.SNAP_MASK,
|
|
495
|
+
snapElements: new _immutable.List(),
|
|
496
|
+
activeSnapElement: null,
|
|
497
|
+
replacingSupport: new _immutable.Map(),
|
|
498
|
+
drawingSupport: new _immutable.Map(),
|
|
499
|
+
draggingSupport: new _immutable.Map(),
|
|
500
|
+
rotatingSupport: new _immutable.Map(),
|
|
501
|
+
doorStyle: null,
|
|
502
|
+
oStyle: null,
|
|
503
|
+
errors: new _immutable.List(),
|
|
504
|
+
warnings: new _immutable.List(),
|
|
505
|
+
clipboardProperties: new _immutable.Map(),
|
|
506
|
+
selectedElementsHistory: new _immutable.List(),
|
|
507
|
+
misc: new _immutable.Map(),
|
|
508
|
+
//additional info
|
|
509
|
+
alterate: false,
|
|
510
|
+
isOpen: false,
|
|
511
|
+
popup: false,
|
|
512
|
+
openedType: 0,
|
|
513
|
+
login: false,
|
|
514
|
+
userId: 0,
|
|
515
|
+
isHelp: false,
|
|
516
|
+
isCabinetDrawing: false
|
|
517
|
+
}, 'State'));
|