kitchen-simulator 1.1.1-test.60 → 1.1.1-test.61
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 +92 -96
- package/es/KitchenConfiguratorApp.js +143 -136
- 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 -24
- package/es/catalog/factories/area-factory-3d.js +31 -22
- package/es/catalog/factories/area-factory.js +20 -14
- 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 -27
- package/es/catalog/properties/property-color.js +23 -16
- package/es/catalog/properties/property-enum.js +31 -29
- package/es/catalog/properties/property-hidden.js +16 -9
- package/es/catalog/properties/property-lenght-measure.js +45 -39
- package/es/catalog/properties/property-length-measure.js +43 -42
- package/es/catalog/properties/property-length-measure_hole.js +45 -39
- 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 -11
- package/es/catalog/utils/exporter.js +15 -11
- package/es/catalog/utils/geom-utils.js +29 -13
- package/es/catalog/utils/item-loader.js +97 -91
- 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 -11
- package/es/class/area.js +28 -26
- package/es/class/export.js +95 -23
- package/es/class/group.js +59 -62
- package/es/class/guide.js +21 -19
- package/es/class/hole.js +89 -87
- package/es/class/item.js +147 -150
- package/es/class/layer.js +65 -63
- package/es/class/line.js +143 -144
- package/es/class/project.js +98 -94
- package/es/class/vertex.js +35 -33
- 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 -30
- package/es/components/style/cancel-button.js +14 -8
- package/es/components/style/content-container.js +16 -12
- package/es/components/style/content-title.js +20 -15
- package/es/components/style/delete-button.js +17 -9
- package/es/components/style/export.js +120 -30
- package/es/components/style/form-block.js +15 -12
- package/es/components/style/form-color-input.js +14 -8
- package/es/components/style/form-label.js +15 -12
- package/es/components/style/form-number-input.js +49 -47
- package/es/components/style/form-number-input_2.js +44 -42
- package/es/components/style/form-select.js +24 -26
- package/es/components/style/form-slider.js +17 -11
- package/es/components/style/form-submit-button.js +17 -9
- package/es/components/style/form-text-input.js +34 -33
- 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 -15
- package/es/components/viewer2d/group.js +24 -15
- package/es/components/viewer2d/item.js +70 -66
- 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 -45
- package/es/components/viewer2d/rulerY.js +45 -43
- package/es/components/viewer2d/scene.js +41 -45
- package/es/components/viewer2d/snap.js +22 -13
- package/es/components/viewer2d/state.js +27 -23
- package/es/components/viewer2d/utils.js +37 -29
- package/es/components/viewer2d/vertex.js +17 -8
- package/es/components/viewer2d/viewer2d.js +163 -164
- package/es/components/viewer3d/camera-controls-module/camera-controls.module.js +23 -24
- package/es/components/viewer3d/dcm.js +7 -1
- package/es/components/viewer3d/fbm.js +7 -1
- package/es/components/viewer3d/front3D.js +21 -17
- 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 -42
- 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 +227 -198
- package/es/components/viewer3d/three-memory-cleaner.js +12 -3
- package/es/components/viewer3d/viewer3d-first-person.js +46 -46
- package/es/components/viewer3d/viewer3d.js +202 -202
- package/es/constants.js +358 -349
- package/es/index.js +13 -6
- package/es/models.js +184 -183
- package/es/plugins/SVGLoader.js +53 -48
- package/es/plugins/autosave.js +9 -3
- package/es/plugins/console-debugger.js +12 -8
- 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 -17
- 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 -190
- 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 -13
- package/es/utils/helper.js +63 -41
- package/es/utils/history.js +15 -8
- package/es/utils/id-broker.js +15 -12
- package/es/utils/logger.js +7 -1
- package/es/utils/math.js +12 -5
- package/es/utils/molding.js +144 -125
- package/es/utils/name-generator.js +13 -11
- package/es/utils/objects-utils.js +19 -7
- package/es/utils/phone-validator.js +7 -1
- package/es/utils/process-black-list.js +10 -6
- package/es/utils/react-if.js +12 -6
- package/es/utils/snap-scene.js +34 -32
- package/es/utils/snap.js +59 -51
- package/es/utils/summarizeCart.js +7 -1
- package/es/utils/threeCSG.es6.js +22 -17
- package/es/version.js +7 -1
- package/lib/@history.js +1 -1
- package/lib/AppContext.js +1 -1
- package/lib/KitchenConfigurator.js +37 -49
- package/lib/KitchenConfiguratorApp.js +60 -61
- package/lib/actions/export.js +1 -1
- package/lib/catalog/areas/area/planner-element.js +1 -1
- package/lib/catalog/catalog.js +7 -15
- package/lib/catalog/factories/area-factory-3d.js +1 -1
- package/lib/catalog/factories/area-factory.js +4 -6
- package/lib/catalog/factories/export.js +1 -1
- package/lib/catalog/factories/wall-factory-3d.js +2 -2
- package/lib/catalog/factories/wall-factory.js +2 -2
- package/lib/catalog/holes/door-closet/planner-element.js +2 -2
- package/lib/catalog/holes/door-double/planner-element.js +2 -2
- package/lib/catalog/holes/door-exterior/planner-element.js +2 -2
- package/lib/catalog/holes/door-interior/planner-element.js +2 -2
- package/lib/catalog/holes/door-panic/planner-element.js +2 -2
- package/lib/catalog/holes/door-panic-double/planner-element.js +2 -2
- package/lib/catalog/holes/door-sliding/planner-element.js +2 -2
- package/lib/catalog/holes/doorway-framed/planner-element.js +2 -2
- package/lib/catalog/holes/doorway-frameless/planner-element.js +2 -2
- package/lib/catalog/holes/export.js +2 -2
- package/lib/catalog/holes/window-clear/planner-element.js +2 -2
- package/lib/catalog/holes/window-cross/planner-element.js +2 -2
- package/lib/catalog/holes/window-double-hung/planner-element.js +2 -2
- package/lib/catalog/holes/window-vertical/planner-element.js +2 -2
- package/lib/catalog/lines/wall/planner-element.js +1 -1
- package/lib/catalog/molding/molding-dcm/planner-element.js +2 -2
- package/lib/catalog/molding/molding-fbm/planner-element.js +2 -2
- package/lib/catalog/molding/molding-lrm/planner-element.js +2 -2
- package/lib/catalog/properties/export.js +1 -1
- package/lib/catalog/properties/property-checkbox.js +3 -6
- package/lib/catalog/properties/property-color.js +1 -1
- package/lib/catalog/properties/property-enum.js +4 -9
- package/lib/catalog/properties/property-hidden.js +1 -1
- package/lib/catalog/properties/property-lenght-measure.js +5 -6
- package/lib/catalog/properties/property-length-measure.js +7 -13
- package/lib/catalog/properties/property-length-measure_hole.js +5 -6
- package/lib/catalog/properties/property-number.js +1 -1
- package/lib/catalog/properties/property-read-only.js +1 -1
- package/lib/catalog/properties/property-string.js +1 -1
- package/lib/catalog/properties/property-toggle.js +1 -1
- package/lib/catalog/utils/FuseUtils.js +8 -10
- package/lib/catalog/utils/exporter.js +3 -5
- package/lib/catalog/utils/geom-utils.js +1 -1
- package/lib/catalog/utils/item-loader.js +9 -14
- package/lib/class/FuseUtils.js +8 -10
- package/lib/class/area.js +7 -10
- package/lib/class/export.js +1 -1
- package/lib/class/group.js +11 -19
- package/lib/class/guide.js +9 -12
- package/lib/class/hole.js +5 -8
- package/lib/class/item.js +10 -18
- package/lib/class/layer.js +5 -8
- package/lib/class/line.js +12 -19
- package/lib/class/project.js +8 -10
- package/lib/class/vertex.js +7 -10
- package/lib/components/content.js +2 -2
- package/lib/components/disclaimer/disclaimer.js +1 -1
- package/lib/components/export.js +1 -1
- package/lib/components/style/button.js +15 -21
- package/lib/components/style/cancel-button.js +5 -6
- package/lib/components/style/content-container.js +3 -6
- package/lib/components/style/content-title.js +8 -11
- package/lib/components/style/delete-button.js +6 -7
- package/lib/components/style/export.js +1 -1
- package/lib/components/style/form-block.js +7 -11
- package/lib/components/style/form-color-input.js +5 -6
- package/lib/components/style/form-label.js +7 -11
- package/lib/components/style/form-number-input.js +13 -18
- package/lib/components/style/form-number-input_2.js +13 -18
- package/lib/components/style/form-select.js +10 -19
- package/lib/components/style/form-slider.js +5 -6
- package/lib/components/style/form-submit-button.js +6 -7
- package/lib/components/style/form-text-input.js +17 -22
- package/lib/components/viewer2d/area.js +1 -1
- package/lib/components/viewer2d/export.js +1 -1
- package/lib/components/viewer2d/grids/grid-horizontal-streak.js +1 -1
- package/lib/components/viewer2d/grids/grid-streak.js +1 -1
- package/lib/components/viewer2d/grids/grid-vertical-streak.js +1 -1
- package/lib/components/viewer2d/grids/grids.js +4 -9
- package/lib/components/viewer2d/group.js +2 -2
- package/lib/components/viewer2d/item.js +5 -10
- package/lib/components/viewer2d/layer.js +1 -1
- package/lib/components/viewer2d/line.js +2 -2
- package/lib/components/viewer2d/ruler.js +1 -1
- package/lib/components/viewer2d/rulerDist.js +1 -1
- package/lib/components/viewer2d/rulerX.js +13 -18
- package/lib/components/viewer2d/rulerY.js +13 -18
- package/lib/components/viewer2d/scene.js +21 -32
- package/lib/components/viewer2d/snap.js +2 -2
- package/lib/components/viewer2d/state.js +5 -10
- package/lib/components/viewer2d/utils.js +5 -9
- package/lib/components/viewer2d/vertex.js +2 -2
- package/lib/components/viewer2d/viewer2d.js +13 -23
- package/lib/components/viewer3d/camera-controls-module/camera-controls.module.js +14 -20
- package/lib/components/viewer3d/front3D.js +4 -9
- package/lib/components/viewer3d/grid-creator.js +2 -2
- package/lib/components/viewer3d/grids/grid-horizontal-streak.js +1 -1
- package/lib/components/viewer3d/grids/grid-streak.js +1 -1
- package/lib/components/viewer3d/grids/grid-vertical-streak.js +1 -1
- package/lib/components/viewer3d/pointer-lock-navigation.js +1 -1
- package/lib/components/viewer3d/ruler-utils/itemRect.js +1 -1
- package/lib/components/viewer3d/ruler-utils/layer3D.js +1 -1
- package/lib/components/viewer3d/ruler-utils/ruler3D.js +3 -6
- package/lib/components/viewer3d/ruler-utils/scene3D.js +1 -1
- package/lib/components/viewer3d/ruler-utils/state3D.js +1 -1
- package/lib/components/viewer3d/scene-creator.js +16 -21
- package/lib/components/viewer3d/three-memory-cleaner.js +1 -1
- package/lib/components/viewer3d/viewer3d-first-person.js +11 -16
- package/lib/components/viewer3d/viewer3d.js +15 -20
- package/lib/index.js +1 -1
- package/lib/models.js +51 -56
- package/lib/plugins/console-debugger.js +3 -6
- package/lib/plugins/export.js +1 -1
- package/lib/reducers/export.js +1 -1
- package/lib/styles/export.js +1 -1
- package/lib/translator/translator.js +5 -9
- package/lib/utils/export.js +2 -2
- package/lib/utils/geometry.js +11 -18
- package/lib/utils/graph-inner-cycles.js +1 -1
- package/lib/utils/graph.js +7 -10
- package/lib/utils/helper.js +7 -7
- package/lib/utils/history.js +1 -1
- package/lib/utils/id-broker.js +5 -8
- package/lib/utils/molding.js +14 -19
- package/lib/utils/name-generator.js +5 -8
- package/lib/utils/objects-utils.js +5 -3
- package/lib/utils/process-black-list.js +3 -5
- package/lib/utils/react-if.js +1 -1
- package/lib/utils/snap-scene.js +3 -7
- package/lib/utils/snap.js +22 -26
- package/lib/utils/threeCSG.es6.js +14 -14
- package/package.json +24 -18
|
@@ -1,18 +1,20 @@
|
|
|
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["default"] = void 0;
|
|
8
|
+
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
9
|
+
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
10
|
+
var NameGenerator = exports["default"] = /*#__PURE__*/function () {
|
|
8
11
|
function NameGenerator() {
|
|
9
|
-
|
|
12
|
+
(0, _classCallCheck2["default"])(this, NameGenerator);
|
|
10
13
|
}
|
|
11
|
-
return
|
|
14
|
+
return (0, _createClass2["default"])(NameGenerator, null, [{
|
|
12
15
|
key: "generateName",
|
|
13
16
|
value: function generateName(prototype, type) {
|
|
14
17
|
return type.substr(0, 1).toUpperCase() + type.substr(1);
|
|
15
18
|
}
|
|
16
19
|
}]);
|
|
17
|
-
}();
|
|
18
|
-
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/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,10 +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/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
|
-
|
|
5
|
-
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
6
|
-
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
7
|
-
export var buildCurrentCabinetObject = function buildCurrentCabinetObject(cabinet, texture) {
|
|
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) {
|
|
8
12
|
return {
|
|
9
13
|
type: cabinet.name,
|
|
10
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,15 +1,17 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
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/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();
|
|
13
15
|
var width = scene.width,
|
|
14
16
|
height = scene.height;
|
|
15
17
|
var a, b, c;
|
|
@@ -21,36 +23,36 @@ export function sceneSnapElements(scene) {
|
|
|
21
23
|
var vertexID = _ref.id,
|
|
22
24
|
x = _ref.x,
|
|
23
25
|
y = _ref.y;
|
|
24
|
-
if (snapMask.get(SNAP_POINT)) {
|
|
25
|
-
addPointSnap(snapElements, x, y, 10, 10, vertexID);
|
|
26
|
+
if (snapMask.get(_snap.SNAP_POINT)) {
|
|
27
|
+
(0, _snap.addPointSnap)(snapElements, x, y, 10, 10, vertexID);
|
|
26
28
|
}
|
|
27
|
-
if (snapMask.get(SNAP_LINE)) {
|
|
28
|
-
var _GeometryUtils$horizo = GeometryUtils.horizontalLine(y);
|
|
29
|
+
if (snapMask.get(_snap.SNAP_LINE)) {
|
|
30
|
+
var _GeometryUtils$horizo = _export.GeometryUtils.horizontalLine(y);
|
|
29
31
|
a = _GeometryUtils$horizo.a;
|
|
30
32
|
b = _GeometryUtils$horizo.b;
|
|
31
33
|
c = _GeometryUtils$horizo.c;
|
|
32
|
-
addLineSnap(snapElements, a, b, c, 10, 1, vertexID);
|
|
33
|
-
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);
|
|
34
36
|
a = _GeometryUtils$vertic.a;
|
|
35
37
|
b = _GeometryUtils$vertic.b;
|
|
36
38
|
c = _GeometryUtils$vertic.c;
|
|
37
|
-
addLineSnap(snapElements, a, b, c, 10, 1, vertexID);
|
|
38
|
-
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);
|
|
39
41
|
a = _GeometryUtils$upcros.a;
|
|
40
42
|
b = _GeometryUtils$upcros.b;
|
|
41
43
|
c = _GeometryUtils$upcros.c;
|
|
42
|
-
addLineSnap(snapElements, a, b, c, 10, 3, null);
|
|
43
|
-
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);
|
|
44
46
|
a = _GeometryUtils$downcr.a;
|
|
45
47
|
b = _GeometryUtils$downcr.b;
|
|
46
48
|
c = _GeometryUtils$downcr.c;
|
|
47
|
-
addLineSnap(snapElements, a, b, c, 10, 3, null);
|
|
49
|
+
(0, _snap.addLineSnap)(snapElements, a, b, c, 10, 3, null);
|
|
48
50
|
}
|
|
49
51
|
});
|
|
50
|
-
if (snapMask.get(SNAP_SEGMENT)) {
|
|
52
|
+
if (snapMask.get(_snap.SNAP_SEGMENT)) {
|
|
51
53
|
lines.forEach(function (_ref2) {
|
|
52
54
|
var lineID = _ref2.id,
|
|
53
|
-
_ref2$vertices =
|
|
55
|
+
_ref2$vertices = (0, _slicedToArray2["default"])(_ref2.vertices, 2),
|
|
54
56
|
v0 = _ref2$vertices[0],
|
|
55
57
|
v1 = _ref2$vertices[1];
|
|
56
58
|
var _vertices$get = vertices.get(v0),
|
|
@@ -59,11 +61,11 @@ export function sceneSnapElements(scene) {
|
|
|
59
61
|
var _vertices$get2 = vertices.get(v1),
|
|
60
62
|
x2 = _vertices$get2.x,
|
|
61
63
|
y2 = _vertices$get2.y;
|
|
62
|
-
addLineSegmentSnap(snapElements, x1, y1, x2, y2, 20, 1, lineID);
|
|
64
|
+
(0, _snap.addLineSegmentSnap)(snapElements, x1, y1, x2, y2, 20, 1, lineID);
|
|
63
65
|
});
|
|
64
66
|
}
|
|
65
67
|
});
|
|
66
|
-
if (snapMask.get(SNAP_GRID)) {
|
|
68
|
+
if (snapMask.get(_snap.SNAP_GRID)) {
|
|
67
69
|
var divider = 5;
|
|
68
70
|
var gridCellSize = 100 / divider;
|
|
69
71
|
var xCycle = width / gridCellSize;
|
|
@@ -74,25 +76,25 @@ export function sceneSnapElements(scene) {
|
|
|
74
76
|
var yMul = y * gridCellSize;
|
|
75
77
|
var onXCross = !(x % divider) ? true : false;
|
|
76
78
|
var onYCross = !(y % divider) ? true : false;
|
|
77
|
-
addGridSnap(snapElements, xMul, yMul, 10, onXCross && onYCross ? 15 : 10, null);
|
|
79
|
+
(0, _snap.addGridSnap)(snapElements, xMul, yMul, 10, onXCross && onYCross ? 15 : 10, null);
|
|
78
80
|
}
|
|
79
81
|
}
|
|
80
82
|
}
|
|
81
|
-
if (snapMask.get(SNAP_GUIDE)) {
|
|
83
|
+
if (snapMask.get(_snap.SNAP_GUIDE)) {
|
|
82
84
|
var horizontal = scene.getIn(['guides', 'horizontal']);
|
|
83
85
|
var vertical = scene.getIn(['guides', 'vertical']);
|
|
84
86
|
var hValues = horizontal.valueSeq();
|
|
85
87
|
var vValues = vertical.valueSeq();
|
|
86
88
|
hValues.forEach(function (hVal) {
|
|
87
89
|
vValues.forEach(function (vVal) {
|
|
88
|
-
addPointSnap(snapElements, vVal, hVal, 10, 10);
|
|
90
|
+
(0, _snap.addPointSnap)(snapElements, vVal, hVal, 10, 10);
|
|
89
91
|
});
|
|
90
92
|
});
|
|
91
93
|
hValues.forEach(function (hVal) {
|
|
92
|
-
return addLineSegmentSnap(snapElements, 0, hVal, width, hVal, 20, 1);
|
|
94
|
+
return (0, _snap.addLineSegmentSnap)(snapElements, 0, hVal, width, hVal, 20, 1);
|
|
93
95
|
});
|
|
94
96
|
vValues.forEach(function (vVal) {
|
|
95
|
-
return addLineSegmentSnap(snapElements, vVal, 0, vVal, height, 20, 1);
|
|
97
|
+
return (0, _snap.addLineSegmentSnap)(snapElements, vVal, 0, vVal, height, 20, 1);
|
|
96
98
|
});
|
|
97
99
|
}
|
|
98
100
|
});
|
package/es/utils/snap.js
CHANGED
|
@@ -1,27 +1,35 @@
|
|
|
1
|
-
|
|
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/defineProperty"));
|
|
15
|
+
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
16
|
+
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
17
|
+
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
|
|
18
|
+
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
19
|
+
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/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); }
|
|
2
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; }
|
|
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
|
-
function
|
|
5
|
-
function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
|
|
6
|
-
function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }
|
|
7
|
-
function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
|
|
8
|
-
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
9
|
-
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
10
|
-
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
11
|
-
function _possibleConstructorReturn(t, e) { if (e && ("object" == _typeof(e) || "function" == typeof e)) return e; if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined"); return _assertThisInitialized(t); }
|
|
12
|
-
function _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e; }
|
|
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)); }
|
|
13
26
|
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
export var SNAP_LINE = 'SNAP_LINE';
|
|
21
|
-
export var SNAP_SEGMENT = 'SNAP_SEGMENT';
|
|
22
|
-
export var SNAP_GRID = 'SNAP_GRID';
|
|
23
|
-
export var SNAP_GUIDE = 'SNAP_GUIDE';
|
|
24
|
-
export var SNAP_MASK = new Map({
|
|
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({
|
|
25
33
|
SNAP_POINT: true,
|
|
26
34
|
SNAP_LINE: true,
|
|
27
35
|
SNAP_SEGMENT: true,
|
|
@@ -30,11 +38,11 @@ export var SNAP_MASK = new Map({
|
|
|
30
38
|
});
|
|
31
39
|
var PointSnap = /*#__PURE__*/function (_Record) {
|
|
32
40
|
function PointSnap() {
|
|
33
|
-
|
|
41
|
+
(0, _classCallCheck2["default"])(this, PointSnap);
|
|
34
42
|
return _callSuper(this, PointSnap, arguments);
|
|
35
43
|
}
|
|
36
|
-
|
|
37
|
-
return
|
|
44
|
+
(0, _inherits2["default"])(PointSnap, _Record);
|
|
45
|
+
return (0, _createClass2["default"])(PointSnap, [{
|
|
38
46
|
key: "nearestPoint",
|
|
39
47
|
value: function nearestPoint(x, y) {
|
|
40
48
|
return {
|
|
@@ -49,21 +57,21 @@ var PointSnap = /*#__PURE__*/function (_Record) {
|
|
|
49
57
|
return ~(this.x - x) + 1 < distance && ~(this.y - y) + 1 < distance;
|
|
50
58
|
}
|
|
51
59
|
}]);
|
|
52
|
-
}(Record({
|
|
60
|
+
}((0, _immutable.Record)({
|
|
53
61
|
type: 'point',
|
|
54
62
|
x: -1,
|
|
55
63
|
y: -1,
|
|
56
64
|
radius: 1,
|
|
57
65
|
priority: 1,
|
|
58
|
-
related: new List()
|
|
66
|
+
related: new _immutable.List()
|
|
59
67
|
}));
|
|
60
68
|
var LineSnap = /*#__PURE__*/function (_Record2) {
|
|
61
69
|
function LineSnap() {
|
|
62
|
-
|
|
70
|
+
(0, _classCallCheck2["default"])(this, LineSnap);
|
|
63
71
|
return _callSuper(this, LineSnap, arguments);
|
|
64
72
|
}
|
|
65
|
-
|
|
66
|
-
return
|
|
73
|
+
(0, _inherits2["default"])(LineSnap, _Record2);
|
|
74
|
+
return (0, _createClass2["default"])(LineSnap, [{
|
|
67
75
|
key: "nearestPoint",
|
|
68
76
|
value: function nearestPoint(x, y) {
|
|
69
77
|
return _objectSpread(_objectSpread({}, Geometry.closestPointFromLine(this.a, this.b, this.c, x, y)), {}, {
|
|
@@ -76,22 +84,22 @@ var LineSnap = /*#__PURE__*/function (_Record2) {
|
|
|
76
84
|
return true;
|
|
77
85
|
}
|
|
78
86
|
}]);
|
|
79
|
-
}(Record({
|
|
87
|
+
}((0, _immutable.Record)({
|
|
80
88
|
type: 'line',
|
|
81
89
|
a: -1,
|
|
82
90
|
b: -1,
|
|
83
91
|
c: -1,
|
|
84
92
|
radius: 1,
|
|
85
93
|
priority: 1,
|
|
86
|
-
related: new List()
|
|
94
|
+
related: new _immutable.List()
|
|
87
95
|
}));
|
|
88
96
|
var LineSegmentSnap = /*#__PURE__*/function (_Record3) {
|
|
89
97
|
function LineSegmentSnap() {
|
|
90
|
-
|
|
98
|
+
(0, _classCallCheck2["default"])(this, LineSegmentSnap);
|
|
91
99
|
return _callSuper(this, LineSegmentSnap, arguments);
|
|
92
100
|
}
|
|
93
|
-
|
|
94
|
-
return
|
|
101
|
+
(0, _inherits2["default"])(LineSegmentSnap, _Record3);
|
|
102
|
+
return (0, _createClass2["default"])(LineSegmentSnap, [{
|
|
95
103
|
key: "nearestPoint",
|
|
96
104
|
value: function nearestPoint(x, y) {
|
|
97
105
|
return _objectSpread(_objectSpread({}, Geometry.closestPointFromLineSegment(this.x1, this.y1, this.x2, this.y2, x, y)), {}, {
|
|
@@ -110,7 +118,7 @@ var LineSegmentSnap = /*#__PURE__*/function (_Record3) {
|
|
|
110
118
|
return true;
|
|
111
119
|
}
|
|
112
120
|
}]);
|
|
113
|
-
}(Record({
|
|
121
|
+
}((0, _immutable.Record)({
|
|
114
122
|
type: 'line-segment',
|
|
115
123
|
x1: -1,
|
|
116
124
|
y1: -1,
|
|
@@ -118,15 +126,15 @@ var LineSegmentSnap = /*#__PURE__*/function (_Record3) {
|
|
|
118
126
|
y2: -1,
|
|
119
127
|
radius: 1,
|
|
120
128
|
priority: 1,
|
|
121
|
-
related: new List()
|
|
129
|
+
related: new _immutable.List()
|
|
122
130
|
}));
|
|
123
131
|
var GridSnap = /*#__PURE__*/function (_Record4) {
|
|
124
132
|
function GridSnap() {
|
|
125
|
-
|
|
133
|
+
(0, _classCallCheck2["default"])(this, GridSnap);
|
|
126
134
|
return _callSuper(this, GridSnap, arguments);
|
|
127
135
|
}
|
|
128
|
-
|
|
129
|
-
return
|
|
136
|
+
(0, _inherits2["default"])(GridSnap, _Record4);
|
|
137
|
+
return (0, _createClass2["default"])(GridSnap, [{
|
|
130
138
|
key: "nearestPoint",
|
|
131
139
|
value: function nearestPoint(x, y) {
|
|
132
140
|
return {
|
|
@@ -141,15 +149,15 @@ var GridSnap = /*#__PURE__*/function (_Record4) {
|
|
|
141
149
|
return ~(this.x - x) + 1 < distance && ~(this.y - y) + 1 < distance;
|
|
142
150
|
}
|
|
143
151
|
}]);
|
|
144
|
-
}(Record({
|
|
152
|
+
}((0, _immutable.Record)({
|
|
145
153
|
type: 'grid',
|
|
146
154
|
x: -1,
|
|
147
155
|
y: -1,
|
|
148
156
|
radius: 1,
|
|
149
157
|
priority: 1,
|
|
150
|
-
related: new List()
|
|
158
|
+
related: new _immutable.List()
|
|
151
159
|
}));
|
|
152
|
-
|
|
160
|
+
function nearestSnap(snapElements, x, y, snapMask) {
|
|
153
161
|
var filter = {
|
|
154
162
|
point: snapMask.get(SNAP_POINT),
|
|
155
163
|
line: snapMask.get(SNAP_LINE),
|
|
@@ -175,8 +183,8 @@ export function nearestSnap(snapElements, x, y, snapMask) {
|
|
|
175
183
|
return p1 === p2 ? d1 < d2 ? -1 : 1 : p1 > p2 ? -1 : 1;
|
|
176
184
|
});
|
|
177
185
|
}
|
|
178
|
-
|
|
179
|
-
related = new List([related]);
|
|
186
|
+
function addPointSnap(snapElements, x, y, radius, priority, related) {
|
|
187
|
+
related = new _immutable.List([related]);
|
|
180
188
|
return snapElements.push(new PointSnap({
|
|
181
189
|
x: x,
|
|
182
190
|
y: y,
|
|
@@ -185,8 +193,8 @@ export function addPointSnap(snapElements, x, y, radius, priority, related) {
|
|
|
185
193
|
related: related
|
|
186
194
|
}));
|
|
187
195
|
}
|
|
188
|
-
|
|
189
|
-
related = new List([related]);
|
|
196
|
+
function addLineSnap(snapElements, a, b, c, radius, priority, related) {
|
|
197
|
+
related = new _immutable.List([related]);
|
|
190
198
|
return snapElements.withMutations(function (snapElements) {
|
|
191
199
|
var alreadyPresent = snapElements.some(function (lineSnap) {
|
|
192
200
|
return lineSnap.type === 'line' && a === lineSnap.a && b === lineSnap.b && c === lineSnap.c;
|
|
@@ -213,8 +221,8 @@ export function addLineSnap(snapElements, a, b, c, radius, priority, related) {
|
|
|
213
221
|
}));
|
|
214
222
|
});
|
|
215
223
|
}
|
|
216
|
-
|
|
217
|
-
related = new List([related]);
|
|
224
|
+
function addLineSegmentSnap(snapElements, x1, y1, x2, y2, radius, priority, related) {
|
|
225
|
+
related = new _immutable.List([related]);
|
|
218
226
|
return snapElements.push(new LineSegmentSnap({
|
|
219
227
|
x1: x1,
|
|
220
228
|
y1: y1,
|
|
@@ -225,8 +233,8 @@ export function addLineSegmentSnap(snapElements, x1, y1, x2, y2, radius, priorit
|
|
|
225
233
|
related: related
|
|
226
234
|
}));
|
|
227
235
|
}
|
|
228
|
-
|
|
229
|
-
related = new List([related]);
|
|
236
|
+
function addGridSnap(snapElements, x, y, radius, priority, related) {
|
|
237
|
+
related = new _immutable.List([related]);
|
|
230
238
|
return snapElements.push(new GridSnap({
|
|
231
239
|
x: x,
|
|
232
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,19 +1,25 @@
|
|
|
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["default"] = void 0;
|
|
9
|
+
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
10
|
+
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/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); }
|
|
7
13
|
/*jshint esversion: 6 */
|
|
8
|
-
|
|
14
|
+
|
|
9
15
|
var EPSILON = 1e-5,
|
|
10
16
|
COPLANAR = 0,
|
|
11
17
|
FRONT = 1,
|
|
12
18
|
BACK = 2,
|
|
13
19
|
SPANNING = 3;
|
|
14
|
-
var ThreeBSP = /*#__PURE__*/function () {
|
|
20
|
+
var ThreeBSP = exports["default"] = /*#__PURE__*/function () {
|
|
15
21
|
function ThreeBSP(geometry) {
|
|
16
|
-
|
|
22
|
+
(0, _classCallCheck2["default"])(this, ThreeBSP);
|
|
17
23
|
// Convert THREE.Geometry to ThreeBSP
|
|
18
24
|
var i,
|
|
19
25
|
_length_i,
|
|
@@ -62,7 +68,7 @@ var ThreeBSP = /*#__PURE__*/function () {
|
|
|
62
68
|
}
|
|
63
69
|
this.tree = new Node(polygons);
|
|
64
70
|
}
|
|
65
|
-
return
|
|
71
|
+
return (0, _createClass2["default"])(ThreeBSP, [{
|
|
66
72
|
key: "subtract",
|
|
67
73
|
value: function subtract(other_tree) {
|
|
68
74
|
var a = this.tree.clone(),
|
|
@@ -157,10 +163,9 @@ var ThreeBSP = /*#__PURE__*/function () {
|
|
|
157
163
|
}
|
|
158
164
|
}]);
|
|
159
165
|
}();
|
|
160
|
-
export { ThreeBSP as default };
|
|
161
166
|
var Polygon = /*#__PURE__*/function () {
|
|
162
167
|
function Polygon(vertices, normal, w) {
|
|
163
|
-
|
|
168
|
+
(0, _classCallCheck2["default"])(this, Polygon);
|
|
164
169
|
if (!(vertices instanceof Array)) {
|
|
165
170
|
vertices = [];
|
|
166
171
|
}
|
|
@@ -171,7 +176,7 @@ var Polygon = /*#__PURE__*/function () {
|
|
|
171
176
|
this.normal = this.w = undefined;
|
|
172
177
|
}
|
|
173
178
|
}
|
|
174
|
-
return
|
|
179
|
+
return (0, _createClass2["default"])(Polygon, [{
|
|
175
180
|
key: "calculateProperties",
|
|
176
181
|
value: function calculateProperties() {
|
|
177
182
|
var a = this.vertices[0],
|
|
@@ -291,14 +296,14 @@ var Polygon = /*#__PURE__*/function () {
|
|
|
291
296
|
}();
|
|
292
297
|
var Vertex = /*#__PURE__*/function () {
|
|
293
298
|
function Vertex(x, y, z, normal, uv) {
|
|
294
|
-
|
|
299
|
+
(0, _classCallCheck2["default"])(this, Vertex);
|
|
295
300
|
this.x = x;
|
|
296
301
|
this.y = y;
|
|
297
302
|
this.z = z;
|
|
298
303
|
this.normal = normal || new THREE.Vector3();
|
|
299
304
|
this.uv = uv || new THREE.Vector2();
|
|
300
305
|
}
|
|
301
|
-
return
|
|
306
|
+
return (0, _createClass2["default"])(Vertex, [{
|
|
302
307
|
key: "clone",
|
|
303
308
|
value: function clone() {
|
|
304
309
|
return new Vertex(this.x, this.y, this.z, this.normal.clone(), this.uv.clone());
|
|
@@ -383,7 +388,7 @@ var Vertex = /*#__PURE__*/function () {
|
|
|
383
388
|
}();
|
|
384
389
|
var Node = /*#__PURE__*/function () {
|
|
385
390
|
function Node(polygons) {
|
|
386
|
-
|
|
391
|
+
(0, _classCallCheck2["default"])(this, Node);
|
|
387
392
|
var i,
|
|
388
393
|
polygon_count,
|
|
389
394
|
front = [],
|
|
@@ -402,7 +407,7 @@ var Node = /*#__PURE__*/function () {
|
|
|
402
407
|
this.back = new Node(back);
|
|
403
408
|
}
|
|
404
409
|
}
|
|
405
|
-
return
|
|
410
|
+
return (0, _createClass2["default"])(Node, [{
|
|
406
411
|
key: "isConvex",
|
|
407
412
|
value: function isConvex(polygons) {
|
|
408
413
|
var i, j;
|
package/es/version.js
CHANGED