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