kitchen-simulator 1.1.1-test.49 → 1.1.1-test.50
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/es/@history.js +2 -0
- package/es/AppContext.js +3 -0
- package/es/KitchenConfigurator.js +645 -0
- package/es/KitchenConfiguratorApp.js +480 -0
- package/es/actions/area-actions.js +14 -0
- package/es/actions/export.js +23 -0
- package/es/actions/groups-actions.js +89 -0
- package/es/actions/holes-actions.js +119 -0
- package/es/actions/items-actions.js +313 -0
- package/es/actions/lines-actions.js +81 -0
- package/es/actions/project-actions.js +281 -0
- package/es/actions/scene-actions.js +33 -0
- package/es/actions/vertices-actions.js +27 -0
- package/es/actions/viewer2d-actions.js +58 -0
- package/es/actions/viewer3d-actions.js +23 -0
- package/es/catalog/areas/area/planner-element.js +40 -0
- 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 +277 -0
- 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 +181 -0
- package/es/catalog/factories/area-factory.js +81 -0
- package/es/catalog/factories/export.js +7 -0
- package/es/catalog/factories/wall-factory-3d.js +202 -0
- package/es/catalog/factories/wall-factory.js +268 -0
- package/es/catalog/holes/door-closet/planner-element.js +222 -0
- package/es/catalog/holes/door-double/door_double.png +0 -0
- package/es/catalog/holes/door-double/planner-element.js +315 -0
- package/es/catalog/holes/door-exterior/planner-element.js +215 -0
- package/es/catalog/holes/door-interior/planner-element.js +227 -0
- package/es/catalog/holes/door-panic/panicDoor.png +0 -0
- package/es/catalog/holes/door-panic/planner-element.js +503 -0
- package/es/catalog/holes/door-panic-double/panicDoorDouble.png +0 -0
- package/es/catalog/holes/door-panic-double/planner-element.js +463 -0
- package/es/catalog/holes/door-sliding/planner-element.js +225 -0
- package/es/catalog/holes/doorway-framed/planner-element.js +145 -0
- package/es/catalog/holes/doorway-frameless/planner-element.js +104 -0
- package/es/catalog/holes/export.js +13 -0
- package/es/catalog/holes/gate/gate.jpg +0 -0
- package/es/catalog/holes/window-clear/planner-element.js +166 -0
- package/es/catalog/holes/window-clear/texture.png +0 -0
- package/es/catalog/holes/window-cross/planner-element.js +165 -0
- package/es/catalog/holes/window-cross/texture.png +0 -0
- package/es/catalog/holes/window-double-hung/planner-element.js +303 -0
- package/es/catalog/holes/window-double-hung/texture.png +0 -0
- package/es/catalog/holes/window-vertical/planner-element.js +276 -0
- package/es/catalog/holes/window-vertical/texture.png +0 -0
- package/es/catalog/lines/wall/planner-element.js +70 -0
- 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 +28 -0
- package/es/catalog/molding/molding-dcm/texture.png +0 -0
- package/es/catalog/molding/molding-fbm/planner-element.js +28 -0
- package/es/catalog/molding/molding-fbm/texture.png +0 -0
- package/es/catalog/molding/molding-lrm/planner-element.js +28 -0
- package/es/catalog/molding/molding-lrm/texture.png +0 -0
- package/es/catalog/properties/export.js +21 -0
- package/es/catalog/properties/property-checkbox.js +116 -0
- package/es/catalog/properties/property-color.js +39 -0
- package/es/catalog/properties/property-enum.js +97 -0
- package/es/catalog/properties/property-hidden.js +19 -0
- package/es/catalog/properties/property-lenght-measure.js +101 -0
- package/es/catalog/properties/property-length-measure.js +134 -0
- package/es/catalog/properties/property-length-measure_hole.js +101 -0
- package/es/catalog/properties/property-number.js +48 -0
- package/es/catalog/properties/property-read-only.js +26 -0
- package/es/catalog/properties/property-string.js +48 -0
- package/es/catalog/properties/property-toggle.js +39 -0
- package/es/catalog/properties/shared-property-style.js +14 -0
- package/es/catalog/utils/FuseUtils.js +82 -0
- package/es/catalog/utils/exporter.js +148 -0
- package/es/catalog/utils/geom-utils.js +189 -0
- package/es/catalog/utils/item-loader.js +1521 -0
- package/es/catalog/utils/load-obj.js +91 -0
- package/es/catalog/utils/mtl-loader.js +358 -0
- package/es/catalog/utils/obj-loader.js +477 -0
- package/es/class/FuseUtils.js +82 -0
- package/es/class/area.js +145 -0
- package/es/class/export.js +24 -0
- package/es/class/group.js +440 -0
- package/es/class/guide.js +62 -0
- package/es/class/hole.js +929 -0
- package/es/class/item.js +1883 -0
- package/es/class/layer.js +667 -0
- package/es/class/line.js +1180 -0
- package/es/class/project.js +793 -0
- package/es/class/vertex.js +202 -0
- package/es/components/content.js +107 -0
- package/es/components/disclaimer/disclaimer.js +97 -0
- package/es/components/export.js +9 -0
- package/es/components/style/button.js +113 -0
- package/es/components/style/cancel-button.js +22 -0
- package/es/components/style/content-container.js +33 -0
- package/es/components/style/content-title.js +29 -0
- package/es/components/style/delete-button.js +25 -0
- package/es/components/style/export.js +31 -0
- package/es/components/style/form-block.js +24 -0
- package/es/components/style/form-color-input.js +27 -0
- package/es/components/style/form-label.js +26 -0
- package/es/components/style/form-number-input.js +213 -0
- package/es/components/style/form-number-input_2.js +206 -0
- package/es/components/style/form-select.js +68 -0
- package/es/components/style/form-slider.js +61 -0
- package/es/components/style/form-submit-button.js +26 -0
- package/es/components/style/form-text-input.js +95 -0
- package/es/components/viewer2d/area.js +81 -0
- package/es/components/viewer2d/export.js +31 -0
- package/es/components/viewer2d/grids/grid-horizontal-streak.js +37 -0
- package/es/components/viewer2d/grids/grid-streak.js +37 -0
- package/es/components/viewer2d/grids/grid-vertical-streak.js +37 -0
- package/es/components/viewer2d/grids/grids.js +35 -0
- package/es/components/viewer2d/group.js +53 -0
- package/es/components/viewer2d/item.js +513 -0
- package/es/components/viewer2d/layer.js +164 -0
- package/es/components/viewer2d/line.js +882 -0
- package/es/components/viewer2d/ruler.js +100 -0
- package/es/components/viewer2d/rulerDist.js +146 -0
- package/es/components/viewer2d/rulerX.js +151 -0
- package/es/components/viewer2d/rulerY.js +153 -0
- package/es/components/viewer2d/scene.js +140 -0
- package/es/components/viewer2d/snap.js +74 -0
- package/es/components/viewer2d/state.js +78 -0
- package/es/components/viewer2d/utils.js +198 -0
- package/es/components/viewer2d/vertex.js +65 -0
- package/es/components/viewer2d/viewer2d.js +1398 -0
- package/es/components/viewer3d/camera-controls-module/camera-controls.module.js +2592 -0
- package/es/components/viewer3d/dcm.js +401 -0
- package/es/components/viewer3d/fbm.js +414 -0
- package/es/components/viewer3d/front3D.js +66 -0
- package/es/components/viewer3d/grid-creator.js +25 -0
- package/es/components/viewer3d/grids/grid-horizontal-streak.js +36 -0
- package/es/components/viewer3d/grids/grid-streak.js +27 -0
- package/es/components/viewer3d/grids/grid-vertical-streak.js +36 -0
- package/es/components/viewer3d/libs/first-person-controls.js +67 -0
- package/es/components/viewer3d/libs/helvetiker_regular.typeface.js +1281 -0
- package/es/components/viewer3d/libs/mtl-loader.js +357 -0
- package/es/components/viewer3d/libs/obj-loader.js +462 -0
- package/es/components/viewer3d/libs/orbit-controls.js +699 -0
- package/es/components/viewer3d/libs/pointer-lock-controls.js +46 -0
- package/es/components/viewer3d/lrm.js +305 -0
- package/es/components/viewer3d/model.js +708 -0
- package/es/components/viewer3d/pointer-lock-navigation.js +115 -0
- package/es/components/viewer3d/ruler-utils/itemRect.js +61 -0
- package/es/components/viewer3d/ruler-utils/layer3D.js +495 -0
- package/es/components/viewer3d/ruler-utils/ruler3D.js +227 -0
- package/es/components/viewer3d/ruler-utils/scene3D.js +60 -0
- package/es/components/viewer3d/ruler-utils/state3D.js +18 -0
- package/es/components/viewer3d/scene-creator.js +3608 -0
- package/es/components/viewer3d/three-memory-cleaner.js +51 -0
- package/es/components/viewer3d/viewer3d-first-person.js +315 -0
- package/es/components/viewer3d/viewer3d.js +2527 -0
- package/es/constants.js +636 -0
- package/es/index.js +16 -0
- package/es/models.js +510 -0
- package/es/plugins/SVGLoader.js +1412 -0
- package/es/plugins/autosave.js +33 -0
- package/es/plugins/console-debugger.js +37 -0
- package/es/plugins/export.js +9 -0
- package/es/plugins/keyboard.js +101 -0
- package/es/reducers/areas-reducer.js +12 -0
- package/es/reducers/export.js +25 -0
- package/es/reducers/groups-reducer.js +38 -0
- package/es/reducers/holes-reducer.js +62 -0
- package/es/reducers/items-reducer.js +140 -0
- package/es/reducers/lines-reducer.js +45 -0
- package/es/reducers/project-reducer.js +129 -0
- package/es/reducers/reducer.js +19 -0
- package/es/reducers/scene-reducer.js +28 -0
- package/es/reducers/user-reducer.js +40 -0
- package/es/reducers/vertices-reducer.js +19 -0
- package/es/reducers/viewer2d-reducer.js +75 -0
- package/es/reducers/viewer3d-reducer.js +56 -0
- package/es/shared-style.js +66 -0
- package/es/styles/export.js +5 -0
- package/es/styles/tabs.css +40 -0
- package/es/translator/en.js +104 -0
- package/es/translator/it.js +79 -0
- package/es/translator/ru.js +79 -0
- package/es/translator/translator.js +84 -0
- package/es/utils/browser.js +33 -0
- package/es/utils/email-validator.js +4 -0
- package/es/utils/export.js +25 -0
- package/es/utils/geometry.js +2420 -0
- package/es/utils/get-edges-of-subgraphs.js +27 -0
- package/es/utils/graph-cycles.js +237 -0
- package/es/utils/graph-inner-cycles.js +46 -0
- package/es/utils/graph.js +150 -0
- package/es/utils/helper.js +268 -0
- package/es/utils/history.js +29 -0
- package/es/utils/id-broker.js +19 -0
- package/es/utils/logger.js +8 -0
- package/es/utils/math.js +50 -0
- package/es/utils/molding.js +871 -0
- package/es/utils/name-generator.js +18 -0
- package/es/utils/objects-utils.js +50 -0
- package/es/utils/phone-validator.js +4 -0
- package/es/utils/process-black-list.js +18 -0
- package/es/utils/react-if.js +18 -0
- package/es/utils/snap-scene.js +99 -0
- package/es/utils/snap.js +237 -0
- package/es/utils/summarizeCart.js +24 -0
- package/es/utils/threeCSG.es6.js +498 -0
- package/es/version.js +2 -0
- package/lib/catalog/properties/property-string.js +55 -0
- package/lib/catalog/properties/property-toggle.js +46 -0
- package/lib/catalog/properties/shared-property-style.js +20 -0
- package/lib/catalog/utils/FuseUtils.js +88 -0
- package/lib/catalog/utils/exporter.js +155 -0
- package/lib/catalog/utils/geom-utils.js +205 -0
- package/lib/catalog/utils/item-loader.js +1533 -0
- package/lib/catalog/utils/load-obj.js +99 -0
- package/lib/catalog/utils/mtl-loader.js +363 -0
- package/lib/catalog/utils/obj-loader.js +482 -0
- package/lib/class/FuseUtils.js +88 -0
- package/lib/class/area.js +150 -0
- package/lib/class/export.js +96 -0
- package/lib/class/group.js +445 -0
- package/lib/class/guide.js +67 -0
- package/lib/class/hole.js +934 -0
- package/lib/class/item.js +1889 -0
- package/lib/class/layer.js +672 -0
- package/lib/class/line.js +1186 -0
- package/lib/class/project.js +799 -0
- package/lib/class/vertex.js +207 -0
- package/lib/components/content.js +116 -0
- package/lib/components/disclaimer/disclaimer.js +105 -0
- package/lib/components/export.js +33 -0
- package/lib/components/style/button.js +120 -0
- package/lib/components/style/cancel-button.js +29 -0
- package/lib/components/style/content-container.js +40 -0
- package/lib/components/style/content-title.js +37 -0
- package/lib/components/style/delete-button.js +34 -0
- package/lib/components/style/export.js +121 -0
- package/lib/components/style/form-block.js +31 -0
- package/lib/components/style/form-color-input.js +34 -0
- package/lib/components/style/form-label.js +33 -0
- package/lib/components/style/form-number-input.js +220 -0
- package/lib/components/style/form-number-input_2.js +213 -0
- package/lib/components/style/form-select.js +75 -0
- package/lib/components/style/form-slider.js +68 -0
- package/lib/components/style/form-submit-button.js +35 -0
- package/lib/components/style/form-text-input.js +101 -0
- package/lib/components/viewer2d/area.js +88 -0
- package/lib/components/viewer2d/export.js +121 -0
- package/lib/components/viewer2d/grids/grid-horizontal-streak.js +44 -0
- package/lib/components/viewer2d/grids/grid-streak.js +44 -0
- package/lib/components/viewer2d/grids/grid-vertical-streak.js +44 -0
- package/lib/components/viewer2d/grids/grids.js +44 -0
- package/lib/components/viewer2d/group.js +62 -0
- package/lib/components/viewer2d/item.js +521 -0
- package/lib/components/viewer2d/layer.js +171 -0
- package/lib/components/viewer2d/line.js +892 -0
- package/lib/components/viewer2d/ruler.js +107 -0
- package/lib/components/viewer2d/rulerDist.js +153 -0
- package/lib/components/viewer2d/rulerX.js +158 -0
- package/lib/components/viewer2d/rulerY.js +160 -0
- package/lib/components/viewer2d/scene.js +147 -0
- package/lib/components/viewer2d/snap.js +83 -0
- package/lib/components/viewer2d/state.js +87 -0
- package/lib/components/viewer2d/utils.js +210 -0
- package/lib/components/viewer2d/vertex.js +74 -0
- package/lib/components/viewer2d/viewer2d.js +1405 -0
- package/lib/components/viewer3d/camera-controls-module/camera-controls.module.js +2597 -0
- package/lib/components/viewer3d/dcm.js +407 -0
- package/lib/components/viewer3d/fbm.js +420 -0
- package/lib/components/viewer3d/front3D.js +75 -0
- package/lib/components/viewer3d/grid-creator.js +34 -0
- package/lib/components/viewer3d/grids/grid-horizontal-streak.js +44 -0
- package/lib/components/viewer3d/grids/grid-streak.js +35 -0
- package/lib/components/viewer3d/grids/grid-vertical-streak.js +44 -0
- package/lib/components/viewer3d/libs/first-person-controls.js +74 -0
- package/lib/components/viewer3d/libs/helvetiker_regular.typeface.js +1287 -0
- package/lib/components/viewer3d/libs/mtl-loader.js +363 -0
- package/lib/components/viewer3d/libs/obj-loader.js +468 -0
- package/lib/components/viewer3d/libs/orbit-controls.js +705 -0
- package/lib/components/viewer3d/libs/pointer-lock-controls.js +52 -0
- package/lib/components/viewer3d/lrm.js +311 -0
- package/lib/components/viewer3d/model.js +714 -0
- package/lib/components/viewer3d/pointer-lock-navigation.js +122 -0
- package/lib/components/viewer3d/ruler-utils/itemRect.js +68 -0
- package/lib/components/viewer3d/ruler-utils/layer3D.js +502 -0
- package/lib/components/viewer3d/ruler-utils/ruler3D.js +234 -0
- package/lib/components/viewer3d/ruler-utils/scene3D.js +68 -0
- package/lib/components/viewer3d/ruler-utils/state3D.js +25 -0
- package/lib/components/viewer3d/scene-creator.js +3642 -0
- package/lib/components/viewer3d/three-memory-cleaner.js +60 -0
- package/lib/components/viewer3d/viewer3d-first-person.js +320 -0
- package/lib/components/viewer3d/viewer3d.js +2532 -0
- package/lib/constants.js +645 -0
- package/lib/index.js +96 -0
- package/lib/models.js +517 -0
- package/lib/plugins/SVGLoader.js +1417 -0
- package/lib/plugins/autosave.js +39 -0
- package/lib/plugins/console-debugger.js +44 -0
- package/lib/plugins/export.js +33 -0
- package/lib/plugins/keyboard.js +107 -0
- package/lib/reducers/areas-reducer.js +18 -0
- package/lib/reducers/export.js +97 -0
- package/lib/reducers/groups-reducer.js +44 -0
- package/lib/reducers/holes-reducer.js +68 -0
- package/lib/reducers/items-reducer.js +146 -0
- package/lib/reducers/lines-reducer.js +51 -0
- package/lib/reducers/project-reducer.js +135 -0
- package/lib/reducers/reducer.js +26 -0
- package/lib/reducers/scene-reducer.js +34 -0
- package/lib/reducers/user-reducer.js +46 -0
- package/lib/reducers/vertices-reducer.js +25 -0
- package/lib/reducers/viewer2d-reducer.js +82 -0
- package/lib/reducers/viewer3d-reducer.js +63 -0
- package/lib/shared-style.js +72 -0
- package/lib/styles/export.js +13 -0
- package/lib/translator/en.js +110 -0
- package/lib/translator/it.js +85 -0
- package/lib/translator/ru.js +85 -0
- package/lib/translator/translator.js +90 -0
- package/lib/utils/browser.js +40 -0
- package/lib/utils/email-validator.js +10 -0
- package/lib/utils/export.js +56 -0
- package/lib/utils/geometry.js +2516 -0
- package/lib/utils/get-edges-of-subgraphs.js +34 -0
- package/lib/utils/graph-cycles.js +240 -0
- package/lib/utils/graph-inner-cycles.js +54 -0
- package/lib/utils/graph.js +157 -0
- package/lib/utils/helper.js +291 -0
- package/lib/utils/history.js +36 -0
- package/lib/utils/id-broker.js +25 -0
- package/lib/utils/logger.js +14 -0
- package/lib/utils/math.js +57 -0
- package/lib/utils/molding.js +895 -0
- package/lib/utils/name-generator.js +23 -0
- package/lib/utils/objects-utils.js +60 -0
- package/lib/utils/phone-validator.js +10 -0
- package/lib/utils/process-black-list.js +24 -0
- package/lib/utils/react-if.js +24 -0
- package/lib/utils/snap-scene.js +105 -0
- package/lib/utils/snap.js +249 -0
- package/lib/utils/summarizeCart.js +30 -0
- package/lib/utils/threeCSG.es6.js +503 -0
- package/lib/version.js +8 -0
- package/package.json +3 -3
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports["default"] = void 0;
|
|
7
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
8
|
+
function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
|
|
9
|
+
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); } }
|
|
10
|
+
function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
|
|
11
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
12
|
+
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); }
|
|
13
|
+
var NameGenerator = exports["default"] = /*#__PURE__*/function () {
|
|
14
|
+
function NameGenerator() {
|
|
15
|
+
_classCallCheck(this, NameGenerator);
|
|
16
|
+
}
|
|
17
|
+
return _createClass(NameGenerator, null, [{
|
|
18
|
+
key: "generateName",
|
|
19
|
+
value: function generateName(prototype, type) {
|
|
20
|
+
return type.substr(0, 1).toUpperCase() + type.substr(1);
|
|
21
|
+
}
|
|
22
|
+
}]);
|
|
23
|
+
}();
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.getAllMeshes = getAllMeshes;
|
|
7
|
+
exports.objectsCompare = objectsCompare;
|
|
8
|
+
exports.objectsMap = objectsMap;
|
|
9
|
+
exports.vectorIntersectWithMesh = vectorIntersectWithMesh;
|
|
10
|
+
var Three = _interopRequireWildcard(require("three"));
|
|
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 _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); }
|
|
13
|
+
String.prototype.isLeftPlaceholder = function () {
|
|
14
|
+
return this.match(/_L$|_L_\d$/) != null;
|
|
15
|
+
};
|
|
16
|
+
String.prototype.isRightPlaceholder = function () {
|
|
17
|
+
return this.match(/_R$|_R_\d$/) != null;
|
|
18
|
+
};
|
|
19
|
+
function objectsMap(object, func) {
|
|
20
|
+
var mappedObject = {};
|
|
21
|
+
for (var key in object) {
|
|
22
|
+
mappedObject[key] = func(key, mappedObject[key]);
|
|
23
|
+
}
|
|
24
|
+
return mappedObject;
|
|
25
|
+
}
|
|
26
|
+
function objectsCompare(x, y) {
|
|
27
|
+
if (x === y) return true;
|
|
28
|
+
if (!(x instanceof Object) || !(y instanceof Object)) return false;
|
|
29
|
+
if (x.constructor !== y.constructor) return false;
|
|
30
|
+
for (var p in x) {
|
|
31
|
+
if (!x.hasOwnProperty(p)) continue;
|
|
32
|
+
if (!y.hasOwnProperty(p)) return false;
|
|
33
|
+
if (x[p] === y[p]) continue;
|
|
34
|
+
if (_typeof(x[p]) !== 'object') return false;
|
|
35
|
+
if (!objectsCompare(x[p], y[p])) return false;
|
|
36
|
+
}
|
|
37
|
+
for (var _p in y) {
|
|
38
|
+
if (y.hasOwnProperty(_p) && !x.hasOwnProperty(_p)) return false;
|
|
39
|
+
}
|
|
40
|
+
return true;
|
|
41
|
+
}
|
|
42
|
+
function getAllMeshes(objects) {
|
|
43
|
+
var meshes = [];
|
|
44
|
+
objects.forEach(function (object) {
|
|
45
|
+
if (!object) return;
|
|
46
|
+
object.traverse(function (o) {
|
|
47
|
+
if (o.isMesh && o.geometry) {
|
|
48
|
+
meshes.push(o);
|
|
49
|
+
}
|
|
50
|
+
});
|
|
51
|
+
});
|
|
52
|
+
return meshes;
|
|
53
|
+
}
|
|
54
|
+
function vectorIntersectWithMesh(origin, target) {
|
|
55
|
+
var vectorDir = new Three.Vector3(origin.x, origin.y - 1000, origin.z);
|
|
56
|
+
var ray = new Three.Raycaster();
|
|
57
|
+
ray.set(origin, vectorDir);
|
|
58
|
+
var intersects = ray.intersectObject(target, true);
|
|
59
|
+
return intersects.length > 0;
|
|
60
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.phoneValidation = void 0;
|
|
7
|
+
var phoneValidation = exports.phoneValidation = function phoneValidation(phone) {
|
|
8
|
+
var result = /^(\+1\s?)?(\(?\d{3}\)?[\s.-]?)?\d{3}[\s.-]?\d{4}$/;
|
|
9
|
+
return result.test(String(phone).toLowerCase());
|
|
10
|
+
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.buildCurrentCabinetObject = void 0;
|
|
7
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
8
|
+
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; }
|
|
9
|
+
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; }
|
|
10
|
+
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; }
|
|
11
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
12
|
+
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); }
|
|
13
|
+
var buildCurrentCabinetObject = exports.buildCurrentCabinetObject = function buildCurrentCabinetObject(cabinet, texture) {
|
|
14
|
+
return {
|
|
15
|
+
type: cabinet.name,
|
|
16
|
+
// e.g. "B09"
|
|
17
|
+
name: cabinet.name,
|
|
18
|
+
category: cabinet.type,
|
|
19
|
+
// "cabinet"
|
|
20
|
+
doorStyle: _objectSpread({}, texture),
|
|
21
|
+
itemID: cabinet.itemID,
|
|
22
|
+
sku_number: cabinet.name
|
|
23
|
+
};
|
|
24
|
+
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports["default"] = If;
|
|
7
|
+
var _react = _interopRequireDefault(require("react"));
|
|
8
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
9
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
10
|
+
/**
|
|
11
|
+
* @return {null}
|
|
12
|
+
*/
|
|
13
|
+
function If(_ref) {
|
|
14
|
+
var condition = _ref.condition,
|
|
15
|
+
style = _ref.style,
|
|
16
|
+
children = _ref.children;
|
|
17
|
+
return condition ? Array.isArray(children) ? /*#__PURE__*/_react["default"].createElement("div", {
|
|
18
|
+
style: style
|
|
19
|
+
}, children) : children : null;
|
|
20
|
+
}
|
|
21
|
+
If.propTypes = {
|
|
22
|
+
condition: _propTypes["default"].bool.isRequired,
|
|
23
|
+
style: _propTypes["default"].object
|
|
24
|
+
};
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.sceneSnapElements = sceneSnapElements;
|
|
7
|
+
var _snap = require("./snap");
|
|
8
|
+
var _export = require("./export");
|
|
9
|
+
var _immutable = require("immutable");
|
|
10
|
+
function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
|
|
11
|
+
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."); }
|
|
12
|
+
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
13
|
+
function _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; }
|
|
14
|
+
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; } }
|
|
15
|
+
function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
|
|
16
|
+
function sceneSnapElements(scene) {
|
|
17
|
+
var snapElements = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : new _immutable.List();
|
|
18
|
+
var snapMask = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : new _immutable.Map();
|
|
19
|
+
var width = scene.width,
|
|
20
|
+
height = scene.height;
|
|
21
|
+
var a, b, c;
|
|
22
|
+
return snapElements.withMutations(function (snapElements) {
|
|
23
|
+
scene.layers.forEach(function (layer) {
|
|
24
|
+
var lines = layer.lines,
|
|
25
|
+
vertices = layer.vertices;
|
|
26
|
+
vertices.forEach(function (_ref) {
|
|
27
|
+
var vertexID = _ref.id,
|
|
28
|
+
x = _ref.x,
|
|
29
|
+
y = _ref.y;
|
|
30
|
+
if (snapMask.get(_snap.SNAP_POINT)) {
|
|
31
|
+
(0, _snap.addPointSnap)(snapElements, x, y, 10, 10, vertexID);
|
|
32
|
+
}
|
|
33
|
+
if (snapMask.get(_snap.SNAP_LINE)) {
|
|
34
|
+
var _GeometryUtils$horizo = _export.GeometryUtils.horizontalLine(y);
|
|
35
|
+
a = _GeometryUtils$horizo.a;
|
|
36
|
+
b = _GeometryUtils$horizo.b;
|
|
37
|
+
c = _GeometryUtils$horizo.c;
|
|
38
|
+
(0, _snap.addLineSnap)(snapElements, a, b, c, 10, 1, vertexID);
|
|
39
|
+
var _GeometryUtils$vertic = _export.GeometryUtils.verticalLine(x);
|
|
40
|
+
a = _GeometryUtils$vertic.a;
|
|
41
|
+
b = _GeometryUtils$vertic.b;
|
|
42
|
+
c = _GeometryUtils$vertic.c;
|
|
43
|
+
(0, _snap.addLineSnap)(snapElements, a, b, c, 10, 1, vertexID);
|
|
44
|
+
var _GeometryUtils$upcros = _export.GeometryUtils.upcrossLine(x, y);
|
|
45
|
+
a = _GeometryUtils$upcros.a;
|
|
46
|
+
b = _GeometryUtils$upcros.b;
|
|
47
|
+
c = _GeometryUtils$upcros.c;
|
|
48
|
+
(0, _snap.addLineSnap)(snapElements, a, b, c, 10, 3, null);
|
|
49
|
+
var _GeometryUtils$downcr = _export.GeometryUtils.downcrossLine(x, y);
|
|
50
|
+
a = _GeometryUtils$downcr.a;
|
|
51
|
+
b = _GeometryUtils$downcr.b;
|
|
52
|
+
c = _GeometryUtils$downcr.c;
|
|
53
|
+
(0, _snap.addLineSnap)(snapElements, a, b, c, 10, 3, null);
|
|
54
|
+
}
|
|
55
|
+
});
|
|
56
|
+
if (snapMask.get(_snap.SNAP_SEGMENT)) {
|
|
57
|
+
lines.forEach(function (_ref2) {
|
|
58
|
+
var lineID = _ref2.id,
|
|
59
|
+
_ref2$vertices = _slicedToArray(_ref2.vertices, 2),
|
|
60
|
+
v0 = _ref2$vertices[0],
|
|
61
|
+
v1 = _ref2$vertices[1];
|
|
62
|
+
var _vertices$get = vertices.get(v0),
|
|
63
|
+
x1 = _vertices$get.x,
|
|
64
|
+
y1 = _vertices$get.y;
|
|
65
|
+
var _vertices$get2 = vertices.get(v1),
|
|
66
|
+
x2 = _vertices$get2.x,
|
|
67
|
+
y2 = _vertices$get2.y;
|
|
68
|
+
(0, _snap.addLineSegmentSnap)(snapElements, x1, y1, x2, y2, 20, 1, lineID);
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
});
|
|
72
|
+
if (snapMask.get(_snap.SNAP_GRID)) {
|
|
73
|
+
var divider = 5;
|
|
74
|
+
var gridCellSize = 100 / divider;
|
|
75
|
+
var xCycle = width / gridCellSize;
|
|
76
|
+
var yCycle = height / gridCellSize;
|
|
77
|
+
for (var x = 0; x < xCycle; x++) {
|
|
78
|
+
var xMul = x * gridCellSize;
|
|
79
|
+
for (var y = 0; y < yCycle; y++) {
|
|
80
|
+
var yMul = y * gridCellSize;
|
|
81
|
+
var onXCross = !(x % divider) ? true : false;
|
|
82
|
+
var onYCross = !(y % divider) ? true : false;
|
|
83
|
+
(0, _snap.addGridSnap)(snapElements, xMul, yMul, 10, onXCross && onYCross ? 15 : 10, null);
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
if (snapMask.get(_snap.SNAP_GUIDE)) {
|
|
88
|
+
var horizontal = scene.getIn(['guides', 'horizontal']);
|
|
89
|
+
var vertical = scene.getIn(['guides', 'vertical']);
|
|
90
|
+
var hValues = horizontal.valueSeq();
|
|
91
|
+
var vValues = vertical.valueSeq();
|
|
92
|
+
hValues.forEach(function (hVal) {
|
|
93
|
+
vValues.forEach(function (vVal) {
|
|
94
|
+
(0, _snap.addPointSnap)(snapElements, vVal, hVal, 10, 10);
|
|
95
|
+
});
|
|
96
|
+
});
|
|
97
|
+
hValues.forEach(function (hVal) {
|
|
98
|
+
return (0, _snap.addLineSegmentSnap)(snapElements, 0, hVal, width, hVal, 20, 1);
|
|
99
|
+
});
|
|
100
|
+
vValues.forEach(function (vVal) {
|
|
101
|
+
return (0, _snap.addLineSegmentSnap)(snapElements, vVal, 0, vVal, height, 20, 1);
|
|
102
|
+
});
|
|
103
|
+
}
|
|
104
|
+
});
|
|
105
|
+
}
|
|
@@ -0,0 +1,249 @@
|
|
|
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.SNAP_SEGMENT = exports.SNAP_POINT = exports.SNAP_MASK = exports.SNAP_LINE = exports.SNAP_GUIDE = exports.SNAP_GRID = void 0;
|
|
8
|
+
exports.addGridSnap = addGridSnap;
|
|
9
|
+
exports.addLineSegmentSnap = addLineSegmentSnap;
|
|
10
|
+
exports.addLineSnap = addLineSnap;
|
|
11
|
+
exports.addPointSnap = addPointSnap;
|
|
12
|
+
exports.nearestSnap = nearestSnap;
|
|
13
|
+
var _immutable = require("immutable");
|
|
14
|
+
var Geometry = _interopRequireWildcard(require("./geometry"));
|
|
15
|
+
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); }
|
|
16
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
17
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
18
|
+
function _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; }
|
|
19
|
+
function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
|
|
20
|
+
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); } }
|
|
21
|
+
function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
|
|
22
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
23
|
+
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); }
|
|
24
|
+
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
25
|
+
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); }
|
|
26
|
+
function _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e; }
|
|
27
|
+
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
28
|
+
function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); }
|
|
29
|
+
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); }
|
|
30
|
+
function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }
|
|
31
|
+
var SNAP_POINT = exports.SNAP_POINT = 'SNAP_POINT';
|
|
32
|
+
var SNAP_LINE = exports.SNAP_LINE = 'SNAP_LINE';
|
|
33
|
+
var SNAP_SEGMENT = exports.SNAP_SEGMENT = 'SNAP_SEGMENT';
|
|
34
|
+
var SNAP_GRID = exports.SNAP_GRID = 'SNAP_GRID';
|
|
35
|
+
var SNAP_GUIDE = exports.SNAP_GUIDE = 'SNAP_GUIDE';
|
|
36
|
+
var SNAP_MASK = exports.SNAP_MASK = new _immutable.Map({
|
|
37
|
+
SNAP_POINT: true,
|
|
38
|
+
SNAP_LINE: true,
|
|
39
|
+
SNAP_SEGMENT: true,
|
|
40
|
+
SNAP_GRID: false,
|
|
41
|
+
SNAP_GUIDE: true
|
|
42
|
+
});
|
|
43
|
+
var PointSnap = /*#__PURE__*/function (_Record) {
|
|
44
|
+
function PointSnap() {
|
|
45
|
+
_classCallCheck(this, PointSnap);
|
|
46
|
+
return _callSuper(this, PointSnap, arguments);
|
|
47
|
+
}
|
|
48
|
+
_inherits(PointSnap, _Record);
|
|
49
|
+
return _createClass(PointSnap, [{
|
|
50
|
+
key: "nearestPoint",
|
|
51
|
+
value: function nearestPoint(x, y) {
|
|
52
|
+
return {
|
|
53
|
+
x: this.x,
|
|
54
|
+
y: this.y,
|
|
55
|
+
distance: Geometry.pointsDistance(this.x, this.y, x, y)
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
}, {
|
|
59
|
+
key: "isNear",
|
|
60
|
+
value: function isNear(x, y, distance) {
|
|
61
|
+
return ~(this.x - x) + 1 < distance && ~(this.y - y) + 1 < distance;
|
|
62
|
+
}
|
|
63
|
+
}]);
|
|
64
|
+
}((0, _immutable.Record)({
|
|
65
|
+
type: 'point',
|
|
66
|
+
x: -1,
|
|
67
|
+
y: -1,
|
|
68
|
+
radius: 1,
|
|
69
|
+
priority: 1,
|
|
70
|
+
related: new _immutable.List()
|
|
71
|
+
}));
|
|
72
|
+
var LineSnap = /*#__PURE__*/function (_Record2) {
|
|
73
|
+
function LineSnap() {
|
|
74
|
+
_classCallCheck(this, LineSnap);
|
|
75
|
+
return _callSuper(this, LineSnap, arguments);
|
|
76
|
+
}
|
|
77
|
+
_inherits(LineSnap, _Record2);
|
|
78
|
+
return _createClass(LineSnap, [{
|
|
79
|
+
key: "nearestPoint",
|
|
80
|
+
value: function nearestPoint(x, y) {
|
|
81
|
+
return _objectSpread(_objectSpread({}, Geometry.closestPointFromLine(this.a, this.b, this.c, x, y)), {}, {
|
|
82
|
+
distance: Geometry.distancePointFromLine(this.a, this.b, this.c, x, y)
|
|
83
|
+
});
|
|
84
|
+
}
|
|
85
|
+
}, {
|
|
86
|
+
key: "isNear",
|
|
87
|
+
value: function isNear(x, y, distance) {
|
|
88
|
+
return true;
|
|
89
|
+
}
|
|
90
|
+
}]);
|
|
91
|
+
}((0, _immutable.Record)({
|
|
92
|
+
type: 'line',
|
|
93
|
+
a: -1,
|
|
94
|
+
b: -1,
|
|
95
|
+
c: -1,
|
|
96
|
+
radius: 1,
|
|
97
|
+
priority: 1,
|
|
98
|
+
related: new _immutable.List()
|
|
99
|
+
}));
|
|
100
|
+
var LineSegmentSnap = /*#__PURE__*/function (_Record3) {
|
|
101
|
+
function LineSegmentSnap() {
|
|
102
|
+
_classCallCheck(this, LineSegmentSnap);
|
|
103
|
+
return _callSuper(this, LineSegmentSnap, arguments);
|
|
104
|
+
}
|
|
105
|
+
_inherits(LineSegmentSnap, _Record3);
|
|
106
|
+
return _createClass(LineSegmentSnap, [{
|
|
107
|
+
key: "nearestPoint",
|
|
108
|
+
value: function nearestPoint(x, y) {
|
|
109
|
+
return _objectSpread(_objectSpread({}, Geometry.closestPointFromLineSegment(this.x1, this.y1, this.x2, this.y2, x, y)), {}, {
|
|
110
|
+
distance: Geometry.distancePointFromLineSegment({
|
|
111
|
+
x: this.x1,
|
|
112
|
+
y: this.y1
|
|
113
|
+
}, {
|
|
114
|
+
x: this.x2,
|
|
115
|
+
y: this.y2
|
|
116
|
+
}, x, y)
|
|
117
|
+
});
|
|
118
|
+
}
|
|
119
|
+
}, {
|
|
120
|
+
key: "isNear",
|
|
121
|
+
value: function isNear(x, y, distance) {
|
|
122
|
+
return true;
|
|
123
|
+
}
|
|
124
|
+
}]);
|
|
125
|
+
}((0, _immutable.Record)({
|
|
126
|
+
type: 'line-segment',
|
|
127
|
+
x1: -1,
|
|
128
|
+
y1: -1,
|
|
129
|
+
x2: -1,
|
|
130
|
+
y2: -1,
|
|
131
|
+
radius: 1,
|
|
132
|
+
priority: 1,
|
|
133
|
+
related: new _immutable.List()
|
|
134
|
+
}));
|
|
135
|
+
var GridSnap = /*#__PURE__*/function (_Record4) {
|
|
136
|
+
function GridSnap() {
|
|
137
|
+
_classCallCheck(this, GridSnap);
|
|
138
|
+
return _callSuper(this, GridSnap, arguments);
|
|
139
|
+
}
|
|
140
|
+
_inherits(GridSnap, _Record4);
|
|
141
|
+
return _createClass(GridSnap, [{
|
|
142
|
+
key: "nearestPoint",
|
|
143
|
+
value: function nearestPoint(x, y) {
|
|
144
|
+
return {
|
|
145
|
+
x: this.x,
|
|
146
|
+
y: this.y,
|
|
147
|
+
distance: Geometry.pointsDistance(this.x, this.y, x, y)
|
|
148
|
+
};
|
|
149
|
+
}
|
|
150
|
+
}, {
|
|
151
|
+
key: "isNear",
|
|
152
|
+
value: function isNear(x, y, distance) {
|
|
153
|
+
return ~(this.x - x) + 1 < distance && ~(this.y - y) + 1 < distance;
|
|
154
|
+
}
|
|
155
|
+
}]);
|
|
156
|
+
}((0, _immutable.Record)({
|
|
157
|
+
type: 'grid',
|
|
158
|
+
x: -1,
|
|
159
|
+
y: -1,
|
|
160
|
+
radius: 1,
|
|
161
|
+
priority: 1,
|
|
162
|
+
related: new _immutable.List()
|
|
163
|
+
}));
|
|
164
|
+
function nearestSnap(snapElements, x, y, snapMask) {
|
|
165
|
+
var filter = {
|
|
166
|
+
point: snapMask.get(SNAP_POINT),
|
|
167
|
+
line: snapMask.get(SNAP_LINE),
|
|
168
|
+
'line-segment': snapMask.get(SNAP_SEGMENT),
|
|
169
|
+
grid: snapMask.get(SNAP_GRID)
|
|
170
|
+
};
|
|
171
|
+
return snapElements.valueSeq().filter(function (el) {
|
|
172
|
+
return filter[el.type] && el.isNear(x, y, el.radius);
|
|
173
|
+
}).map(function (snap) {
|
|
174
|
+
return {
|
|
175
|
+
snap: snap,
|
|
176
|
+
point: snap.nearestPoint(x, y)
|
|
177
|
+
};
|
|
178
|
+
}).filter(function (_ref) {
|
|
179
|
+
var radius = _ref.snap.radius,
|
|
180
|
+
distance = _ref.point.distance;
|
|
181
|
+
return distance < radius;
|
|
182
|
+
}).min(function (_ref2, _ref3) {
|
|
183
|
+
var p1 = _ref2.snap.priority,
|
|
184
|
+
d1 = _ref2.point.distance;
|
|
185
|
+
var p2 = _ref3.snap.priority,
|
|
186
|
+
d2 = _ref3.point.distance;
|
|
187
|
+
return p1 === p2 ? d1 < d2 ? -1 : 1 : p1 > p2 ? -1 : 1;
|
|
188
|
+
});
|
|
189
|
+
}
|
|
190
|
+
function addPointSnap(snapElements, x, y, radius, priority, related) {
|
|
191
|
+
related = new _immutable.List([related]);
|
|
192
|
+
return snapElements.push(new PointSnap({
|
|
193
|
+
x: x,
|
|
194
|
+
y: y,
|
|
195
|
+
radius: radius,
|
|
196
|
+
priority: priority,
|
|
197
|
+
related: related
|
|
198
|
+
}));
|
|
199
|
+
}
|
|
200
|
+
function addLineSnap(snapElements, a, b, c, radius, priority, related) {
|
|
201
|
+
related = new _immutable.List([related]);
|
|
202
|
+
return snapElements.withMutations(function (snapElements) {
|
|
203
|
+
var alreadyPresent = snapElements.some(function (lineSnap) {
|
|
204
|
+
return lineSnap.type === 'line' && a === lineSnap.a && b === lineSnap.b && c === lineSnap.c;
|
|
205
|
+
});
|
|
206
|
+
if (alreadyPresent) return snapElements;
|
|
207
|
+
var intersections = snapElements.valueSeq().filter(function (snap) {
|
|
208
|
+
return snap.type === 'line';
|
|
209
|
+
}).map(function (snap) {
|
|
210
|
+
return Geometry.twoLinesIntersection(snap.a, snap.b, snap.c, a, b, c);
|
|
211
|
+
}).filter(function (intersection) {
|
|
212
|
+
return intersection !== undefined;
|
|
213
|
+
}).forEach(function (_ref4) {
|
|
214
|
+
var x = _ref4.x,
|
|
215
|
+
y = _ref4.y;
|
|
216
|
+
return addPointSnap(snapElements, x, y, 20, 40);
|
|
217
|
+
});
|
|
218
|
+
snapElements.push(new LineSnap({
|
|
219
|
+
a: a,
|
|
220
|
+
b: b,
|
|
221
|
+
c: c,
|
|
222
|
+
radius: radius,
|
|
223
|
+
priority: priority,
|
|
224
|
+
related: related
|
|
225
|
+
}));
|
|
226
|
+
});
|
|
227
|
+
}
|
|
228
|
+
function addLineSegmentSnap(snapElements, x1, y1, x2, y2, radius, priority, related) {
|
|
229
|
+
related = new _immutable.List([related]);
|
|
230
|
+
return snapElements.push(new LineSegmentSnap({
|
|
231
|
+
x1: x1,
|
|
232
|
+
y1: y1,
|
|
233
|
+
x2: x2,
|
|
234
|
+
y2: y2,
|
|
235
|
+
radius: radius,
|
|
236
|
+
priority: priority,
|
|
237
|
+
related: related
|
|
238
|
+
}));
|
|
239
|
+
}
|
|
240
|
+
function addGridSnap(snapElements, x, y, radius, priority, related) {
|
|
241
|
+
related = new _immutable.List([related]);
|
|
242
|
+
return snapElements.push(new GridSnap({
|
|
243
|
+
x: x,
|
|
244
|
+
y: y,
|
|
245
|
+
radius: radius,
|
|
246
|
+
priority: priority,
|
|
247
|
+
related: related
|
|
248
|
+
}));
|
|
249
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.summarizeItems = summarizeItems;
|
|
7
|
+
function summarizeItems(items) {
|
|
8
|
+
var totalCount = 0;
|
|
9
|
+
var totalPrice = 0;
|
|
10
|
+
var totalRegularPrice = 0;
|
|
11
|
+
for (var sku in items) {
|
|
12
|
+
var item = items[sku];
|
|
13
|
+
var _ref = item || {},
|
|
14
|
+
_ref$count = _ref.count,
|
|
15
|
+
count = _ref$count === void 0 ? 0 : _ref$count,
|
|
16
|
+
_ref$regularPrice = _ref.regularPrice,
|
|
17
|
+
regularPrice = _ref$regularPrice === void 0 ? 0 : _ref$regularPrice,
|
|
18
|
+
disCountPrice = _ref.disCountPrice;
|
|
19
|
+
var priceToUse = typeof disCountPrice === 'number' && !isNaN(disCountPrice) ? disCountPrice : regularPrice;
|
|
20
|
+
totalCount += count;
|
|
21
|
+
totalPrice += count * priceToUse;
|
|
22
|
+
totalRegularPrice += count * regularPrice;
|
|
23
|
+
}
|
|
24
|
+
return {
|
|
25
|
+
totalCount: totalCount,
|
|
26
|
+
totalRegularPrice: totalRegularPrice,
|
|
27
|
+
totalPrice: totalPrice,
|
|
28
|
+
totalSavings: totalRegularPrice - totalPrice
|
|
29
|
+
};
|
|
30
|
+
}
|