kitchen-simulator 1.1.1-test.48 → 1.1.1-test.49
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/lib/KitchenConfiguratorApp.js +3 -0
- package/package.json +1 -1
- package/es/@history.js +0 -2
- package/es/AppContext.js +0 -3
- package/es/KitchenConfigurator.js +0 -645
- package/es/KitchenConfiguratorApp.js +0 -478
- package/es/actions/area-actions.js +0 -14
- package/es/actions/export.js +0 -23
- package/es/actions/groups-actions.js +0 -89
- package/es/actions/holes-actions.js +0 -119
- package/es/actions/items-actions.js +0 -313
- package/es/actions/lines-actions.js +0 -81
- package/es/actions/project-actions.js +0 -281
- package/es/actions/scene-actions.js +0 -33
- package/es/actions/vertices-actions.js +0 -27
- package/es/actions/viewer2d-actions.js +0 -58
- package/es/actions/viewer3d-actions.js +0 -23
- package/es/catalog/areas/area/planner-element.js +0 -40
- 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 +0 -277
- 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 +0 -181
- package/es/catalog/factories/area-factory.js +0 -81
- package/es/catalog/factories/export.js +0 -7
- package/es/catalog/factories/wall-factory-3d.js +0 -202
- package/es/catalog/factories/wall-factory.js +0 -268
- package/es/catalog/holes/door-closet/planner-element.js +0 -222
- package/es/catalog/holes/door-double/door_double.png +0 -0
- package/es/catalog/holes/door-double/planner-element.js +0 -315
- package/es/catalog/holes/door-exterior/planner-element.js +0 -215
- package/es/catalog/holes/door-interior/planner-element.js +0 -227
- package/es/catalog/holes/door-panic/panicDoor.png +0 -0
- package/es/catalog/holes/door-panic/planner-element.js +0 -503
- package/es/catalog/holes/door-panic-double/panicDoorDouble.png +0 -0
- package/es/catalog/holes/door-panic-double/planner-element.js +0 -463
- package/es/catalog/holes/door-sliding/planner-element.js +0 -225
- package/es/catalog/holes/doorway-framed/planner-element.js +0 -145
- package/es/catalog/holes/doorway-frameless/planner-element.js +0 -104
- package/es/catalog/holes/export.js +0 -13
- package/es/catalog/holes/gate/gate.jpg +0 -0
- package/es/catalog/holes/window-clear/planner-element.js +0 -166
- package/es/catalog/holes/window-clear/texture.png +0 -0
- package/es/catalog/holes/window-cross/planner-element.js +0 -165
- package/es/catalog/holes/window-cross/texture.png +0 -0
- package/es/catalog/holes/window-double-hung/planner-element.js +0 -303
- package/es/catalog/holes/window-double-hung/texture.png +0 -0
- package/es/catalog/holes/window-vertical/planner-element.js +0 -276
- package/es/catalog/holes/window-vertical/texture.png +0 -0
- package/es/catalog/lines/wall/planner-element.js +0 -70
- 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 +0 -28
- package/es/catalog/molding/molding-dcm/texture.png +0 -0
- package/es/catalog/molding/molding-fbm/planner-element.js +0 -28
- package/es/catalog/molding/molding-fbm/texture.png +0 -0
- package/es/catalog/molding/molding-lrm/planner-element.js +0 -28
- package/es/catalog/molding/molding-lrm/texture.png +0 -0
- package/es/catalog/properties/export.js +0 -21
- package/es/catalog/properties/property-checkbox.js +0 -116
- package/es/catalog/properties/property-color.js +0 -39
- package/es/catalog/properties/property-enum.js +0 -97
- package/es/catalog/properties/property-hidden.js +0 -19
- package/es/catalog/properties/property-lenght-measure.js +0 -101
- package/es/catalog/properties/property-length-measure.js +0 -134
- package/es/catalog/properties/property-length-measure_hole.js +0 -101
- package/es/catalog/properties/property-number.js +0 -48
- package/es/catalog/properties/property-read-only.js +0 -26
- package/es/catalog/properties/property-string.js +0 -48
- package/es/catalog/properties/property-toggle.js +0 -39
- package/es/catalog/properties/shared-property-style.js +0 -14
- package/es/catalog/utils/FuseUtils.js +0 -82
- package/es/catalog/utils/exporter.js +0 -148
- package/es/catalog/utils/geom-utils.js +0 -189
- package/es/catalog/utils/item-loader.js +0 -1521
- package/es/catalog/utils/load-obj.js +0 -91
- package/es/catalog/utils/mtl-loader.js +0 -358
- package/es/catalog/utils/obj-loader.js +0 -477
- package/es/class/FuseUtils.js +0 -82
- package/es/class/area.js +0 -145
- package/es/class/export.js +0 -24
- package/es/class/group.js +0 -440
- package/es/class/guide.js +0 -62
- package/es/class/hole.js +0 -929
- package/es/class/item.js +0 -1883
- package/es/class/layer.js +0 -667
- package/es/class/line.js +0 -1180
- package/es/class/project.js +0 -793
- package/es/class/vertex.js +0 -202
- package/es/components/content.js +0 -107
- package/es/components/disclaimer/disclaimer.js +0 -97
- package/es/components/export.js +0 -9
- package/es/components/style/button.js +0 -113
- package/es/components/style/cancel-button.js +0 -22
- package/es/components/style/content-container.js +0 -33
- package/es/components/style/content-title.js +0 -29
- package/es/components/style/delete-button.js +0 -25
- package/es/components/style/export.js +0 -31
- package/es/components/style/form-block.js +0 -24
- package/es/components/style/form-color-input.js +0 -27
- package/es/components/style/form-label.js +0 -26
- package/es/components/style/form-number-input.js +0 -213
- package/es/components/style/form-number-input_2.js +0 -206
- package/es/components/style/form-select.js +0 -68
- package/es/components/style/form-slider.js +0 -61
- package/es/components/style/form-submit-button.js +0 -26
- package/es/components/style/form-text-input.js +0 -95
- package/es/components/viewer2d/area.js +0 -81
- package/es/components/viewer2d/export.js +0 -31
- package/es/components/viewer2d/grids/grid-horizontal-streak.js +0 -37
- package/es/components/viewer2d/grids/grid-streak.js +0 -37
- package/es/components/viewer2d/grids/grid-vertical-streak.js +0 -37
- package/es/components/viewer2d/grids/grids.js +0 -35
- package/es/components/viewer2d/group.js +0 -53
- package/es/components/viewer2d/item.js +0 -513
- package/es/components/viewer2d/layer.js +0 -164
- package/es/components/viewer2d/line.js +0 -882
- package/es/components/viewer2d/ruler.js +0 -100
- package/es/components/viewer2d/rulerDist.js +0 -146
- package/es/components/viewer2d/rulerX.js +0 -151
- package/es/components/viewer2d/rulerY.js +0 -153
- package/es/components/viewer2d/scene.js +0 -140
- package/es/components/viewer2d/snap.js +0 -74
- package/es/components/viewer2d/state.js +0 -78
- package/es/components/viewer2d/utils.js +0 -198
- package/es/components/viewer2d/vertex.js +0 -65
- package/es/components/viewer2d/viewer2d.js +0 -1398
- package/es/components/viewer3d/camera-controls-module/camera-controls.module.js +0 -2592
- package/es/components/viewer3d/dcm.js +0 -401
- package/es/components/viewer3d/fbm.js +0 -414
- package/es/components/viewer3d/front3D.js +0 -66
- package/es/components/viewer3d/grid-creator.js +0 -25
- package/es/components/viewer3d/grids/grid-horizontal-streak.js +0 -36
- package/es/components/viewer3d/grids/grid-streak.js +0 -27
- package/es/components/viewer3d/grids/grid-vertical-streak.js +0 -36
- package/es/components/viewer3d/libs/first-person-controls.js +0 -67
- package/es/components/viewer3d/libs/helvetiker_regular.typeface.js +0 -1281
- package/es/components/viewer3d/libs/mtl-loader.js +0 -357
- package/es/components/viewer3d/libs/obj-loader.js +0 -462
- package/es/components/viewer3d/libs/orbit-controls.js +0 -699
- package/es/components/viewer3d/libs/pointer-lock-controls.js +0 -46
- package/es/components/viewer3d/lrm.js +0 -305
- package/es/components/viewer3d/model.js +0 -708
- package/es/components/viewer3d/pointer-lock-navigation.js +0 -115
- package/es/components/viewer3d/ruler-utils/itemRect.js +0 -61
- package/es/components/viewer3d/ruler-utils/layer3D.js +0 -495
- package/es/components/viewer3d/ruler-utils/ruler3D.js +0 -227
- package/es/components/viewer3d/ruler-utils/scene3D.js +0 -60
- package/es/components/viewer3d/ruler-utils/state3D.js +0 -18
- package/es/components/viewer3d/scene-creator.js +0 -3608
- package/es/components/viewer3d/three-memory-cleaner.js +0 -51
- package/es/components/viewer3d/viewer3d-first-person.js +0 -315
- package/es/components/viewer3d/viewer3d.js +0 -2527
- package/es/constants.js +0 -636
- package/es/index.js +0 -16
- package/es/models.js +0 -510
- package/es/plugins/SVGLoader.js +0 -1412
- package/es/plugins/autosave.js +0 -33
- package/es/plugins/console-debugger.js +0 -37
- package/es/plugins/export.js +0 -9
- package/es/plugins/keyboard.js +0 -101
- package/es/reducers/areas-reducer.js +0 -12
- package/es/reducers/export.js +0 -25
- package/es/reducers/groups-reducer.js +0 -38
- package/es/reducers/holes-reducer.js +0 -62
- package/es/reducers/items-reducer.js +0 -140
- package/es/reducers/lines-reducer.js +0 -45
- package/es/reducers/project-reducer.js +0 -129
- package/es/reducers/reducer.js +0 -19
- package/es/reducers/scene-reducer.js +0 -28
- package/es/reducers/user-reducer.js +0 -40
- package/es/reducers/vertices-reducer.js +0 -19
- package/es/reducers/viewer2d-reducer.js +0 -75
- package/es/reducers/viewer3d-reducer.js +0 -56
- package/es/shared-style.js +0 -66
- package/es/styles/export.js +0 -5
- package/es/styles/tabs.css +0 -40
- package/es/translator/en.js +0 -104
- package/es/translator/it.js +0 -79
- package/es/translator/ru.js +0 -79
- package/es/translator/translator.js +0 -84
- package/es/utils/browser.js +0 -33
- package/es/utils/email-validator.js +0 -4
- package/es/utils/export.js +0 -25
- package/es/utils/geometry.js +0 -2420
- package/es/utils/get-edges-of-subgraphs.js +0 -27
- package/es/utils/graph-cycles.js +0 -237
- package/es/utils/graph-inner-cycles.js +0 -46
- package/es/utils/graph.js +0 -150
- package/es/utils/helper.js +0 -268
- package/es/utils/history.js +0 -29
- package/es/utils/id-broker.js +0 -19
- package/es/utils/logger.js +0 -8
- package/es/utils/math.js +0 -50
- package/es/utils/molding.js +0 -871
- package/es/utils/name-generator.js +0 -18
- package/es/utils/objects-utils.js +0 -50
- package/es/utils/phone-validator.js +0 -4
- package/es/utils/process-black-list.js +0 -18
- package/es/utils/react-if.js +0 -18
- package/es/utils/snap-scene.js +0 -99
- package/es/utils/snap.js +0 -237
- package/es/utils/summarizeCart.js +0 -24
- package/es/utils/threeCSG.es6.js +0 -498
- package/es/version.js +0 -2
- package/lib/catalog/properties/property-string.js +0 -55
- package/lib/catalog/properties/property-toggle.js +0 -46
- package/lib/catalog/properties/shared-property-style.js +0 -20
- package/lib/catalog/utils/FuseUtils.js +0 -88
- package/lib/catalog/utils/exporter.js +0 -155
- package/lib/catalog/utils/geom-utils.js +0 -205
- package/lib/catalog/utils/item-loader.js +0 -1533
- package/lib/catalog/utils/load-obj.js +0 -99
- package/lib/catalog/utils/mtl-loader.js +0 -363
- package/lib/catalog/utils/obj-loader.js +0 -482
- package/lib/class/FuseUtils.js +0 -88
- package/lib/class/area.js +0 -150
- package/lib/class/export.js +0 -96
- package/lib/class/group.js +0 -445
- package/lib/class/guide.js +0 -67
- package/lib/class/hole.js +0 -934
- package/lib/class/item.js +0 -1889
- package/lib/class/layer.js +0 -672
- package/lib/class/line.js +0 -1186
- package/lib/class/project.js +0 -799
- package/lib/class/vertex.js +0 -207
- package/lib/components/content.js +0 -116
- package/lib/components/disclaimer/disclaimer.js +0 -105
- package/lib/components/export.js +0 -33
- package/lib/components/style/button.js +0 -120
- package/lib/components/style/cancel-button.js +0 -29
- package/lib/components/style/content-container.js +0 -40
- package/lib/components/style/content-title.js +0 -37
- package/lib/components/style/delete-button.js +0 -34
- package/lib/components/style/export.js +0 -121
- package/lib/components/style/form-block.js +0 -31
- package/lib/components/style/form-color-input.js +0 -34
- package/lib/components/style/form-label.js +0 -33
- package/lib/components/style/form-number-input.js +0 -220
- package/lib/components/style/form-number-input_2.js +0 -213
- package/lib/components/style/form-select.js +0 -75
- package/lib/components/style/form-slider.js +0 -68
- package/lib/components/style/form-submit-button.js +0 -35
- package/lib/components/style/form-text-input.js +0 -101
- package/lib/components/viewer2d/area.js +0 -88
- package/lib/components/viewer2d/export.js +0 -121
- package/lib/components/viewer2d/grids/grid-horizontal-streak.js +0 -44
- package/lib/components/viewer2d/grids/grid-streak.js +0 -44
- package/lib/components/viewer2d/grids/grid-vertical-streak.js +0 -44
- package/lib/components/viewer2d/grids/grids.js +0 -44
- package/lib/components/viewer2d/group.js +0 -62
- package/lib/components/viewer2d/item.js +0 -521
- package/lib/components/viewer2d/layer.js +0 -171
- package/lib/components/viewer2d/line.js +0 -892
- package/lib/components/viewer2d/ruler.js +0 -107
- package/lib/components/viewer2d/rulerDist.js +0 -153
- package/lib/components/viewer2d/rulerX.js +0 -158
- package/lib/components/viewer2d/rulerY.js +0 -160
- package/lib/components/viewer2d/scene.js +0 -147
- package/lib/components/viewer2d/snap.js +0 -83
- package/lib/components/viewer2d/state.js +0 -87
- package/lib/components/viewer2d/utils.js +0 -210
- package/lib/components/viewer2d/vertex.js +0 -74
- package/lib/components/viewer2d/viewer2d.js +0 -1405
- package/lib/components/viewer3d/camera-controls-module/camera-controls.module.js +0 -2597
- package/lib/components/viewer3d/dcm.js +0 -407
- package/lib/components/viewer3d/fbm.js +0 -420
- package/lib/components/viewer3d/front3D.js +0 -75
- package/lib/components/viewer3d/grid-creator.js +0 -34
- package/lib/components/viewer3d/grids/grid-horizontal-streak.js +0 -44
- package/lib/components/viewer3d/grids/grid-streak.js +0 -35
- package/lib/components/viewer3d/grids/grid-vertical-streak.js +0 -44
- package/lib/components/viewer3d/libs/first-person-controls.js +0 -74
- package/lib/components/viewer3d/libs/helvetiker_regular.typeface.js +0 -1287
- package/lib/components/viewer3d/libs/mtl-loader.js +0 -363
- package/lib/components/viewer3d/libs/obj-loader.js +0 -468
- package/lib/components/viewer3d/libs/orbit-controls.js +0 -705
- package/lib/components/viewer3d/libs/pointer-lock-controls.js +0 -52
- package/lib/components/viewer3d/lrm.js +0 -311
- package/lib/components/viewer3d/model.js +0 -714
- package/lib/components/viewer3d/pointer-lock-navigation.js +0 -122
- package/lib/components/viewer3d/ruler-utils/itemRect.js +0 -68
- package/lib/components/viewer3d/ruler-utils/layer3D.js +0 -502
- package/lib/components/viewer3d/ruler-utils/ruler3D.js +0 -234
- package/lib/components/viewer3d/ruler-utils/scene3D.js +0 -68
- package/lib/components/viewer3d/ruler-utils/state3D.js +0 -25
- package/lib/components/viewer3d/scene-creator.js +0 -3642
- package/lib/components/viewer3d/three-memory-cleaner.js +0 -60
- package/lib/components/viewer3d/viewer3d-first-person.js +0 -320
- package/lib/components/viewer3d/viewer3d.js +0 -2532
- package/lib/constants.js +0 -645
- package/lib/index.js +0 -96
- package/lib/models.js +0 -517
- package/lib/plugins/SVGLoader.js +0 -1417
- package/lib/plugins/autosave.js +0 -39
- package/lib/plugins/console-debugger.js +0 -44
- package/lib/plugins/export.js +0 -33
- package/lib/plugins/keyboard.js +0 -107
- package/lib/reducers/areas-reducer.js +0 -18
- package/lib/reducers/export.js +0 -97
- package/lib/reducers/groups-reducer.js +0 -44
- package/lib/reducers/holes-reducer.js +0 -68
- package/lib/reducers/items-reducer.js +0 -146
- package/lib/reducers/lines-reducer.js +0 -51
- package/lib/reducers/project-reducer.js +0 -135
- package/lib/reducers/reducer.js +0 -26
- package/lib/reducers/scene-reducer.js +0 -34
- package/lib/reducers/user-reducer.js +0 -46
- package/lib/reducers/vertices-reducer.js +0 -25
- package/lib/reducers/viewer2d-reducer.js +0 -82
- package/lib/reducers/viewer3d-reducer.js +0 -63
- package/lib/shared-style.js +0 -72
- package/lib/styles/export.js +0 -13
- package/lib/translator/en.js +0 -110
- package/lib/translator/it.js +0 -85
- package/lib/translator/ru.js +0 -85
- package/lib/translator/translator.js +0 -90
- package/lib/utils/browser.js +0 -40
- package/lib/utils/email-validator.js +0 -10
- package/lib/utils/export.js +0 -56
- package/lib/utils/geometry.js +0 -2516
- package/lib/utils/get-edges-of-subgraphs.js +0 -34
- package/lib/utils/graph-cycles.js +0 -240
- package/lib/utils/graph-inner-cycles.js +0 -54
- package/lib/utils/graph.js +0 -157
- package/lib/utils/helper.js +0 -291
- package/lib/utils/history.js +0 -36
- package/lib/utils/id-broker.js +0 -25
- package/lib/utils/logger.js +0 -14
- package/lib/utils/math.js +0 -57
- package/lib/utils/molding.js +0 -895
- package/lib/utils/name-generator.js +0 -23
- package/lib/utils/objects-utils.js +0 -60
- package/lib/utils/phone-validator.js +0 -10
- package/lib/utils/process-black-list.js +0 -24
- package/lib/utils/react-if.js +0 -24
- package/lib/utils/snap-scene.js +0 -105
- package/lib/utils/snap.js +0 -249
- package/lib/utils/summarizeCart.js +0 -30
- package/lib/utils/threeCSG.es6.js +0 -503
- package/lib/version.js +0 -8
|
@@ -1,645 +0,0 @@
|
|
|
1
|
-
var _excluded = ["width", "height", "state", "stateExtractor"];
|
|
2
|
-
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); }
|
|
3
|
-
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
4
|
-
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
|
|
5
|
-
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
|
|
6
|
-
function _regenerator() { /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */ var e, t, r = "function" == typeof Symbol ? Symbol : {}, n = r.iterator || "@@iterator", o = r.toStringTag || "@@toStringTag"; function i(r, n, o, i) { var c = n && n.prototype instanceof Generator ? n : Generator, u = Object.create(c.prototype); return _regeneratorDefine2(u, "_invoke", function (r, n, o) { var i, c, u, f = 0, p = o || [], y = !1, G = { p: 0, n: 0, v: e, a: d, f: d.bind(e, 4), d: function d(t, r) { return i = t, c = 0, u = e, G.n = r, a; } }; function d(r, n) { for (c = r, u = n, t = 0; !y && f && !o && t < p.length; t++) { var o, i = p[t], d = G.p, l = i[2]; r > 3 ? (o = l === n) && (u = i[(c = i[4]) ? 5 : (c = 3, 3)], i[4] = i[5] = e) : i[0] <= d && ((o = r < 2 && d < i[1]) ? (c = 0, G.v = n, G.n = i[1]) : d < l && (o = r < 3 || i[0] > n || n > l) && (i[4] = r, i[5] = n, G.n = l, c = 0)); } if (o || r > 1) return a; throw y = !0, n; } return function (o, p, l) { if (f > 1) throw TypeError("Generator is already running"); for (y && 1 === p && d(p, l), c = p, u = l; (t = c < 2 ? e : u) || !y;) { i || (c ? c < 3 ? (c > 1 && (G.n = -1), d(c, u)) : G.n = u : G.v = u); try { if (f = 2, i) { if (c || (o = "next"), t = i[o]) { if (!(t = t.call(i, u))) throw TypeError("iterator result is not an object"); if (!t.done) return t; u = t.value, c < 2 && (c = 0); } else 1 === c && (t = i["return"]) && t.call(i), c < 2 && (u = TypeError("The iterator does not provide a '" + o + "' method"), c = 1); i = e; } else if ((t = (y = G.n < 0) ? u : r.call(n, G)) !== a) break; } catch (t) { i = e, c = 1, u = t; } finally { f = 1; } } return { value: t, done: y }; }; }(r, o, i), !0), u; } var a = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} t = Object.getPrototypeOf; var c = [][n] ? t(t([][n]())) : (_regeneratorDefine2(t = {}, n, function () { return this; }), t), u = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(c); function f(e) { return Object.setPrototypeOf ? Object.setPrototypeOf(e, GeneratorFunctionPrototype) : (e.__proto__ = GeneratorFunctionPrototype, _regeneratorDefine2(e, o, "GeneratorFunction")), e.prototype = Object.create(u), e; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, _regeneratorDefine2(u, "constructor", GeneratorFunctionPrototype), _regeneratorDefine2(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = "GeneratorFunction", _regeneratorDefine2(GeneratorFunctionPrototype, o, "GeneratorFunction"), _regeneratorDefine2(u), _regeneratorDefine2(u, o, "Generator"), _regeneratorDefine2(u, n, function () { return this; }), _regeneratorDefine2(u, "toString", function () { return "[object Generator]"; }), (_regenerator = function _regenerator() { return { w: i, m: f }; })(); }
|
|
7
|
-
function _regeneratorDefine2(e, r, n, t) { var i = Object.defineProperty; try { i({}, "", {}); } catch (e) { i = 0; } _regeneratorDefine2 = function _regeneratorDefine(e, r, n, t) { function o(r, n) { _regeneratorDefine2(e, r, function (e) { return this._invoke(r, n, e); }); } r ? i ? i(e, r, { value: n, enumerable: !t, configurable: !t, writable: !t }) : e[r] = n : (o("next", 0), o("throw", 1), o("return", 2)); }, _regeneratorDefine2(e, r, n, t); }
|
|
8
|
-
function asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); }
|
|
9
|
-
function _asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { asyncGeneratorStep(a, r, o, _next, _throw, "next", n); } function _throw(n) { asyncGeneratorStep(a, r, o, _next, _throw, "throw", n); } _next(void 0); }); }; }
|
|
10
|
-
function _toConsumableArray(r) { return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread(); }
|
|
11
|
-
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
12
|
-
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
13
|
-
function _iterableToArray(r) { if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r); }
|
|
14
|
-
function _arrayWithoutHoles(r) { if (Array.isArray(r)) return _arrayLikeToArray(r); }
|
|
15
|
-
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
16
|
-
function 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; }
|
|
17
|
-
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; }
|
|
18
|
-
function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
|
|
19
|
-
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); } }
|
|
20
|
-
function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
|
|
21
|
-
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
22
|
-
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); }
|
|
23
|
-
function _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e; }
|
|
24
|
-
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
25
|
-
function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); }
|
|
26
|
-
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); }
|
|
27
|
-
function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }
|
|
28
|
-
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; }
|
|
29
|
-
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
30
|
-
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); }
|
|
31
|
-
import axios from 'axios';
|
|
32
|
-
import * as convert from 'convert-units';
|
|
33
|
-
import { Plugins as PlannerPlugins } from "./index";
|
|
34
|
-
import PropTypes from 'prop-types';
|
|
35
|
-
import React, { Component } from 'react';
|
|
36
|
-
import { connect } from 'react-redux';
|
|
37
|
-
import { bindActionCreators } from 'redux';
|
|
38
|
-
import * as constants from "./constants";
|
|
39
|
-
import { base64Decode } from "./utils/helper";
|
|
40
|
-
import actions from "./actions/export";
|
|
41
|
-
import Catalog from "./catalog/catalog";
|
|
42
|
-
import { Content } from "./components/export";
|
|
43
|
-
import Translator from "./translator/translator";
|
|
44
|
-
import { objectsMap } from "./utils/objects-utils";
|
|
45
|
-
import { VERSION } from "./version";
|
|
46
|
-
var toolbarW = 0;
|
|
47
|
-
var wrapperStyle = {
|
|
48
|
-
display: 'flex',
|
|
49
|
-
flexFlow: 'row nowrap'
|
|
50
|
-
};
|
|
51
|
-
var KitchenConfigurator = /*#__PURE__*/function (_Component) {
|
|
52
|
-
function KitchenConfigurator(props) {
|
|
53
|
-
var _utmRequestData2, _utmRequestData3, _utmRequestData4, _utmRequestData5, _utmRequestData6, _utmRequestData7, _utmRequestData8, _utmRequestData9, _utmRequestData0;
|
|
54
|
-
var _this;
|
|
55
|
-
_classCallCheck(this, KitchenConfigurator);
|
|
56
|
-
_this = _callSuper(this, KitchenConfigurator, [props]);
|
|
57
|
-
|
|
58
|
-
// utm tracking
|
|
59
|
-
_defineProperty(_this, "handleBeforeUnload", function (e) {
|
|
60
|
-
var areas = _this.props.stateExtractor(_this.props.state).getIn(['scene', 'layers', _this.props.stateExtractor(_this.props.state).scene.selectedLayer, 'areas']);
|
|
61
|
-
if (!_this.state.isSaved && areas.size > 0) {
|
|
62
|
-
setTimeout(function () {
|
|
63
|
-
_this.setState({
|
|
64
|
-
savePromptVisible: true,
|
|
65
|
-
isLeaving: true
|
|
66
|
-
});
|
|
67
|
-
}, 500);
|
|
68
|
-
_this.saveProjectToStorage();
|
|
69
|
-
|
|
70
|
-
// This line is required to trigger the browser confirmation dialog
|
|
71
|
-
e.preventDefault();
|
|
72
|
-
e.returnValue = '';
|
|
73
|
-
return '';
|
|
74
|
-
}
|
|
75
|
-
});
|
|
76
|
-
var utmDetailParams = new URLSearchParams(_this.props.location && _this.props.location.search);
|
|
77
|
-
var utmStrEncoded = utmDetailParams.get('details');
|
|
78
|
-
var utmRequestData = null;
|
|
79
|
-
if (utmStrEncoded) {
|
|
80
|
-
try {
|
|
81
|
-
var _utmRequestData;
|
|
82
|
-
utmRequestData = JSON.parse(base64Decode(utmStrEncoded));
|
|
83
|
-
utmRequestData = JSON.parse((_utmRequestData = utmRequestData) === null || _utmRequestData === void 0 ? void 0 : _utmRequestData.utm);
|
|
84
|
-
} catch (e) {
|
|
85
|
-
console.error('Cannot parse utm parameter: ', error);
|
|
86
|
-
utmRequestData = null;
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
_this.state = {
|
|
90
|
-
savePopupVisible: false,
|
|
91
|
-
quotePopupVisible: false,
|
|
92
|
-
assistPopupVisible: false,
|
|
93
|
-
newProjectPopupVisible: false,
|
|
94
|
-
isModalVisible: false,
|
|
95
|
-
submitPromptVisible: false,
|
|
96
|
-
stateSubmitType: constants.SUBMIT_REQUEST_ASSIST,
|
|
97
|
-
savePromptVisible: false,
|
|
98
|
-
isShowProperty: true,
|
|
99
|
-
submitTosave: false,
|
|
100
|
-
signOpen: false,
|
|
101
|
-
myProjectsOpen: false,
|
|
102
|
-
myProjectsToLogin: false,
|
|
103
|
-
downloadPopupVisible: false,
|
|
104
|
-
// For Toolbar Item
|
|
105
|
-
toolbar: '',
|
|
106
|
-
reviewQuotePopupOpened: false,
|
|
107
|
-
floorOpened: false,
|
|
108
|
-
cabinetOpened: false,
|
|
109
|
-
applianceOpened: false,
|
|
110
|
-
finishingOpened: false,
|
|
111
|
-
doorStyleOpen: false,
|
|
112
|
-
wizardStepOpend: false,
|
|
113
|
-
tutorialMouseEventsAdd: false,
|
|
114
|
-
replaceCabinetFlag: false,
|
|
115
|
-
isSnackBarOpen: false,
|
|
116
|
-
isSnackBar1Open: false,
|
|
117
|
-
redirectURL: '',
|
|
118
|
-
snackBarMessage: '',
|
|
119
|
-
isSaved: false,
|
|
120
|
-
isLeaving: false
|
|
121
|
-
};
|
|
122
|
-
|
|
123
|
-
// For UTM tracking
|
|
124
|
-
_this.utm = {
|
|
125
|
-
utm_source: ((_utmRequestData2 = utmRequestData) === null || _utmRequestData2 === void 0 ? void 0 : _utmRequestData2.source) || 'source',
|
|
126
|
-
utm_medium: ((_utmRequestData3 = utmRequestData) === null || _utmRequestData3 === void 0 ? void 0 : _utmRequestData3.medium) || 'medium',
|
|
127
|
-
utm_campaign: ((_utmRequestData4 = utmRequestData) === null || _utmRequestData4 === void 0 ? void 0 : _utmRequestData4.campaign) || 'campaign',
|
|
128
|
-
utm_term: ((_utmRequestData5 = utmRequestData) === null || _utmRequestData5 === void 0 ? void 0 : _utmRequestData5.term) || 'term',
|
|
129
|
-
utm_content: ((_utmRequestData6 = utmRequestData) === null || _utmRequestData6 === void 0 ? void 0 : _utmRequestData6.content) || 'content',
|
|
130
|
-
gclid: ((_utmRequestData7 = utmRequestData) === null || _utmRequestData7 === void 0 ? void 0 : _utmRequestData7.gclid) || 'gclid',
|
|
131
|
-
msclkid: ((_utmRequestData8 = utmRequestData) === null || _utmRequestData8 === void 0 ? void 0 : _utmRequestData8.msclkid) || 'msclkid',
|
|
132
|
-
fbclid: ((_utmRequestData9 = utmRequestData) === null || _utmRequestData9 === void 0 ? void 0 : _utmRequestData9.fbclid) || 'fbclid',
|
|
133
|
-
ttclid: ((_utmRequestData0 = utmRequestData) === null || _utmRequestData0 === void 0 ? void 0 : _utmRequestData0.ttclid) || 'ttclid'
|
|
134
|
-
};
|
|
135
|
-
_this.openFloor = _this.openFloor.bind(_this);
|
|
136
|
-
_this.openCabinet = _this.openCabinet.bind(_this);
|
|
137
|
-
_this.openFinishing = _this.openFinishing.bind(_this);
|
|
138
|
-
_this.openAppliance = _this.openAppliance.bind(_this);
|
|
139
|
-
_this.toggleDoorStyle = _this.toggleDoorStyle.bind(_this);
|
|
140
|
-
_this.onReviewQuoteClicked = _this.onReviewQuoteClicked.bind(_this);
|
|
141
|
-
_this.closeFloorTB = _this.closeFloorTB.bind(_this);
|
|
142
|
-
_this.closeCabinetTB = _this.closeCabinetTB.bind(_this);
|
|
143
|
-
_this.closeFinishingTB = _this.closeFinishingTB.bind(_this);
|
|
144
|
-
_this.closeApplianceTB = _this.closeApplianceTB.bind(_this);
|
|
145
|
-
_this.setToolbar = _this.setToolbar.bind(_this);
|
|
146
|
-
_this.replaceCabinet = _this.replaceCabinet.bind(_this);
|
|
147
|
-
_this.setSubmitToSave = _this.setSubmitToSave.bind(_this);
|
|
148
|
-
_this.setSignOpen = _this.setSignOpen.bind(_this);
|
|
149
|
-
_this.setMyProjectsOpen = _this.setMyProjectsOpen.bind(_this);
|
|
150
|
-
_this.setMyProjectsToLogin = _this.setMyProjectsToLogin.bind(_this);
|
|
151
|
-
_this.setDownloadPopupVisible = _this.setDownloadPopupVisible.bind(_this);
|
|
152
|
-
_this.neverShowInput = /*#__PURE__*/React.createRef(null);
|
|
153
|
-
_this.setShowProperty = _this.setShowProperty.bind(_this);
|
|
154
|
-
return _this;
|
|
155
|
-
}
|
|
156
|
-
|
|
157
|
-
// Toolbar control functions
|
|
158
|
-
_inherits(KitchenConfigurator, _Component);
|
|
159
|
-
return _createClass(KitchenConfigurator, [{
|
|
160
|
-
key: "setToolbar",
|
|
161
|
-
value: function setToolbar(toolBarKey) {
|
|
162
|
-
this.setState({
|
|
163
|
-
toolbar: toolBarKey
|
|
164
|
-
});
|
|
165
|
-
}
|
|
166
|
-
}, {
|
|
167
|
-
key: "setShowProperty",
|
|
168
|
-
value: function setShowProperty(value) {
|
|
169
|
-
this.setState({
|
|
170
|
-
isShowProperty: value
|
|
171
|
-
});
|
|
172
|
-
}
|
|
173
|
-
}, {
|
|
174
|
-
key: "setMyProjectsOpen",
|
|
175
|
-
value: function setMyProjectsOpen(value) {
|
|
176
|
-
this.setState({
|
|
177
|
-
myProjectsOpen: value
|
|
178
|
-
});
|
|
179
|
-
this.setState({
|
|
180
|
-
signOpen: false
|
|
181
|
-
});
|
|
182
|
-
this.setState({
|
|
183
|
-
wizardStepOpend: false
|
|
184
|
-
});
|
|
185
|
-
}
|
|
186
|
-
}, {
|
|
187
|
-
key: "setMyProjectsToLogin",
|
|
188
|
-
value: function setMyProjectsToLogin(value) {
|
|
189
|
-
this.setState({
|
|
190
|
-
myProjectsToLogin: value
|
|
191
|
-
});
|
|
192
|
-
}
|
|
193
|
-
}, {
|
|
194
|
-
key: "setDownloadPopupVisible",
|
|
195
|
-
value: function setDownloadPopupVisible(value) {
|
|
196
|
-
this.setState({
|
|
197
|
-
reviewQuotePopupOpened: false
|
|
198
|
-
});
|
|
199
|
-
this.setState({
|
|
200
|
-
savePopupVisible: false
|
|
201
|
-
});
|
|
202
|
-
this.setState({
|
|
203
|
-
quotePopupVisible: false
|
|
204
|
-
});
|
|
205
|
-
this.setState({
|
|
206
|
-
submitTosave: false
|
|
207
|
-
});
|
|
208
|
-
this.setState({
|
|
209
|
-
assistPopupVisible: false
|
|
210
|
-
});
|
|
211
|
-
this.setState({
|
|
212
|
-
newProjectPopupVisible: false
|
|
213
|
-
});
|
|
214
|
-
this.setState({
|
|
215
|
-
downloadPopupVisible: value
|
|
216
|
-
});
|
|
217
|
-
}
|
|
218
|
-
}, {
|
|
219
|
-
key: "setSubmitToSave",
|
|
220
|
-
value: function setSubmitToSave(value) {
|
|
221
|
-
this.setState({
|
|
222
|
-
submitTosave: value
|
|
223
|
-
});
|
|
224
|
-
}
|
|
225
|
-
}, {
|
|
226
|
-
key: "setSignOpen",
|
|
227
|
-
value: function setSignOpen(value) {
|
|
228
|
-
this.setState({
|
|
229
|
-
wizardStepOpend: false
|
|
230
|
-
});
|
|
231
|
-
this.setState({
|
|
232
|
-
myProjectsOpen: false
|
|
233
|
-
});
|
|
234
|
-
this.setState({
|
|
235
|
-
signOpen: value
|
|
236
|
-
});
|
|
237
|
-
}
|
|
238
|
-
}, {
|
|
239
|
-
key: "openFloor",
|
|
240
|
-
value: function openFloor() {
|
|
241
|
-
this.setState({
|
|
242
|
-
floorOpened: true
|
|
243
|
-
});
|
|
244
|
-
document.getElementById('make_floorplan_inactive').parentElement.parentElement.style.zIndex = 999;
|
|
245
|
-
}
|
|
246
|
-
}, {
|
|
247
|
-
key: "openCabinet",
|
|
248
|
-
value: function openCabinet() {
|
|
249
|
-
this.setState({
|
|
250
|
-
cabinetOpened: true
|
|
251
|
-
});
|
|
252
|
-
document.getElementById('add_cabinets_inactive').parentElement.parentElement.style.zIndex = 999;
|
|
253
|
-
}
|
|
254
|
-
}, {
|
|
255
|
-
key: "toggleDoorStyle",
|
|
256
|
-
value: function toggleDoorStyle(visible) {
|
|
257
|
-
this.setState({
|
|
258
|
-
doorStyleOpen: visible
|
|
259
|
-
});
|
|
260
|
-
document.getElementById('select_doorstyle_inactive').parentElement.parentElement.style.zIndex = visible ? 999 : 6;
|
|
261
|
-
}
|
|
262
|
-
}, {
|
|
263
|
-
key: "replaceCabinet",
|
|
264
|
-
value: function replaceCabinet(value) {
|
|
265
|
-
this.setState({
|
|
266
|
-
replaceCabinetFlag: value
|
|
267
|
-
});
|
|
268
|
-
}
|
|
269
|
-
}, {
|
|
270
|
-
key: "openAppliance",
|
|
271
|
-
value: function openAppliance() {
|
|
272
|
-
this.setState({
|
|
273
|
-
applianceOpened: true
|
|
274
|
-
});
|
|
275
|
-
document.getElementById('add_appliances_inactive').parentElement.parentElement.style.zIndex = 999;
|
|
276
|
-
}
|
|
277
|
-
}, {
|
|
278
|
-
key: "openFinishing",
|
|
279
|
-
value: function openFinishing() {
|
|
280
|
-
this.setState({
|
|
281
|
-
finishingOpened: true
|
|
282
|
-
});
|
|
283
|
-
document.getElementById('finishing_touches_inactive').parentElement.parentElement.style.zIndex = 999;
|
|
284
|
-
}
|
|
285
|
-
}, {
|
|
286
|
-
key: "onReviewQuoteClicked",
|
|
287
|
-
value: function onReviewQuoteClicked(visible) {
|
|
288
|
-
this.setState({
|
|
289
|
-
reviewQuotePopupOpened: visible
|
|
290
|
-
});
|
|
291
|
-
document.getElementById('review_quote_inactive').parentElement.parentElement.style.zIndex = visible ? 999 : 6;
|
|
292
|
-
}
|
|
293
|
-
}, {
|
|
294
|
-
key: "closeFloorTB",
|
|
295
|
-
value: function closeFloorTB() {
|
|
296
|
-
this.setState({
|
|
297
|
-
floorOpened: false
|
|
298
|
-
});
|
|
299
|
-
document.getElementById('make_floorplan_inactive') && (document.getElementById('make_floorplan_inactive').parentElement.parentElement.style.zIndex = 6);
|
|
300
|
-
}
|
|
301
|
-
}, {
|
|
302
|
-
key: "closeCabinetTB",
|
|
303
|
-
value: function closeCabinetTB() {
|
|
304
|
-
this.setState({
|
|
305
|
-
cabinetOpened: false
|
|
306
|
-
});
|
|
307
|
-
document.getElementById('add_cabinets_inactive').parentElement.parentElement.style.zIndex = 6;
|
|
308
|
-
}
|
|
309
|
-
}, {
|
|
310
|
-
key: "closeFinishingTB",
|
|
311
|
-
value: function closeFinishingTB() {
|
|
312
|
-
this.setState({
|
|
313
|
-
finishingOpened: false
|
|
314
|
-
});
|
|
315
|
-
document.getElementById('finishing_touches_inactive').parentElement.parentElement.style.zIndex = 6;
|
|
316
|
-
}
|
|
317
|
-
}, {
|
|
318
|
-
key: "closeApplianceTB",
|
|
319
|
-
value: function closeApplianceTB() {
|
|
320
|
-
this.setState({
|
|
321
|
-
applianceOpened: false
|
|
322
|
-
});
|
|
323
|
-
document.getElementById('add_appliances_inactive').parentElement.parentElement.style.zIndex = 6;
|
|
324
|
-
}
|
|
325
|
-
}, {
|
|
326
|
-
key: "closeDoorstyle",
|
|
327
|
-
value: function closeDoorstyle() {
|
|
328
|
-
this.setState({});
|
|
329
|
-
document.getElementById('select_doorstyle_inactive').parentElement.parentElement.style.zIndex = 6;
|
|
330
|
-
}
|
|
331
|
-
}, {
|
|
332
|
-
key: "closeReviewQuote",
|
|
333
|
-
value: function closeReviewQuote() {
|
|
334
|
-
this.setState({});
|
|
335
|
-
document.getElementById('review_quote_inactive').parentElement.parentElement.style.zIndex = 6;
|
|
336
|
-
}
|
|
337
|
-
}, {
|
|
338
|
-
key: "getChildContext",
|
|
339
|
-
value: function getChildContext() {
|
|
340
|
-
var _this2 = this;
|
|
341
|
-
return _objectSpread(_objectSpread({}, objectsMap(actions, function (actionNamespace) {
|
|
342
|
-
return _this2.props[actionNamespace];
|
|
343
|
-
})), {}, {
|
|
344
|
-
translator: this.props.translator,
|
|
345
|
-
catalog: this.props.catalog
|
|
346
|
-
});
|
|
347
|
-
}
|
|
348
|
-
}, {
|
|
349
|
-
key: "saveProjectToStorage",
|
|
350
|
-
value: function saveProjectToStorage() {
|
|
351
|
-
var _this$props = this.props,
|
|
352
|
-
state = _this$props.state,
|
|
353
|
-
stateExtractor = _this$props.stateExtractor;
|
|
354
|
-
var extractedState = stateExtractor(state);
|
|
355
|
-
var projectData = JSON.stringify(extractedState.get('scene').toJS());
|
|
356
|
-
sessionStorage.setItem(window.location.href, projectData);
|
|
357
|
-
}
|
|
358
|
-
}, {
|
|
359
|
-
key: "componentDidMount",
|
|
360
|
-
value: function componentDidMount() {
|
|
361
|
-
var _this3 = this;
|
|
362
|
-
window.addEventListener('beforeunload', this.handleBeforeUnload);
|
|
363
|
-
console.log('context =>', this.context);
|
|
364
|
-
window.forRedo = [];
|
|
365
|
-
var store = this.context.store;
|
|
366
|
-
var _this$props2 = this.props,
|
|
367
|
-
projectActions = _this$props2.projectActions,
|
|
368
|
-
catalog = _this$props2.catalog,
|
|
369
|
-
stateExtractor = _this$props2.stateExtractor,
|
|
370
|
-
state = _this$props2.state,
|
|
371
|
-
plugins = _this$props2.plugins;
|
|
372
|
-
projectActions.initCatalog(catalog);
|
|
373
|
-
var match = this.props.match;
|
|
374
|
-
if (sessionStorage.getItem(window.location.href)) {
|
|
375
|
-
var jsonData = sessionStorage.getItem(window.location.href);
|
|
376
|
-
projectActions.loadProject(JSON.parse(jsonData), this.props.categoryData);
|
|
377
|
-
sessionStorage.removeItem(window.location.href);
|
|
378
|
-
return;
|
|
379
|
-
}
|
|
380
|
-
if (match && match.params.pid === undefined) {
|
|
381
|
-
var newplugins = [].concat(_toConsumableArray(plugins), [PlannerPlugins.Autosave('KitchenConfigurator_v0', false)]);
|
|
382
|
-
newplugins.forEach(function (newplugin) {
|
|
383
|
-
return newplugin(store, stateExtractor);
|
|
384
|
-
});
|
|
385
|
-
projectActions.newProject();
|
|
386
|
-
sessionStorage.setItem('projectTitle', 'Untitled');
|
|
387
|
-
projectActions.rename('Untitled');
|
|
388
|
-
sessionStorage.removeItem('projectId');
|
|
389
|
-
sessionStorage.removeItem('email');
|
|
390
|
-
sessionStorage.removeItem('firstName');
|
|
391
|
-
sessionStorage.removeItem('lastName');
|
|
392
|
-
sessionStorage.removeItem('usedObjects');
|
|
393
|
-
return;
|
|
394
|
-
}
|
|
395
|
-
if (match && match.params.pid !== undefined) {
|
|
396
|
-
if (match.params.pid === 'new') {
|
|
397
|
-
projectActions.newProject();
|
|
398
|
-
sessionStorage.setItem('projectTitle', 'Untitled');
|
|
399
|
-
projectActions.rename('Untitled');
|
|
400
|
-
sessionStorage.removeItem('projectId');
|
|
401
|
-
sessionStorage.removeItem('email');
|
|
402
|
-
sessionStorage.removeItem('firstName');
|
|
403
|
-
sessionStorage.removeItem('lastName');
|
|
404
|
-
sessionStorage.removeItem('usedObjects');
|
|
405
|
-
} else {
|
|
406
|
-
axios.post("".concat(constants.API_SERVER_URL, "/api/project/loadPidProject"), {
|
|
407
|
-
pid: match.params.pid,
|
|
408
|
-
visualizerName: sessionStorage.getItem('visualizerName')
|
|
409
|
-
}).then(/*#__PURE__*/function () {
|
|
410
|
-
var _ref = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee(response) {
|
|
411
|
-
var projectElement, jsonData, _t;
|
|
412
|
-
return _regenerator().w(function (_context) {
|
|
413
|
-
while (1) switch (_context.p = _context.n) {
|
|
414
|
-
case 0:
|
|
415
|
-
projectElement = response.data.projectElement;
|
|
416
|
-
if (!(projectElement.length === 0)) {
|
|
417
|
-
_context.n = 1;
|
|
418
|
-
break;
|
|
419
|
-
}
|
|
420
|
-
return _context.a(2);
|
|
421
|
-
case 1:
|
|
422
|
-
sessionStorage.setItem('projectTitle', projectElement[0].title);
|
|
423
|
-
projectActions.rename(projectElement[0].title);
|
|
424
|
-
sessionStorage.setItem('projectId', projectElement[0].id);
|
|
425
|
-
sessionStorage.setItem('email', projectElement[0].email);
|
|
426
|
-
sessionStorage.setItem('firstName', projectElement[0].firstName);
|
|
427
|
-
sessionStorage.setItem('lastName', projectElement[0].lastName);
|
|
428
|
-
sessionStorage.setItem('phone', projectElement[0].phone);
|
|
429
|
-
if (!projectElement[0].project_data) {
|
|
430
|
-
_context.n = 2;
|
|
431
|
-
break;
|
|
432
|
-
}
|
|
433
|
-
jsonData = JSON.parse(projectElement[0].project_data);
|
|
434
|
-
_context.n = 5;
|
|
435
|
-
break;
|
|
436
|
-
case 2:
|
|
437
|
-
_context.p = 2;
|
|
438
|
-
_context.n = 3;
|
|
439
|
-
return axios.post("".concat(constants.API_SERVER_URL, "/api/project/loadPidData"), {
|
|
440
|
-
pid: match.params.pid
|
|
441
|
-
}).data.data;
|
|
442
|
-
case 3:
|
|
443
|
-
jsonData = _context.v;
|
|
444
|
-
_context.n = 5;
|
|
445
|
-
break;
|
|
446
|
-
case 4:
|
|
447
|
-
_context.p = 4;
|
|
448
|
-
_t = _context.v;
|
|
449
|
-
_this3.setState({
|
|
450
|
-
isSnackBarOpen: true,
|
|
451
|
-
snackBarMessage: _t
|
|
452
|
-
});
|
|
453
|
-
case 5:
|
|
454
|
-
jsonData.isLoadingCabinet = false;
|
|
455
|
-
projectActions.loadProject(jsonData, _this3.props.categoryData);
|
|
456
|
-
case 6:
|
|
457
|
-
return _context.a(2);
|
|
458
|
-
}
|
|
459
|
-
}, _callee, null, [[2, 4]]);
|
|
460
|
-
}));
|
|
461
|
-
return function (_x) {
|
|
462
|
-
return _ref.apply(this, arguments);
|
|
463
|
-
};
|
|
464
|
-
}());
|
|
465
|
-
}
|
|
466
|
-
sessionStorage.removeItem('user_type');
|
|
467
|
-
sessionStorage.removeItem('project_type');
|
|
468
|
-
sessionStorage.removeItem('project_timeline');
|
|
469
|
-
}
|
|
470
|
-
}
|
|
471
|
-
}, {
|
|
472
|
-
key: "componentWillUnmount",
|
|
473
|
-
value: function componentWillUnmount() {
|
|
474
|
-
window.addEventListener('beforeunload', this.handleBeforeUnload);
|
|
475
|
-
window.onbeforeunload = null;
|
|
476
|
-
}
|
|
477
|
-
}, {
|
|
478
|
-
key: "componentWillMount",
|
|
479
|
-
value: function componentWillMount() {}
|
|
480
|
-
}, {
|
|
481
|
-
key: "componentWillReceiveProps",
|
|
482
|
-
value: function componentWillReceiveProps(nextProps) {
|
|
483
|
-
var stateExtractor = nextProps.stateExtractor,
|
|
484
|
-
state = nextProps.state,
|
|
485
|
-
projectActions = nextProps.projectActions,
|
|
486
|
-
catalog = nextProps.catalog;
|
|
487
|
-
var plannerState = stateExtractor(state);
|
|
488
|
-
var catalogReady = plannerState.getIn(['catalog', 'ready']);
|
|
489
|
-
if (!catalogReady) {
|
|
490
|
-
projectActions.initCatalog(catalog);
|
|
491
|
-
}
|
|
492
|
-
}
|
|
493
|
-
}, {
|
|
494
|
-
key: "isProjectEmpty",
|
|
495
|
-
value: function isProjectEmpty(scene) {
|
|
496
|
-
var layers = scene.layers,
|
|
497
|
-
selectedLayer = scene.selectedLayer;
|
|
498
|
-
var layer = layers.get(selectedLayer);
|
|
499
|
-
return layer.areas.size + layer.lines.size + layer.holes.size + layer.items.size === 0;
|
|
500
|
-
}
|
|
501
|
-
}, {
|
|
502
|
-
key: "render",
|
|
503
|
-
value: function render() {
|
|
504
|
-
var _this$props3 = this.props,
|
|
505
|
-
width = _this$props3.width,
|
|
506
|
-
height = _this$props3.height,
|
|
507
|
-
state = _this$props3.state,
|
|
508
|
-
stateExtractor = _this$props3.stateExtractor,
|
|
509
|
-
props = _objectWithoutProperties(_this$props3, _excluded);
|
|
510
|
-
var _this$state = this.state,
|
|
511
|
-
savePopupVisible = _this$state.savePopupVisible,
|
|
512
|
-
quotePopupVisible = _this$state.quotePopupVisible,
|
|
513
|
-
assistPopupVisible = _this$state.assistPopupVisible,
|
|
514
|
-
signOpen = _this$state.signOpen,
|
|
515
|
-
myProjectsOpen = _this$state.myProjectsOpen;
|
|
516
|
-
var contentW = width - toolbarW;
|
|
517
|
-
var categoryData = this.props.categoryData;
|
|
518
|
-
// console.log(categoryData);
|
|
519
|
-
// let contentW = width - toolbarW - sidebarW;
|
|
520
|
-
// let toolbarH = height - footerBarH;
|
|
521
|
-
// let contentH = height - footerBarH;
|
|
522
|
-
// let sidebarH = height - footerBarH;
|
|
523
|
-
var toolbarH = height;
|
|
524
|
-
var contentH = height;
|
|
525
|
-
var sidebarH = height;
|
|
526
|
-
var headerW = width;
|
|
527
|
-
var headerH = 60;
|
|
528
|
-
var extractedState = stateExtractor(state);
|
|
529
|
-
var doorStyle = extractedState.get('doorStyle');
|
|
530
|
-
if (extractedState.getIn(['scene', 'layers', extractedState.scene.selectedLayer, 'doorStyle']) !== undefined && extractedState.getIn(['scene', 'layers', extractedState.scene.selectedLayer, 'doorStyle']) !== null) {
|
|
531
|
-
var extractedStateData = extractedState.getIn(['scene', 'layers', extractedState.scene.selectedLayer, 'doorStyle']);
|
|
532
|
-
var doorIdAvailable = false;
|
|
533
|
-
if (this.props.categoryData.doorStyles && this.props.categoryData.doorStyles.items) {
|
|
534
|
-
this.props.categoryData.doorStyles.items.find(function (category) {
|
|
535
|
-
doorIdAvailable = category.items.find(function (style) {
|
|
536
|
-
var item = style.items.find(function (it) {
|
|
537
|
-
return it.id === extractedStateData.id;
|
|
538
|
-
});
|
|
539
|
-
if (item) {
|
|
540
|
-
colorItem = item;
|
|
541
|
-
return true;
|
|
542
|
-
} else {
|
|
543
|
-
return false;
|
|
544
|
-
}
|
|
545
|
-
});
|
|
546
|
-
});
|
|
547
|
-
}
|
|
548
|
-
if (doorIdAvailable) doorStyle = extractedStateData;
|
|
549
|
-
}
|
|
550
|
-
var firstVisit = this.state.wizardStepOpend && this.isProjectEmpty(extractedState.scene);
|
|
551
|
-
var allVisible = firstVisit || signOpen || myProjectsOpen;
|
|
552
|
-
var _scene = extractedState.getIn(['scene']);
|
|
553
|
-
var len = convert(_scene.width).from(_scene.unit).to('cm');
|
|
554
|
-
var _viewer2D = extractedState.getIn(['viewer2D']);
|
|
555
|
-
if (_viewer2D.size > 0) {
|
|
556
|
-
var scaleX = width / len * 3;
|
|
557
|
-
var scaleY = height / len * 3;
|
|
558
|
-
var scale = scaleX > scaleY ? scaleY : scaleX;
|
|
559
|
-
var _e = width - len * scale,
|
|
560
|
-
_f = height - len * scale;
|
|
561
|
-
var viewer = _viewer2D.toJS();
|
|
562
|
-
if (viewer.e === 0 && viewer.f === 0) {
|
|
563
|
-
_viewer2D = _viewer2D.merge({
|
|
564
|
-
e: viewer.viewerWidth / 2 - viewer.SVGWidth / 2,
|
|
565
|
-
f: viewer.viewerHeight / 2 - viewer.SVGHeight / 2,
|
|
566
|
-
a: 0.99,
|
|
567
|
-
d: 0.99
|
|
568
|
-
});
|
|
569
|
-
}
|
|
570
|
-
}
|
|
571
|
-
extractedState = extractedState.merge({
|
|
572
|
-
viewer2D: _viewer2D
|
|
573
|
-
});
|
|
574
|
-
return /*#__PURE__*/React.createElement("section", null, /*#__PURE__*/React.createElement("div", {
|
|
575
|
-
style: _objectSpread(_objectSpread({}, wrapperStyle), {}, {
|
|
576
|
-
height: height
|
|
577
|
-
})
|
|
578
|
-
}, /*#__PURE__*/React.createElement(Content, _extends({
|
|
579
|
-
width: contentW,
|
|
580
|
-
height: contentH,
|
|
581
|
-
catalog: this.props.catalog,
|
|
582
|
-
state: extractedState,
|
|
583
|
-
toolBar: this.state.toolbar,
|
|
584
|
-
setToolbar: this.setToolbar,
|
|
585
|
-
replaceCabinet: this.replaceCabinet,
|
|
586
|
-
keyDownEnable: !savePopupVisible && !quotePopupVisible && !assistPopupVisible
|
|
587
|
-
}, props, {
|
|
588
|
-
onWheel: function onWheel(event) {
|
|
589
|
-
return event.preventDefault();
|
|
590
|
-
}
|
|
591
|
-
}))));
|
|
592
|
-
}
|
|
593
|
-
}]);
|
|
594
|
-
}(Component);
|
|
595
|
-
KitchenConfigurator.propTypes = {
|
|
596
|
-
translator: PropTypes.instanceOf(Translator),
|
|
597
|
-
catalog: PropTypes.instanceOf(Catalog),
|
|
598
|
-
allowProjectFileSupport: PropTypes.bool,
|
|
599
|
-
plugins: PropTypes.arrayOf(PropTypes.func),
|
|
600
|
-
autosaveKey: PropTypes.string,
|
|
601
|
-
autosaveDelay: PropTypes.number,
|
|
602
|
-
width: PropTypes.number.isRequired,
|
|
603
|
-
height: PropTypes.number.isRequired,
|
|
604
|
-
stateExtractor: PropTypes.func.isRequired,
|
|
605
|
-
toolbarButtons: PropTypes.array,
|
|
606
|
-
sidebarComponents: PropTypes.array,
|
|
607
|
-
footerbarComponents: PropTypes.array,
|
|
608
|
-
customContents: PropTypes.object,
|
|
609
|
-
softwareSignature: PropTypes.string,
|
|
610
|
-
configData: PropTypes.object
|
|
611
|
-
};
|
|
612
|
-
KitchenConfigurator.contextTypes = {
|
|
613
|
-
store: PropTypes.object.isRequired
|
|
614
|
-
};
|
|
615
|
-
KitchenConfigurator.childContextTypes = _objectSpread(_objectSpread({}, objectsMap(actions, function () {
|
|
616
|
-
return PropTypes.object;
|
|
617
|
-
})), {}, {
|
|
618
|
-
translator: PropTypes.object,
|
|
619
|
-
catalog: PropTypes.object
|
|
620
|
-
});
|
|
621
|
-
KitchenConfigurator.defaultProps = {
|
|
622
|
-
translator: new Translator(),
|
|
623
|
-
catalog: new Catalog(),
|
|
624
|
-
plugins: [],
|
|
625
|
-
allowProjectFileSupport: true,
|
|
626
|
-
softwareSignature: "KitchenConfigurator ".concat(VERSION),
|
|
627
|
-
toolbarButtons: [],
|
|
628
|
-
sidebarComponents: [],
|
|
629
|
-
footerbarComponents: [],
|
|
630
|
-
customContents: {},
|
|
631
|
-
configData: {}
|
|
632
|
-
};
|
|
633
|
-
|
|
634
|
-
//redux connect
|
|
635
|
-
function mapStateToProps(reduxState) {
|
|
636
|
-
return {
|
|
637
|
-
state: reduxState
|
|
638
|
-
};
|
|
639
|
-
}
|
|
640
|
-
function mapDispatchToProps(dispatch) {
|
|
641
|
-
return objectsMap(actions, function (actionNamespace) {
|
|
642
|
-
return bindActionCreators(actions[actionNamespace], dispatch);
|
|
643
|
-
});
|
|
644
|
-
}
|
|
645
|
-
export default connect(mapStateToProps, mapDispatchToProps)(KitchenConfigurator);
|