kitchen-simulator 1.1.1-test.63 → 1.1.1-test.65
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 +10 -2
- package/es/AppContext.js +10 -3
- package/es/KitchenConfigurator.js +79 -70
- package/es/KitchenConfiguratorApp.js +107 -98
- package/es/actions/area-actions.js +12 -5
- package/es/actions/export.js +29 -12
- package/es/actions/groups-actions.js +45 -27
- package/es/actions/holes-actions.js +55 -34
- package/es/actions/items-actions.js +145 -94
- package/es/actions/lines-actions.js +36 -21
- package/es/actions/project-actions.js +145 -94
- package/es/actions/scene-actions.js +21 -11
- package/es/actions/vertices-actions.js +15 -7
- package/es/actions/viewer2d-actions.js +36 -21
- package/es/actions/viewer3d-actions.js +18 -9
- package/es/catalog/areas/area/planner-element.js +9 -2
- package/es/catalog/catalog.js +21 -15
- package/es/catalog/factories/area-factory-3d.js +31 -22
- package/es/catalog/factories/area-factory.js +20 -11
- package/es/catalog/factories/export.js +24 -6
- package/es/catalog/factories/wall-factory-3d.js +41 -31
- package/es/catalog/factories/wall-factory.js +31 -21
- package/es/catalog/holes/door-closet/planner-element.js +24 -15
- package/es/catalog/holes/door-double/planner-element.js +24 -15
- package/es/catalog/holes/door-exterior/planner-element.js +25 -16
- package/es/catalog/holes/door-interior/planner-element.js +25 -16
- package/es/catalog/holes/door-panic/planner-element.js +16 -7
- package/es/catalog/holes/door-panic-double/planner-element.js +24 -15
- package/es/catalog/holes/door-sliding/planner-element.js +25 -16
- package/es/catalog/holes/doorway-framed/planner-element.js +20 -11
- package/es/catalog/holes/doorway-frameless/planner-element.js +16 -7
- package/es/catalog/holes/export.js +97 -13
- package/es/catalog/holes/window-clear/planner-element.js +19 -10
- package/es/catalog/holes/window-cross/planner-element.js +19 -10
- package/es/catalog/holes/window-double-hung/planner-element.js +19 -10
- package/es/catalog/holes/window-vertical/planner-element.js +19 -10
- package/es/catalog/lines/wall/planner-element.js +9 -2
- package/es/catalog/molding/molding-dcm/planner-element.js +14 -5
- package/es/catalog/molding/molding-fbm/planner-element.js +14 -5
- package/es/catalog/molding/molding-lrm/planner-element.js +14 -5
- package/es/catalog/properties/export.js +80 -20
- package/es/catalog/properties/property-checkbox.js +31 -24
- package/es/catalog/properties/property-color.js +23 -16
- package/es/catalog/properties/property-enum.js +31 -24
- package/es/catalog/properties/property-hidden.js +16 -9
- package/es/catalog/properties/property-lenght-measure.js +45 -38
- package/es/catalog/properties/property-length-measure.js +43 -36
- package/es/catalog/properties/property-length-measure_hole.js +45 -38
- package/es/catalog/properties/property-number.js +24 -17
- package/es/catalog/properties/property-read-only.js +23 -16
- package/es/catalog/properties/property-string.js +23 -16
- package/es/catalog/properties/property-toggle.js +23 -16
- package/es/catalog/properties/shared-property-style.js +7 -1
- package/es/catalog/utils/FuseUtils.js +15 -8
- package/es/catalog/utils/exporter.js +15 -8
- package/es/catalog/utils/geom-utils.js +29 -13
- package/es/catalog/utils/item-loader.js +97 -84
- package/es/catalog/utils/load-obj.js +28 -20
- package/es/catalog/utils/mtl-loader.js +8 -3
- package/es/catalog/utils/obj-loader.js +8 -3
- package/es/class/FuseUtils.js +15 -8
- package/es/class/area.js +28 -22
- package/es/class/export.js +95 -23
- package/es/class/group.js +59 -53
- package/es/class/guide.js +21 -15
- package/es/class/hole.js +89 -83
- package/es/class/item.js +147 -141
- package/es/class/layer.js +65 -59
- package/es/class/line.js +143 -135
- package/es/class/project.js +98 -90
- package/es/class/vertex.js +35 -29
- package/es/components/content.js +28 -19
- package/es/components/disclaimer/disclaimer.js +18 -10
- package/es/components/export.js +32 -8
- package/es/components/style/button.js +31 -23
- package/es/components/style/cancel-button.js +14 -7
- package/es/components/style/content-container.js +16 -9
- package/es/components/style/content-title.js +20 -11
- package/es/components/style/delete-button.js +17 -8
- package/es/components/style/export.js +120 -30
- package/es/components/style/form-block.js +15 -8
- package/es/components/style/form-color-input.js +14 -7
- package/es/components/style/form-label.js +15 -8
- package/es/components/style/form-number-input.js +49 -41
- package/es/components/style/form-number-input_2.js +44 -36
- package/es/components/style/form-select.js +24 -17
- package/es/components/style/form-slider.js +17 -10
- package/es/components/style/form-submit-button.js +17 -8
- package/es/components/style/form-text-input.js +34 -26
- package/es/components/viewer2d/area.js +24 -17
- package/es/components/viewer2d/export.js +120 -30
- package/es/components/viewer2d/grids/grid-horizontal-streak.js +17 -10
- package/es/components/viewer2d/grids/grid-streak.js +17 -10
- package/es/components/viewer2d/grids/grid-vertical-streak.js +17 -10
- package/es/components/viewer2d/grids/grids.js +19 -10
- package/es/components/viewer2d/group.js +24 -15
- package/es/components/viewer2d/item.js +70 -61
- package/es/components/viewer2d/layer.js +30 -23
- package/es/components/viewer2d/line.js +111 -101
- package/es/components/viewer2d/ruler.js +29 -22
- package/es/components/viewer2d/rulerDist.js +28 -21
- package/es/components/viewer2d/rulerX.js +47 -39
- package/es/components/viewer2d/rulerY.js +45 -37
- package/es/components/viewer2d/scene.js +38 -30
- package/es/components/viewer2d/snap.js +22 -13
- package/es/components/viewer2d/state.js +27 -18
- package/es/components/viewer2d/utils.js +37 -24
- package/es/components/viewer2d/vertex.js +17 -8
- package/es/components/viewer2d/viewer2d.js +163 -153
- package/es/components/viewer3d/camera-controls-module/camera-controls.module.js +23 -17
- package/es/components/viewer3d/dcm.js +7 -1
- package/es/components/viewer3d/fbm.js +7 -1
- package/es/components/viewer3d/front3D.js +21 -12
- package/es/components/viewer3d/grid-creator.js +17 -8
- package/es/components/viewer3d/grids/grid-horizontal-streak.js +14 -6
- package/es/components/viewer3d/grids/grid-streak.js +13 -5
- package/es/components/viewer3d/grids/grid-vertical-streak.js +14 -6
- package/es/components/viewer3d/libs/first-person-controls.js +9 -2
- package/es/components/viewer3d/libs/helvetiker_regular.typeface.js +7 -1
- package/es/components/viewer3d/libs/mtl-loader.js +7 -1
- package/es/components/viewer3d/libs/obj-loader.js +7 -1
- package/es/components/viewer3d/libs/orbit-controls.js +8 -2
- package/es/components/viewer3d/libs/pointer-lock-controls.js +8 -2
- package/es/components/viewer3d/lrm.js +7 -1
- package/es/components/viewer3d/model.js +7 -1
- package/es/components/viewer3d/pointer-lock-navigation.js +10 -3
- package/es/components/viewer3d/ruler-utils/itemRect.js +25 -18
- package/es/components/viewer3d/ruler-utils/layer3D.js +66 -59
- package/es/components/viewer3d/ruler-utils/ruler3D.js +46 -39
- package/es/components/viewer3d/ruler-utils/scene3D.js +17 -9
- package/es/components/viewer3d/ruler-utils/state3D.js +11 -4
- package/es/components/viewer3d/scene-creator.js +226 -191
- package/es/components/viewer3d/three-memory-cleaner.js +12 -3
- package/es/components/viewer3d/viewer3d-first-person.js +46 -40
- package/es/components/viewer3d/viewer3d.js +202 -196
- package/es/constants.js +358 -349
- package/es/index.js +15 -7
- package/es/models.js +184 -177
- package/es/plugins/SVGLoader.js +53 -48
- package/es/plugins/autosave.js +9 -3
- package/es/plugins/console-debugger.js +12 -5
- package/es/plugins/export.js +32 -8
- package/es/plugins/keyboard.js +35 -29
- package/es/reducers/areas-reducer.js +13 -7
- package/es/reducers/export.js +96 -24
- package/es/reducers/groups-reducer.js +37 -31
- package/es/reducers/holes-reducer.js +49 -43
- package/es/reducers/items-reducer.js +112 -106
- package/es/reducers/lines-reducer.js +34 -28
- package/es/reducers/project-reducer.js +111 -105
- package/es/reducers/reducer.js +23 -16
- package/es/reducers/scene-reducer.js +21 -15
- package/es/reducers/user-reducer.js +11 -5
- package/es/reducers/vertices-reducer.js +17 -11
- package/es/reducers/viewer2d-reducer.js +24 -18
- package/es/reducers/viewer3d-reducer.js +22 -16
- package/es/shared-style.js +16 -10
- package/es/styles/export.js +11 -3
- package/es/translator/en.js +7 -1
- package/es/translator/it.js +7 -1
- package/es/translator/ru.js +7 -1
- package/es/translator/translator.js +19 -13
- package/es/utils/browser.js +9 -2
- package/es/utils/convert-units-lite.js +7 -1
- package/es/utils/email-validator.js +7 -1
- package/es/utils/export.js +46 -15
- package/es/utils/geometry.js +278 -181
- package/es/utils/get-edges-of-subgraphs.js +9 -2
- package/es/utils/graph-cycles.js +11 -8
- package/es/utils/graph-inner-cycles.js +18 -10
- package/es/utils/graph.js +17 -9
- package/es/utils/helper.js +63 -39
- package/es/utils/history.js +15 -8
- package/es/utils/id-broker.js +15 -8
- package/es/utils/logger.js +7 -1
- package/es/utils/math.js +12 -5
- package/es/utils/molding.js +144 -119
- package/es/utils/name-generator.js +13 -7
- package/es/utils/objects-utils.js +19 -7
- package/es/utils/phone-validator.js +7 -1
- package/es/utils/process-black-list.js +10 -3
- package/es/utils/react-if.js +12 -6
- package/es/utils/snap-scene.js +34 -27
- package/es/utils/snap.js +59 -45
- package/es/utils/summarizeCart.js +7 -1
- package/es/utils/threeCSG.es6.js +22 -13
- package/es/version.js +7 -1
- package/lib/@history.js +2 -1
- package/lib/AppContext.js +2 -1
- package/lib/KitchenConfigurator.js +2 -1
- package/lib/KitchenConfiguratorApp.js +2 -1
- package/lib/catalog/areas/area/planner-element.js +2 -1
- package/lib/catalog/catalog.js +2 -1
- package/lib/catalog/factories/area-factory.js +2 -1
- package/lib/catalog/factories/wall-factory.js +2 -1
- package/lib/catalog/holes/door-closet/planner-element.js +2 -1
- package/lib/catalog/holes/door-double/planner-element.js +2 -1
- package/lib/catalog/holes/door-exterior/planner-element.js +2 -1
- package/lib/catalog/holes/door-interior/planner-element.js +2 -1
- package/lib/catalog/holes/door-panic/planner-element.js +2 -1
- package/lib/catalog/holes/door-panic-double/planner-element.js +2 -1
- package/lib/catalog/holes/door-sliding/planner-element.js +2 -1
- package/lib/catalog/holes/doorway-framed/planner-element.js +2 -1
- package/lib/catalog/holes/doorway-frameless/planner-element.js +2 -1
- package/lib/catalog/holes/window-clear/planner-element.js +2 -1
- package/lib/catalog/holes/window-cross/planner-element.js +2 -1
- package/lib/catalog/holes/window-double-hung/planner-element.js +2 -1
- package/lib/catalog/holes/window-vertical/planner-element.js +2 -1
- package/lib/catalog/lines/wall/planner-element.js +2 -1
- package/lib/catalog/molding/molding-dcm/planner-element.js +2 -1
- package/lib/catalog/molding/molding-fbm/planner-element.js +2 -1
- package/lib/catalog/molding/molding-lrm/planner-element.js +2 -1
- package/lib/catalog/properties/property-checkbox.js +2 -1
- package/lib/catalog/properties/property-color.js +2 -1
- package/lib/catalog/properties/property-enum.js +2 -1
- package/lib/catalog/properties/property-hidden.js +2 -1
- package/lib/catalog/properties/property-lenght-measure.js +2 -1
- package/lib/catalog/properties/property-length-measure.js +2 -1
- package/lib/catalog/properties/property-length-measure_hole.js +2 -1
- package/lib/catalog/properties/property-number.js +2 -1
- package/lib/catalog/properties/property-read-only.js +2 -1
- package/lib/catalog/properties/property-string.js +2 -1
- package/lib/catalog/properties/property-toggle.js +2 -1
- package/lib/catalog/properties/shared-property-style.js +2 -1
- package/lib/catalog/utils/FuseUtils.js +2 -1
- package/lib/catalog/utils/exporter.js +2 -1
- package/lib/class/FuseUtils.js +2 -1
- package/lib/class/area.js +2 -1
- package/lib/class/group.js +2 -1
- package/lib/class/hole.js +2 -1
- package/lib/class/item.js +2 -1
- package/lib/class/layer.js +2 -1
- package/lib/class/line.js +2 -1
- package/lib/class/project.js +2 -1
- package/lib/class/vertex.js +2 -1
- package/lib/components/content.js +2 -1
- package/lib/components/disclaimer/disclaimer.js +2 -1
- package/lib/components/style/button.js +2 -1
- package/lib/components/style/cancel-button.js +2 -1
- package/lib/components/style/content-container.js +2 -1
- package/lib/components/style/content-title.js +2 -1
- package/lib/components/style/delete-button.js +2 -1
- package/lib/components/style/form-block.js +2 -1
- package/lib/components/style/form-color-input.js +2 -1
- package/lib/components/style/form-label.js +2 -1
- package/lib/components/style/form-number-input.js +2 -1
- package/lib/components/style/form-number-input_2.js +2 -1
- package/lib/components/style/form-select.js +2 -1
- package/lib/components/style/form-slider.js +2 -1
- package/lib/components/style/form-submit-button.js +2 -1
- package/lib/components/style/form-text-input.js +2 -1
- package/lib/components/viewer2d/area.js +2 -1
- package/lib/components/viewer2d/grids/grid-horizontal-streak.js +2 -1
- package/lib/components/viewer2d/grids/grid-streak.js +2 -1
- package/lib/components/viewer2d/grids/grid-vertical-streak.js +2 -1
- package/lib/components/viewer2d/grids/grids.js +2 -1
- package/lib/components/viewer2d/group.js +2 -1
- package/lib/components/viewer2d/item.js +2 -1
- package/lib/components/viewer2d/layer.js +2 -1
- package/lib/components/viewer2d/ruler.js +2 -1
- package/lib/components/viewer2d/rulerDist.js +2 -1
- package/lib/components/viewer2d/rulerX.js +2 -1
- package/lib/components/viewer2d/rulerY.js +2 -1
- package/lib/components/viewer2d/scene.js +2 -1
- package/lib/components/viewer2d/snap.js +2 -1
- package/lib/components/viewer2d/state.js +2 -1
- package/lib/components/viewer2d/vertex.js +2 -1
- package/lib/components/viewer2d/viewer2d.js +2 -1
- package/lib/components/viewer3d/dcm.js +2 -1
- package/lib/components/viewer3d/fbm.js +2 -1
- package/lib/components/viewer3d/front3D.js +2 -1
- package/lib/components/viewer3d/grid-creator.js +2 -1
- package/lib/components/viewer3d/grids/grid-horizontal-streak.js +2 -1
- package/lib/components/viewer3d/grids/grid-streak.js +2 -1
- package/lib/components/viewer3d/grids/grid-vertical-streak.js +2 -1
- package/lib/components/viewer3d/libs/mtl-loader.js +2 -1
- package/lib/components/viewer3d/libs/obj-loader.js +2 -1
- package/lib/components/viewer3d/lrm.js +2 -1
- package/lib/components/viewer3d/ruler-utils/itemRect.js +2 -1
- package/lib/components/viewer3d/ruler-utils/layer3D.js +2 -1
- package/lib/components/viewer3d/ruler-utils/ruler3D.js +2 -1
- package/lib/components/viewer3d/ruler-utils/state3D.js +2 -1
- package/lib/components/viewer3d/viewer3d-first-person.js +2 -1
- package/lib/components/viewer3d/viewer3d.js +2 -1
- package/lib/plugins/autosave.js +2 -1
- package/lib/plugins/console-debugger.js +2 -1
- package/lib/plugins/keyboard.js +2 -1
- package/lib/reducers/areas-reducer.js +2 -1
- package/lib/reducers/groups-reducer.js +2 -1
- package/lib/reducers/holes-reducer.js +2 -1
- package/lib/reducers/items-reducer.js +2 -1
- package/lib/reducers/lines-reducer.js +2 -1
- package/lib/reducers/project-reducer.js +2 -1
- package/lib/reducers/scene-reducer.js +2 -1
- package/lib/reducers/user-reducer.js +2 -1
- package/lib/reducers/vertices-reducer.js +2 -1
- package/lib/reducers/viewer2d-reducer.js +2 -1
- package/lib/reducers/viewer3d-reducer.js +2 -1
- package/lib/translator/en.js +2 -1
- package/lib/translator/it.js +2 -1
- package/lib/translator/ru.js +2 -1
- package/lib/translator/translator.js +2 -1
- package/lib/utils/name-generator.js +2 -1
- package/lib/utils/react-if.js +2 -1
- package/lib/utils/threeCSG.es6.js +2 -1
- package/package.json +2 -1
|
@@ -1,14 +1,20 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
var
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports["default"] = void 0;
|
|
8
|
+
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/classCallCheck"));
|
|
9
|
+
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/createClass"));
|
|
10
|
+
var NameGenerator = exports["default"] = /*#__PURE__*/function () {
|
|
4
11
|
function NameGenerator() {
|
|
5
|
-
|
|
12
|
+
(0, _classCallCheck2["default"])(this, NameGenerator);
|
|
6
13
|
}
|
|
7
|
-
return
|
|
14
|
+
return (0, _createClass2["default"])(NameGenerator, null, [{
|
|
8
15
|
key: "generateName",
|
|
9
16
|
value: function generateName(prototype, type) {
|
|
10
17
|
return type.substr(0, 1).toUpperCase() + type.substr(1);
|
|
11
18
|
}
|
|
12
19
|
}]);
|
|
13
|
-
}();
|
|
14
|
-
export { NameGenerator as default };
|
|
20
|
+
}();
|
|
@@ -1,19 +1,31 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
var _typeof3 = require("@babel/runtime/helpers/typeof");
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.getAllMeshes = getAllMeshes;
|
|
9
|
+
exports.objectsCompare = objectsCompare;
|
|
10
|
+
exports.objectsMap = objectsMap;
|
|
11
|
+
exports.vectorIntersectWithMesh = vectorIntersectWithMesh;
|
|
12
|
+
var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/typeof"));
|
|
13
|
+
var Three = _interopRequireWildcard(require("three"));
|
|
14
|
+
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" != _typeof3(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); }
|
|
3
15
|
String.prototype.isLeftPlaceholder = function () {
|
|
4
16
|
return this.match(/_L$|_L_\d$/) != null;
|
|
5
17
|
};
|
|
6
18
|
String.prototype.isRightPlaceholder = function () {
|
|
7
19
|
return this.match(/_R$|_R_\d$/) != null;
|
|
8
20
|
};
|
|
9
|
-
|
|
21
|
+
function objectsMap(object, func) {
|
|
10
22
|
var mappedObject = {};
|
|
11
23
|
for (var key in object) {
|
|
12
24
|
mappedObject[key] = func(key, mappedObject[key]);
|
|
13
25
|
}
|
|
14
26
|
return mappedObject;
|
|
15
27
|
}
|
|
16
|
-
|
|
28
|
+
function objectsCompare(x, y) {
|
|
17
29
|
if (x === y) return true;
|
|
18
30
|
if (!(x instanceof Object) || !(y instanceof Object)) return false;
|
|
19
31
|
if (x.constructor !== y.constructor) return false;
|
|
@@ -21,7 +33,7 @@ export function objectsCompare(x, y) {
|
|
|
21
33
|
if (!x.hasOwnProperty(p)) continue;
|
|
22
34
|
if (!y.hasOwnProperty(p)) return false;
|
|
23
35
|
if (x[p] === y[p]) continue;
|
|
24
|
-
if (
|
|
36
|
+
if ((0, _typeof2["default"])(x[p]) !== 'object') return false;
|
|
25
37
|
if (!objectsCompare(x[p], y[p])) return false;
|
|
26
38
|
}
|
|
27
39
|
for (var _p in y) {
|
|
@@ -29,7 +41,7 @@ export function objectsCompare(x, y) {
|
|
|
29
41
|
}
|
|
30
42
|
return true;
|
|
31
43
|
}
|
|
32
|
-
|
|
44
|
+
function getAllMeshes(objects) {
|
|
33
45
|
var meshes = [];
|
|
34
46
|
objects.forEach(function (object) {
|
|
35
47
|
if (!object) return;
|
|
@@ -41,7 +53,7 @@ export function getAllMeshes(objects) {
|
|
|
41
53
|
});
|
|
42
54
|
return meshes;
|
|
43
55
|
}
|
|
44
|
-
|
|
56
|
+
function vectorIntersectWithMesh(origin, target) {
|
|
45
57
|
var vectorDir = new Three.Vector3(origin.x, origin.y - 1000, origin.z);
|
|
46
58
|
var ray = new Three.Raycaster();
|
|
47
59
|
ray.set(origin, vectorDir);
|
|
@@ -1,4 +1,10 @@
|
|
|
1
|
-
|
|
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) {
|
|
2
8
|
var result = /^(\+1\s?)?(\(?\d{3}\)?[\s.-]?)?\d{3}[\s.-]?\d{4}$/;
|
|
3
9
|
return result.test(String(phone).toLowerCase());
|
|
4
10
|
};
|
|
@@ -1,7 +1,14 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.buildCurrentCabinetObject = void 0;
|
|
8
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/defineProperty"));
|
|
2
9
|
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) {
|
|
4
|
-
|
|
10
|
+
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) { (0, _defineProperty2["default"])(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; }
|
|
11
|
+
var buildCurrentCabinetObject = exports.buildCurrentCabinetObject = function buildCurrentCabinetObject(cabinet, texture) {
|
|
5
12
|
return {
|
|
6
13
|
type: cabinet.name,
|
|
7
14
|
// e.g. "B09"
|
package/es/utils/react-if.js
CHANGED
|
@@ -1,18 +1,24 @@
|
|
|
1
|
-
|
|
2
|
-
import PropTypes from 'prop-types';
|
|
1
|
+
"use strict";
|
|
3
2
|
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports["default"] = If;
|
|
8
|
+
var _react = _interopRequireDefault(require("react"));
|
|
9
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
4
10
|
/**
|
|
5
11
|
* @return {null}
|
|
6
12
|
*/
|
|
7
|
-
|
|
13
|
+
function If(_ref) {
|
|
8
14
|
var condition = _ref.condition,
|
|
9
15
|
style = _ref.style,
|
|
10
16
|
children = _ref.children;
|
|
11
|
-
return condition ? Array.isArray(children) ? /*#__PURE__*/
|
|
17
|
+
return condition ? Array.isArray(children) ? /*#__PURE__*/_react["default"].createElement("div", {
|
|
12
18
|
style: style
|
|
13
19
|
}, children) : children : null;
|
|
14
20
|
}
|
|
15
21
|
If.propTypes = {
|
|
16
|
-
condition:
|
|
17
|
-
style:
|
|
22
|
+
condition: _propTypes["default"].bool.isRequired,
|
|
23
|
+
style: _propTypes["default"].object
|
|
18
24
|
};
|
package/es/utils/snap-scene.js
CHANGED
|
@@ -1,10 +1,17 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.sceneSnapElements = sceneSnapElements;
|
|
8
|
+
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/slicedToArray"));
|
|
9
|
+
var _snap = require("./snap");
|
|
10
|
+
var _export = require("./export");
|
|
11
|
+
var _immutable = require("immutable");
|
|
12
|
+
function sceneSnapElements(scene) {
|
|
13
|
+
var snapElements = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : new _immutable.List();
|
|
14
|
+
var snapMask = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : new _immutable.Map();
|
|
8
15
|
var width = scene.width,
|
|
9
16
|
height = scene.height;
|
|
10
17
|
var a, b, c;
|
|
@@ -16,36 +23,36 @@ export function sceneSnapElements(scene) {
|
|
|
16
23
|
var vertexID = _ref.id,
|
|
17
24
|
x = _ref.x,
|
|
18
25
|
y = _ref.y;
|
|
19
|
-
if (snapMask.get(SNAP_POINT)) {
|
|
20
|
-
addPointSnap(snapElements, x, y, 10, 10, vertexID);
|
|
26
|
+
if (snapMask.get(_snap.SNAP_POINT)) {
|
|
27
|
+
(0, _snap.addPointSnap)(snapElements, x, y, 10, 10, vertexID);
|
|
21
28
|
}
|
|
22
|
-
if (snapMask.get(SNAP_LINE)) {
|
|
23
|
-
var _GeometryUtils$horizo = GeometryUtils.horizontalLine(y);
|
|
29
|
+
if (snapMask.get(_snap.SNAP_LINE)) {
|
|
30
|
+
var _GeometryUtils$horizo = _export.GeometryUtils.horizontalLine(y);
|
|
24
31
|
a = _GeometryUtils$horizo.a;
|
|
25
32
|
b = _GeometryUtils$horizo.b;
|
|
26
33
|
c = _GeometryUtils$horizo.c;
|
|
27
|
-
addLineSnap(snapElements, a, b, c, 10, 1, vertexID);
|
|
28
|
-
var _GeometryUtils$vertic = GeometryUtils.verticalLine(x);
|
|
34
|
+
(0, _snap.addLineSnap)(snapElements, a, b, c, 10, 1, vertexID);
|
|
35
|
+
var _GeometryUtils$vertic = _export.GeometryUtils.verticalLine(x);
|
|
29
36
|
a = _GeometryUtils$vertic.a;
|
|
30
37
|
b = _GeometryUtils$vertic.b;
|
|
31
38
|
c = _GeometryUtils$vertic.c;
|
|
32
|
-
addLineSnap(snapElements, a, b, c, 10, 1, vertexID);
|
|
33
|
-
var _GeometryUtils$upcros = GeometryUtils.upcrossLine(x, y);
|
|
39
|
+
(0, _snap.addLineSnap)(snapElements, a, b, c, 10, 1, vertexID);
|
|
40
|
+
var _GeometryUtils$upcros = _export.GeometryUtils.upcrossLine(x, y);
|
|
34
41
|
a = _GeometryUtils$upcros.a;
|
|
35
42
|
b = _GeometryUtils$upcros.b;
|
|
36
43
|
c = _GeometryUtils$upcros.c;
|
|
37
|
-
addLineSnap(snapElements, a, b, c, 10, 3, null);
|
|
38
|
-
var _GeometryUtils$downcr = GeometryUtils.downcrossLine(x, y);
|
|
44
|
+
(0, _snap.addLineSnap)(snapElements, a, b, c, 10, 3, null);
|
|
45
|
+
var _GeometryUtils$downcr = _export.GeometryUtils.downcrossLine(x, y);
|
|
39
46
|
a = _GeometryUtils$downcr.a;
|
|
40
47
|
b = _GeometryUtils$downcr.b;
|
|
41
48
|
c = _GeometryUtils$downcr.c;
|
|
42
|
-
addLineSnap(snapElements, a, b, c, 10, 3, null);
|
|
49
|
+
(0, _snap.addLineSnap)(snapElements, a, b, c, 10, 3, null);
|
|
43
50
|
}
|
|
44
51
|
});
|
|
45
|
-
if (snapMask.get(SNAP_SEGMENT)) {
|
|
52
|
+
if (snapMask.get(_snap.SNAP_SEGMENT)) {
|
|
46
53
|
lines.forEach(function (_ref2) {
|
|
47
54
|
var lineID = _ref2.id,
|
|
48
|
-
_ref2$vertices =
|
|
55
|
+
_ref2$vertices = (0, _slicedToArray2["default"])(_ref2.vertices, 2),
|
|
49
56
|
v0 = _ref2$vertices[0],
|
|
50
57
|
v1 = _ref2$vertices[1];
|
|
51
58
|
var _vertices$get = vertices.get(v0),
|
|
@@ -54,11 +61,11 @@ export function sceneSnapElements(scene) {
|
|
|
54
61
|
var _vertices$get2 = vertices.get(v1),
|
|
55
62
|
x2 = _vertices$get2.x,
|
|
56
63
|
y2 = _vertices$get2.y;
|
|
57
|
-
addLineSegmentSnap(snapElements, x1, y1, x2, y2, 20, 1, lineID);
|
|
64
|
+
(0, _snap.addLineSegmentSnap)(snapElements, x1, y1, x2, y2, 20, 1, lineID);
|
|
58
65
|
});
|
|
59
66
|
}
|
|
60
67
|
});
|
|
61
|
-
if (snapMask.get(SNAP_GRID)) {
|
|
68
|
+
if (snapMask.get(_snap.SNAP_GRID)) {
|
|
62
69
|
var divider = 5;
|
|
63
70
|
var gridCellSize = 100 / divider;
|
|
64
71
|
var xCycle = width / gridCellSize;
|
|
@@ -69,25 +76,25 @@ export function sceneSnapElements(scene) {
|
|
|
69
76
|
var yMul = y * gridCellSize;
|
|
70
77
|
var onXCross = !(x % divider) ? true : false;
|
|
71
78
|
var onYCross = !(y % divider) ? true : false;
|
|
72
|
-
addGridSnap(snapElements, xMul, yMul, 10, onXCross && onYCross ? 15 : 10, null);
|
|
79
|
+
(0, _snap.addGridSnap)(snapElements, xMul, yMul, 10, onXCross && onYCross ? 15 : 10, null);
|
|
73
80
|
}
|
|
74
81
|
}
|
|
75
82
|
}
|
|
76
|
-
if (snapMask.get(SNAP_GUIDE)) {
|
|
83
|
+
if (snapMask.get(_snap.SNAP_GUIDE)) {
|
|
77
84
|
var horizontal = scene.getIn(['guides', 'horizontal']);
|
|
78
85
|
var vertical = scene.getIn(['guides', 'vertical']);
|
|
79
86
|
var hValues = horizontal.valueSeq();
|
|
80
87
|
var vValues = vertical.valueSeq();
|
|
81
88
|
hValues.forEach(function (hVal) {
|
|
82
89
|
vValues.forEach(function (vVal) {
|
|
83
|
-
addPointSnap(snapElements, vVal, hVal, 10, 10);
|
|
90
|
+
(0, _snap.addPointSnap)(snapElements, vVal, hVal, 10, 10);
|
|
84
91
|
});
|
|
85
92
|
});
|
|
86
93
|
hValues.forEach(function (hVal) {
|
|
87
|
-
return addLineSegmentSnap(snapElements, 0, hVal, width, hVal, 20, 1);
|
|
94
|
+
return (0, _snap.addLineSegmentSnap)(snapElements, 0, hVal, width, hVal, 20, 1);
|
|
88
95
|
});
|
|
89
96
|
vValues.forEach(function (vVal) {
|
|
90
|
-
return addLineSegmentSnap(snapElements, vVal, 0, vVal, height, 20, 1);
|
|
97
|
+
return (0, _snap.addLineSegmentSnap)(snapElements, vVal, 0, vVal, height, 20, 1);
|
|
91
98
|
});
|
|
92
99
|
}
|
|
93
100
|
});
|
package/es/utils/snap.js
CHANGED
|
@@ -1,21 +1,35 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.SNAP_SEGMENT = exports.SNAP_POINT = exports.SNAP_MASK = exports.SNAP_LINE = exports.SNAP_GUIDE = exports.SNAP_GRID = void 0;
|
|
9
|
+
exports.addGridSnap = addGridSnap;
|
|
10
|
+
exports.addLineSegmentSnap = addLineSegmentSnap;
|
|
11
|
+
exports.addLineSnap = addLineSnap;
|
|
12
|
+
exports.addPointSnap = addPointSnap;
|
|
13
|
+
exports.nearestSnap = nearestSnap;
|
|
14
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/defineProperty"));
|
|
15
|
+
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/classCallCheck"));
|
|
16
|
+
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/createClass"));
|
|
17
|
+
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/possibleConstructorReturn"));
|
|
18
|
+
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/getPrototypeOf"));
|
|
19
|
+
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/inherits"));
|
|
20
|
+
var _immutable = require("immutable");
|
|
21
|
+
var Geometry = _interopRequireWildcard(require("./geometry"));
|
|
22
|
+
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); }
|
|
7
23
|
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; }
|
|
8
|
-
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) {
|
|
9
|
-
function _callSuper(t, o, e) { return o =
|
|
24
|
+
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) { (0, _defineProperty2["default"])(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; }
|
|
25
|
+
function _callSuper(t, o, e) { return o = (0, _getPrototypeOf2["default"])(o), (0, _possibleConstructorReturn2["default"])(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], (0, _getPrototypeOf2["default"])(t).constructor) : o.apply(t, e)); }
|
|
10
26
|
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
export var SNAP_GUIDE = 'SNAP_GUIDE';
|
|
18
|
-
export var SNAP_MASK = new Map({
|
|
27
|
+
var SNAP_POINT = exports.SNAP_POINT = 'SNAP_POINT';
|
|
28
|
+
var SNAP_LINE = exports.SNAP_LINE = 'SNAP_LINE';
|
|
29
|
+
var SNAP_SEGMENT = exports.SNAP_SEGMENT = 'SNAP_SEGMENT';
|
|
30
|
+
var SNAP_GRID = exports.SNAP_GRID = 'SNAP_GRID';
|
|
31
|
+
var SNAP_GUIDE = exports.SNAP_GUIDE = 'SNAP_GUIDE';
|
|
32
|
+
var SNAP_MASK = exports.SNAP_MASK = new _immutable.Map({
|
|
19
33
|
SNAP_POINT: true,
|
|
20
34
|
SNAP_LINE: true,
|
|
21
35
|
SNAP_SEGMENT: true,
|
|
@@ -24,11 +38,11 @@ export var SNAP_MASK = new Map({
|
|
|
24
38
|
});
|
|
25
39
|
var PointSnap = /*#__PURE__*/function (_Record) {
|
|
26
40
|
function PointSnap() {
|
|
27
|
-
|
|
41
|
+
(0, _classCallCheck2["default"])(this, PointSnap);
|
|
28
42
|
return _callSuper(this, PointSnap, arguments);
|
|
29
43
|
}
|
|
30
|
-
|
|
31
|
-
return
|
|
44
|
+
(0, _inherits2["default"])(PointSnap, _Record);
|
|
45
|
+
return (0, _createClass2["default"])(PointSnap, [{
|
|
32
46
|
key: "nearestPoint",
|
|
33
47
|
value: function nearestPoint(x, y) {
|
|
34
48
|
return {
|
|
@@ -43,21 +57,21 @@ var PointSnap = /*#__PURE__*/function (_Record) {
|
|
|
43
57
|
return ~(this.x - x) + 1 < distance && ~(this.y - y) + 1 < distance;
|
|
44
58
|
}
|
|
45
59
|
}]);
|
|
46
|
-
}(Record({
|
|
60
|
+
}((0, _immutable.Record)({
|
|
47
61
|
type: 'point',
|
|
48
62
|
x: -1,
|
|
49
63
|
y: -1,
|
|
50
64
|
radius: 1,
|
|
51
65
|
priority: 1,
|
|
52
|
-
related: new List()
|
|
66
|
+
related: new _immutable.List()
|
|
53
67
|
}));
|
|
54
68
|
var LineSnap = /*#__PURE__*/function (_Record2) {
|
|
55
69
|
function LineSnap() {
|
|
56
|
-
|
|
70
|
+
(0, _classCallCheck2["default"])(this, LineSnap);
|
|
57
71
|
return _callSuper(this, LineSnap, arguments);
|
|
58
72
|
}
|
|
59
|
-
|
|
60
|
-
return
|
|
73
|
+
(0, _inherits2["default"])(LineSnap, _Record2);
|
|
74
|
+
return (0, _createClass2["default"])(LineSnap, [{
|
|
61
75
|
key: "nearestPoint",
|
|
62
76
|
value: function nearestPoint(x, y) {
|
|
63
77
|
return _objectSpread(_objectSpread({}, Geometry.closestPointFromLine(this.a, this.b, this.c, x, y)), {}, {
|
|
@@ -70,22 +84,22 @@ var LineSnap = /*#__PURE__*/function (_Record2) {
|
|
|
70
84
|
return true;
|
|
71
85
|
}
|
|
72
86
|
}]);
|
|
73
|
-
}(Record({
|
|
87
|
+
}((0, _immutable.Record)({
|
|
74
88
|
type: 'line',
|
|
75
89
|
a: -1,
|
|
76
90
|
b: -1,
|
|
77
91
|
c: -1,
|
|
78
92
|
radius: 1,
|
|
79
93
|
priority: 1,
|
|
80
|
-
related: new List()
|
|
94
|
+
related: new _immutable.List()
|
|
81
95
|
}));
|
|
82
96
|
var LineSegmentSnap = /*#__PURE__*/function (_Record3) {
|
|
83
97
|
function LineSegmentSnap() {
|
|
84
|
-
|
|
98
|
+
(0, _classCallCheck2["default"])(this, LineSegmentSnap);
|
|
85
99
|
return _callSuper(this, LineSegmentSnap, arguments);
|
|
86
100
|
}
|
|
87
|
-
|
|
88
|
-
return
|
|
101
|
+
(0, _inherits2["default"])(LineSegmentSnap, _Record3);
|
|
102
|
+
return (0, _createClass2["default"])(LineSegmentSnap, [{
|
|
89
103
|
key: "nearestPoint",
|
|
90
104
|
value: function nearestPoint(x, y) {
|
|
91
105
|
return _objectSpread(_objectSpread({}, Geometry.closestPointFromLineSegment(this.x1, this.y1, this.x2, this.y2, x, y)), {}, {
|
|
@@ -104,7 +118,7 @@ var LineSegmentSnap = /*#__PURE__*/function (_Record3) {
|
|
|
104
118
|
return true;
|
|
105
119
|
}
|
|
106
120
|
}]);
|
|
107
|
-
}(Record({
|
|
121
|
+
}((0, _immutable.Record)({
|
|
108
122
|
type: 'line-segment',
|
|
109
123
|
x1: -1,
|
|
110
124
|
y1: -1,
|
|
@@ -112,15 +126,15 @@ var LineSegmentSnap = /*#__PURE__*/function (_Record3) {
|
|
|
112
126
|
y2: -1,
|
|
113
127
|
radius: 1,
|
|
114
128
|
priority: 1,
|
|
115
|
-
related: new List()
|
|
129
|
+
related: new _immutable.List()
|
|
116
130
|
}));
|
|
117
131
|
var GridSnap = /*#__PURE__*/function (_Record4) {
|
|
118
132
|
function GridSnap() {
|
|
119
|
-
|
|
133
|
+
(0, _classCallCheck2["default"])(this, GridSnap);
|
|
120
134
|
return _callSuper(this, GridSnap, arguments);
|
|
121
135
|
}
|
|
122
|
-
|
|
123
|
-
return
|
|
136
|
+
(0, _inherits2["default"])(GridSnap, _Record4);
|
|
137
|
+
return (0, _createClass2["default"])(GridSnap, [{
|
|
124
138
|
key: "nearestPoint",
|
|
125
139
|
value: function nearestPoint(x, y) {
|
|
126
140
|
return {
|
|
@@ -135,15 +149,15 @@ var GridSnap = /*#__PURE__*/function (_Record4) {
|
|
|
135
149
|
return ~(this.x - x) + 1 < distance && ~(this.y - y) + 1 < distance;
|
|
136
150
|
}
|
|
137
151
|
}]);
|
|
138
|
-
}(Record({
|
|
152
|
+
}((0, _immutable.Record)({
|
|
139
153
|
type: 'grid',
|
|
140
154
|
x: -1,
|
|
141
155
|
y: -1,
|
|
142
156
|
radius: 1,
|
|
143
157
|
priority: 1,
|
|
144
|
-
related: new List()
|
|
158
|
+
related: new _immutable.List()
|
|
145
159
|
}));
|
|
146
|
-
|
|
160
|
+
function nearestSnap(snapElements, x, y, snapMask) {
|
|
147
161
|
var filter = {
|
|
148
162
|
point: snapMask.get(SNAP_POINT),
|
|
149
163
|
line: snapMask.get(SNAP_LINE),
|
|
@@ -169,8 +183,8 @@ export function nearestSnap(snapElements, x, y, snapMask) {
|
|
|
169
183
|
return p1 === p2 ? d1 < d2 ? -1 : 1 : p1 > p2 ? -1 : 1;
|
|
170
184
|
});
|
|
171
185
|
}
|
|
172
|
-
|
|
173
|
-
related = new List([related]);
|
|
186
|
+
function addPointSnap(snapElements, x, y, radius, priority, related) {
|
|
187
|
+
related = new _immutable.List([related]);
|
|
174
188
|
return snapElements.push(new PointSnap({
|
|
175
189
|
x: x,
|
|
176
190
|
y: y,
|
|
@@ -179,8 +193,8 @@ export function addPointSnap(snapElements, x, y, radius, priority, related) {
|
|
|
179
193
|
related: related
|
|
180
194
|
}));
|
|
181
195
|
}
|
|
182
|
-
|
|
183
|
-
related = new List([related]);
|
|
196
|
+
function addLineSnap(snapElements, a, b, c, radius, priority, related) {
|
|
197
|
+
related = new _immutable.List([related]);
|
|
184
198
|
return snapElements.withMutations(function (snapElements) {
|
|
185
199
|
var alreadyPresent = snapElements.some(function (lineSnap) {
|
|
186
200
|
return lineSnap.type === 'line' && a === lineSnap.a && b === lineSnap.b && c === lineSnap.c;
|
|
@@ -207,8 +221,8 @@ export function addLineSnap(snapElements, a, b, c, radius, priority, related) {
|
|
|
207
221
|
}));
|
|
208
222
|
});
|
|
209
223
|
}
|
|
210
|
-
|
|
211
|
-
related = new List([related]);
|
|
224
|
+
function addLineSegmentSnap(snapElements, x1, y1, x2, y2, radius, priority, related) {
|
|
225
|
+
related = new _immutable.List([related]);
|
|
212
226
|
return snapElements.push(new LineSegmentSnap({
|
|
213
227
|
x1: x1,
|
|
214
228
|
y1: y1,
|
|
@@ -219,8 +233,8 @@ export function addLineSegmentSnap(snapElements, x1, y1, x2, y2, radius, priorit
|
|
|
219
233
|
related: related
|
|
220
234
|
}));
|
|
221
235
|
}
|
|
222
|
-
|
|
223
|
-
related = new List([related]);
|
|
236
|
+
function addGridSnap(snapElements, x, y, radius, priority, related) {
|
|
237
|
+
related = new _immutable.List([related]);
|
|
224
238
|
return snapElements.push(new GridSnap({
|
|
225
239
|
x: x,
|
|
226
240
|
y: y,
|
|
@@ -1,4 +1,10 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.summarizeItems = summarizeItems;
|
|
7
|
+
function summarizeItems(items) {
|
|
2
8
|
var totalCount = 0;
|
|
3
9
|
var totalPrice = 0;
|
|
4
10
|
var totalRegularPrice = 0;
|
package/es/utils/threeCSG.es6.js
CHANGED
|
@@ -1,15 +1,25 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports["default"] = void 0;
|
|
9
|
+
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/classCallCheck"));
|
|
10
|
+
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/createClass"));
|
|
11
|
+
var THREE = _interopRequireWildcard(require("three"));
|
|
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); }
|
|
3
13
|
/*jshint esversion: 6 */
|
|
4
|
-
|
|
14
|
+
|
|
5
15
|
var EPSILON = 1e-5,
|
|
6
16
|
COPLANAR = 0,
|
|
7
17
|
FRONT = 1,
|
|
8
18
|
BACK = 2,
|
|
9
19
|
SPANNING = 3;
|
|
10
|
-
var ThreeBSP = /*#__PURE__*/function () {
|
|
20
|
+
var ThreeBSP = exports["default"] = /*#__PURE__*/function () {
|
|
11
21
|
function ThreeBSP(geometry) {
|
|
12
|
-
|
|
22
|
+
(0, _classCallCheck2["default"])(this, ThreeBSP);
|
|
13
23
|
// Convert THREE.Geometry to ThreeBSP
|
|
14
24
|
var i,
|
|
15
25
|
_length_i,
|
|
@@ -58,7 +68,7 @@ var ThreeBSP = /*#__PURE__*/function () {
|
|
|
58
68
|
}
|
|
59
69
|
this.tree = new Node(polygons);
|
|
60
70
|
}
|
|
61
|
-
return
|
|
71
|
+
return (0, _createClass2["default"])(ThreeBSP, [{
|
|
62
72
|
key: "subtract",
|
|
63
73
|
value: function subtract(other_tree) {
|
|
64
74
|
var a = this.tree.clone(),
|
|
@@ -153,10 +163,9 @@ var ThreeBSP = /*#__PURE__*/function () {
|
|
|
153
163
|
}
|
|
154
164
|
}]);
|
|
155
165
|
}();
|
|
156
|
-
export { ThreeBSP as default };
|
|
157
166
|
var Polygon = /*#__PURE__*/function () {
|
|
158
167
|
function Polygon(vertices, normal, w) {
|
|
159
|
-
|
|
168
|
+
(0, _classCallCheck2["default"])(this, Polygon);
|
|
160
169
|
if (!(vertices instanceof Array)) {
|
|
161
170
|
vertices = [];
|
|
162
171
|
}
|
|
@@ -167,7 +176,7 @@ var Polygon = /*#__PURE__*/function () {
|
|
|
167
176
|
this.normal = this.w = undefined;
|
|
168
177
|
}
|
|
169
178
|
}
|
|
170
|
-
return
|
|
179
|
+
return (0, _createClass2["default"])(Polygon, [{
|
|
171
180
|
key: "calculateProperties",
|
|
172
181
|
value: function calculateProperties() {
|
|
173
182
|
var a = this.vertices[0],
|
|
@@ -287,14 +296,14 @@ var Polygon = /*#__PURE__*/function () {
|
|
|
287
296
|
}();
|
|
288
297
|
var Vertex = /*#__PURE__*/function () {
|
|
289
298
|
function Vertex(x, y, z, normal, uv) {
|
|
290
|
-
|
|
299
|
+
(0, _classCallCheck2["default"])(this, Vertex);
|
|
291
300
|
this.x = x;
|
|
292
301
|
this.y = y;
|
|
293
302
|
this.z = z;
|
|
294
303
|
this.normal = normal || new THREE.Vector3();
|
|
295
304
|
this.uv = uv || new THREE.Vector2();
|
|
296
305
|
}
|
|
297
|
-
return
|
|
306
|
+
return (0, _createClass2["default"])(Vertex, [{
|
|
298
307
|
key: "clone",
|
|
299
308
|
value: function clone() {
|
|
300
309
|
return new Vertex(this.x, this.y, this.z, this.normal.clone(), this.uv.clone());
|
|
@@ -379,7 +388,7 @@ var Vertex = /*#__PURE__*/function () {
|
|
|
379
388
|
}();
|
|
380
389
|
var Node = /*#__PURE__*/function () {
|
|
381
390
|
function Node(polygons) {
|
|
382
|
-
|
|
391
|
+
(0, _classCallCheck2["default"])(this, Node);
|
|
383
392
|
var i,
|
|
384
393
|
polygon_count,
|
|
385
394
|
front = [],
|
|
@@ -398,7 +407,7 @@ var Node = /*#__PURE__*/function () {
|
|
|
398
407
|
this.back = new Node(back);
|
|
399
408
|
}
|
|
400
409
|
}
|
|
401
|
-
return
|
|
410
|
+
return (0, _createClass2["default"])(Node, [{
|
|
402
411
|
key: "isConvex",
|
|
403
412
|
value: function isConvex(polygons) {
|
|
404
413
|
var i, j;
|
package/es/version.js
CHANGED
package/lib/@history.js
CHANGED
|
@@ -7,4 +7,5 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
exports["default"] = void 0;
|
|
8
8
|
var history = _interopRequireWildcard(require("history"));
|
|
9
9
|
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); }
|
|
10
|
-
var _default = exports["default"] = history.createBrowserHistory();
|
|
10
|
+
var _default = exports["default"] = history.createBrowserHistory();
|
|
11
|
+
module.exports = exports.default;
|
package/lib/AppContext.js
CHANGED
|
@@ -7,4 +7,5 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
exports["default"] = void 0;
|
|
8
8
|
var _react = _interopRequireDefault(require("react"));
|
|
9
9
|
var AppContext = /*#__PURE__*/_react["default"].createContext({});
|
|
10
|
-
var _default = exports["default"] = AppContext;
|
|
10
|
+
var _default = exports["default"] = AppContext;
|
|
11
|
+
module.exports = exports.default;
|
|
@@ -638,4 +638,5 @@ function mapDispatchToProps(dispatch) {
|
|
|
638
638
|
return (0, _redux.bindActionCreators)(_export2["default"][actionNamespace], dispatch);
|
|
639
639
|
});
|
|
640
640
|
}
|
|
641
|
-
var _default = exports["default"] = (0, _reactRedux.connect)(mapStateToProps, mapDispatchToProps)(KitchenConfigurator);
|
|
641
|
+
var _default = exports["default"] = (0, _reactRedux.connect)(mapStateToProps, mapDispatchToProps)(KitchenConfigurator);
|
|
642
|
+
module.exports = exports.default;
|
|
@@ -47,4 +47,5 @@ var textures = {
|
|
|
47
47
|
heightRepeatScale: 0.01
|
|
48
48
|
}
|
|
49
49
|
};
|
|
50
|
-
var _default = exports["default"] = _export["default"].AreaFactory('area', info, textures);
|
|
50
|
+
var _default = exports["default"] = _export["default"].AreaFactory('area', info, textures);
|
|
51
|
+
module.exports = exports.default;
|