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