kitchen-simulator 5.0.0-test.4 → 5.0.0-test.5
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/package.json +1 -2
- package/src/@history.js +0 -3
- package/src/AppContext.js +0 -5
- package/src/KitchenConfigurator.jsx +0 -1517
- package/src/KitchenConfiguratorApp.jsx +0 -443
- package/src/actions/area-actions.js +0 -15
- package/src/actions/export.js +0 -38
- package/src/actions/groups-actions.js +0 -102
- package/src/actions/holes-actions.js +0 -152
- package/src/actions/items-actions.js +0 -393
- package/src/actions/lines-actions.js +0 -103
- package/src/actions/project-actions.js +0 -391
- package/src/actions/scene-actions.js +0 -44
- package/src/actions/user-actions.js +0 -75
- package/src/actions/vertices-actions.js +0 -34
- package/src/actions/viewer2d-actions.js +0 -79
- package/src/actions/viewer3d-actions.js +0 -32
- package/src/catalog/areas/area/planner-element.jsx +0 -43
- package/src/catalog/areas/area/textures/ceramic-tile.jpg +0 -0
- package/src/catalog/areas/area/textures/grass.jpg +0 -0
- package/src/catalog/areas/area/textures/parquet.jpg +0 -0
- package/src/catalog/areas/area/textures/strand-porcelain.jpg +0 -0
- package/src/catalog/areas/area/textures/tile1.jpg +0 -0
- package/src/catalog/back.png +0 -0
- package/src/catalog/catalog.js +0 -258
- package/src/catalog/doors.png +0 -0
- package/src/catalog/doorways.png +0 -0
- package/src/catalog/envMap/nx.hdr +0 -0
- package/src/catalog/envMap/ny.hdr +0 -0
- package/src/catalog/envMap/nz.hdr +0 -0
- package/src/catalog/envMap/px.hdr +0 -0
- package/src/catalog/envMap/py.hdr +0 -0
- package/src/catalog/envMap/pz.hdr +0 -0
- package/src/catalog/factories/area-factory-3d.js +0 -252
- package/src/catalog/factories/area-factory.jsx +0 -102
- package/src/catalog/factories/export.js +0 -9
- package/src/catalog/factories/wall-factory-3d.js +0 -296
- package/src/catalog/factories/wall-factory.jsx +0 -321
- package/src/catalog/holes/door-closet/planner-element.jsx +0 -251
- package/src/catalog/holes/door-double/door_double.png +0 -0
- package/src/catalog/holes/door-double/planner-element.jsx +0 -391
- package/src/catalog/holes/door-exterior/planner-element.jsx +0 -245
- package/src/catalog/holes/door-interior/planner-element.jsx +0 -256
- package/src/catalog/holes/door-panic/panicDoor.png +0 -0
- package/src/catalog/holes/door-panic/planner-element.jsx +0 -594
- package/src/catalog/holes/door-panic-double/panicDoorDouble.png +0 -0
- package/src/catalog/holes/door-panic-double/planner-element.jsx +0 -574
- package/src/catalog/holes/door-sliding/planner-element.jsx +0 -256
- package/src/catalog/holes/doorway-framed/planner-element.jsx +0 -169
- package/src/catalog/holes/doorway-frameless/planner-element.jsx +0 -116
- package/src/catalog/holes/gate/gate.jpg +0 -0
- package/src/catalog/holes/window-clear/planner-element.jsx +0 -181
- package/src/catalog/holes/window-clear/texture.png +0 -0
- package/src/catalog/holes/window-cross/planner-element.jsx +0 -180
- package/src/catalog/holes/window-cross/texture.png +0 -0
- package/src/catalog/holes/window-double-hung/planner-element.jsx +0 -366
- package/src/catalog/holes/window-double-hung/texture.png +0 -0
- package/src/catalog/holes/window-vertical/planner-element.jsx +0 -290
- package/src/catalog/holes/window-vertical/texture.png +0 -0
- package/src/catalog/lines/wall/planner-element.jsx +0 -73
- package/src/catalog/lines/wall/textures/bricks-normal.jpg +0 -0
- package/src/catalog/lines/wall/textures/bricks-normal2.jpg +0 -0
- package/src/catalog/lines/wall/textures/bricks.jpg +0 -0
- package/src/catalog/lines/wall/textures/bricks2.jpg +0 -0
- package/src/catalog/lines/wall/textures/bricks3.jpg +0 -0
- package/src/catalog/lines/wall/textures/morden-normal.jpg +0 -0
- package/src/catalog/lines/wall/textures/morden.jpg +0 -0
- package/src/catalog/lines/wall/textures/painted-normal.jpg +0 -0
- package/src/catalog/lines/wall/textures/painted.jpg +0 -0
- package/src/catalog/lines/wall/textures/plaster-normal.jpg +0 -0
- package/src/catalog/lines/wall/textures/plaster.jpg +0 -0
- package/src/catalog/lines/wall/wall.png +0 -0
- package/src/catalog/molding/molding-dcm/planner-element.jsx +0 -35
- package/src/catalog/molding/molding-dcm/texture.png +0 -0
- package/src/catalog/molding/molding-fbm/planner-element.jsx +0 -35
- package/src/catalog/molding/molding-fbm/texture.png +0 -0
- package/src/catalog/molding/molding-lrm/planner-element.jsx +0 -35
- package/src/catalog/molding/molding-lrm/texture.png +0 -0
- package/src/catalog/properties/export.js +0 -33
- package/src/catalog/properties/property-checkbox.jsx +0 -123
- package/src/catalog/properties/property-color.jsx +0 -52
- package/src/catalog/properties/property-enum.jsx +0 -87
- package/src/catalog/properties/property-hidden.jsx +0 -22
- package/src/catalog/properties/property-lenght-measure.jsx +0 -113
- package/src/catalog/properties/property-length-measure.jsx +0 -129
- package/src/catalog/properties/property-length-measure_hole.jsx +0 -110
- package/src/catalog/properties/property-number.jsx +0 -63
- package/src/catalog/properties/property-read-only.jsx +0 -37
- package/src/catalog/properties/property-string.jsx +0 -59
- package/src/catalog/properties/property-toggle.jsx +0 -51
- package/src/catalog/properties/shared-property-style.js +0 -13
- package/src/catalog/utils/FuseUtils.js +0 -61
- package/src/catalog/utils/exporter.js +0 -173
- package/src/catalog/utils/geom-utils.js +0 -301
- package/src/catalog/utils/item-loader.jsx +0 -2122
- package/src/catalog/utils/load-obj.js +0 -113
- package/src/catalog/utils/mtl-loader.js +0 -462
- package/src/catalog/utils/obj-loader.js +0 -544
- package/src/catalog/windows.png +0 -0
- package/src/class/FuseUtils.js +0 -61
- package/src/class/area.js +0 -159
- package/src/class/export.js +0 -37
- package/src/class/group.js +0 -565
- package/src/class/guide.js +0 -44
- package/src/class/hole.js +0 -1359
- package/src/class/item.js +0 -2050
- package/src/class/layer.js +0 -926
- package/src/class/line.js +0 -1780
- package/src/class/project.js +0 -875
- package/src/class/vertex.js +0 -409
- package/src/components/atoms/Snackbar/index.jsx +0 -43
- package/src/components/atoms/radio-button/index.jsx +0 -20
- package/src/components/atoms/radio-button/styles.js +0 -56
- package/src/components/button/MainButton.jsx +0 -157
- package/src/components/button/ToggleMeasureButton.jsx +0 -65
- package/src/components/catalog-view/catalog-breadcrumb.jsx +0 -53
- package/src/components/catalog-view/catalog-item.jsx +0 -229
- package/src/components/catalog-view/catalog-list.jsx +0 -173
- package/src/components/catalog-view/catalog-page-item.jsx +0 -110
- package/src/components/catalog-view/catalog-turn-back-page-item.jsx +0 -80
- package/src/components/configurator/custom-configurator.jsx +0 -77
- package/src/components/configurator/project-configurator.jsx +0 -120
- package/src/components/content.jsx +0 -136
- package/src/components/export.js +0 -36
- package/src/components/firstsetting/button/styles.js +0 -223
- package/src/components/firstsetting/export.js +0 -9
- package/src/components/firstsetting/firstsetting-content-button.jsx +0 -198
- package/src/components/firstsetting/firstsetting-toggle-button.jsx +0 -101
- package/src/components/firstsetting/firstsetting.jsx +0 -814
- package/src/components/footerbar/button/ControlButton.jsx +0 -43
- package/src/components/footerbar/button/DirectionButton.jsx +0 -54
- package/src/components/footerbar/button/DirectionPanSpinButton.jsx +0 -36
- package/src/components/footerbar/button/ToggleButton.jsx +0 -58
- package/src/components/footerbar/button/ToggleConvertButton.jsx +0 -48
- package/src/components/footerbar/button/ToggleMeasureButton.jsx +0 -33
- package/src/components/footerbar/button/styles.js +0 -217
- package/src/components/footerbar/export.js +0 -9
- package/src/components/footerbar/footer-content-button.jsx +0 -198
- package/src/components/footerbar/footer-toggle-button.jsx +0 -101
- package/src/components/footerbar/footerbar.jsx +0 -1103
- package/src/components/footerbar/styles.js +0 -263
- package/src/components/header/button/MenuButton.jsx +0 -46
- package/src/components/header/button/SaveButton.jsx +0 -54
- package/src/components/header/button/styles.js +0 -181
- package/src/components/header/export.js +0 -5
- package/src/components/header/header.jsx +0 -631
- package/src/components/header/header.style.css +0 -47
- package/src/components/header/styles.js +0 -320
- package/src/components/login/Login.js +0 -77
- package/src/components/login/LoginForm/index.js +0 -108
- package/src/components/login/Register.js +0 -83
- package/src/components/login/RegisterForm/index.js +0 -171
- package/src/components/login/jwtService.js +0 -201
- package/src/components/login/style.css +0 -158
- package/src/components/login/style.scss +0 -260
- package/src/components/molecules/slider/index.jsx +0 -15
- package/src/components/molecules/slider/styles.js +0 -0
- package/src/components/molecules/slider/styles.scss +0 -3
- package/src/components/myprojects/export.js +0 -5
- package/src/components/myprojects/index.jsx +0 -445
- package/src/components/myprojects/styles.js +0 -241
- package/src/components/sidebar/custom-accordion.jsx +0 -48
- package/src/components/sidebar/export.js +0 -15
- package/src/components/sidebar/panel-element-editor/attributes-editor/attributes-editor.jsx +0 -73
- package/src/components/sidebar/panel-element-editor/attributes-editor/confirm-popup.jsx +0 -101
- package/src/components/sidebar/panel-element-editor/attributes-editor/hole-attributes-editor.jsx +0 -149
- package/src/components/sidebar/panel-element-editor/attributes-editor/item-attributes-editor.jsx +0 -316
- package/src/components/sidebar/panel-element-editor/attributes-editor/line-attributes-editor.jsx +0 -108
- package/src/components/sidebar/panel-element-editor/element-editor.jsx +0 -1070
- package/src/components/sidebar/panel-element-editor/multi-elements-editor.jsx +0 -0
- package/src/components/sidebar/panel-element-editor/panel-element-editor.jsx +0 -104
- package/src/components/sidebar/panel-element-editor/panel-multi-elements-editor.jsx +0 -155
- package/src/components/sidebar/panel-group-editor.jsx +0 -272
- package/src/components/sidebar/panel-groups.jsx +0 -310
- package/src/components/sidebar/panel-guides.jsx +0 -192
- package/src/components/sidebar/panel-layer-elements.jsx +0 -298
- package/src/components/sidebar/panel-layers.jsx +0 -381
- package/src/components/sidebar/panel.jsx +0 -71
- package/src/components/sidebar/sidebar.jsx +0 -106
- package/src/components/sidebar/toolbar-panel.jsx +0 -139
- package/src/components/sign/export.js +0 -7
- package/src/components/sign/main/index.jsx +0 -523
- package/src/components/sign/main/styles.js +0 -163
- package/src/components/style/button.jsx +0 -95
- package/src/components/style/cancel-button.jsx +0 -20
- package/src/components/style/content-container.jsx +0 -29
- package/src/components/style/content-title.jsx +0 -20
- package/src/components/style/delete-button.jsx +0 -23
- package/src/components/style/export.jsx +0 -48
- package/src/components/style/form-block.jsx +0 -13
- package/src/components/style/form-color-input.jsx +0 -27
- package/src/components/style/form-label.jsx +0 -15
- package/src/components/style/form-number-input.jsx +0 -196
- package/src/components/style/form-number-input_2.jsx +0 -191
- package/src/components/style/form-select.jsx +0 -38
- package/src/components/style/form-slider.jsx +0 -36
- package/src/components/style/form-submit-button.jsx +0 -23
- package/src/components/style/form-text-input.jsx +0 -65
- package/src/components/toolbar/button/ControlButton.jsx +0 -41
- package/src/components/toolbar/button/DirectionButton.jsx +0 -34
- package/src/components/toolbar/button/RightButton.jsx +0 -103
- package/src/components/toolbar/button/ToggleButton.jsx +0 -41
- package/src/components/toolbar/button/index.jsx +0 -55
- package/src/components/toolbar/button/styles.js +0 -127
- package/src/components/toolbar/components/DoorStyleMenu.jsx +0 -103
- package/src/components/toolbar/components/Pricing.jsx +0 -126
- package/src/components/toolbar/components/ReviewForQuote.jsx +0 -635
- package/src/components/toolbar/export.js +0 -21
- package/src/components/toolbar/main/Alert.js +0 -122
- package/src/components/toolbar/main/TakePictureModal.jsx +0 -104
- package/src/components/toolbar/main/confirm-popup.jsx +0 -99
- package/src/components/toolbar/main/index.jsx +0 -5687
- package/src/components/toolbar/main/lShaped.json +0 -311
- package/src/components/toolbar/main/longNarrow.json +0 -238
- package/src/components/toolbar/main/myComponents.js +0 -123
- package/src/components/toolbar/main/oRectangle.json +0 -220
- package/src/components/toolbar/main/rectangle.json +0 -238
- package/src/components/toolbar/main/style.css +0 -107
- package/src/components/toolbar/main/styles.js +0 -696
- package/src/components/toolbar/plugin-item.jsx +0 -123
- package/src/components/toolbar/popup/appliance/appliance-category/index.jsx +0 -73
- package/src/components/toolbar/popup/appliance/choose-appliance/index.jsx +0 -102
- package/src/components/toolbar/popup/appliance/index.jsx +0 -83
- package/src/components/toolbar/popup/autosaveprompt/index.jsx +0 -150
- package/src/components/toolbar/popup/autosaveprompt/styles.css +0 -64
- package/src/components/toolbar/popup/autosaveprompt/styles.js +0 -40
- package/src/components/toolbar/popup/cabinet/cabinet-category/index.jsx +0 -73
- package/src/components/toolbar/popup/cabinet/choose-product/index.jsx +0 -119
- package/src/components/toolbar/popup/cabinet/index.jsx +0 -85
- package/src/components/toolbar/popup/doorStyle/choose-style/index.jsx +0 -63
- package/src/components/toolbar/popup/doorStyle/index.jsx +0 -71
- package/src/components/toolbar/popup/doorStyle/style-category/index.jsx +0 -139
- package/src/components/toolbar/popup/downloadsummary/downloadSummaryContext.js +0 -2
- package/src/components/toolbar/popup/downloadsummary/downloadSummaryTemp.jsx +0 -157
- package/src/components/toolbar/popup/downloadsummary/index.jsx +0 -643
- package/src/components/toolbar/popup/downloadsummary/show2D/show2DView.jsx +0 -51
- package/src/components/toolbar/popup/downloadsummary/show2D/viewer2DDownLoad.jsx +0 -175
- package/src/components/toolbar/popup/downloadsummary/show3D/show3DView.jsx +0 -283
- package/src/components/toolbar/popup/downloadsummary/show3D/viewer3DDownLoad.jsx +0 -2257
- package/src/components/toolbar/popup/downloadsummary/showCabinetInfo.js +0 -93
- package/src/components/toolbar/popup/downloadsummary/showElevation/showElevationView.jsx +0 -132
- package/src/components/toolbar/popup/downloadsummary/showElevation/viewer3DElevationDownload.jsx +0 -2198
- package/src/components/toolbar/popup/downloadsummary/showElevation/viewerElevationDownload.jsx +0 -152
- package/src/components/toolbar/popup/downloadsummary/showWarranty.jsx +0 -149
- package/src/components/toolbar/popup/downloadsummary/styles.css +0 -177
- package/src/components/toolbar/popup/downloadsummary/styles.js +0 -453
- package/src/components/toolbar/popup/finishingtouch/category/index.jsx +0 -34
- package/src/components/toolbar/popup/finishingtouch/index.jsx +0 -58
- package/src/components/toolbar/popup/finishingtouch/material-edit.jsx +0 -112
- package/src/components/toolbar/popup/finishingtouch/product/index.jsx +0 -116
- package/src/components/toolbar/popup/floorplan/choose-floor/confirm-popup.jsx +0 -101
- package/src/components/toolbar/popup/floorplan/choose-floor/index.jsx +0 -254
- package/src/components/toolbar/popup/floorplan/choose-floor/lShaped.json +0 -311
- package/src/components/toolbar/popup/floorplan/choose-floor/longNarrow.json +0 -238
- package/src/components/toolbar/popup/floorplan/choose-floor/oRectangle.json +0 -220
- package/src/components/toolbar/popup/floorplan/choose-floor/rectangle.json +0 -238
- package/src/components/toolbar/popup/floorplan/choose-floor/styles.js +0 -86
- package/src/components/toolbar/popup/floorplan/floor-category/index.jsx +0 -109
- package/src/components/toolbar/popup/floorplan/index.jsx +0 -60
- package/src/components/toolbar/popup/index.jsx +0 -241
- package/src/components/toolbar/popup/newproject/index.jsx +0 -59
- package/src/components/toolbar/popup/newproject/styles.css +0 -64
- package/src/components/toolbar/popup/newproject/styles.js +0 -41
- package/src/components/toolbar/popup/product/appliance.jsx +0 -54
- package/src/components/toolbar/popup/product/cabinetproduct.jsx +0 -15
- package/src/components/toolbar/popup/product/doorstyle.jsx +0 -58
- package/src/components/toolbar/popup/product/doorstyleproduct.jsx +0 -47
- package/src/components/toolbar/popup/product/floor.jsx +0 -36
- package/src/components/toolbar/popup/product/floorproduct.jsx +0 -42
- package/src/components/toolbar/popup/product/index.jsx +0 -36
- package/src/components/toolbar/popup/product/primary.jsx +0 -77
- package/src/components/toolbar/popup/product/productline.jsx +0 -93
- package/src/components/toolbar/popup/product/reviewItem.jsx +0 -427
- package/src/components/toolbar/popup/product/reviewMolding.jsx +0 -310
- package/src/components/toolbar/popup/product/style.css +0 -54
- package/src/components/toolbar/popup/product/styles.js +0 -260
- package/src/components/toolbar/popup/savedesign/FullPictureForm.jsx +0 -146
- package/src/components/toolbar/popup/savedesign/index.jsx +0 -495
- package/src/components/toolbar/popup/savedesign/savedesign.style.css +0 -16
- package/src/components/toolbar/popup/savedesign/styles.js +0 -151
- package/src/components/toolbar/popup/setDoorStyleOption/index.jsx +0 -87
- package/src/components/toolbar/popup/styles.js +0 -909
- package/src/components/toolbar/popup/submitforquote/AddToCartOptions.jsx +0 -192
- package/src/components/toolbar/popup/submitforquote/CustomerRequestsForm.jsx +0 -96
- package/src/components/toolbar/popup/submitforquote/SkipDesignerReview.jsx +0 -54
- package/src/components/toolbar/popup/submitforquote/StepDots.jsx +0 -25
- package/src/components/toolbar/popup/submitforquote/cart-choice.jsx +0 -116
- package/src/components/toolbar/popup/submitforquote/doorstyle-menus.js +0 -38
- package/src/components/toolbar/popup/submitforquote/index.jsx +0 -698
- package/src/components/toolbar/popup/submitforquote/styles.css +0 -105
- package/src/components/toolbar/popup/submitforquote/styles.js +0 -294
- package/src/components/toolbar/popup/submitprompt/index.jsx +0 -89
- package/src/components/toolbar/popup/submitprompt/styles.css +0 -64
- package/src/components/toolbar/popup/submitprompt/styles.js +0 -42
- package/src/components/toolbar/toolbar-button.jsx +0 -90
- package/src/components/toolbar/toolbar-load-button.jsx +0 -36
- package/src/components/toolbar/toolbar-save-button.jsx +0 -32
- package/src/components/tutorial-view/Modal.jsx +0 -584
- package/src/components/tutorial-view/style.css +0 -111
- package/src/components/tutorial-view/styles.js +0 -65
- package/src/components/viewer2d/area.jsx +0 -98
- package/src/components/viewer2d/export.js +0 -48
- package/src/components/viewer2d/grids/grid-horizontal-streak.jsx +0 -40
- package/src/components/viewer2d/grids/grid-streak.jsx +0 -32
- package/src/components/viewer2d/grids/grid-vertical-streak.jsx +0 -41
- package/src/components/viewer2d/grids/grids.jsx +0 -30
- package/src/components/viewer2d/group.jsx +0 -57
- package/src/components/viewer2d/item.jsx +0 -618
- package/src/components/viewer2d/layer.jsx +0 -214
- package/src/components/viewer2d/line.jsx +0 -1358
- package/src/components/viewer2d/ruler.jsx +0 -136
- package/src/components/viewer2d/rulerDist.jsx +0 -192
- package/src/components/viewer2d/rulerX.jsx +0 -141
- package/src/components/viewer2d/rulerY.jsx +0 -138
- package/src/components/viewer2d/scene.jsx +0 -94
- package/src/components/viewer2d/snap.jsx +0 -118
- package/src/components/viewer2d/state.jsx +0 -77
- package/src/components/viewer2d/utils.js +0 -195
- package/src/components/viewer2d/vertex.jsx +0 -76
- package/src/components/viewer2d/viewer2d.jsx +0 -1830
- package/src/components/viewer3d/camera-controls-module/camera-controls.module.js +0 -3078
- package/src/components/viewer3d/dcm.js +0 -226
- package/src/components/viewer3d/fbm.js +0 -383
- package/src/components/viewer3d/front3D.jsx +0 -63
- package/src/components/viewer3d/grid-creator.js +0 -25
- package/src/components/viewer3d/grids/grid-horizontal-streak.js +0 -41
- package/src/components/viewer3d/grids/grid-streak.js +0 -34
- package/src/components/viewer3d/grids/grid-vertical-streak.js +0 -42
- package/src/components/viewer3d/libs/first-person-controls.js +0 -70
- package/src/components/viewer3d/libs/helvetiker_regular.typeface.js +0 -1265
- package/src/components/viewer3d/libs/mtl-loader.js +0 -462
- package/src/components/viewer3d/libs/obj-loader.js +0 -653
- package/src/components/viewer3d/libs/orbit-controls.js +0 -945
- package/src/components/viewer3d/libs/pointer-lock-controls.js +0 -67
- package/src/components/viewer3d/lrm.js +0 -358
- package/src/components/viewer3d/model.js +0 -830
- package/src/components/viewer3d/pointer-lock-navigation.js +0 -140
- package/src/components/viewer3d/ruler-utils/itemRect.jsx +0 -91
- package/src/components/viewer3d/ruler-utils/layer3D.jsx +0 -528
- package/src/components/viewer3d/ruler-utils/ruler3D.jsx +0 -218
- package/src/components/viewer3d/ruler-utils/scene3D.jsx +0 -87
- package/src/components/viewer3d/ruler-utils/state3D.jsx +0 -25
- package/src/components/viewer3d/scene-creator.js +0 -5172
- package/src/components/viewer3d/three-memory-cleaner.js +0 -65
- package/src/components/viewer3d/viewer3d-first-person.js +0 -395
- package/src/components/viewer3d/viewer3d.js +0 -3376
- package/src/components/wizardstep/button/styles.js +0 -677
- package/src/components/wizardstep/export.js +0 -5
- package/src/components/wizardstep/index.jsx +0 -1372
- package/src/components/wizardstep/styles.js +0 -688
- package/src/components/wizardstep/wizardstep-content-button.jsx +0 -198
- package/src/components/wizardstep/wizardstep-toggle-button.jsx +0 -101
- package/src/constants.js +0 -731
- package/src/hooks/useCheckCart.js +0 -38
- package/src/hooks/useGetPricesBySku.js +0 -59
- package/src/hooks/useValidateToken.js +0 -181
- package/src/index.js +0 -32
- package/src/models.js +0 -541
- package/src/plugins/SVGLoader.js +0 -1991
- package/src/plugins/autosave.js +0 -39
- package/src/plugins/console-debugger.js +0 -36
- package/src/plugins/export.js +0 -11
- package/src/plugins/keyboard.js +0 -194
- package/src/reducers/areas-reducer.js +0 -13
- package/src/reducers/export.js +0 -39
- package/src/reducers/groups-reducer.js +0 -73
- package/src/reducers/holes-reducer.js +0 -125
- package/src/reducers/items-reducer.js +0 -286
- package/src/reducers/lines-reducer.js +0 -96
- package/src/reducers/project-reducer.js +0 -239
- package/src/reducers/reducer.js +0 -59
- package/src/reducers/scene-reducer.js +0 -41
- package/src/reducers/user-reducer.js +0 -30
- package/src/reducers/vertices-reducer.js +0 -34
- package/src/reducers/viewer2d-reducer.js +0 -81
- package/src/reducers/viewer3d-reducer.js +0 -65
- package/src/shared-style.js +0 -72
- package/src/styles/export.js +0 -7
- package/src/styles/tabs.css +0 -40
- package/src/translator/en.js +0 -106
- package/src/translator/it.js +0 -80
- package/src/translator/ru.js +0 -80
- package/src/translator/translator.js +0 -81
- package/src/utils/browser.js +0 -36
- package/src/utils/email-validator.js +0 -5
- package/src/utils/export.js +0 -39
- package/src/utils/geometry.js +0 -2572
- package/src/utils/get-edges-of-subgraphs.js +0 -29
- package/src/utils/graph-cycles.js +0 -259
- package/src/utils/graph-inner-cycles.js +0 -49
- package/src/utils/graph.js +0 -147
- package/src/utils/helper.js +0 -431
- package/src/utils/history.js +0 -37
- package/src/utils/id-broker.js +0 -9
- package/src/utils/logger.js +0 -8
- package/src/utils/math.js +0 -51
- package/src/utils/molding.js +0 -973
- package/src/utils/name-generator.js +0 -5
- package/src/utils/objects-utils.js +0 -56
- package/src/utils/phone-validator.js +0 -4
- package/src/utils/process-black-list.js +0 -10
- package/src/utils/react-if.jsx +0 -20
- package/src/utils/snap-scene.js +0 -102
- package/src/utils/snap.js +0 -184
- package/src/utils/threeCSG.es6.js +0 -578
- package/src/version.js +0 -1
package/src/class/project.js
DELETED
|
@@ -1,875 +0,0 @@
|
|
|
1
|
-
import { List, Map } from 'immutable';
|
|
2
|
-
import * as constants from '../constants';
|
|
3
|
-
import {
|
|
4
|
-
ARRAY_3D_MODES,
|
|
5
|
-
MODE_CONFIGURING_PROJECT,
|
|
6
|
-
MODE_DRAWING_HOLE,
|
|
7
|
-
MODE_DRAWING_ITEM,
|
|
8
|
-
MODE_DRAWING_ITEM_3D,
|
|
9
|
-
MODE_IDLE,
|
|
10
|
-
MODE_IDLE_3D,
|
|
11
|
-
MODE_VIEWING_CATALOG,
|
|
12
|
-
MODE_WAITING_DRAWING_LINE
|
|
13
|
-
} from '../constants';
|
|
14
|
-
import { Catalog, Scene, State } from '../models';
|
|
15
|
-
import { history } from '../utils/export';
|
|
16
|
-
import { isEmpty } from '../utils/helper';
|
|
17
|
-
import {
|
|
18
|
-
Area,
|
|
19
|
-
Group,
|
|
20
|
-
Hole,
|
|
21
|
-
HorizontalGuide,
|
|
22
|
-
Item,
|
|
23
|
-
Layer,
|
|
24
|
-
Line,
|
|
25
|
-
VerticalGuide
|
|
26
|
-
} from '../class/export';
|
|
27
|
-
import * as viewer2DActions from '../actions/viewer2d-actions';
|
|
28
|
-
|
|
29
|
-
class Project {
|
|
30
|
-
static setAlterate(state) {
|
|
31
|
-
return { updatedState: state.set('alterate', !state.alterate) };
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
static openCatalog(state) {
|
|
35
|
-
state = this.setMode(state, MODE_VIEWING_CATALOG).updatedState;
|
|
36
|
-
|
|
37
|
-
return { updatedState: state };
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
static newProject(state) {
|
|
41
|
-
let doorStyle =
|
|
42
|
-
state.toJS().doorStyle === null ? null : state.toJS().doorStyle;
|
|
43
|
-
let oStyle = state.oStyle;
|
|
44
|
-
// let counterTop = state.getIn(['scene', 'layers', layerID, 'counterTop']);
|
|
45
|
-
// let floorStyle = state.getIn(['scene', 'layers', layerID, 'floorStyle']);
|
|
46
|
-
let _viewer2D = state.viewer2D;
|
|
47
|
-
let viewer = state.viewer2D.toJS();
|
|
48
|
-
_viewer2D = _viewer2D.merge({
|
|
49
|
-
e: viewer.viewerWidth / 2 - viewer.SVGWidth / 2,
|
|
50
|
-
f: viewer.viewerHeight / 2 - viewer.SVGHeight / 2,
|
|
51
|
-
a: 0.99,
|
|
52
|
-
d: 0.99
|
|
53
|
-
});
|
|
54
|
-
|
|
55
|
-
state = new State({});
|
|
56
|
-
state = state.merge({
|
|
57
|
-
doorStyle: doorStyle,
|
|
58
|
-
oStyle: oStyle,
|
|
59
|
-
viewer2D: _viewer2D
|
|
60
|
-
});
|
|
61
|
-
// state = Item.setCounterTop(state, counterTop).updatedState;
|
|
62
|
-
// state = Area.setFloorStyles(state, floorStyle).updatedState;
|
|
63
|
-
return { updatedState: state };
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
static loadProject(state, sceneJSON, categoryData) {
|
|
67
|
-
console.log({
|
|
68
|
-
sceneJSON,
|
|
69
|
-
categoryData
|
|
70
|
-
});
|
|
71
|
-
let doorStyle = state.doorStyle;
|
|
72
|
-
let oStyle = state.oStyle;
|
|
73
|
-
let layerID = state.scene.selectedLayer;
|
|
74
|
-
let _viewer2D = state.viewer2D;
|
|
75
|
-
let viewer = state.viewer2D.toJS();
|
|
76
|
-
let counterTop = state.getIn(['scene', 'layers', layerID, 'counterTop']);
|
|
77
|
-
let floorStyle = state.getIn(['scene', 'layers', layerID, 'floorStyle']);
|
|
78
|
-
|
|
79
|
-
let a, e, f;
|
|
80
|
-
e = viewer.viewerWidth / 2 - viewer.SVGWidth / 2;
|
|
81
|
-
f = viewer.viewerHeight / 2 - viewer.SVGHeight / 2;
|
|
82
|
-
_viewer2D = _viewer2D.merge({
|
|
83
|
-
e: e,
|
|
84
|
-
f: f,
|
|
85
|
-
a: 0.99,
|
|
86
|
-
d: 0.99
|
|
87
|
-
});
|
|
88
|
-
|
|
89
|
-
let { scene: oldScene, sceneHistory: oldSceneHistory } = state;
|
|
90
|
-
let json_items = sceneJSON.layers[sceneJSON.selectedLayer].items;
|
|
91
|
-
let elements = state.catalog.get('elements').toArray();
|
|
92
|
-
for (let x in json_items) {
|
|
93
|
-
let idx = elements.findIndex(
|
|
94
|
-
it =>
|
|
95
|
-
it.itemID === json_items[x].itemID &&
|
|
96
|
-
it.type === json_items[x].category
|
|
97
|
-
);
|
|
98
|
-
if (idx > -1) {
|
|
99
|
-
json_items[x].name = elements[idx].name;
|
|
100
|
-
json_items[x].type = elements[idx].name;
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
let newScene = new Scene(sceneJSON);
|
|
104
|
-
state = new State({
|
|
105
|
-
scene: newScene.toJS(),
|
|
106
|
-
catalog: state.catalog.toJS()
|
|
107
|
-
});
|
|
108
|
-
state = state.merge({
|
|
109
|
-
sceneHistory: history.historyPush(oldSceneHistory, oldScene)
|
|
110
|
-
});
|
|
111
|
-
if (state.scene.title === '') {
|
|
112
|
-
state = state.mergeIn(['scene', 'title'], oldScene.title);
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
//Validate item positions after loading project.
|
|
116
|
-
state = Item.validateItemPositions(state, layerID).updatedState;
|
|
117
|
-
|
|
118
|
-
// get counterTop and floorStyle is after state created from sceneJSON
|
|
119
|
-
if (state.getIn(['scene', 'layers', layerID, 'counterTop']).uri) {
|
|
120
|
-
counterTop = state.getIn(['scene', 'layers', layerID, 'counterTop']);
|
|
121
|
-
}
|
|
122
|
-
if (state.getIn(['scene', 'layers', layerID, 'floorStyle']).uri) {
|
|
123
|
-
floorStyle = state.getIn(['scene', 'layers', layerID, 'floorStyle']);
|
|
124
|
-
}
|
|
125
|
-
const layer = state.scene.getIn(['layers', state.scene.selectedLayer]);
|
|
126
|
-
let bb = {
|
|
127
|
-
minX: Infinity,
|
|
128
|
-
maxX: -Infinity,
|
|
129
|
-
minY: Infinity,
|
|
130
|
-
maxY: -Infinity
|
|
131
|
-
};
|
|
132
|
-
bb = layer.vertices.reduce((pre, cur) => {
|
|
133
|
-
pre.minX = Math.min(pre.minX, cur.x);
|
|
134
|
-
pre.maxX = Math.max(pre.maxX, cur.x);
|
|
135
|
-
pre.minY = Math.min(pre.minY, cur.y);
|
|
136
|
-
pre.maxY = Math.max(pre.maxY, cur.y);
|
|
137
|
-
return pre;
|
|
138
|
-
}, bb);
|
|
139
|
-
|
|
140
|
-
let w = bb.maxX - bb.minX;
|
|
141
|
-
let h = bb.maxY - bb.minY;
|
|
142
|
-
|
|
143
|
-
if (
|
|
144
|
-
w != 0 &&
|
|
145
|
-
Math.abs(w) != Infinity &&
|
|
146
|
-
h != 0 &&
|
|
147
|
-
Math.abs(h) != Infinity
|
|
148
|
-
) {
|
|
149
|
-
a =
|
|
150
|
-
viewer.viewerHeight < h
|
|
151
|
-
? viewer.viewerHeight / h
|
|
152
|
-
: (((viewer.viewerHeight / h) * 3) / 5 - 0.5) /
|
|
153
|
-
constants.ZOOM_VARIABLE >
|
|
154
|
-
400
|
|
155
|
-
? ((viewer.viewerHeight / h) * 400) /
|
|
156
|
-
((viewer.viewerHeight / h - 0.5) / constants.ZOOM_VARIABLE)
|
|
157
|
-
: ((viewer.viewerHeight / h) * 3) / 5;
|
|
158
|
-
e = (viewer.viewerWidth - (bb.maxX + bb.minX) * a) / 2;
|
|
159
|
-
f =
|
|
160
|
-
(viewer.viewerHeight - (viewer.SVGHeight * 2 - bb.maxY - bb.minY) * a) /
|
|
161
|
-
2;
|
|
162
|
-
while (!(e <= 10)) {
|
|
163
|
-
e -= 0.1;
|
|
164
|
-
}
|
|
165
|
-
while (!(e + a * viewer.SVGWidth + 10 >= viewer.viewerWidth)) {
|
|
166
|
-
e += 0.1;
|
|
167
|
-
}
|
|
168
|
-
while (!(f <= 80)) {
|
|
169
|
-
f -= 0.1;
|
|
170
|
-
}
|
|
171
|
-
while (!(f + a * viewer.SVGHeight + 10 >= viewer.viewerHeight)) {
|
|
172
|
-
f += 0.1;
|
|
173
|
-
}
|
|
174
|
-
_viewer2D = _viewer2D.merge({
|
|
175
|
-
a: a,
|
|
176
|
-
d: a,
|
|
177
|
-
e: e,
|
|
178
|
-
f: f
|
|
179
|
-
});
|
|
180
|
-
}
|
|
181
|
-
if (!doorStyle) {
|
|
182
|
-
if (state.getIn(['scene', 'layers', layerID, 'doorStyle'])) {
|
|
183
|
-
doorStyle = state.getIn(['scene', 'layers', layerID, 'doorStyle']);
|
|
184
|
-
}
|
|
185
|
-
}
|
|
186
|
-
|
|
187
|
-
state = state.merge({
|
|
188
|
-
doorStyle: doorStyle,
|
|
189
|
-
oStyle: oStyle,
|
|
190
|
-
viewer2D: _viewer2D
|
|
191
|
-
});
|
|
192
|
-
state = Item.setCounterTop(state, counterTop).updatedState;
|
|
193
|
-
state = Area.setFloorStyles(state, floorStyle).updatedState;
|
|
194
|
-
if (
|
|
195
|
-
state.getIn(['scene', 'layers', layerID, 'doorStyle']) &&
|
|
196
|
-
!state.getIn(['scene', 'layers', layerID, 'doorStyle', 'install'])
|
|
197
|
-
) {
|
|
198
|
-
let layerDoorStyle = state.getIn([
|
|
199
|
-
'scene',
|
|
200
|
-
'layers',
|
|
201
|
-
layerID,
|
|
202
|
-
'doorStyle'
|
|
203
|
-
]);
|
|
204
|
-
let install = '';
|
|
205
|
-
categoryData.data.doorStyles.items.forEach(category => {
|
|
206
|
-
category.items.forEach(element => {
|
|
207
|
-
if (
|
|
208
|
-
element.items.filter(
|
|
209
|
-
it =>
|
|
210
|
-
it.id === layerDoorStyle.id &&
|
|
211
|
-
(layerDoorStyle.install
|
|
212
|
-
? category.name === layerDoorStyle.install
|
|
213
|
-
: true)
|
|
214
|
-
).length
|
|
215
|
-
) {
|
|
216
|
-
install = category.name;
|
|
217
|
-
}
|
|
218
|
-
});
|
|
219
|
-
});
|
|
220
|
-
layerDoorStyle = { ...layerDoorStyle, install: install };
|
|
221
|
-
state = state.mergeIn(
|
|
222
|
-
['scene', 'layers', layerID, 'doorStyle'],
|
|
223
|
-
layerDoorStyle
|
|
224
|
-
);
|
|
225
|
-
}
|
|
226
|
-
this.updateZoomScale(state, a);
|
|
227
|
-
viewer2DActions.updateCameraView(_viewer2D);
|
|
228
|
-
return { updatedState: state };
|
|
229
|
-
}
|
|
230
|
-
|
|
231
|
-
static setProperties(state, layerID, properties) {
|
|
232
|
-
let propJS = properties.toJS();
|
|
233
|
-
if (propJS && !propJS.altitude) {
|
|
234
|
-
alert('You can not set width to 0');
|
|
235
|
-
return { updatedState: state };
|
|
236
|
-
}
|
|
237
|
-
state = Layer.setPropertiesOnSelected(
|
|
238
|
-
state,
|
|
239
|
-
layerID,
|
|
240
|
-
properties
|
|
241
|
-
).updatedState;
|
|
242
|
-
state = Layer.updateMovingState(state, false).updatedState;
|
|
243
|
-
return { updatedState: state };
|
|
244
|
-
}
|
|
245
|
-
|
|
246
|
-
static updateProperties(state, layerID, properties) {
|
|
247
|
-
state = Layer.updatePropertiesOnSelected(
|
|
248
|
-
state,
|
|
249
|
-
layerID,
|
|
250
|
-
properties
|
|
251
|
-
).updatedState;
|
|
252
|
-
return { updatedState: state };
|
|
253
|
-
}
|
|
254
|
-
|
|
255
|
-
static setItemsAttributes(state, attributes) {
|
|
256
|
-
//TODO apply only to items
|
|
257
|
-
state = Layer.updateMovingState(state, false).updatedState;
|
|
258
|
-
state.getIn(['scene', 'layers']).forEach(layer => {
|
|
259
|
-
state = Layer.setAttributesOnSelected(
|
|
260
|
-
state,
|
|
261
|
-
layer.id,
|
|
262
|
-
attributes
|
|
263
|
-
).updatedState;
|
|
264
|
-
});
|
|
265
|
-
|
|
266
|
-
return { updatedState: state };
|
|
267
|
-
}
|
|
268
|
-
|
|
269
|
-
static setLinesAttributes(state, attributes, isDirect, directData) {
|
|
270
|
-
//TODO apply only to lines
|
|
271
|
-
if (!isDirect) {
|
|
272
|
-
state.getIn(['scene', 'layers']).forEach(layer => {
|
|
273
|
-
state = Layer.setAttributesOnSelected(
|
|
274
|
-
state,
|
|
275
|
-
layer.id,
|
|
276
|
-
attributes
|
|
277
|
-
).updatedState;
|
|
278
|
-
});
|
|
279
|
-
} else if (isDirect && directData !== null) {
|
|
280
|
-
const { layerID, lineID } = directData;
|
|
281
|
-
if (layerID && lineID)
|
|
282
|
-
state = Line.setAttributes(
|
|
283
|
-
state,
|
|
284
|
-
layerID,
|
|
285
|
-
lineID,
|
|
286
|
-
attributes
|
|
287
|
-
).updatedState;
|
|
288
|
-
}
|
|
289
|
-
return { updatedState: state };
|
|
290
|
-
}
|
|
291
|
-
|
|
292
|
-
static setHolesAttributes(state, attributes) {
|
|
293
|
-
//TODO apply only to holes
|
|
294
|
-
state.getIn(['scene', 'layers']).forEach(layer => {
|
|
295
|
-
state = Layer.setAttributesOnSelected(
|
|
296
|
-
state,
|
|
297
|
-
layer.id,
|
|
298
|
-
attributes
|
|
299
|
-
).updatedState;
|
|
300
|
-
});
|
|
301
|
-
|
|
302
|
-
return { updatedState: state };
|
|
303
|
-
}
|
|
304
|
-
|
|
305
|
-
static unselectAll(state) {
|
|
306
|
-
state.getIn(['scene', 'layers']).forEach(({ id: layerID }) => {
|
|
307
|
-
state = Layer.unselectAll(state, layerID).updatedState;
|
|
308
|
-
});
|
|
309
|
-
state.getIn(['scene', 'groups']).forEach(group => {
|
|
310
|
-
state = Group.unselect(state, group.get('id')).updatedState;
|
|
311
|
-
});
|
|
312
|
-
let mode = state.getIn(['mode']);
|
|
313
|
-
if (
|
|
314
|
-
mode === constants.MODE_DRAGGING_LINE ||
|
|
315
|
-
mode === constants.MODE_DRAGGING_VERTEX
|
|
316
|
-
) {
|
|
317
|
-
if (mode.includes('3D')) {
|
|
318
|
-
state = state.setIn(['mode'], MODE_IDLE_3D);
|
|
319
|
-
} else state = state.setIn(['mode'], MODE_IDLE);
|
|
320
|
-
state = state.merge({
|
|
321
|
-
activeSnapElement: null,
|
|
322
|
-
snapElements: new List()
|
|
323
|
-
});
|
|
324
|
-
}
|
|
325
|
-
|
|
326
|
-
return { updatedState: state };
|
|
327
|
-
}
|
|
328
|
-
|
|
329
|
-
static selectAll(state, value) {
|
|
330
|
-
if (value == null) {
|
|
331
|
-
state.getIn(['scene', 'layers']).forEach(({ id: layerID }) => {
|
|
332
|
-
state = Layer.selectAll(state, layerID).updatedState;
|
|
333
|
-
});
|
|
334
|
-
} else {
|
|
335
|
-
let layerID = state.getIn(['scene', 'selectedLayer']);
|
|
336
|
-
let layer = state.scene.layers.get(layerID);
|
|
337
|
-
layer.items.forEach(data => {
|
|
338
|
-
let x = state.getIn([
|
|
339
|
-
'scene',
|
|
340
|
-
'layers',
|
|
341
|
-
layerID,
|
|
342
|
-
'items',
|
|
343
|
-
data.id,
|
|
344
|
-
'x'
|
|
345
|
-
]);
|
|
346
|
-
state = state.mergeIn(
|
|
347
|
-
['scene', 'layers', layerID, 'items', data.id, 'x'],
|
|
348
|
-
x + value.x
|
|
349
|
-
);
|
|
350
|
-
let y = state.getIn([
|
|
351
|
-
'scene',
|
|
352
|
-
'layers',
|
|
353
|
-
layerID,
|
|
354
|
-
'items',
|
|
355
|
-
data.id,
|
|
356
|
-
'y'
|
|
357
|
-
]);
|
|
358
|
-
state = state.mergeIn(
|
|
359
|
-
['scene', 'layers', layerID, 'items', data.id, 'y'],
|
|
360
|
-
y + value.y
|
|
361
|
-
);
|
|
362
|
-
});
|
|
363
|
-
// layer.lines.forEach(data => { state = Layer.selectElement(state, layerID, "lines", data.id).updatedState });
|
|
364
|
-
// layer.holes.forEach(data => { state = Layer.selectElement(state, layerID, "holes", data.id).updatedState });
|
|
365
|
-
// layer.areas.forEach(data => { state = Layer.selectElement(state, layerID, "areas", data.id).updatedState });
|
|
366
|
-
layer.vertices.forEach(data => {
|
|
367
|
-
let x = state.getIn([
|
|
368
|
-
'scene',
|
|
369
|
-
'layers',
|
|
370
|
-
layerID,
|
|
371
|
-
'vertices',
|
|
372
|
-
data.id,
|
|
373
|
-
'x'
|
|
374
|
-
]);
|
|
375
|
-
state = state.mergeIn(
|
|
376
|
-
['scene', 'layers', layerID, 'vertices', data.id, 'x'],
|
|
377
|
-
x + value.x
|
|
378
|
-
);
|
|
379
|
-
let y = state.getIn([
|
|
380
|
-
'scene',
|
|
381
|
-
'layers',
|
|
382
|
-
layerID,
|
|
383
|
-
'vertices',
|
|
384
|
-
data.id,
|
|
385
|
-
'y'
|
|
386
|
-
]);
|
|
387
|
-
state = state.mergeIn(
|
|
388
|
-
['scene', 'layers', layerID, 'vertices', data.id, 'y'],
|
|
389
|
-
y + value.y
|
|
390
|
-
);
|
|
391
|
-
});
|
|
392
|
-
|
|
393
|
-
return { updatedState: state };
|
|
394
|
-
}
|
|
395
|
-
// state.getIn(['scene', 'groups']).forEach(group => { state = Group.unselect(state, group.get('id')).updatedState; });
|
|
396
|
-
|
|
397
|
-
return { updatedState: state };
|
|
398
|
-
}
|
|
399
|
-
|
|
400
|
-
static remove(state) {
|
|
401
|
-
let selectedLayer = state.getIn(['scene', 'selectedLayer']);
|
|
402
|
-
let {
|
|
403
|
-
lines: selectedLines,
|
|
404
|
-
holes: selectedHoles,
|
|
405
|
-
items: selectedItems
|
|
406
|
-
} = state.getIn(['scene', 'layers', selectedLayer, 'selected']);
|
|
407
|
-
let lineID = selectedLines.first();
|
|
408
|
-
let allVertices = state
|
|
409
|
-
.getIn(['scene', 'layers', selectedLayer, 'vertices'])
|
|
410
|
-
.toJS();
|
|
411
|
-
let selLines = state
|
|
412
|
-
.getIn(['scene', 'layers', selectedLayer, 'selected', 'lines'])
|
|
413
|
-
.toJS();
|
|
414
|
-
let delLine =
|
|
415
|
-
!isEmpty(lineID) &&
|
|
416
|
-
state.getIn(['scene', 'layers', selectedLayer, 'lines', lineID]).toJS();
|
|
417
|
-
|
|
418
|
-
let line = state.getIn(['scene', 'layers', selectedLayer, 'lines', lineID]);
|
|
419
|
-
|
|
420
|
-
state = Layer.unselectAll(state, selectedLayer).updatedState;
|
|
421
|
-
|
|
422
|
-
selectedLines.forEach(lineID => {
|
|
423
|
-
state = Line.remove(state, selectedLayer, lineID).updatedState;
|
|
424
|
-
});
|
|
425
|
-
selectedHoles.forEach(holeID => {
|
|
426
|
-
state = Hole.remove(state, selectedLayer, holeID).updatedState;
|
|
427
|
-
});
|
|
428
|
-
selectedItems.forEach(itemID => {
|
|
429
|
-
state = Item.remove(state, selectedLayer, itemID).updatedState;
|
|
430
|
-
});
|
|
431
|
-
|
|
432
|
-
let allLine = state.getIn(['scene', 'layers', selectedLayer, 'lines']);
|
|
433
|
-
if (!isEmpty(lineID)) {
|
|
434
|
-
const resultInterior = Layer.interiorsurfacedetect(
|
|
435
|
-
state,
|
|
436
|
-
delLine,
|
|
437
|
-
allVertices,
|
|
438
|
-
allLine,
|
|
439
|
-
selectedLayer
|
|
440
|
-
);
|
|
441
|
-
if (!isEmpty(resultInterior)) {
|
|
442
|
-
state = resultInterior.updatedState;
|
|
443
|
-
}
|
|
444
|
-
}
|
|
445
|
-
|
|
446
|
-
/// 180 merge lines - start ////
|
|
447
|
-
let vertexGroup = [];
|
|
448
|
-
|
|
449
|
-
if (!isEmpty(line)) {
|
|
450
|
-
line.vertices.forEach(vertexID => {
|
|
451
|
-
let colinearLines = state.getIn([
|
|
452
|
-
'scene',
|
|
453
|
-
'layers',
|
|
454
|
-
selectedLayer,
|
|
455
|
-
'vertices',
|
|
456
|
-
vertexID,
|
|
457
|
-
'lines'
|
|
458
|
-
]);
|
|
459
|
-
if (!isEmpty(colinearLines)) {
|
|
460
|
-
vertexGroup.push(vertexID);
|
|
461
|
-
colinearLines.forEach(lineID => {
|
|
462
|
-
let line = state.getIn([
|
|
463
|
-
'scene',
|
|
464
|
-
'layers',
|
|
465
|
-
selectedLayer,
|
|
466
|
-
'lines',
|
|
467
|
-
lineID
|
|
468
|
-
]);
|
|
469
|
-
|
|
470
|
-
line.vertices.forEach(vertex => {
|
|
471
|
-
if (vertex !== vertexID) vertexGroup.push(vertex);
|
|
472
|
-
});
|
|
473
|
-
});
|
|
474
|
-
}
|
|
475
|
-
});
|
|
476
|
-
|
|
477
|
-
vertexGroup.forEach(vertexId => {
|
|
478
|
-
let lineGroup = [];
|
|
479
|
-
|
|
480
|
-
lineGroup = Line.hasColinearTwoLines(state, vertexId, selectedLayer);
|
|
481
|
-
if (!isEmpty(lineGroup)) {
|
|
482
|
-
state = Line.mergeTwoColinearLines(
|
|
483
|
-
state,
|
|
484
|
-
lineGroup[0],
|
|
485
|
-
lineGroup[1],
|
|
486
|
-
selectedLayer,
|
|
487
|
-
line.properties
|
|
488
|
-
).updatedState;
|
|
489
|
-
}
|
|
490
|
-
});
|
|
491
|
-
}
|
|
492
|
-
/// 180 merge lines - end ////
|
|
493
|
-
|
|
494
|
-
state = Layer.detectAndUpdateAreas(state, selectedLayer, {}).updatedState;
|
|
495
|
-
let mode = state.getIn(['mode']);
|
|
496
|
-
if (
|
|
497
|
-
mode.includes('DRAWING') ||
|
|
498
|
-
mode.includes('DRAGGING') ||
|
|
499
|
-
mode.includes('ROTATING')
|
|
500
|
-
) {
|
|
501
|
-
state = state.merge({ activeSnapElement: null });
|
|
502
|
-
if (mode.endsWith('3D')) state = state.setIn(['mode'], MODE_IDLE_3D);
|
|
503
|
-
else state = state.setIn(['mode'], MODE_IDLE);
|
|
504
|
-
}
|
|
505
|
-
return { updatedState: state };
|
|
506
|
-
}
|
|
507
|
-
|
|
508
|
-
static undo(state) {
|
|
509
|
-
let ActiveDrawingHelpers = document.getElementsByName(
|
|
510
|
-
'line_type_ActiveDrawingHelper'
|
|
511
|
-
);
|
|
512
|
-
ActiveDrawingHelpers.forEach((element, index) => {
|
|
513
|
-
element.style.display = 'none';
|
|
514
|
-
});
|
|
515
|
-
let sceneHistory = state.sceneHistory;
|
|
516
|
-
let forRedo = window.forRedo;
|
|
517
|
-
window.forRedo = forRedo;
|
|
518
|
-
if (state.scene === sceneHistory.last && sceneHistory.list.size > 1) {
|
|
519
|
-
sceneHistory = history.historyPop(sceneHistory);
|
|
520
|
-
}
|
|
521
|
-
forRedo.push(state.scene);
|
|
522
|
-
let mode;
|
|
523
|
-
if (ARRAY_3D_MODES.includes(state.mode)) mode = MODE_IDLE_3D;
|
|
524
|
-
else mode = MODE_IDLE;
|
|
525
|
-
state = state.merge({
|
|
526
|
-
mode: mode,
|
|
527
|
-
scene: sceneHistory.last,
|
|
528
|
-
sceneHistory: history.historyPop(sceneHistory)
|
|
529
|
-
});
|
|
530
|
-
return { updatedState: state };
|
|
531
|
-
}
|
|
532
|
-
|
|
533
|
-
static redo(state) {
|
|
534
|
-
let forRedo = window.forRedo;
|
|
535
|
-
if (forRedo.length == 0) return { updatedState: state };
|
|
536
|
-
let scene = forRedo.pop();
|
|
537
|
-
let mode;
|
|
538
|
-
if (ARRAY_3D_MODES.includes(state.mode)) mode = MODE_IDLE_3D;
|
|
539
|
-
else mode = MODE_IDLE;
|
|
540
|
-
state = state.merge({
|
|
541
|
-
mode: mode,
|
|
542
|
-
scene: scene,
|
|
543
|
-
sceneHistory: history.historyPush(state.sceneHistory, state.scene)
|
|
544
|
-
});
|
|
545
|
-
window.forRedo = forRedo;
|
|
546
|
-
return { updatedState: state };
|
|
547
|
-
}
|
|
548
|
-
|
|
549
|
-
static uncreate(state) {
|
|
550
|
-
state = state.merge({
|
|
551
|
-
popup: false
|
|
552
|
-
});
|
|
553
|
-
return { updatedState: state };
|
|
554
|
-
}
|
|
555
|
-
|
|
556
|
-
static rename(state, name) {
|
|
557
|
-
state = state.mergeIn(['scene', 'title'], name);
|
|
558
|
-
return { updatedState: state };
|
|
559
|
-
}
|
|
560
|
-
|
|
561
|
-
static recreate(state) {
|
|
562
|
-
if (state.getIn(['drawingSupport', 'type']) !== undefined)
|
|
563
|
-
state = state.merge({
|
|
564
|
-
mode: MODE_DRAWING_ITEM_3D,
|
|
565
|
-
popup: true
|
|
566
|
-
});
|
|
567
|
-
return { updatedState: state };
|
|
568
|
-
}
|
|
569
|
-
|
|
570
|
-
static shift2don(state) {
|
|
571
|
-
state = state.merge({
|
|
572
|
-
popup: false
|
|
573
|
-
});
|
|
574
|
-
return { updatedState: state };
|
|
575
|
-
}
|
|
576
|
-
|
|
577
|
-
static shift2doff(state) {
|
|
578
|
-
if (state.getIn(['drawingSupport', 'type']) !== undefined) {
|
|
579
|
-
if (
|
|
580
|
-
state.get('selectedElementsHistory')._tail.array[0].prototype ===
|
|
581
|
-
'holes'
|
|
582
|
-
)
|
|
583
|
-
state = state.merge({
|
|
584
|
-
mode: MODE_DRAWING_HOLE,
|
|
585
|
-
popup: true
|
|
586
|
-
});
|
|
587
|
-
else
|
|
588
|
-
state = state.merge({
|
|
589
|
-
mode: MODE_DRAWING_ITEM,
|
|
590
|
-
popup: true
|
|
591
|
-
});
|
|
592
|
-
}
|
|
593
|
-
return { updatedState: state };
|
|
594
|
-
}
|
|
595
|
-
|
|
596
|
-
static rollback(state) {
|
|
597
|
-
let sceneHistory = state.sceneHistory;
|
|
598
|
-
state = this.unselectAll(state).updatedState;
|
|
599
|
-
|
|
600
|
-
// if create a design and any elements is not added then no need rollback to last scene state
|
|
601
|
-
if (!sceneHistory.last && sceneHistory.list.isEmpty()) {
|
|
602
|
-
return { updatedState: state };
|
|
603
|
-
}
|
|
604
|
-
|
|
605
|
-
// ESC event doesn't need when mode = MODE_IDLE || MODE_IDLE_3D
|
|
606
|
-
if (state.mode == MODE_IDLE_3D || state.mode == MODE_IDLE) {
|
|
607
|
-
return { updatedState: state };
|
|
608
|
-
}
|
|
609
|
-
|
|
610
|
-
let mode;
|
|
611
|
-
if (state.mode == MODE_DRAWING_ITEM_3D) {
|
|
612
|
-
mode = MODE_IDLE_3D;
|
|
613
|
-
if (state.drawingSupport.has('currentID'))
|
|
614
|
-
state = Layer.removeElement(
|
|
615
|
-
state,
|
|
616
|
-
state.scene.selectedLayer,
|
|
617
|
-
'items',
|
|
618
|
-
state.drawingSupport.get('currentID')
|
|
619
|
-
).updatedState;
|
|
620
|
-
state = state.merge({
|
|
621
|
-
mode: mode,
|
|
622
|
-
snapElements: new List(),
|
|
623
|
-
activeSnapElement: null,
|
|
624
|
-
drawingSupport: new Map(),
|
|
625
|
-
draggingSupport: new Map(),
|
|
626
|
-
rotatingSupport: new Map()
|
|
627
|
-
});
|
|
628
|
-
return { updatedState: state };
|
|
629
|
-
}
|
|
630
|
-
|
|
631
|
-
// when Add Walls button clicked
|
|
632
|
-
if (state.mode == MODE_WAITING_DRAWING_LINE) {
|
|
633
|
-
mode = MODE_IDLE;
|
|
634
|
-
state = state.merge({
|
|
635
|
-
mode: mode,
|
|
636
|
-
snapElements: new List(),
|
|
637
|
-
activeSnapElement: null,
|
|
638
|
-
drawingSupport: new Map(),
|
|
639
|
-
draggingSupport: new Map(),
|
|
640
|
-
rotatingSupport: new Map()
|
|
641
|
-
});
|
|
642
|
-
return { updatedState: state };
|
|
643
|
-
}
|
|
644
|
-
|
|
645
|
-
if (ARRAY_3D_MODES.includes(state.mode)) mode = MODE_IDLE_3D;
|
|
646
|
-
else mode = MODE_IDLE;
|
|
647
|
-
state = state.merge({
|
|
648
|
-
mode: mode,
|
|
649
|
-
scene: sceneHistory.last,
|
|
650
|
-
sceneHistory: history.historyPush(sceneHistory, sceneHistory.last),
|
|
651
|
-
snapElements: new List(),
|
|
652
|
-
activeSnapElement: null,
|
|
653
|
-
drawingSupport: new Map(),
|
|
654
|
-
draggingSupport: new Map(),
|
|
655
|
-
rotatingSupport: new Map()
|
|
656
|
-
});
|
|
657
|
-
return { updatedState: state };
|
|
658
|
-
}
|
|
659
|
-
|
|
660
|
-
static removeDrawingSupport(state) {
|
|
661
|
-
let sceneHistory = state.sceneHistory;
|
|
662
|
-
let mode = state.mode;
|
|
663
|
-
if (
|
|
664
|
-
(!sceneHistory.last && sceneHistory.list.isEmpty()) ||
|
|
665
|
-
mode != MODE_DRAWING_ITEM_3D
|
|
666
|
-
) {
|
|
667
|
-
return { updatedState: state };
|
|
668
|
-
}
|
|
669
|
-
|
|
670
|
-
state = this.unselectAll(state).updatedState;
|
|
671
|
-
state = state.merge({
|
|
672
|
-
scene: sceneHistory.last,
|
|
673
|
-
sceneHistory: history.historyPush(sceneHistory, sceneHistory.last),
|
|
674
|
-
drawingSupport: new Map()
|
|
675
|
-
});
|
|
676
|
-
return { updatedState: state };
|
|
677
|
-
}
|
|
678
|
-
|
|
679
|
-
static setProjectProperties(state, properties) {
|
|
680
|
-
let scene = state.scene.merge(properties);
|
|
681
|
-
state = state.merge({
|
|
682
|
-
mode: MODE_IDLE,
|
|
683
|
-
scene
|
|
684
|
-
});
|
|
685
|
-
|
|
686
|
-
return { updatedState: state };
|
|
687
|
-
}
|
|
688
|
-
|
|
689
|
-
static setProjectId(state, id) {
|
|
690
|
-
let scene = state.scene.merge(id);
|
|
691
|
-
state = state.merge({
|
|
692
|
-
scene
|
|
693
|
-
});
|
|
694
|
-
|
|
695
|
-
return { updatedState: state };
|
|
696
|
-
}
|
|
697
|
-
|
|
698
|
-
static openProjectConfigurator(state) {
|
|
699
|
-
state = state.merge({
|
|
700
|
-
mode: MODE_CONFIGURING_PROJECT
|
|
701
|
-
});
|
|
702
|
-
|
|
703
|
-
return { updatedState: state };
|
|
704
|
-
}
|
|
705
|
-
|
|
706
|
-
static initCatalog(state, catalog) {
|
|
707
|
-
try {
|
|
708
|
-
state = state.set('catalog', new Catalog(catalog));
|
|
709
|
-
return { updatedState: state };
|
|
710
|
-
} catch (error) {
|
|
711
|
-
console.log('initCatalogError', error);
|
|
712
|
-
return { updatedState: state };
|
|
713
|
-
}
|
|
714
|
-
}
|
|
715
|
-
|
|
716
|
-
static updateMouseCoord(state, coords) {
|
|
717
|
-
state = state.set('mouse', new Map(coords));
|
|
718
|
-
|
|
719
|
-
return { updatedState: state };
|
|
720
|
-
}
|
|
721
|
-
|
|
722
|
-
static updateZoomScale(state, scale) {
|
|
723
|
-
state = state.set('zoom', scale);
|
|
724
|
-
|
|
725
|
-
return { updatedState: state };
|
|
726
|
-
}
|
|
727
|
-
|
|
728
|
-
static toggleSnap(state, mask) {
|
|
729
|
-
state = state.set('snapMask', mask);
|
|
730
|
-
return { updatedState: state };
|
|
731
|
-
}
|
|
732
|
-
|
|
733
|
-
static throwError(state, error) {
|
|
734
|
-
state = state.set(
|
|
735
|
-
'errors',
|
|
736
|
-
state.get('errors').push({
|
|
737
|
-
date: Date.now(),
|
|
738
|
-
error
|
|
739
|
-
})
|
|
740
|
-
);
|
|
741
|
-
|
|
742
|
-
return { updatedState: state };
|
|
743
|
-
}
|
|
744
|
-
|
|
745
|
-
static throwWarning(state, warning) {
|
|
746
|
-
state = state.set(
|
|
747
|
-
'warnings',
|
|
748
|
-
state.get('warnings').push({
|
|
749
|
-
date: Date.now(),
|
|
750
|
-
warning
|
|
751
|
-
})
|
|
752
|
-
);
|
|
753
|
-
|
|
754
|
-
return { updatedState: state };
|
|
755
|
-
}
|
|
756
|
-
|
|
757
|
-
static copyProperties(state, properties) {
|
|
758
|
-
let layerID = state.getIn(['drawingSupport', 'layerID']);
|
|
759
|
-
let layer = state.getIn(['scene', 'layers', layerID]);
|
|
760
|
-
if (layer === undefined) return { updatedState: state };
|
|
761
|
-
else {
|
|
762
|
-
state = state.merge({
|
|
763
|
-
mode: MODE_WAITING_DRAWING_LINE,
|
|
764
|
-
activeSnapElement: null
|
|
765
|
-
});
|
|
766
|
-
return { updatedState: state };
|
|
767
|
-
}
|
|
768
|
-
}
|
|
769
|
-
|
|
770
|
-
static pasteProperties(state) {
|
|
771
|
-
state = this.updateProperties(
|
|
772
|
-
state,
|
|
773
|
-
state.getIn(['scene', 'selectedLayer']),
|
|
774
|
-
state.get('clipboardProperties')
|
|
775
|
-
).updatedState;
|
|
776
|
-
|
|
777
|
-
return { updatedState: state };
|
|
778
|
-
}
|
|
779
|
-
|
|
780
|
-
static pushLastSelectedCatalogElementToHistory(state, element) {
|
|
781
|
-
let currHistory = state.selectedElementsHistory;
|
|
782
|
-
|
|
783
|
-
let previousPosition = currHistory.findIndex(
|
|
784
|
-
el => el.name === element.name
|
|
785
|
-
);
|
|
786
|
-
if (previousPosition !== -1) {
|
|
787
|
-
currHistory = currHistory.splice(previousPosition, 1);
|
|
788
|
-
}
|
|
789
|
-
currHistory = currHistory.splice(0, 0, element);
|
|
790
|
-
|
|
791
|
-
state = state.set('selectedElementsHistory', currHistory);
|
|
792
|
-
return { updatedState: state };
|
|
793
|
-
}
|
|
794
|
-
|
|
795
|
-
static changeCatalogPage(state, oldPage, newPage) {
|
|
796
|
-
state = state
|
|
797
|
-
.setIn(['catalog', 'page'], newPage)
|
|
798
|
-
.updateIn(['catalog', 'path'], path => path.push(oldPage));
|
|
799
|
-
|
|
800
|
-
return { updatedState: state };
|
|
801
|
-
}
|
|
802
|
-
|
|
803
|
-
static goBackToCatalogPage(state, newPage) {
|
|
804
|
-
let pageIndex = state.catalog.path.findIndex(page => page === newPage);
|
|
805
|
-
state = state
|
|
806
|
-
.setIn(['catalog', 'page'], newPage)
|
|
807
|
-
.updateIn(['catalog', 'path'], path => path.take(pageIndex));
|
|
808
|
-
|
|
809
|
-
return { updatedState: state };
|
|
810
|
-
}
|
|
811
|
-
|
|
812
|
-
static setMode(state, mode) {
|
|
813
|
-
state = state.set('mode', mode);
|
|
814
|
-
return { updatedState: state };
|
|
815
|
-
}
|
|
816
|
-
|
|
817
|
-
static addHorizontalGuide(state, coordinate) {
|
|
818
|
-
state = HorizontalGuide.create(state, coordinate).updatedState;
|
|
819
|
-
|
|
820
|
-
return { updatedState: state };
|
|
821
|
-
}
|
|
822
|
-
|
|
823
|
-
static addVerticalGuide(state, coordinate) {
|
|
824
|
-
state = VerticalGuide.create(state, coordinate).updatedState;
|
|
825
|
-
|
|
826
|
-
return { updatedState: state };
|
|
827
|
-
}
|
|
828
|
-
|
|
829
|
-
static addCircularGuide(state, x, y, radius) {
|
|
830
|
-
console.log('adding horizontal guide at', x, y, radius);
|
|
831
|
-
|
|
832
|
-
return { updatedState: state };
|
|
833
|
-
}
|
|
834
|
-
|
|
835
|
-
static removeHorizontalGuide(state, guideID) {
|
|
836
|
-
state = HorizontalGuide.remove(state, guideID).updatedState;
|
|
837
|
-
|
|
838
|
-
return { updatedState: state };
|
|
839
|
-
}
|
|
840
|
-
|
|
841
|
-
static removeVerticalGuide(state, guideID) {
|
|
842
|
-
state = VerticalGuide.remove(state, guideID).updatedState;
|
|
843
|
-
|
|
844
|
-
return { updatedState: state };
|
|
845
|
-
}
|
|
846
|
-
|
|
847
|
-
static removeCircularGuide(state, guideID) {
|
|
848
|
-
console.log('removeing horizontal guide ', guideID);
|
|
849
|
-
|
|
850
|
-
return { updatedState: state };
|
|
851
|
-
}
|
|
852
|
-
|
|
853
|
-
static setStateProperties(state, properties) {
|
|
854
|
-
state = state.merge({
|
|
855
|
-
...properties
|
|
856
|
-
});
|
|
857
|
-
return { updatedState: state };
|
|
858
|
-
}
|
|
859
|
-
|
|
860
|
-
static setIsHelp(state, isHelp) {
|
|
861
|
-
state = state.merge({
|
|
862
|
-
isHelp: isHelp
|
|
863
|
-
});
|
|
864
|
-
return { updatedState: state };
|
|
865
|
-
}
|
|
866
|
-
|
|
867
|
-
static setIsCabinetDrawing(state, isCabinetDrawing) {
|
|
868
|
-
state = state.merge({
|
|
869
|
-
isCabinetDrawing: isCabinetDrawing
|
|
870
|
-
});
|
|
871
|
-
return { updatedState: state };
|
|
872
|
-
}
|
|
873
|
-
}
|
|
874
|
-
|
|
875
|
-
export { Project as default };
|