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,140 +0,0 @@
|
|
|
1
|
-
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); }
|
|
2
|
-
function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
|
|
3
|
-
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
4
|
-
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; } }
|
|
5
|
-
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; }
|
|
6
|
-
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
7
|
-
function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
|
|
8
|
-
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 }; })(); }
|
|
9
|
-
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); }
|
|
10
|
-
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); }
|
|
11
|
-
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); }); }; }
|
|
12
|
-
function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
|
|
13
|
-
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); } }
|
|
14
|
-
function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
|
|
15
|
-
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
16
|
-
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); }
|
|
17
|
-
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
18
|
-
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); }
|
|
19
|
-
function _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e; }
|
|
20
|
-
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
21
|
-
function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); }
|
|
22
|
-
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); }
|
|
23
|
-
function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }
|
|
24
|
-
import React, { Component } from 'react';
|
|
25
|
-
import PropTypes from 'prop-types';
|
|
26
|
-
import { Grids, Layer } from "./export";
|
|
27
|
-
var Scene = /*#__PURE__*/function (_Component) {
|
|
28
|
-
function Scene() {
|
|
29
|
-
_classCallCheck(this, Scene);
|
|
30
|
-
return _callSuper(this, Scene, arguments);
|
|
31
|
-
}
|
|
32
|
-
_inherits(Scene, _Component);
|
|
33
|
-
return _createClass(Scene, [{
|
|
34
|
-
key: "componentWillReceiveProps",
|
|
35
|
-
value: function () {
|
|
36
|
-
var _componentWillReceiveProps = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee(nextProps) {
|
|
37
|
-
var scene, catalog, height, layers, selectedLayer, msg, isNotFoundInElements, itemType;
|
|
38
|
-
return _regenerator().w(function (_context) {
|
|
39
|
-
while (1) switch (_context.n) {
|
|
40
|
-
case 0:
|
|
41
|
-
// console.log("componentDidMount", this.props.scene.hashCode(), nextProps.scene.hashCode());
|
|
42
|
-
if (this.props.scene.hashCode() !== nextProps.scene.hashCode()) {
|
|
43
|
-
scene = nextProps.scene, catalog = nextProps.catalog;
|
|
44
|
-
height = scene.height, layers = scene.layers;
|
|
45
|
-
console.log(layers.toJS());
|
|
46
|
-
selectedLayer = layers.get(scene.selectedLayer);
|
|
47
|
-
msg = '';
|
|
48
|
-
isNotFoundInElements = false;
|
|
49
|
-
itemType = '';
|
|
50
|
-
selectedLayer.items.valueSeq().forEach(function (item) {
|
|
51
|
-
if (!catalog.elements.hasOwnProperty(item.type)) {
|
|
52
|
-
itemType = item.type;
|
|
53
|
-
isNotFoundInElements = true;
|
|
54
|
-
}
|
|
55
|
-
});
|
|
56
|
-
// if(isNotFoundInElements){
|
|
57
|
-
// const deepSearchResult = await searchForSkuValue(catalog, selectedLayer, itemType)
|
|
58
|
-
// if(!deepSearchResult.isAvailable){
|
|
59
|
-
// msg += (`Element ${itemType} does not exist in catalog.\n`);
|
|
60
|
-
// }
|
|
61
|
-
// }
|
|
62
|
-
|
|
63
|
-
// if(msg !== '') {
|
|
64
|
-
// msg += `Do you want to initialize?`;
|
|
65
|
-
// confirm(msg)
|
|
66
|
-
// ? this.context.projectActions.newProject()
|
|
67
|
-
// : null
|
|
68
|
-
// }
|
|
69
|
-
}
|
|
70
|
-
case 1:
|
|
71
|
-
return _context.a(2);
|
|
72
|
-
}
|
|
73
|
-
}, _callee, this);
|
|
74
|
-
}));
|
|
75
|
-
function componentWillReceiveProps(_x) {
|
|
76
|
-
return _componentWillReceiveProps.apply(this, arguments);
|
|
77
|
-
}
|
|
78
|
-
return componentWillReceiveProps;
|
|
79
|
-
}()
|
|
80
|
-
}, {
|
|
81
|
-
key: "shouldComponentUpdate",
|
|
82
|
-
value: function shouldComponentUpdate(nextProps, nextState) {
|
|
83
|
-
return this.props.scene.hashCode() !== nextProps.scene.hashCode();
|
|
84
|
-
}
|
|
85
|
-
}, {
|
|
86
|
-
key: "render",
|
|
87
|
-
value: function render() {
|
|
88
|
-
var _this = this;
|
|
89
|
-
// console.log("scene", this);
|
|
90
|
-
var _this$props = this.props,
|
|
91
|
-
scene = _this$props.scene,
|
|
92
|
-
catalog = _this$props.catalog;
|
|
93
|
-
var height = scene.height,
|
|
94
|
-
layers = scene.layers;
|
|
95
|
-
var selectedLayer = layers.get(scene.selectedLayer);
|
|
96
|
-
return /*#__PURE__*/React.createElement("g", null, /*#__PURE__*/React.createElement(Grids, {
|
|
97
|
-
scene: scene
|
|
98
|
-
}), /*#__PURE__*/React.createElement("g", {
|
|
99
|
-
style: {
|
|
100
|
-
pointerEvents: 'none'
|
|
101
|
-
}
|
|
102
|
-
}, layers.entrySeq().filter(function (_ref) {
|
|
103
|
-
var _ref2 = _slicedToArray(_ref, 2),
|
|
104
|
-
layerID = _ref2[0],
|
|
105
|
-
layer = _ref2[1];
|
|
106
|
-
return layerID !== scene.selectedLayer && layer.visible;
|
|
107
|
-
}).map(function (_ref3) {
|
|
108
|
-
var _ref4 = _slicedToArray(_ref3, 2),
|
|
109
|
-
layerID = _ref4[0],
|
|
110
|
-
layer = _ref4[1];
|
|
111
|
-
return /*#__PURE__*/React.createElement(Layer, {
|
|
112
|
-
key: layerID,
|
|
113
|
-
layer: layer,
|
|
114
|
-
scene: scene,
|
|
115
|
-
catalog: catalog,
|
|
116
|
-
mode: _this.props.state.mode,
|
|
117
|
-
state: _this.props.state,
|
|
118
|
-
relatedLines: _this.props.relatedLines
|
|
119
|
-
});
|
|
120
|
-
})), /*#__PURE__*/React.createElement(Layer, {
|
|
121
|
-
key: selectedLayer.id,
|
|
122
|
-
layer: selectedLayer,
|
|
123
|
-
scene: scene,
|
|
124
|
-
catalog: catalog,
|
|
125
|
-
mode: this.props.state.mode,
|
|
126
|
-
state: this.props.state,
|
|
127
|
-
relatedLines: this.props.relatedLines
|
|
128
|
-
}));
|
|
129
|
-
}
|
|
130
|
-
}]);
|
|
131
|
-
}(Component);
|
|
132
|
-
export { Scene as default };
|
|
133
|
-
Scene.propTypes = {
|
|
134
|
-
scene: PropTypes.object.isRequired,
|
|
135
|
-
catalog: PropTypes.object.isRequired,
|
|
136
|
-
relatedLines: PropTypes.object.isRequired
|
|
137
|
-
};
|
|
138
|
-
Scene.contextTypes = {
|
|
139
|
-
projectActions: PropTypes.object.isRequired
|
|
140
|
-
};
|
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import PropTypes from 'prop-types';
|
|
3
|
-
import * as Geometry from "../../utils/geometry";
|
|
4
|
-
var STYLE = {
|
|
5
|
-
stroke: '#D32F2F',
|
|
6
|
-
strokeWidth: '1px'
|
|
7
|
-
};
|
|
8
|
-
export default function ActiveDrawingHelper(_ref) {
|
|
9
|
-
var snap = _ref.snap,
|
|
10
|
-
width = _ref.width,
|
|
11
|
-
height = _ref.height;
|
|
12
|
-
switch (snap.type) {
|
|
13
|
-
case 'point':
|
|
14
|
-
return /*#__PURE__*/React.createElement("g", {
|
|
15
|
-
transform: "translate(".concat(snap.x, " ").concat(snap.y, ")")
|
|
16
|
-
}, /*#__PURE__*/React.createElement("line", {
|
|
17
|
-
name: "line_type_ActiveDrawingHelper",
|
|
18
|
-
x1: "0",
|
|
19
|
-
y1: "-70",
|
|
20
|
-
x2: "0",
|
|
21
|
-
y2: "70",
|
|
22
|
-
style: STYLE
|
|
23
|
-
}), /*#__PURE__*/React.createElement("line", {
|
|
24
|
-
name: "line_type_ActiveDrawingHelper",
|
|
25
|
-
x1: "-70",
|
|
26
|
-
y1: "0",
|
|
27
|
-
x2: "70",
|
|
28
|
-
y2: "0",
|
|
29
|
-
style: STYLE
|
|
30
|
-
}));
|
|
31
|
-
case 'line':
|
|
32
|
-
var h0 = Geometry.horizontalLine(0);
|
|
33
|
-
var h1 = Geometry.horizontalLine(height);
|
|
34
|
-
var pointH0 = Geometry.twoLinesIntersection(snap.a, snap.b, snap.c, h0.a, h0.b, h0.c);
|
|
35
|
-
var pointH1 = Geometry.twoLinesIntersection(snap.a, snap.b, snap.c, h1.a, h1.b, h1.c);
|
|
36
|
-
var v0 = Geometry.verticalLine(0);
|
|
37
|
-
var v1 = Geometry.verticalLine(width);
|
|
38
|
-
var pointV0 = Geometry.twoLinesIntersection(snap.a, snap.b, snap.c, v0.a, v0.b, v0.c);
|
|
39
|
-
var pointV1 = Geometry.twoLinesIntersection(snap.a, snap.b, snap.c, v1.a, v1.b, v1.c);
|
|
40
|
-
if (pointH0 && pointH1) return /*#__PURE__*/React.createElement("line", {
|
|
41
|
-
name: "line_type_ActiveDrawingHelper",
|
|
42
|
-
x1: pointH0.x,
|
|
43
|
-
y1: pointH0.y,
|
|
44
|
-
x2: pointH1.x,
|
|
45
|
-
y2: pointH1.y,
|
|
46
|
-
style: STYLE
|
|
47
|
-
});
|
|
48
|
-
if (pointV0 && pointV1) return /*#__PURE__*/React.createElement("line", {
|
|
49
|
-
name: "line_type_ActiveDrawingHelper",
|
|
50
|
-
x1: pointV0.x,
|
|
51
|
-
y1: pointV0.y,
|
|
52
|
-
x2: pointV1.x,
|
|
53
|
-
y2: pointV1.y,
|
|
54
|
-
style: STYLE
|
|
55
|
-
});
|
|
56
|
-
return null;
|
|
57
|
-
case 'line-segment':
|
|
58
|
-
return /*#__PURE__*/React.createElement("line", {
|
|
59
|
-
name: "line_type_ActiveDrawingHelper",
|
|
60
|
-
x1: snap.x1,
|
|
61
|
-
y1: snap.y1,
|
|
62
|
-
x2: snap.x2,
|
|
63
|
-
y2: snap.y2,
|
|
64
|
-
style: STYLE
|
|
65
|
-
});
|
|
66
|
-
default:
|
|
67
|
-
return null;
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
ActiveDrawingHelper.propTypes = {
|
|
71
|
-
snap: PropTypes.object.isRequired,
|
|
72
|
-
width: PropTypes.number.isRequired,
|
|
73
|
-
height: PropTypes.number.isRequired
|
|
74
|
-
};
|
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
|
|
2
|
-
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
3
|
-
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
4
|
-
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
5
|
-
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
6
|
-
function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
|
|
7
|
-
import React from 'react';
|
|
8
|
-
import PropTypes from 'prop-types';
|
|
9
|
-
import Scene from "./scene";
|
|
10
|
-
import Snap from "./snap";
|
|
11
|
-
import * as SharedStyle from "../../shared-style";
|
|
12
|
-
var guideStyle = {
|
|
13
|
-
stroke: SharedStyle.SECONDARY_COLOR.main,
|
|
14
|
-
strokewidth: '2.5px'
|
|
15
|
-
};
|
|
16
|
-
export default function State(_ref) {
|
|
17
|
-
var state = _ref.state,
|
|
18
|
-
catalog = _ref.catalog,
|
|
19
|
-
relatedLines = _ref.relatedLines;
|
|
20
|
-
var activeSnapElement = state.activeSnapElement,
|
|
21
|
-
snapElements = state.snapElements,
|
|
22
|
-
scene = state.scene;
|
|
23
|
-
var width = scene.width,
|
|
24
|
-
height = scene.height;
|
|
25
|
-
activeSnapElement = activeSnapElement ? /*#__PURE__*/React.createElement(Snap, {
|
|
26
|
-
snap: activeSnapElement,
|
|
27
|
-
width: scene.width,
|
|
28
|
-
height: scene.height
|
|
29
|
-
}) : null;
|
|
30
|
-
// snapElements = snapElements.map((snap,id) => <Snap key={id} snap={snap} width={scene.width} height={scene.height}/>);
|
|
31
|
-
snapElements = null; //only for debug purpose
|
|
32
|
-
|
|
33
|
-
return /*#__PURE__*/React.createElement("g", null, /*#__PURE__*/React.createElement("rect", {
|
|
34
|
-
x: "0",
|
|
35
|
-
y: "0",
|
|
36
|
-
width: width,
|
|
37
|
-
height: height,
|
|
38
|
-
fill: SharedStyle.COLORS.white
|
|
39
|
-
}), /*#__PURE__*/React.createElement("g", {
|
|
40
|
-
transform: "translate(0, ".concat(scene.height, ") scale(1, -1)"),
|
|
41
|
-
id: "svg-drawing-paper"
|
|
42
|
-
}, /*#__PURE__*/React.createElement(Scene, {
|
|
43
|
-
scene: scene,
|
|
44
|
-
state: state,
|
|
45
|
-
catalog: catalog,
|
|
46
|
-
relatedLines: relatedLines
|
|
47
|
-
}), scene.getIn(['guides', 'horizontal']).entrySeq().map(function (_ref2) {
|
|
48
|
-
var _ref3 = _slicedToArray(_ref2, 2),
|
|
49
|
-
hgKey = _ref3[0],
|
|
50
|
-
hgVal = _ref3[1];
|
|
51
|
-
return /*#__PURE__*/React.createElement("line", {
|
|
52
|
-
id: 'hGuide' + hgKey,
|
|
53
|
-
key: hgKey,
|
|
54
|
-
x1: 0,
|
|
55
|
-
y1: hgVal,
|
|
56
|
-
x2: width,
|
|
57
|
-
y2: hgVal,
|
|
58
|
-
style: guideStyle
|
|
59
|
-
});
|
|
60
|
-
}), scene.getIn(['guides', 'vertical']).entrySeq().map(function (_ref4) {
|
|
61
|
-
var _ref5 = _slicedToArray(_ref4, 2),
|
|
62
|
-
vgKey = _ref5[0],
|
|
63
|
-
vgVal = _ref5[1];
|
|
64
|
-
return /*#__PURE__*/React.createElement("line", {
|
|
65
|
-
key: vgKey,
|
|
66
|
-
x1: vgVal,
|
|
67
|
-
y1: 0,
|
|
68
|
-
x2: vgVal,
|
|
69
|
-
y2: height,
|
|
70
|
-
style: guideStyle
|
|
71
|
-
});
|
|
72
|
-
}), activeSnapElement, snapElements));
|
|
73
|
-
}
|
|
74
|
-
State.propTypes = {
|
|
75
|
-
state: PropTypes.object.isRequired,
|
|
76
|
-
catalog: PropTypes.object.isRequired,
|
|
77
|
-
relatedLines: PropTypes.object.isRequired
|
|
78
|
-
};
|
|
@@ -1,198 +0,0 @@
|
|
|
1
|
-
function _toConsumableArray(r) { return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread(); }
|
|
2
|
-
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."); }
|
|
3
|
-
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
4
|
-
function _iterableToArray(r) { if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r); }
|
|
5
|
-
function _arrayWithoutHoles(r) { if (Array.isArray(r)) return _arrayLikeToArray(r); }
|
|
6
|
-
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; }
|
|
7
|
-
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); }
|
|
8
|
-
import { toPlainObject } from "../../utils/helper";
|
|
9
|
-
import { INSTALLATION_SUFFIX_TYPE, INSTALLATION_TYPE_NAME, INSTALLATION_TYPE_SKU_SUFFIX, TOE_KICK_MOLDING } from "../../constants";
|
|
10
|
-
export var searchForSkuValue = function searchForSkuValue(catalog, selectedLayer, elementType) {
|
|
11
|
-
return new Promise(function (resolve) {
|
|
12
|
-
if (elementType) {
|
|
13
|
-
Object.values(catalog.elements).forEach(function (value) {
|
|
14
|
-
if (value.obj && value.obj.skuArray) {
|
|
15
|
-
if (value.obj.skuArray.find(function (skItem) {
|
|
16
|
-
return skItem.sku === elementType;
|
|
17
|
-
})) {
|
|
18
|
-
saveDeepSearchType(elementType, value.name);
|
|
19
|
-
resolve({
|
|
20
|
-
isAvailable: true,
|
|
21
|
-
rootType: value.name
|
|
22
|
-
});
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
});
|
|
26
|
-
} else {
|
|
27
|
-
selectedLayer.items.valueSeq().forEach(function (item) {
|
|
28
|
-
Object.values(catalog.elements).forEach(function (value) {
|
|
29
|
-
if (value.obj && value.obj.skuArray) {
|
|
30
|
-
if (value.obj.skuArray.find(function (skItem) {
|
|
31
|
-
return skItem.sku === item.type;
|
|
32
|
-
})) {
|
|
33
|
-
resolve({
|
|
34
|
-
isAvailable: true,
|
|
35
|
-
rootType: value.name
|
|
36
|
-
});
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
});
|
|
40
|
-
});
|
|
41
|
-
}
|
|
42
|
-
resolve({
|
|
43
|
-
isAvailable: false
|
|
44
|
-
});
|
|
45
|
-
});
|
|
46
|
-
};
|
|
47
|
-
export var returnReplaceableDeepSearchType = function returnReplaceableDeepSearchType(type) {
|
|
48
|
-
var DeepSearchTypes = JSON.parse(sessionStorage.getItem('deepSearchTypes')) || [];
|
|
49
|
-
var replaceableType = DeepSearchTypes.find(function (item) {
|
|
50
|
-
return item.type === type;
|
|
51
|
-
});
|
|
52
|
-
return replaceableType && replaceableType.foundType || '';
|
|
53
|
-
};
|
|
54
|
-
export function getInstallationSuffix(type) {
|
|
55
|
-
var _doorColor$isAssemble, _doorColor$install;
|
|
56
|
-
var doorColor = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
57
|
-
if (!doorColor) {
|
|
58
|
-
console.error('getInstallationSuffix received false argument : ', doorColor);
|
|
59
|
-
return doorColor;
|
|
60
|
-
}
|
|
61
|
-
doorColor = toPlainObject(doorColor);
|
|
62
|
-
|
|
63
|
-
// If doorColor.isAssembled is explicitly set → trust it.
|
|
64
|
-
// Else → fall back to checking install.
|
|
65
|
-
var isAssembled = (_doorColor$isAssemble = doorColor.isAssembled) !== null && _doorColor$isAssemble !== void 0 ? _doorColor$isAssemble : ((_doorColor$install = doorColor.install) === null || _doorColor$install === void 0 ? void 0 : _doorColor$install.toLowerCase()) === INSTALLATION_TYPE_NAME.ASSEMBLED.toLowerCase();
|
|
66
|
-
if (type === INSTALLATION_SUFFIX_TYPE.SKU) {
|
|
67
|
-
return isAssembled ? INSTALLATION_TYPE_SKU_SUFFIX.ASSEMBLED : INSTALLATION_TYPE_SKU_SUFFIX.RTA;
|
|
68
|
-
} else {
|
|
69
|
-
return isAssembled ? INSTALLATION_TYPE_NAME.ASSEMBLED : INSTALLATION_TYPE_NAME.RTA;
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
export function isEqualInstallationType(doorColor1, doorColor2) {
|
|
73
|
-
var _getInstallationSuffi, _getInstallationSuffi2;
|
|
74
|
-
return ((_getInstallationSuffi = getInstallationSuffix(INSTALLATION_SUFFIX_TYPE.NAME, doorColor1)) === null || _getInstallationSuffi === void 0 ? void 0 : _getInstallationSuffi.toLowerCase()) === ((_getInstallationSuffi2 = getInstallationSuffix(INSTALLATION_SUFFIX_TYPE.NAME, doorColor2)) === null || _getInstallationSuffi2 === void 0 ? void 0 : _getInstallationSuffi2.toLowerCase());
|
|
75
|
-
}
|
|
76
|
-
function buildSKU(baseSKU) {
|
|
77
|
-
var doorColor = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
78
|
-
var colorSuffix = doorColor.color_sku_alias || doorColor.sku || '';
|
|
79
|
-
var installationSuffix = getInstallationSuffix(INSTALLATION_SUFFIX_TYPE.SKU, doorColor);
|
|
80
|
-
return [baseSKU, colorSuffix, installationSuffix].filter(Boolean).join('-');
|
|
81
|
-
}
|
|
82
|
-
function buildToeKickSKU() {
|
|
83
|
-
var doorColor = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
84
|
-
var catalog = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
85
|
-
// Base toe kick SKU (can be swapped between ['TKC', 'TK8', 'TK96'])
|
|
86
|
-
var baseSKU = getToeKickSKU(doorColor, catalog);
|
|
87
|
-
if (baseSKU === false) return false;
|
|
88
|
-
return buildSKU(baseSKU, doorColor);
|
|
89
|
-
}
|
|
90
|
-
function buildRegularSKU(element, catalog) {
|
|
91
|
-
var _internal_sku;
|
|
92
|
-
var doorColor = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
93
|
-
// Try to resolve element in catalog
|
|
94
|
-
var _element = catalog.elements[element.type] || catalog.elements[returnReplaceableDeepSearchType(element.type)];
|
|
95
|
-
if (!_element) return false;
|
|
96
|
-
|
|
97
|
-
// Start from default SKU
|
|
98
|
-
var internal_sku = _element.obj.sku_number;
|
|
99
|
-
|
|
100
|
-
// Override with SKU matching door color if found
|
|
101
|
-
var tempSKU = _element.obj.skuArray.find(function (el) {
|
|
102
|
-
return el.door_color_id === doorColor.id;
|
|
103
|
-
});
|
|
104
|
-
if (tempSKU !== null && tempSKU !== void 0 && tempSKU.sku) {
|
|
105
|
-
internal_sku = tempSKU.sku;
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
// Normalize left/right variants
|
|
109
|
-
internal_sku = (_internal_sku = internal_sku) === null || _internal_sku === void 0 ? void 0 : _internal_sku.replace(/-([RL])$/, '');
|
|
110
|
-
|
|
111
|
-
// Reuse generic builder for suffixes
|
|
112
|
-
return buildSKU(internal_sku, doorColor);
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
// element : cabinet
|
|
116
|
-
// catalog : all cabinet info
|
|
117
|
-
export function makeSKUForMagento(element, catalog, categoryData) {
|
|
118
|
-
var _element$category;
|
|
119
|
-
if ((_element$category = element.category) !== null && _element$category !== void 0 && _element$category.toLowerCase().includes('molding')) {
|
|
120
|
-
element.type = element.name;
|
|
121
|
-
}
|
|
122
|
-
var doorColor = toPlainObject(element.doorStyle);
|
|
123
|
-
if (!doorColor) return false;
|
|
124
|
-
return element.name === TOE_KICK_MOLDING ? buildToeKickSKU(doorColor, catalog) : buildRegularSKU(element, catalog, doorColor);
|
|
125
|
-
}
|
|
126
|
-
export function isEmpty(value) {
|
|
127
|
-
if (value === undefined || value === null || _typeof(value) === 'object' && Object.keys(value).length === 0 || typeof value === 'string' && value.trim().length === 0) return true;else return false;
|
|
128
|
-
}
|
|
129
|
-
var saveDeepSearchType = function saveDeepSearchType(type, foundType) {
|
|
130
|
-
var DeepSearchTypes = JSON.parse(sessionStorage.getItem('deepSearchTypes')) || [];
|
|
131
|
-
var isAlreadyAvailable = DeepSearchTypes.find(function (item) {
|
|
132
|
-
return item.type === type;
|
|
133
|
-
});
|
|
134
|
-
if (!isAlreadyAvailable) {
|
|
135
|
-
DeepSearchTypes.push({
|
|
136
|
-
type: type,
|
|
137
|
-
foundType: foundType
|
|
138
|
-
});
|
|
139
|
-
}
|
|
140
|
-
sessionStorage.setItem('deepSearchTypes', JSON.stringify(DeepSearchTypes));
|
|
141
|
-
};
|
|
142
|
-
|
|
143
|
-
/**
|
|
144
|
-
* @param {Boolean} flag true: for thumbnail, false: default value
|
|
145
|
-
* @returns
|
|
146
|
-
*/
|
|
147
|
-
export var getToeKickSKU = function getToeKickSKU() {
|
|
148
|
-
var doorColor = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
149
|
-
var catalog = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
150
|
-
var flag = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
|
151
|
-
var catalogData = catalog.elements || [];
|
|
152
|
-
var itemDoorColorID = (doorColor === null || doorColor === void 0 ? void 0 : doorColor.id) || [];
|
|
153
|
-
var skuData = '';
|
|
154
|
-
Object.keys(catalogData).forEach(function (data) {
|
|
155
|
-
var obj = catalogData[data].obj;
|
|
156
|
-
if ((obj === null || obj === void 0 ? void 0 : obj.cabinet_category) === TOE_KICK_MOLDING) {
|
|
157
|
-
var _obj$skuArray;
|
|
158
|
-
var found = (_obj$skuArray = obj.skuArray) === null || _obj$skuArray === void 0 ? void 0 : _obj$skuArray.find(function (cData) {
|
|
159
|
-
return cData.door_color_id === itemDoorColorID;
|
|
160
|
-
});
|
|
161
|
-
if (found) {
|
|
162
|
-
skuData = flag ? data : found === null || found === void 0 ? void 0 : found.sku;
|
|
163
|
-
}
|
|
164
|
-
}
|
|
165
|
-
});
|
|
166
|
-
if (!skuData) return false;
|
|
167
|
-
return skuData;
|
|
168
|
-
};
|
|
169
|
-
|
|
170
|
-
// ESM version of "area-polygon" with default + named export.
|
|
171
|
-
// Same behavior: takes an array of [x,y] tuples or {x,y} objects.
|
|
172
|
-
// If `signed` is truthy, returns signed area; otherwise absolute area.
|
|
173
|
-
// Does not mutate the input array.
|
|
174
|
-
|
|
175
|
-
function normalize(point) {
|
|
176
|
-
if (Array.isArray(point)) {
|
|
177
|
-
return {
|
|
178
|
-
x: point[0],
|
|
179
|
-
y: point[1]
|
|
180
|
-
};
|
|
181
|
-
}
|
|
182
|
-
return point;
|
|
183
|
-
}
|
|
184
|
-
export var areaPolygon = function areaPolygon(points) {
|
|
185
|
-
var signed = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
186
|
-
if (!Array.isArray(points) || points.length < 3) return 0;
|
|
187
|
-
|
|
188
|
-
// normalize and ensure closed ring (without mutating input)
|
|
189
|
-
var pts = points.map(normalize);
|
|
190
|
-
var closed = pts.length > 0 && (pts[0].x !== pts[pts.length - 1].x || pts[0].y !== pts[pts.length - 1].y) ? [].concat(_toConsumableArray(pts), [pts[0]]) : pts;
|
|
191
|
-
var det = 0;
|
|
192
|
-
var l = closed.length - 1; // last index before the duplicated first point
|
|
193
|
-
for (var i = 0; i < l; i++) {
|
|
194
|
-
det += closed[i].x * closed[i + 1].y - closed[i].y * closed[i + 1].x;
|
|
195
|
-
}
|
|
196
|
-
var area = det / 2;
|
|
197
|
-
return signed ? area : Math.abs(area);
|
|
198
|
-
};
|
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import PropTypes from 'prop-types';
|
|
3
|
-
import * as SharedStyle from "../../shared-style";
|
|
4
|
-
//Space from the center of the point(Use cases:x - vertexthickness,y + vertexthickness )
|
|
5
|
-
var vertexthickness = 4;
|
|
6
|
-
var STYLE = {
|
|
7
|
-
// strokeWidth: 5,
|
|
8
|
-
strokeLinejoin: 'round',
|
|
9
|
-
rx: '2px',
|
|
10
|
-
stroke: SharedStyle.LINE_MESH_COLOR.selected,
|
|
11
|
-
fill: SharedStyle.LINE_MESH_COLOR.selected,
|
|
12
|
-
cursor: 'move'
|
|
13
|
-
};
|
|
14
|
-
export default function Vertex(_ref) {
|
|
15
|
-
var vertex = _ref.vertex,
|
|
16
|
-
layer = _ref.layer;
|
|
17
|
-
var x = vertex.x,
|
|
18
|
-
y = vertex.y;
|
|
19
|
-
var relatedVertice = {
|
|
20
|
-
x: x,
|
|
21
|
-
y: y
|
|
22
|
-
};
|
|
23
|
-
if (vertex.lines.get(0)) {
|
|
24
|
-
var line = layer.lines.get(vertex.lines.get(0));
|
|
25
|
-
if (layer.lines.get(vertex.lines.get(1)) !== undefined && layer.lines.get(vertex.lines.get(1)).get('selected')) {
|
|
26
|
-
line = layer.lines.get(vertex.lines.get(1));
|
|
27
|
-
}
|
|
28
|
-
if (line) {
|
|
29
|
-
var index = line.vertices.findIndex(function (a) {
|
|
30
|
-
return a === vertex.id;
|
|
31
|
-
});
|
|
32
|
-
if (index > -1) {
|
|
33
|
-
var vertice = line.relatedVertices.filter(function (a) {
|
|
34
|
-
if (a['index'] === undefined) {
|
|
35
|
-
return a.get('index') === index;
|
|
36
|
-
} else if (a['index'] !== undefined) {
|
|
37
|
-
return a.index === index;
|
|
38
|
-
}
|
|
39
|
-
}).get(0);
|
|
40
|
-
if (vertice && !vertice['point']) {
|
|
41
|
-
relatedVertice = {
|
|
42
|
-
x: vertice.get('point').get('x'),
|
|
43
|
-
y: vertice.get('point').get('y')
|
|
44
|
-
};
|
|
45
|
-
} else if (vertice !== undefined) {
|
|
46
|
-
relatedVertice = vertice['point'];
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
return /*#__PURE__*/React.createElement("g", {
|
|
52
|
-
"data-element-root": true,
|
|
53
|
-
"data-prototype": vertex.prototype,
|
|
54
|
-
"data-id": vertex.id,
|
|
55
|
-
"data-selected": vertex.selected,
|
|
56
|
-
"data-layer": layer.id
|
|
57
|
-
}, /*#__PURE__*/React.createElement("polygon", {
|
|
58
|
-
points: "".concat(x - vertexthickness, ",").concat(y + vertexthickness, " ").concat(x - vertexthickness, ",").concat(y - vertexthickness, " ").concat(x + vertexthickness, ",").concat(y - vertexthickness, " ").concat(x + vertexthickness, ",").concat(y + vertexthickness),
|
|
59
|
-
style: STYLE
|
|
60
|
-
}));
|
|
61
|
-
}
|
|
62
|
-
Vertex.propTypes = {
|
|
63
|
-
vertex: PropTypes.object.isRequired,
|
|
64
|
-
layer: PropTypes.object.isRequired
|
|
65
|
-
};
|