kitchen-simulator 1.1.1-test.47 → 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 +15 -16
- 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 -26
- 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,18 +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 _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
|
|
3
|
-
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); } }
|
|
4
|
-
function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
|
|
5
|
-
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
6
|
-
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); }
|
|
7
|
-
var NameGenerator = /*#__PURE__*/function () {
|
|
8
|
-
function NameGenerator() {
|
|
9
|
-
_classCallCheck(this, NameGenerator);
|
|
10
|
-
}
|
|
11
|
-
return _createClass(NameGenerator, null, [{
|
|
12
|
-
key: "generateName",
|
|
13
|
-
value: function generateName(prototype, type) {
|
|
14
|
-
return type.substr(0, 1).toUpperCase() + type.substr(1);
|
|
15
|
-
}
|
|
16
|
-
}]);
|
|
17
|
-
}();
|
|
18
|
-
export { NameGenerator as default };
|
|
@@ -1,50 +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
|
-
import * as Three from 'three';
|
|
3
|
-
String.prototype.isLeftPlaceholder = function () {
|
|
4
|
-
return this.match(/_L$|_L_\d$/) != null;
|
|
5
|
-
};
|
|
6
|
-
String.prototype.isRightPlaceholder = function () {
|
|
7
|
-
return this.match(/_R$|_R_\d$/) != null;
|
|
8
|
-
};
|
|
9
|
-
export function objectsMap(object, func) {
|
|
10
|
-
var mappedObject = {};
|
|
11
|
-
for (var key in object) {
|
|
12
|
-
mappedObject[key] = func(key, mappedObject[key]);
|
|
13
|
-
}
|
|
14
|
-
return mappedObject;
|
|
15
|
-
}
|
|
16
|
-
export function objectsCompare(x, y) {
|
|
17
|
-
if (x === y) return true;
|
|
18
|
-
if (!(x instanceof Object) || !(y instanceof Object)) return false;
|
|
19
|
-
if (x.constructor !== y.constructor) return false;
|
|
20
|
-
for (var p in x) {
|
|
21
|
-
if (!x.hasOwnProperty(p)) continue;
|
|
22
|
-
if (!y.hasOwnProperty(p)) return false;
|
|
23
|
-
if (x[p] === y[p]) continue;
|
|
24
|
-
if (_typeof(x[p]) !== 'object') return false;
|
|
25
|
-
if (!objectsCompare(x[p], y[p])) return false;
|
|
26
|
-
}
|
|
27
|
-
for (var _p in y) {
|
|
28
|
-
if (y.hasOwnProperty(_p) && !x.hasOwnProperty(_p)) return false;
|
|
29
|
-
}
|
|
30
|
-
return true;
|
|
31
|
-
}
|
|
32
|
-
export function getAllMeshes(objects) {
|
|
33
|
-
var meshes = [];
|
|
34
|
-
objects.forEach(function (object) {
|
|
35
|
-
if (!object) return;
|
|
36
|
-
object.traverse(function (o) {
|
|
37
|
-
if (o.isMesh && o.geometry) {
|
|
38
|
-
meshes.push(o);
|
|
39
|
-
}
|
|
40
|
-
});
|
|
41
|
-
});
|
|
42
|
-
return meshes;
|
|
43
|
-
}
|
|
44
|
-
export function vectorIntersectWithMesh(origin, target) {
|
|
45
|
-
var vectorDir = new Three.Vector3(origin.x, origin.y - 1000, origin.z);
|
|
46
|
-
var ray = new Three.Raycaster();
|
|
47
|
-
ray.set(origin, vectorDir);
|
|
48
|
-
var intersects = ray.intersectObject(target, true);
|
|
49
|
-
return intersects.length > 0;
|
|
50
|
-
}
|
|
@@ -1,18 +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 ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
3
|
-
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
4
|
-
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
5
|
-
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
6
|
-
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); }
|
|
7
|
-
export var buildCurrentCabinetObject = function buildCurrentCabinetObject(cabinet, texture) {
|
|
8
|
-
return {
|
|
9
|
-
type: cabinet.name,
|
|
10
|
-
// e.g. "B09"
|
|
11
|
-
name: cabinet.name,
|
|
12
|
-
category: cabinet.type,
|
|
13
|
-
// "cabinet"
|
|
14
|
-
doorStyle: _objectSpread({}, texture),
|
|
15
|
-
itemID: cabinet.itemID,
|
|
16
|
-
sku_number: cabinet.name
|
|
17
|
-
};
|
|
18
|
-
};
|
package/es/utils/react-if.js
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import PropTypes from 'prop-types';
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* @return {null}
|
|
6
|
-
*/
|
|
7
|
-
export default function If(_ref) {
|
|
8
|
-
var condition = _ref.condition,
|
|
9
|
-
style = _ref.style,
|
|
10
|
-
children = _ref.children;
|
|
11
|
-
return condition ? Array.isArray(children) ? /*#__PURE__*/React.createElement("div", {
|
|
12
|
-
style: style
|
|
13
|
-
}, children) : children : null;
|
|
14
|
-
}
|
|
15
|
-
If.propTypes = {
|
|
16
|
-
condition: PropTypes.bool.isRequired,
|
|
17
|
-
style: PropTypes.object
|
|
18
|
-
};
|
package/es/utils/snap-scene.js
DELETED
|
@@ -1,99 +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 { SNAP_POINT, SNAP_LINE, SNAP_SEGMENT, SNAP_GRID, SNAP_GUIDE, addPointSnap, addLineSnap, addLineSegmentSnap, addGridSnap } from "./snap";
|
|
8
|
-
import { GeometryUtils } from "./export";
|
|
9
|
-
import { Map, List } from 'immutable';
|
|
10
|
-
export function sceneSnapElements(scene) {
|
|
11
|
-
var snapElements = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : new List();
|
|
12
|
-
var snapMask = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : new Map();
|
|
13
|
-
var width = scene.width,
|
|
14
|
-
height = scene.height;
|
|
15
|
-
var a, b, c;
|
|
16
|
-
return snapElements.withMutations(function (snapElements) {
|
|
17
|
-
scene.layers.forEach(function (layer) {
|
|
18
|
-
var lines = layer.lines,
|
|
19
|
-
vertices = layer.vertices;
|
|
20
|
-
vertices.forEach(function (_ref) {
|
|
21
|
-
var vertexID = _ref.id,
|
|
22
|
-
x = _ref.x,
|
|
23
|
-
y = _ref.y;
|
|
24
|
-
if (snapMask.get(SNAP_POINT)) {
|
|
25
|
-
addPointSnap(snapElements, x, y, 10, 10, vertexID);
|
|
26
|
-
}
|
|
27
|
-
if (snapMask.get(SNAP_LINE)) {
|
|
28
|
-
var _GeometryUtils$horizo = GeometryUtils.horizontalLine(y);
|
|
29
|
-
a = _GeometryUtils$horizo.a;
|
|
30
|
-
b = _GeometryUtils$horizo.b;
|
|
31
|
-
c = _GeometryUtils$horizo.c;
|
|
32
|
-
addLineSnap(snapElements, a, b, c, 10, 1, vertexID);
|
|
33
|
-
var _GeometryUtils$vertic = GeometryUtils.verticalLine(x);
|
|
34
|
-
a = _GeometryUtils$vertic.a;
|
|
35
|
-
b = _GeometryUtils$vertic.b;
|
|
36
|
-
c = _GeometryUtils$vertic.c;
|
|
37
|
-
addLineSnap(snapElements, a, b, c, 10, 1, vertexID);
|
|
38
|
-
var _GeometryUtils$upcros = GeometryUtils.upcrossLine(x, y);
|
|
39
|
-
a = _GeometryUtils$upcros.a;
|
|
40
|
-
b = _GeometryUtils$upcros.b;
|
|
41
|
-
c = _GeometryUtils$upcros.c;
|
|
42
|
-
addLineSnap(snapElements, a, b, c, 10, 3, null);
|
|
43
|
-
var _GeometryUtils$downcr = GeometryUtils.downcrossLine(x, y);
|
|
44
|
-
a = _GeometryUtils$downcr.a;
|
|
45
|
-
b = _GeometryUtils$downcr.b;
|
|
46
|
-
c = _GeometryUtils$downcr.c;
|
|
47
|
-
addLineSnap(snapElements, a, b, c, 10, 3, null);
|
|
48
|
-
}
|
|
49
|
-
});
|
|
50
|
-
if (snapMask.get(SNAP_SEGMENT)) {
|
|
51
|
-
lines.forEach(function (_ref2) {
|
|
52
|
-
var lineID = _ref2.id,
|
|
53
|
-
_ref2$vertices = _slicedToArray(_ref2.vertices, 2),
|
|
54
|
-
v0 = _ref2$vertices[0],
|
|
55
|
-
v1 = _ref2$vertices[1];
|
|
56
|
-
var _vertices$get = vertices.get(v0),
|
|
57
|
-
x1 = _vertices$get.x,
|
|
58
|
-
y1 = _vertices$get.y;
|
|
59
|
-
var _vertices$get2 = vertices.get(v1),
|
|
60
|
-
x2 = _vertices$get2.x,
|
|
61
|
-
y2 = _vertices$get2.y;
|
|
62
|
-
addLineSegmentSnap(snapElements, x1, y1, x2, y2, 20, 1, lineID);
|
|
63
|
-
});
|
|
64
|
-
}
|
|
65
|
-
});
|
|
66
|
-
if (snapMask.get(SNAP_GRID)) {
|
|
67
|
-
var divider = 5;
|
|
68
|
-
var gridCellSize = 100 / divider;
|
|
69
|
-
var xCycle = width / gridCellSize;
|
|
70
|
-
var yCycle = height / gridCellSize;
|
|
71
|
-
for (var x = 0; x < xCycle; x++) {
|
|
72
|
-
var xMul = x * gridCellSize;
|
|
73
|
-
for (var y = 0; y < yCycle; y++) {
|
|
74
|
-
var yMul = y * gridCellSize;
|
|
75
|
-
var onXCross = !(x % divider) ? true : false;
|
|
76
|
-
var onYCross = !(y % divider) ? true : false;
|
|
77
|
-
addGridSnap(snapElements, xMul, yMul, 10, onXCross && onYCross ? 15 : 10, null);
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
if (snapMask.get(SNAP_GUIDE)) {
|
|
82
|
-
var horizontal = scene.getIn(['guides', 'horizontal']);
|
|
83
|
-
var vertical = scene.getIn(['guides', 'vertical']);
|
|
84
|
-
var hValues = horizontal.valueSeq();
|
|
85
|
-
var vValues = vertical.valueSeq();
|
|
86
|
-
hValues.forEach(function (hVal) {
|
|
87
|
-
vValues.forEach(function (vVal) {
|
|
88
|
-
addPointSnap(snapElements, vVal, hVal, 10, 10);
|
|
89
|
-
});
|
|
90
|
-
});
|
|
91
|
-
hValues.forEach(function (hVal) {
|
|
92
|
-
return addLineSegmentSnap(snapElements, 0, hVal, width, hVal, 20, 1);
|
|
93
|
-
});
|
|
94
|
-
vValues.forEach(function (vVal) {
|
|
95
|
-
return addLineSegmentSnap(snapElements, vVal, 0, vVal, height, 20, 1);
|
|
96
|
-
});
|
|
97
|
-
}
|
|
98
|
-
});
|
|
99
|
-
}
|
package/es/utils/snap.js
DELETED
|
@@ -1,237 +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 ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
3
|
-
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
4
|
-
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
5
|
-
function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
|
|
6
|
-
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); } }
|
|
7
|
-
function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
|
|
8
|
-
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
9
|
-
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); }
|
|
10
|
-
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
11
|
-
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); }
|
|
12
|
-
function _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e; }
|
|
13
|
-
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
14
|
-
function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); }
|
|
15
|
-
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); }
|
|
16
|
-
function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }
|
|
17
|
-
import { Map, List, Record } from 'immutable';
|
|
18
|
-
import * as Geometry from "./geometry";
|
|
19
|
-
export var SNAP_POINT = 'SNAP_POINT';
|
|
20
|
-
export var SNAP_LINE = 'SNAP_LINE';
|
|
21
|
-
export var SNAP_SEGMENT = 'SNAP_SEGMENT';
|
|
22
|
-
export var SNAP_GRID = 'SNAP_GRID';
|
|
23
|
-
export var SNAP_GUIDE = 'SNAP_GUIDE';
|
|
24
|
-
export var SNAP_MASK = new Map({
|
|
25
|
-
SNAP_POINT: true,
|
|
26
|
-
SNAP_LINE: true,
|
|
27
|
-
SNAP_SEGMENT: true,
|
|
28
|
-
SNAP_GRID: false,
|
|
29
|
-
SNAP_GUIDE: true
|
|
30
|
-
});
|
|
31
|
-
var PointSnap = /*#__PURE__*/function (_Record) {
|
|
32
|
-
function PointSnap() {
|
|
33
|
-
_classCallCheck(this, PointSnap);
|
|
34
|
-
return _callSuper(this, PointSnap, arguments);
|
|
35
|
-
}
|
|
36
|
-
_inherits(PointSnap, _Record);
|
|
37
|
-
return _createClass(PointSnap, [{
|
|
38
|
-
key: "nearestPoint",
|
|
39
|
-
value: function nearestPoint(x, y) {
|
|
40
|
-
return {
|
|
41
|
-
x: this.x,
|
|
42
|
-
y: this.y,
|
|
43
|
-
distance: Geometry.pointsDistance(this.x, this.y, x, y)
|
|
44
|
-
};
|
|
45
|
-
}
|
|
46
|
-
}, {
|
|
47
|
-
key: "isNear",
|
|
48
|
-
value: function isNear(x, y, distance) {
|
|
49
|
-
return ~(this.x - x) + 1 < distance && ~(this.y - y) + 1 < distance;
|
|
50
|
-
}
|
|
51
|
-
}]);
|
|
52
|
-
}(Record({
|
|
53
|
-
type: 'point',
|
|
54
|
-
x: -1,
|
|
55
|
-
y: -1,
|
|
56
|
-
radius: 1,
|
|
57
|
-
priority: 1,
|
|
58
|
-
related: new List()
|
|
59
|
-
}));
|
|
60
|
-
var LineSnap = /*#__PURE__*/function (_Record2) {
|
|
61
|
-
function LineSnap() {
|
|
62
|
-
_classCallCheck(this, LineSnap);
|
|
63
|
-
return _callSuper(this, LineSnap, arguments);
|
|
64
|
-
}
|
|
65
|
-
_inherits(LineSnap, _Record2);
|
|
66
|
-
return _createClass(LineSnap, [{
|
|
67
|
-
key: "nearestPoint",
|
|
68
|
-
value: function nearestPoint(x, y) {
|
|
69
|
-
return _objectSpread(_objectSpread({}, Geometry.closestPointFromLine(this.a, this.b, this.c, x, y)), {}, {
|
|
70
|
-
distance: Geometry.distancePointFromLine(this.a, this.b, this.c, x, y)
|
|
71
|
-
});
|
|
72
|
-
}
|
|
73
|
-
}, {
|
|
74
|
-
key: "isNear",
|
|
75
|
-
value: function isNear(x, y, distance) {
|
|
76
|
-
return true;
|
|
77
|
-
}
|
|
78
|
-
}]);
|
|
79
|
-
}(Record({
|
|
80
|
-
type: 'line',
|
|
81
|
-
a: -1,
|
|
82
|
-
b: -1,
|
|
83
|
-
c: -1,
|
|
84
|
-
radius: 1,
|
|
85
|
-
priority: 1,
|
|
86
|
-
related: new List()
|
|
87
|
-
}));
|
|
88
|
-
var LineSegmentSnap = /*#__PURE__*/function (_Record3) {
|
|
89
|
-
function LineSegmentSnap() {
|
|
90
|
-
_classCallCheck(this, LineSegmentSnap);
|
|
91
|
-
return _callSuper(this, LineSegmentSnap, arguments);
|
|
92
|
-
}
|
|
93
|
-
_inherits(LineSegmentSnap, _Record3);
|
|
94
|
-
return _createClass(LineSegmentSnap, [{
|
|
95
|
-
key: "nearestPoint",
|
|
96
|
-
value: function nearestPoint(x, y) {
|
|
97
|
-
return _objectSpread(_objectSpread({}, Geometry.closestPointFromLineSegment(this.x1, this.y1, this.x2, this.y2, x, y)), {}, {
|
|
98
|
-
distance: Geometry.distancePointFromLineSegment({
|
|
99
|
-
x: this.x1,
|
|
100
|
-
y: this.y1
|
|
101
|
-
}, {
|
|
102
|
-
x: this.x2,
|
|
103
|
-
y: this.y2
|
|
104
|
-
}, x, y)
|
|
105
|
-
});
|
|
106
|
-
}
|
|
107
|
-
}, {
|
|
108
|
-
key: "isNear",
|
|
109
|
-
value: function isNear(x, y, distance) {
|
|
110
|
-
return true;
|
|
111
|
-
}
|
|
112
|
-
}]);
|
|
113
|
-
}(Record({
|
|
114
|
-
type: 'line-segment',
|
|
115
|
-
x1: -1,
|
|
116
|
-
y1: -1,
|
|
117
|
-
x2: -1,
|
|
118
|
-
y2: -1,
|
|
119
|
-
radius: 1,
|
|
120
|
-
priority: 1,
|
|
121
|
-
related: new List()
|
|
122
|
-
}));
|
|
123
|
-
var GridSnap = /*#__PURE__*/function (_Record4) {
|
|
124
|
-
function GridSnap() {
|
|
125
|
-
_classCallCheck(this, GridSnap);
|
|
126
|
-
return _callSuper(this, GridSnap, arguments);
|
|
127
|
-
}
|
|
128
|
-
_inherits(GridSnap, _Record4);
|
|
129
|
-
return _createClass(GridSnap, [{
|
|
130
|
-
key: "nearestPoint",
|
|
131
|
-
value: function nearestPoint(x, y) {
|
|
132
|
-
return {
|
|
133
|
-
x: this.x,
|
|
134
|
-
y: this.y,
|
|
135
|
-
distance: Geometry.pointsDistance(this.x, this.y, x, y)
|
|
136
|
-
};
|
|
137
|
-
}
|
|
138
|
-
}, {
|
|
139
|
-
key: "isNear",
|
|
140
|
-
value: function isNear(x, y, distance) {
|
|
141
|
-
return ~(this.x - x) + 1 < distance && ~(this.y - y) + 1 < distance;
|
|
142
|
-
}
|
|
143
|
-
}]);
|
|
144
|
-
}(Record({
|
|
145
|
-
type: 'grid',
|
|
146
|
-
x: -1,
|
|
147
|
-
y: -1,
|
|
148
|
-
radius: 1,
|
|
149
|
-
priority: 1,
|
|
150
|
-
related: new List()
|
|
151
|
-
}));
|
|
152
|
-
export function nearestSnap(snapElements, x, y, snapMask) {
|
|
153
|
-
var filter = {
|
|
154
|
-
point: snapMask.get(SNAP_POINT),
|
|
155
|
-
line: snapMask.get(SNAP_LINE),
|
|
156
|
-
'line-segment': snapMask.get(SNAP_SEGMENT),
|
|
157
|
-
grid: snapMask.get(SNAP_GRID)
|
|
158
|
-
};
|
|
159
|
-
return snapElements.valueSeq().filter(function (el) {
|
|
160
|
-
return filter[el.type] && el.isNear(x, y, el.radius);
|
|
161
|
-
}).map(function (snap) {
|
|
162
|
-
return {
|
|
163
|
-
snap: snap,
|
|
164
|
-
point: snap.nearestPoint(x, y)
|
|
165
|
-
};
|
|
166
|
-
}).filter(function (_ref) {
|
|
167
|
-
var radius = _ref.snap.radius,
|
|
168
|
-
distance = _ref.point.distance;
|
|
169
|
-
return distance < radius;
|
|
170
|
-
}).min(function (_ref2, _ref3) {
|
|
171
|
-
var p1 = _ref2.snap.priority,
|
|
172
|
-
d1 = _ref2.point.distance;
|
|
173
|
-
var p2 = _ref3.snap.priority,
|
|
174
|
-
d2 = _ref3.point.distance;
|
|
175
|
-
return p1 === p2 ? d1 < d2 ? -1 : 1 : p1 > p2 ? -1 : 1;
|
|
176
|
-
});
|
|
177
|
-
}
|
|
178
|
-
export function addPointSnap(snapElements, x, y, radius, priority, related) {
|
|
179
|
-
related = new List([related]);
|
|
180
|
-
return snapElements.push(new PointSnap({
|
|
181
|
-
x: x,
|
|
182
|
-
y: y,
|
|
183
|
-
radius: radius,
|
|
184
|
-
priority: priority,
|
|
185
|
-
related: related
|
|
186
|
-
}));
|
|
187
|
-
}
|
|
188
|
-
export function addLineSnap(snapElements, a, b, c, radius, priority, related) {
|
|
189
|
-
related = new List([related]);
|
|
190
|
-
return snapElements.withMutations(function (snapElements) {
|
|
191
|
-
var alreadyPresent = snapElements.some(function (lineSnap) {
|
|
192
|
-
return lineSnap.type === 'line' && a === lineSnap.a && b === lineSnap.b && c === lineSnap.c;
|
|
193
|
-
});
|
|
194
|
-
if (alreadyPresent) return snapElements;
|
|
195
|
-
var intersections = snapElements.valueSeq().filter(function (snap) {
|
|
196
|
-
return snap.type === 'line';
|
|
197
|
-
}).map(function (snap) {
|
|
198
|
-
return Geometry.twoLinesIntersection(snap.a, snap.b, snap.c, a, b, c);
|
|
199
|
-
}).filter(function (intersection) {
|
|
200
|
-
return intersection !== undefined;
|
|
201
|
-
}).forEach(function (_ref4) {
|
|
202
|
-
var x = _ref4.x,
|
|
203
|
-
y = _ref4.y;
|
|
204
|
-
return addPointSnap(snapElements, x, y, 20, 40);
|
|
205
|
-
});
|
|
206
|
-
snapElements.push(new LineSnap({
|
|
207
|
-
a: a,
|
|
208
|
-
b: b,
|
|
209
|
-
c: c,
|
|
210
|
-
radius: radius,
|
|
211
|
-
priority: priority,
|
|
212
|
-
related: related
|
|
213
|
-
}));
|
|
214
|
-
});
|
|
215
|
-
}
|
|
216
|
-
export function addLineSegmentSnap(snapElements, x1, y1, x2, y2, radius, priority, related) {
|
|
217
|
-
related = new List([related]);
|
|
218
|
-
return snapElements.push(new LineSegmentSnap({
|
|
219
|
-
x1: x1,
|
|
220
|
-
y1: y1,
|
|
221
|
-
x2: x2,
|
|
222
|
-
y2: y2,
|
|
223
|
-
radius: radius,
|
|
224
|
-
priority: priority,
|
|
225
|
-
related: related
|
|
226
|
-
}));
|
|
227
|
-
}
|
|
228
|
-
export function addGridSnap(snapElements, x, y, radius, priority, related) {
|
|
229
|
-
related = new List([related]);
|
|
230
|
-
return snapElements.push(new GridSnap({
|
|
231
|
-
x: x,
|
|
232
|
-
y: y,
|
|
233
|
-
radius: radius,
|
|
234
|
-
priority: priority,
|
|
235
|
-
related: related
|
|
236
|
-
}));
|
|
237
|
-
}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
export function summarizeItems(items) {
|
|
2
|
-
var totalCount = 0;
|
|
3
|
-
var totalPrice = 0;
|
|
4
|
-
var totalRegularPrice = 0;
|
|
5
|
-
for (var sku in items) {
|
|
6
|
-
var item = items[sku];
|
|
7
|
-
var _ref = item || {},
|
|
8
|
-
_ref$count = _ref.count,
|
|
9
|
-
count = _ref$count === void 0 ? 0 : _ref$count,
|
|
10
|
-
_ref$regularPrice = _ref.regularPrice,
|
|
11
|
-
regularPrice = _ref$regularPrice === void 0 ? 0 : _ref$regularPrice,
|
|
12
|
-
disCountPrice = _ref.disCountPrice;
|
|
13
|
-
var priceToUse = typeof disCountPrice === 'number' && !isNaN(disCountPrice) ? disCountPrice : regularPrice;
|
|
14
|
-
totalCount += count;
|
|
15
|
-
totalPrice += count * priceToUse;
|
|
16
|
-
totalRegularPrice += count * regularPrice;
|
|
17
|
-
}
|
|
18
|
-
return {
|
|
19
|
-
totalCount: totalCount,
|
|
20
|
-
totalRegularPrice: totalRegularPrice,
|
|
21
|
-
totalPrice: totalPrice,
|
|
22
|
-
totalSavings: totalRegularPrice - totalPrice
|
|
23
|
-
};
|
|
24
|
-
}
|