@threekit-tools/treble 0.0.95-next-01 → 0.0.96
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/dist/Treble/Treble.d.ts +2 -2
- package/dist/Treble/Treble.js +2 -2
- package/dist/Treble/index.d.ts +1 -1
- package/dist/Treble/index.js +1 -1
- package/dist/hooks/useNestedConfigurator/index.js +2 -1
- package/dist/hooks/useRoomBuilder/RoomBuilderState.d.ts +95 -0
- package/dist/hooks/useRoomBuilder/RoomBuilderState.js +1237 -0
- package/dist/hooks/useRoomBuilder/constants.d.ts +41 -0
- package/dist/hooks/useRoomBuilder/constants.js +48 -0
- package/dist/hooks/useRoomBuilder/dataHandlers.d.ts +18 -0
- package/dist/hooks/useRoomBuilder/dataHandlers.js +187 -0
- package/dist/hooks/useRoomBuilder/draw.d.ts +55 -0
- package/dist/hooks/useRoomBuilder/draw.js +573 -0
- package/dist/hooks/useRoomBuilder/findLoops.d.ts +5 -0
- package/dist/hooks/{useSpaces/geometry → useRoomBuilder}/findLoops.js +13 -31
- package/dist/hooks/useRoomBuilder/geometry.d.ts +33 -0
- package/dist/hooks/useRoomBuilder/geometry.js +325 -0
- package/dist/hooks/useRoomBuilder/index.d.ts +40 -0
- package/dist/hooks/useRoomBuilder/index.js +303 -0
- package/dist/hooks/{useSpaces/validators → useRoomBuilder}/messaging.js +1 -1
- package/dist/hooks/{useSpaces/themes/index.d.ts → useRoomBuilder/themes.d.ts} +4 -3
- package/dist/hooks/useRoomBuilder/themes.js +273 -0
- package/dist/hooks/useRoomBuilder/types.d.ts +238 -0
- package/dist/hooks/{useSpaces → useRoomBuilder}/types.js +1 -19
- package/dist/hooks/useRoomBuilder/validators.d.ts +36 -0
- package/dist/hooks/useRoomBuilder/validators.js +362 -0
- package/dist/icons/Draw.js +3 -3
- package/dist/icons/Window.js +4 -4
- package/dist/icons/index.js +0 -28
- package/dist/icons/types.d.ts +1 -1
- package/dist/index.d.ts +2 -17
- package/dist/index.js +5 -35
- package/dist/store/attributes.d.ts +0 -1
- package/dist/store/index.d.ts +0 -10
- package/dist/store/index.js +1 -3
- package/dist/store/product.js +7 -4
- package/dist/store/treble.d.ts +1 -1
- package/dist/store/treble.js +21 -14
- package/dist/types.d.ts +1 -3
- package/package.json +1 -1
- package/dist/hooks/useSpaces/SpacesLayout.d.ts +0 -11
- package/dist/hooks/useSpaces/SpacesLayout.js +0 -74
- package/dist/hooks/useSpaces/SpacesState.d.ts +0 -177
- package/dist/hooks/useSpaces/SpacesState.js +0 -1816
- package/dist/hooks/useSpaces/constants.d.ts +0 -79
- package/dist/hooks/useSpaces/constants.js +0 -130
- package/dist/hooks/useSpaces/dataHandlers.d.ts +0 -38
- package/dist/hooks/useSpaces/dataHandlers.js +0 -411
- package/dist/hooks/useSpaces/draw/clearCanvas.d.ts +0 -2
- package/dist/hooks/useSpaces/draw/clearCanvas.js +0 -9
- package/dist/hooks/useSpaces/draw/drawBackground.d.ts +0 -2
- package/dist/hooks/useSpaces/draw/drawBackground.js +0 -12
- package/dist/hooks/useSpaces/draw/drawDimensions.d.ts +0 -3
- package/dist/hooks/useSpaces/draw/drawDimensions.js +0 -53
- package/dist/hooks/useSpaces/draw/drawDoors.d.ts +0 -9
- package/dist/hooks/useSpaces/draw/drawDoors.js +0 -99
- package/dist/hooks/useSpaces/draw/drawFloor.d.ts +0 -3
- package/dist/hooks/useSpaces/draw/drawFloor.js +0 -36
- package/dist/hooks/useSpaces/draw/drawGrid.d.ts +0 -3
- package/dist/hooks/useSpaces/draw/drawGrid.js +0 -36
- package/dist/hooks/useSpaces/draw/drawGuides.d.ts +0 -3
- package/dist/hooks/useSpaces/draw/drawGuides.js +0 -23
- package/dist/hooks/useSpaces/draw/drawOpenings.d.ts +0 -9
- package/dist/hooks/useSpaces/draw/drawOpenings.js +0 -72
- package/dist/hooks/useSpaces/draw/drawVertices.d.ts +0 -8
- package/dist/hooks/useSpaces/draw/drawVertices.js +0 -61
- package/dist/hooks/useSpaces/draw/drawWalls.d.ts +0 -11
- package/dist/hooks/useSpaces/draw/drawWalls.js +0 -90
- package/dist/hooks/useSpaces/draw/drawWindows.d.ts +0 -9
- package/dist/hooks/useSpaces/draw/drawWindows.js +0 -82
- package/dist/hooks/useSpaces/draw/index.d.ts +0 -11
- package/dist/hooks/useSpaces/draw/index.js +0 -129
- package/dist/hooks/useSpaces/geometry/addThicknessToLine.d.ts +0 -3
- package/dist/hooks/useSpaces/geometry/addThicknessToLine.js +0 -13
- package/dist/hooks/useSpaces/geometry/areLinesEqual.d.ts +0 -3
- package/dist/hooks/useSpaces/geometry/areLinesEqual.js +0 -17
- package/dist/hooks/useSpaces/geometry/arePointsEqual.d.ts +0 -3
- package/dist/hooks/useSpaces/geometry/arePointsEqual.js +0 -8
- package/dist/hooks/useSpaces/geometry/arePointsWithinProximity.d.ts +0 -3
- package/dist/hooks/useSpaces/geometry/arePointsWithinProximity.js +0 -11
- package/dist/hooks/useSpaces/geometry/closestPointOnLine.d.ts +0 -3
- package/dist/hooks/useSpaces/geometry/closestPointOnLine.js +0 -13
- package/dist/hooks/useSpaces/geometry/doLinesOverlap.d.ts +0 -2
- package/dist/hooks/useSpaces/geometry/doLinesOverlap.js +0 -16
- package/dist/hooks/useSpaces/geometry/euclideanMod.d.ts +0 -2
- package/dist/hooks/useSpaces/geometry/euclideanMod.js +0 -6
- package/dist/hooks/useSpaces/geometry/findLoops.d.ts +0 -6
- package/dist/hooks/useSpaces/geometry/getAllLineIntersections.d.ts +0 -6
- package/dist/hooks/useSpaces/geometry/getAllLineIntersections.js +0 -23
- package/dist/hooks/useSpaces/geometry/getAngleOfLineSegment.d.ts +0 -3
- package/dist/hooks/useSpaces/geometry/getAngleOfLineSegment.js +0 -7
- package/dist/hooks/useSpaces/geometry/getClosestPointOnLineSegment.d.ts +0 -3
- package/dist/hooks/useSpaces/geometry/getClosestPointOnLineSegment.js +0 -17
- package/dist/hooks/useSpaces/geometry/getDistanceToLine.d.ts +0 -3
- package/dist/hooks/useSpaces/geometry/getDistanceToLine.js +0 -10
- package/dist/hooks/useSpaces/geometry/getLengthOfLineSegment.d.ts +0 -3
- package/dist/hooks/useSpaces/geometry/getLengthOfLineSegment.js +0 -7
- package/dist/hooks/useSpaces/geometry/getLineAtOffsetOnLineSegment.d.ts +0 -3
- package/dist/hooks/useSpaces/geometry/getLineAtOffsetOnLineSegment.js +0 -17
- package/dist/hooks/useSpaces/geometry/getLineOtherPoint.d.ts +0 -3
- package/dist/hooks/useSpaces/geometry/getLineOtherPoint.js +0 -11
- package/dist/hooks/useSpaces/geometry/getLineSegmentsIntersection.d.ts +0 -3
- package/dist/hooks/useSpaces/geometry/getLineSegmentsIntersection.js +0 -43
- package/dist/hooks/useSpaces/geometry/getMidpointOfLineSegment.d.ts +0 -3
- package/dist/hooks/useSpaces/geometry/getMidpointOfLineSegment.js +0 -9
- package/dist/hooks/useSpaces/geometry/getParallelLineSegmentAtDistance.d.ts +0 -3
- package/dist/hooks/useSpaces/geometry/getParallelLineSegmentAtDistance.js +0 -20
- package/dist/hooks/useSpaces/geometry/getPointAtOffsetOnLineSegment.d.ts +0 -3
- package/dist/hooks/useSpaces/geometry/getPointAtOffsetOnLineSegment.js +0 -11
- package/dist/hooks/useSpaces/geometry/getPolygonArea.d.ts +0 -3
- package/dist/hooks/useSpaces/geometry/getPolygonArea.js +0 -15
- package/dist/hooks/useSpaces/geometry/getQuadrilateralArea.d.ts +0 -3
- package/dist/hooks/useSpaces/geometry/getQuadrilateralArea.js +0 -16
- package/dist/hooks/useSpaces/geometry/getTangetIntersectionAndOffset.d.ts +0 -6
- package/dist/hooks/useSpaces/geometry/getTangetIntersectionAndOffset.js +0 -17
- package/dist/hooks/useSpaces/geometry/getTriangleArea.d.ts +0 -3
- package/dist/hooks/useSpaces/geometry/getTriangleArea.js +0 -9
- package/dist/hooks/useSpaces/geometry/getUnitVectorOfLineSegment.d.ts +0 -3
- package/dist/hooks/useSpaces/geometry/getUnitVectorOfLineSegment.js +0 -12
- package/dist/hooks/useSpaces/geometry/index.d.ts +0 -30
- package/dist/hooks/useSpaces/geometry/index.js +0 -64
- package/dist/hooks/useSpaces/geometry/isPointInPolygon.d.ts +0 -3
- package/dist/hooks/useSpaces/geometry/isPointInPolygon.js +0 -21
- package/dist/hooks/useSpaces/geometry/isPointInQuadrilateral.d.ts +0 -3
- package/dist/hooks/useSpaces/geometry/isPointInQuadrilateral.js +0 -25
- package/dist/hooks/useSpaces/geometry/orderCoordinatesOnLineSegment.d.ts +0 -3
- package/dist/hooks/useSpaces/geometry/orderCoordinatesOnLineSegment.js +0 -11
- package/dist/hooks/useSpaces/geometry/splitLineAtOffset.d.ts +0 -3
- package/dist/hooks/useSpaces/geometry/splitLineAtOffset.js +0 -12
- package/dist/hooks/useSpaces/geometry/splitLineAtPoint.d.ts +0 -3
- package/dist/hooks/useSpaces/geometry/splitLineAtPoint.js +0 -9
- package/dist/hooks/useSpaces/geometry/splitLineAtPoints.d.ts +0 -3
- package/dist/hooks/useSpaces/geometry/splitLineAtPoints.js +0 -28
- package/dist/hooks/useSpaces/index.d.ts +0 -95
- package/dist/hooks/useSpaces/index.js +0 -625
- package/dist/hooks/useSpaces/themes/blueprint.d.ts +0 -3
- package/dist/hooks/useSpaces/themes/blueprint.js +0 -96
- package/dist/hooks/useSpaces/themes/default.d.ts +0 -3
- package/dist/hooks/useSpaces/themes/default.js +0 -96
- package/dist/hooks/useSpaces/themes/index.js +0 -21
- package/dist/hooks/useSpaces/themes/light.d.ts +0 -3
- package/dist/hooks/useSpaces/themes/light.js +0 -96
- package/dist/hooks/useSpaces/types.d.ts +0 -378
- package/dist/hooks/useSpaces/validators/areWallsDuplicated.d.ts +0 -3
- package/dist/hooks/useSpaces/validators/areWallsDuplicated.js +0 -61
- package/dist/hooks/useSpaces/validators/areWallsIntersecting.d.ts +0 -3
- package/dist/hooks/useSpaces/validators/areWallsIntersecting.js +0 -42
- package/dist/hooks/useSpaces/validators/areWallsOrphaningFeatures.d.ts +0 -3
- package/dist/hooks/useSpaces/validators/areWallsOrphaningFeatures.js +0 -52
- package/dist/hooks/useSpaces/validators/areWallsTooShort.d.ts +0 -3
- package/dist/hooks/useSpaces/validators/areWallsTooShort.js +0 -37
- package/dist/hooks/useSpaces/validators/index.d.ts +0 -15
- package/dist/hooks/useSpaces/validators/index.js +0 -40
- package/dist/hooks/useSpaces/validators/isFeatureCollidingWithExistingFeature.d.ts +0 -3
- package/dist/hooks/useSpaces/validators/isFeatureCollidingWithExistingFeature.js +0 -31
- package/dist/hooks/useSpaces/validators/isFeatureOutsideWallBounds.d.ts +0 -3
- package/dist/hooks/useSpaces/validators/isFeatureOutsideWallBounds.js +0 -19
- package/dist/hooks/useSpaces/validators/isLineTooShort.d.ts +0 -3
- package/dist/hooks/useSpaces/validators/isLineTooShort.js +0 -26
- package/dist/hooks/useSpaces/validators/isVertexLandingOnFeature.d.ts +0 -4
- package/dist/hooks/useSpaces/validators/isVertexLandingOnFeature.js +0 -19
- package/dist/hooks/useSpaces/validators/isWallEndingOnFeature.d.ts +0 -3
- package/dist/hooks/useSpaces/validators/isWallEndingOnFeature.js +0 -19
- package/dist/hooks/useSpaces/validators/isWallIntersectingFeature.d.ts +0 -3
- package/dist/hooks/useSpaces/validators/isWallIntersectingFeature.js +0 -41
- package/dist/hooks/useSpaces/validators/isWallOverlappingExisitingWalls.d.ts +0 -3
- package/dist/hooks/useSpaces/validators/isWallOverlappingExisitingWalls.js +0 -54
- package/dist/hooks/useSpaces/validators/isWallTooShort.d.ts +0 -3
- package/dist/hooks/useSpaces/validators/isWallTooShort.js +0 -10
- package/dist/icons/AngleSnapping.d.ts +0 -3
- package/dist/icons/AngleSnapping.js +0 -28
- package/dist/icons/Boundary.d.ts +0 -3
- package/dist/icons/Boundary.js +0 -21
- package/dist/icons/Center.d.ts +0 -3
- package/dist/icons/Center.js +0 -24
- package/dist/icons/GridSnapping.d.ts +0 -3
- package/dist/icons/GridSnapping.js +0 -28
- package/dist/icons/LayoutAlt.d.ts +0 -3
- package/dist/icons/LayoutAlt.js +0 -21
- package/dist/icons/Magnet.d.ts +0 -3
- package/dist/icons/Magnet.js +0 -27
- package/dist/icons/Player3D.d.ts +0 -3
- package/dist/icons/Player3D.js +0 -21
- package/dist/icons/RulerBlank.d.ts +0 -3
- package/dist/icons/RulerBlank.js +0 -25
- package/dist/icons/RulerDetailed.d.ts +0 -3
- package/dist/icons/RulerDetailed.js +0 -27
- package/dist/icons/Save.d.ts +0 -3
- package/dist/icons/Save.js +0 -21
- package/dist/icons/UnitCm.d.ts +0 -3
- package/dist/icons/UnitCm.js +0 -22
- package/dist/icons/UnitFeet.d.ts +0 -3
- package/dist/icons/UnitFeet.js +0 -22
- package/dist/icons/UnitInch.d.ts +0 -3
- package/dist/icons/UnitInch.js +0 -22
- package/dist/icons/UnitMeter.d.ts +0 -3
- package/dist/icons/UnitMeter.js +0 -21
- package/dist/store/spaces.d.ts +0 -74
- package/dist/store/spaces.js +0 -354
- /package/dist/Treble/{snapshot.d.ts → snapshots.d.ts} +0 -0
- /package/dist/Treble/{snapshot.js → snapshots.js} +0 -0
- /package/dist/hooks/{useSpaces/validators → useRoomBuilder}/messaging.d.ts +0 -0
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
var geometry_1 = require("../geometry");
|
|
4
|
-
var messaging_1 = require("./messaging");
|
|
5
|
-
var types_1 = require("../types");
|
|
6
|
-
function areWallsDuplicated(input, wallAndFeatures) {
|
|
7
|
-
var vertex = input.vertex, updatedPosition = input.updatedPosition;
|
|
8
|
-
var walls = wallAndFeatures.walls;
|
|
9
|
-
var point = updatedPosition.point;
|
|
10
|
-
var _a = vertex.connections.reduce(function (output, connection) {
|
|
11
|
-
var _a;
|
|
12
|
-
var wallIndex = connection[0], vertexIndex = connection[1];
|
|
13
|
-
output.wallIndexes.add(wallIndex);
|
|
14
|
-
output.updatedVerticesMap = Object.assign(output.updatedVerticesMap, (_a = {},
|
|
15
|
-
_a[wallIndex] = vertexIndex,
|
|
16
|
-
_a));
|
|
17
|
-
return output;
|
|
18
|
-
}, {
|
|
19
|
-
wallIndexes: new Set([]),
|
|
20
|
-
updatedVerticesMap: {},
|
|
21
|
-
}), wallIndexes = _a.wallIndexes, updatedVerticesMap = _a.updatedVerticesMap;
|
|
22
|
-
for (var _i = 0, _b = Array.from(wallIndexes); _i < _b.length; _i++) {
|
|
23
|
-
var wallIdx = _b[_i];
|
|
24
|
-
var wall = walls[wallIdx];
|
|
25
|
-
var updatedLine = JSON.parse(JSON.stringify(wall.line));
|
|
26
|
-
updatedLine[updatedVerticesMap[wallIdx]] = point;
|
|
27
|
-
if ((updatedPosition === null || updatedPosition === void 0 ? void 0 : updatedPosition.type) === types_1.IElements.WALL &&
|
|
28
|
-
updatedPosition.index !== wallIdx) {
|
|
29
|
-
var _c = walls[updatedPosition.index].line, xTest = _c[0], yTest = _c[1];
|
|
30
|
-
var unmovedPoint = updatedLine[updatedVerticesMap[wallIdx] === 1 ? 0 : 1];
|
|
31
|
-
if ((0, geometry_1.arePointsEqual)(unmovedPoint, xTest) ||
|
|
32
|
-
(0, geometry_1.arePointsEqual)(unmovedPoint, yTest))
|
|
33
|
-
return {
|
|
34
|
-
address: {
|
|
35
|
-
type: types_1.IElements.WALL,
|
|
36
|
-
index: updatedPosition.index,
|
|
37
|
-
},
|
|
38
|
-
type: types_1.IErrorTypes.SOFT,
|
|
39
|
-
message: messaging_1.errorMessages.wallsNotUnique(),
|
|
40
|
-
};
|
|
41
|
-
}
|
|
42
|
-
for (var i = 0; i < walls.length; i++) {
|
|
43
|
-
if (wallIdx === i)
|
|
44
|
-
continue;
|
|
45
|
-
var existingWall = walls[i];
|
|
46
|
-
var error = {
|
|
47
|
-
address: { type: types_1.IElements.WALL, index: i },
|
|
48
|
-
type: types_1.IErrorTypes.SOFT,
|
|
49
|
-
message: messaging_1.errorMessages.wallsNotUnique(),
|
|
50
|
-
};
|
|
51
|
-
if (((0, geometry_1.arePointsEqual)(existingWall[0], wall.line[0]) &&
|
|
52
|
-
(0, geometry_1.arePointsEqual)(existingWall[1], wall.line[1])) ||
|
|
53
|
-
((0, geometry_1.arePointsEqual)(existingWall[0], wall.line[1]) &&
|
|
54
|
-
(0, geometry_1.arePointsEqual)(existingWall[1], wall.line[0]))) {
|
|
55
|
-
return error;
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
return false;
|
|
60
|
-
}
|
|
61
|
-
exports.default = areWallsDuplicated;
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
var geometry_1 = require("../geometry");
|
|
4
|
-
var messaging_1 = require("./messaging");
|
|
5
|
-
var types_1 = require("../types");
|
|
6
|
-
function areWallsIntersecting(input, wallAndFeatures) {
|
|
7
|
-
var vertex = input.vertex, updatedPosition = input.updatedPosition;
|
|
8
|
-
var walls = wallAndFeatures.walls;
|
|
9
|
-
var _a = vertex.connections.reduce(function (output, connection) {
|
|
10
|
-
var _a;
|
|
11
|
-
var wallIndex = connection[0], vertexIndex = connection[1];
|
|
12
|
-
output.wallIndexes.add(wallIndex);
|
|
13
|
-
output.updatedVerticesMap = Object.assign(output.updatedVerticesMap, (_a = {},
|
|
14
|
-
_a[wallIndex] = vertexIndex,
|
|
15
|
-
_a));
|
|
16
|
-
return output;
|
|
17
|
-
}, {
|
|
18
|
-
wallIndexes: new Set([]),
|
|
19
|
-
updatedVerticesMap: {},
|
|
20
|
-
}), wallIndexes = _a.wallIndexes, updatedVerticesMap = _a.updatedVerticesMap;
|
|
21
|
-
for (var _i = 0, _b = Array.from(wallIndexes); _i < _b.length; _i++) {
|
|
22
|
-
var validateWallIndex = _b[_i];
|
|
23
|
-
var line = walls[validateWallIndex].line;
|
|
24
|
-
line[updatedVerticesMap[validateWallIndex]] = updatedPosition.point;
|
|
25
|
-
for (var i = 0; i < walls.length; i++) {
|
|
26
|
-
if (wallIndexes.has(i))
|
|
27
|
-
continue;
|
|
28
|
-
var wall = walls[i];
|
|
29
|
-
if (!wall)
|
|
30
|
-
continue;
|
|
31
|
-
var intersectionPoint = (0, geometry_1.getLineSegmentsIntersection)(line, wall.line);
|
|
32
|
-
if (intersectionPoint)
|
|
33
|
-
return {
|
|
34
|
-
address: { type: types_1.IElements.WALL, index: i },
|
|
35
|
-
message: messaging_1.errorMessages.addWallCollidingWithWall(),
|
|
36
|
-
type: types_1.IErrorTypes.SOFT,
|
|
37
|
-
};
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
return false;
|
|
41
|
-
}
|
|
42
|
-
exports.default = areWallsIntersecting;
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import type { IErrorElement, IMoveVertexValidatorInput, ISharedValidatorInput, IWallsValidationConfig } from '../types';
|
|
2
|
-
declare function areWallsOrphaningFeatures(input: IMoveVertexValidatorInput, wallAndFeatures: ISharedValidatorInput, validationConfig: IWallsValidationConfig): false | IErrorElement;
|
|
3
|
-
export default areWallsOrphaningFeatures;
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
var geometry_1 = require("../geometry");
|
|
4
|
-
var types_1 = require("../types");
|
|
5
|
-
function areWallsOrphaningFeatures(input, wallAndFeatures, validationConfig) {
|
|
6
|
-
var _a;
|
|
7
|
-
var vertex = input.vertex, updatedPosition = input.updatedPosition;
|
|
8
|
-
var walls = wallAndFeatures.walls, features = wallAndFeatures.features;
|
|
9
|
-
var padding = validationConfig.padding;
|
|
10
|
-
var _b = vertex.connections.reduce(function (output, connection) {
|
|
11
|
-
var _a;
|
|
12
|
-
var wallIndex = connection[0], vertexIndex = connection[1];
|
|
13
|
-
output.wallIndexes.add(wallIndex);
|
|
14
|
-
output.updatedVerticesMap = Object.assign(output.updatedVerticesMap, (_a = {},
|
|
15
|
-
_a[wallIndex] = vertexIndex,
|
|
16
|
-
_a));
|
|
17
|
-
return output;
|
|
18
|
-
}, {
|
|
19
|
-
wallIndexes: new Set([]),
|
|
20
|
-
updatedVerticesMap: {},
|
|
21
|
-
}), wallIndexes = _b.wallIndexes, updatedVerticesMap = _b.updatedVerticesMap;
|
|
22
|
-
for (var _i = 0, _c = Array.from(wallIndexes); _i < _c.length; _i++) {
|
|
23
|
-
var wallIdx = _c[_i];
|
|
24
|
-
var wall = walls[wallIdx];
|
|
25
|
-
if (!wall.connections.length)
|
|
26
|
-
continue;
|
|
27
|
-
var updatedLine = JSON.parse(JSON.stringify(wall.line));
|
|
28
|
-
updatedLine[updatedVerticesMap[wallIdx]] = updatedPosition.point;
|
|
29
|
-
var currentWallLength = (0, geometry_1.getLengthOfLineSegment)(wall.line);
|
|
30
|
-
var updatedWallLength = (0, geometry_1.getLengthOfLineSegment)(updatedLine);
|
|
31
|
-
var wallLengthDelta = updatedWallLength - currentWallLength;
|
|
32
|
-
for (var i = 0; i < wall.connections.length; i++) {
|
|
33
|
-
var _d = wall.connections[i], type = _d[0], index = _d[1];
|
|
34
|
-
var feat = (_a = features[type]) === null || _a === void 0 ? void 0 : _a[index];
|
|
35
|
-
if (!feat)
|
|
36
|
-
continue;
|
|
37
|
-
var error = {
|
|
38
|
-
address: { type: type, index: index },
|
|
39
|
-
message: 'feature collision',
|
|
40
|
-
type: types_1.IErrorTypes.HARD,
|
|
41
|
-
};
|
|
42
|
-
if (updatedVerticesMap[wallIdx] === 0 &&
|
|
43
|
-
feat.offset - wallLengthDelta < padding)
|
|
44
|
-
return error;
|
|
45
|
-
else if (feat.offset + feat.length > updatedWallLength - padding) {
|
|
46
|
-
return error;
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
return false;
|
|
51
|
-
}
|
|
52
|
-
exports.default = areWallsOrphaningFeatures;
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import type { IErrorElement, IWallsValidationConfig, IMoveVertexValidatorInput, ISharedValidatorInput } from '../types';
|
|
2
|
-
declare function areWallsTooShort(input: IMoveVertexValidatorInput, wallAndFeatures: ISharedValidatorInput, validationConfig: IWallsValidationConfig): false | IErrorElement;
|
|
3
|
-
export default areWallsTooShort;
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
var messaging_1 = require("./messaging");
|
|
7
|
-
var types_1 = require("../types");
|
|
8
|
-
var isLineTooShort_1 = __importDefault(require("./isLineTooShort"));
|
|
9
|
-
function areWallsTooShort(input, wallAndFeatures, validationConfig) {
|
|
10
|
-
var vertex = input.vertex, updatedPosition = input.updatedPosition;
|
|
11
|
-
var walls = wallAndFeatures.walls;
|
|
12
|
-
var _a = vertex.connections.reduce(function (output, connection) {
|
|
13
|
-
var _a;
|
|
14
|
-
var wallIndex = connection[0], vertexIndex = connection[1];
|
|
15
|
-
output.wallIndexes.push(wallIndex);
|
|
16
|
-
output.updatedVerticesMap = Object.assign(output.updatedVerticesMap, (_a = {},
|
|
17
|
-
_a[wallIndex] = vertexIndex,
|
|
18
|
-
_a));
|
|
19
|
-
return output;
|
|
20
|
-
}, {
|
|
21
|
-
wallIndexes: [],
|
|
22
|
-
updatedVerticesMap: {},
|
|
23
|
-
}), wallIndexes = _a.wallIndexes, updatedVerticesMap = _a.updatedVerticesMap;
|
|
24
|
-
for (var _i = 0, wallIndexes_1 = wallIndexes; _i < wallIndexes_1.length; _i++) {
|
|
25
|
-
var index = wallIndexes_1[_i];
|
|
26
|
-
var line = walls[index].line;
|
|
27
|
-
line[updatedVerticesMap[index]] = updatedPosition.point;
|
|
28
|
-
if ((0, isLineTooShort_1.default)(line, validationConfig))
|
|
29
|
-
return {
|
|
30
|
-
address: { type: types_1.IElements.WALL, index: index },
|
|
31
|
-
message: messaging_1.errorMessages.wallTooShort(),
|
|
32
|
-
type: types_1.IErrorTypes.HARD,
|
|
33
|
-
};
|
|
34
|
-
}
|
|
35
|
-
return false;
|
|
36
|
-
}
|
|
37
|
-
exports.default = areWallsTooShort;
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { IErrorElement, IWallsValidationConfig } from '../types';
|
|
2
|
-
import { ISharedValidatorInput, IValidatorFunction } from '../types';
|
|
3
|
-
import isFeatureOutsideWallBounds from './isFeatureOutsideWallBounds';
|
|
4
|
-
import isFeatureCollidingWithExistingFeature from './isFeatureCollidingWithExistingFeature';
|
|
5
|
-
import isWallIntersectingFeature from './isWallIntersectingFeature';
|
|
6
|
-
import isWallOverlappingExisitingWalls from './isWallOverlappingExisitingWalls';
|
|
7
|
-
import isWallTooShort from './isWallTooShort';
|
|
8
|
-
import areWallsTooShort from './areWallsTooShort';
|
|
9
|
-
import areWallsIntersecting from './areWallsIntersecting';
|
|
10
|
-
import areWallsOrphaningFeatures from './areWallsOrphaningFeatures';
|
|
11
|
-
import areWallsDuplicated from './areWallsDuplicated';
|
|
12
|
-
import isWallEndingOnFeature from './isWallEndingOnFeature';
|
|
13
|
-
import isVertexLandingOnFeature from './isVertexLandingOnFeature';
|
|
14
|
-
export { isFeatureOutsideWallBounds, isFeatureCollidingWithExistingFeature, isWallIntersectingFeature, isWallOverlappingExisitingWalls, isWallTooShort, areWallsTooShort, areWallsIntersecting, areWallsOrphaningFeatures, areWallsDuplicated, isWallEndingOnFeature, isVertexLandingOnFeature, };
|
|
15
|
-
export declare function runValidators<T>(validators: Array<IValidatorFunction<T>>, input: T, wallAndFeatures: ISharedValidatorInput, validationConfig: IWallsValidationConfig): IErrorElement[] | null;
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.runValidators = exports.isVertexLandingOnFeature = exports.isWallEndingOnFeature = exports.areWallsDuplicated = exports.areWallsOrphaningFeatures = exports.areWallsIntersecting = exports.areWallsTooShort = exports.isWallTooShort = exports.isWallOverlappingExisitingWalls = exports.isWallIntersectingFeature = exports.isFeatureCollidingWithExistingFeature = exports.isFeatureOutsideWallBounds = void 0;
|
|
7
|
-
var isFeatureOutsideWallBounds_1 = __importDefault(require("./isFeatureOutsideWallBounds"));
|
|
8
|
-
exports.isFeatureOutsideWallBounds = isFeatureOutsideWallBounds_1.default;
|
|
9
|
-
var isFeatureCollidingWithExistingFeature_1 = __importDefault(require("./isFeatureCollidingWithExistingFeature"));
|
|
10
|
-
exports.isFeatureCollidingWithExistingFeature = isFeatureCollidingWithExistingFeature_1.default;
|
|
11
|
-
var isWallIntersectingFeature_1 = __importDefault(require("./isWallIntersectingFeature"));
|
|
12
|
-
exports.isWallIntersectingFeature = isWallIntersectingFeature_1.default;
|
|
13
|
-
var isWallOverlappingExisitingWalls_1 = __importDefault(require("./isWallOverlappingExisitingWalls"));
|
|
14
|
-
exports.isWallOverlappingExisitingWalls = isWallOverlappingExisitingWalls_1.default;
|
|
15
|
-
var isWallTooShort_1 = __importDefault(require("./isWallTooShort"));
|
|
16
|
-
exports.isWallTooShort = isWallTooShort_1.default;
|
|
17
|
-
var areWallsTooShort_1 = __importDefault(require("./areWallsTooShort"));
|
|
18
|
-
exports.areWallsTooShort = areWallsTooShort_1.default;
|
|
19
|
-
var areWallsIntersecting_1 = __importDefault(require("./areWallsIntersecting"));
|
|
20
|
-
exports.areWallsIntersecting = areWallsIntersecting_1.default;
|
|
21
|
-
var areWallsOrphaningFeatures_1 = __importDefault(require("./areWallsOrphaningFeatures"));
|
|
22
|
-
exports.areWallsOrphaningFeatures = areWallsOrphaningFeatures_1.default;
|
|
23
|
-
var areWallsDuplicated_1 = __importDefault(require("./areWallsDuplicated"));
|
|
24
|
-
exports.areWallsDuplicated = areWallsDuplicated_1.default;
|
|
25
|
-
var isWallEndingOnFeature_1 = __importDefault(require("./isWallEndingOnFeature"));
|
|
26
|
-
exports.isWallEndingOnFeature = isWallEndingOnFeature_1.default;
|
|
27
|
-
var isVertexLandingOnFeature_1 = __importDefault(require("./isVertexLandingOnFeature"));
|
|
28
|
-
exports.isVertexLandingOnFeature = isVertexLandingOnFeature_1.default;
|
|
29
|
-
function runValidators(validators, input, wallAndFeatures, validationConfig) {
|
|
30
|
-
var errors = validators.reduce(function (output, validate) {
|
|
31
|
-
var error = validate(input, wallAndFeatures, validationConfig);
|
|
32
|
-
if (error)
|
|
33
|
-
output.push(error);
|
|
34
|
-
return output;
|
|
35
|
-
}, []);
|
|
36
|
-
if (errors.length)
|
|
37
|
-
return errors;
|
|
38
|
-
return null;
|
|
39
|
-
}
|
|
40
|
-
exports.runValidators = runValidators;
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import type { IFeatureValidatorInput, ISharedValidatorInput, IErrorElement } from '../types';
|
|
2
|
-
declare function isFeatureCollidingWithExistingFeature(input: IFeatureValidatorInput, wallAndFeatures: ISharedValidatorInput): false | IErrorElement;
|
|
3
|
-
export default isFeatureCollidingWithExistingFeature;
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
var geometry_1 = require("../geometry");
|
|
4
|
-
var messaging_1 = require("./messaging");
|
|
5
|
-
var types_1 = require("../types");
|
|
6
|
-
function isFeatureCollidingWithExistingFeature(input, wallAndFeatures) {
|
|
7
|
-
var _a, _b;
|
|
8
|
-
var wall = input.wall, updatedFeature = input.updatedFeature;
|
|
9
|
-
var features = wallAndFeatures.features;
|
|
10
|
-
if (!features || !((_a = wall.connections) === null || _a === void 0 ? void 0 : _a.length))
|
|
11
|
-
return false;
|
|
12
|
-
if (!Object.values(updatedFeature).flat().length)
|
|
13
|
-
return false;
|
|
14
|
-
for (var i = 0; i < wall.connections.length; i++) {
|
|
15
|
-
var _c = wall.connections[i], type = _c[0], index = _c[1];
|
|
16
|
-
if (updatedFeature.address.type === type &&
|
|
17
|
-
updatedFeature.address.index === index)
|
|
18
|
-
continue;
|
|
19
|
-
var existingFeature = (_b = features[type]) === null || _b === void 0 ? void 0 : _b[index];
|
|
20
|
-
if (!existingFeature)
|
|
21
|
-
continue;
|
|
22
|
-
if ((0, geometry_1.doLinesOverlap)([updatedFeature.offset, updatedFeature.length], [existingFeature.offset, existingFeature.length]))
|
|
23
|
-
return {
|
|
24
|
-
address: { type: type, index: index },
|
|
25
|
-
type: types_1.IErrorTypes.SOFT,
|
|
26
|
-
message: messaging_1.errorMessages.featuresColliding(type),
|
|
27
|
-
};
|
|
28
|
-
}
|
|
29
|
-
return false;
|
|
30
|
-
}
|
|
31
|
-
exports.default = isFeatureCollidingWithExistingFeature;
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import type { IErrorElement, IWallsValidationConfig, IFeatureValidatorInput, ISharedValidatorInput } from '../types';
|
|
2
|
-
declare function isFeatureOutsideWallBounds(input: IFeatureValidatorInput, _: ISharedValidatorInput, validationConfig: IWallsValidationConfig): false | IErrorElement;
|
|
3
|
-
export default isFeatureOutsideWallBounds;
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
var geometry_1 = require("../geometry");
|
|
4
|
-
var messaging_1 = require("./messaging");
|
|
5
|
-
var types_1 = require("../types");
|
|
6
|
-
function isFeatureOutsideWallBounds(input, _, validationConfig) {
|
|
7
|
-
var wall = input.wall, updatedFeature = input.updatedFeature;
|
|
8
|
-
var padding = validationConfig.padding;
|
|
9
|
-
var wallLength = (0, geometry_1.getLengthOfLineSegment)(wall.line);
|
|
10
|
-
if (updatedFeature.offset < padding ||
|
|
11
|
-
updatedFeature.offset + updatedFeature.length > wallLength - padding)
|
|
12
|
-
return {
|
|
13
|
-
address: updatedFeature.address,
|
|
14
|
-
type: types_1.IErrorTypes.HARD,
|
|
15
|
-
message: messaging_1.errorMessages.featureOutsideWallBounds(),
|
|
16
|
-
};
|
|
17
|
-
return false;
|
|
18
|
-
}
|
|
19
|
-
exports.default = isFeatureOutsideWallBounds;
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
3
|
-
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
4
|
-
if (ar || !(i in from)) {
|
|
5
|
-
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
6
|
-
ar[i] = from[i];
|
|
7
|
-
}
|
|
8
|
-
}
|
|
9
|
-
return to.concat(ar || Array.prototype.slice.call(from));
|
|
10
|
-
};
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
var geometry_1 = require("../geometry");
|
|
13
|
-
var messaging_1 = require("./messaging");
|
|
14
|
-
var types_1 = require("../types");
|
|
15
|
-
function isLineTooShort(wallOrLine, validationConfig) {
|
|
16
|
-
var minLength = validationConfig.minLength;
|
|
17
|
-
var line = Array.isArray(wallOrLine) ? wallOrLine : wallOrLine.line;
|
|
18
|
-
var tooClose = geometry_1.arePointsWithinProximity.apply(void 0, __spreadArray(__spreadArray([], line, false), [minLength], false));
|
|
19
|
-
if (tooClose)
|
|
20
|
-
return {
|
|
21
|
-
message: messaging_1.errorMessages.wallTooShort(),
|
|
22
|
-
type: types_1.IErrorTypes.HARD,
|
|
23
|
-
};
|
|
24
|
-
return false;
|
|
25
|
-
}
|
|
26
|
-
exports.default = isLineTooShort;
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
var messaging_1 = require("./messaging");
|
|
4
|
-
var types_1 = require("../types");
|
|
5
|
-
function isVertexLandingOnFeature(input) {
|
|
6
|
-
var snapPoint = input.updatedPosition;
|
|
7
|
-
if (!snapPoint)
|
|
8
|
-
return false;
|
|
9
|
-
if (snapPoint.type === types_1.IElements.WINDOW ||
|
|
10
|
-
snapPoint.type === types_1.IElements.DOOR ||
|
|
11
|
-
snapPoint.type === types_1.IElements.OPENING)
|
|
12
|
-
return {
|
|
13
|
-
address: snapPoint,
|
|
14
|
-
message: messaging_1.errorMessages.addWallCollidingWithFeature(snapPoint.type),
|
|
15
|
-
type: types_1.IErrorTypes.SOFT,
|
|
16
|
-
};
|
|
17
|
-
return false;
|
|
18
|
-
}
|
|
19
|
-
exports.default = isVertexLandingOnFeature;
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
var messaging_1 = require("./messaging");
|
|
4
|
-
var types_1 = require("../types");
|
|
5
|
-
function isWallEndingOnFeature(input) {
|
|
6
|
-
var snapPoint = input.newWall.end;
|
|
7
|
-
if (!snapPoint)
|
|
8
|
-
return false;
|
|
9
|
-
if (snapPoint.type === types_1.IElements.WINDOW ||
|
|
10
|
-
snapPoint.type === types_1.IElements.DOOR ||
|
|
11
|
-
snapPoint.type === types_1.IElements.OPENING)
|
|
12
|
-
return {
|
|
13
|
-
address: snapPoint,
|
|
14
|
-
message: messaging_1.errorMessages.addWallCollidingWithFeature(snapPoint.type),
|
|
15
|
-
type: types_1.IErrorTypes.SOFT,
|
|
16
|
-
};
|
|
17
|
-
return false;
|
|
18
|
-
}
|
|
19
|
-
exports.default = isWallEndingOnFeature;
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import type { IAddWallValidatorInput, ISharedValidatorInput, IErrorElement } from '../types';
|
|
2
|
-
declare function isWallIntersectingFeature(input: IAddWallValidatorInput, wallAndFeatures: ISharedValidatorInput): false | IErrorElement;
|
|
3
|
-
export default isWallIntersectingFeature;
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
var geometry_1 = require("../geometry");
|
|
4
|
-
var messaging_1 = require("./messaging");
|
|
5
|
-
var types_1 = require("../types");
|
|
6
|
-
function isWallIntersectingFeature(input, wallAndFeatures) {
|
|
7
|
-
var _a;
|
|
8
|
-
var newWall = input.newWall;
|
|
9
|
-
var walls = wallAndFeatures.walls, features = wallAndFeatures.features;
|
|
10
|
-
if (!walls.length || !Object.values(features).flat().length)
|
|
11
|
-
return false;
|
|
12
|
-
var intersectingFeature;
|
|
13
|
-
for (var i = 0; i < walls.length && !intersectingFeature; i++) {
|
|
14
|
-
if (!walls[i].connections)
|
|
15
|
-
continue;
|
|
16
|
-
var intersectionPoint = (0, geometry_1.getLineSegmentsIntersection)(newWall.line, walls[i].line);
|
|
17
|
-
if (!intersectionPoint)
|
|
18
|
-
continue;
|
|
19
|
-
var intersectionOffset = (0, geometry_1.getLengthOfLineSegment)([
|
|
20
|
-
walls[i].line[0],
|
|
21
|
-
intersectionPoint,
|
|
22
|
-
]);
|
|
23
|
-
for (var j = 0; j < walls[i].connections.length && !intersectingFeature; j++) {
|
|
24
|
-
var _b = walls[i].connections[j], type = _b[0], index = _b[1];
|
|
25
|
-
var feature = (_a = features[type]) === null || _a === void 0 ? void 0 : _a[index];
|
|
26
|
-
if (!feature)
|
|
27
|
-
continue;
|
|
28
|
-
if (feature.offset < intersectionOffset &&
|
|
29
|
-
intersectionOffset < feature.offset + feature.length)
|
|
30
|
-
intersectingFeature = { type: type, index: index };
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
if (!intersectingFeature)
|
|
34
|
-
return false;
|
|
35
|
-
return ({
|
|
36
|
-
address: intersectingFeature,
|
|
37
|
-
message: messaging_1.errorMessages.addWallCollidingWithFeature(intersectingFeature.type),
|
|
38
|
-
type: types_1.IErrorTypes.SOFT,
|
|
39
|
-
} || false);
|
|
40
|
-
}
|
|
41
|
-
exports.default = isWallIntersectingFeature;
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import type { IErrorElement, IAddWallValidatorInput, ISharedValidatorInput } from '../types';
|
|
2
|
-
declare function isWallOverlappingExisitingWalls(input: IAddWallValidatorInput, wallAndFeatures: ISharedValidatorInput): false | IErrorElement;
|
|
3
|
-
export default isWallOverlappingExisitingWalls;
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
var geometry_1 = require("../geometry");
|
|
4
|
-
var messaging_1 = require("./messaging");
|
|
5
|
-
var types_1 = require("../types");
|
|
6
|
-
function isWallOverlappingExisitingWalls(input, wallAndFeatures) {
|
|
7
|
-
var newWall = input.newWall;
|
|
8
|
-
var walls = wallAndFeatures.walls;
|
|
9
|
-
var start = newWall.start, end = newWall.end;
|
|
10
|
-
if (start.type === types_1.IElements.WALL &&
|
|
11
|
-
(end === null || end === void 0 ? void 0 : end.type) === types_1.IElements.WALL &&
|
|
12
|
-
start.index === end.index) {
|
|
13
|
-
return {
|
|
14
|
-
address: {
|
|
15
|
-
type: types_1.IElements.WALL,
|
|
16
|
-
index: start.index,
|
|
17
|
-
},
|
|
18
|
-
type: types_1.IErrorTypes.SOFT,
|
|
19
|
-
message: messaging_1.errorMessages.wallsNotUnique(),
|
|
20
|
-
};
|
|
21
|
-
}
|
|
22
|
-
var overlappingIndex = walls.findIndex(function (wall, i) {
|
|
23
|
-
var line = wall.line;
|
|
24
|
-
if ((0, geometry_1.areLinesEqual)(line, newWall.line))
|
|
25
|
-
return true;
|
|
26
|
-
if (start.type === types_1.IElements.VERTEX &&
|
|
27
|
-
((0, geometry_1.arePointsEqual)(start.point, line[0]) ||
|
|
28
|
-
(0, geometry_1.arePointsEqual)(start.point, line[1])) &&
|
|
29
|
-
(end === null || end === void 0 ? void 0 : end.type) === types_1.IElements.WALL &&
|
|
30
|
-
end.index === i) {
|
|
31
|
-
return true;
|
|
32
|
-
}
|
|
33
|
-
if ((end === null || end === void 0 ? void 0 : end.type) === types_1.IElements.VERTEX &&
|
|
34
|
-
((0, geometry_1.arePointsEqual)(end.point, line[0]) ||
|
|
35
|
-
(0, geometry_1.arePointsEqual)(end.point, line[1])) &&
|
|
36
|
-
start.type === types_1.IElements.WALL &&
|
|
37
|
-
start.index === i) {
|
|
38
|
-
return true;
|
|
39
|
-
}
|
|
40
|
-
return false;
|
|
41
|
-
});
|
|
42
|
-
if (overlappingIndex !== -1) {
|
|
43
|
-
return {
|
|
44
|
-
address: {
|
|
45
|
-
type: types_1.IElements.WALL,
|
|
46
|
-
index: overlappingIndex,
|
|
47
|
-
},
|
|
48
|
-
type: types_1.IErrorTypes.SOFT,
|
|
49
|
-
message: messaging_1.errorMessages.wallsNotUnique(),
|
|
50
|
-
};
|
|
51
|
-
}
|
|
52
|
-
return false;
|
|
53
|
-
}
|
|
54
|
-
exports.default = isWallOverlappingExisitingWalls;
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import type { IAddWallValidatorInput, ISharedValidatorInput, IErrorElement, IWallsValidationConfig } from '../types';
|
|
2
|
-
declare function isWallTooShort(input: IAddWallValidatorInput, _: ISharedValidatorInput, validationConfig: IWallsValidationConfig): false | IErrorElement;
|
|
3
|
-
export default isWallTooShort;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
var isLineTooShort_1 = __importDefault(require("./isLineTooShort"));
|
|
7
|
-
function isWallTooShort(input, _, validationConfig) {
|
|
8
|
-
return (0, isLineTooShort_1.default)(input.newWall.line, validationConfig);
|
|
9
|
-
}
|
|
10
|
-
exports.default = isWallTooShort;
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
|
|
3
|
-
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
|
|
4
|
-
return cooked;
|
|
5
|
-
};
|
|
6
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
7
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
8
|
-
};
|
|
9
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
-
exports.AngleSnapping = void 0;
|
|
11
|
-
var react_1 = __importDefault(require("react"));
|
|
12
|
-
var styled_components_1 = __importDefault(require("styled-components"));
|
|
13
|
-
var Path = styled_components_1.default.path(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n fill: ", ";\n"], ["\n fill: ", ";\n"])), function (props) { return props.color || props.theme.textColor; });
|
|
14
|
-
var AngleSnapping = function (props) {
|
|
15
|
-
return (react_1.default.createElement("svg", { width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", xmlns: "http://www.w3.org/2000/svg" },
|
|
16
|
-
react_1.default.createElement(Path, { color: props.color, fillRule: "evenodd", clipRule: "evenodd", d: "M7.45664 2.10874C7.58614 1.9779 7.78102 1.99096 7.89191 2.13791L18.7612 16.5419C18.8196 16.6192 18.8431 16.7182 18.8333 16.8137C18.8515 16.855 18.8616 16.9007 18.8615 16.9488C18.8611 17.1329 18.7116 17.2816 18.5275 17.2809L9.33325 17.2483V16.5817L12.7405 16.5937C12.7363 16.453 12.7372 16.2902 12.7486 16.1119C12.7862 15.5202 12.9395 14.743 13.409 14.0338C13.9153 13.2692 14.4387 12.8542 14.8471 12.6305C14.8805 12.6122 14.913 12.5953 14.9447 12.5795L7.42294 2.61173C7.31205 2.46478 7.32714 2.23959 7.45664 2.10874ZM15.3807 13.1573C15.3115 13.1845 15.231 13.221 15.1418 13.2698C14.8153 13.4486 14.3648 13.7971 13.9152 14.4761C13.5326 15.0539 13.4031 15.6943 13.371 16.1987C13.3617 16.3457 13.3607 16.4799 13.3639 16.596L17.9879 16.6124L15.3807 13.1573Z" }),
|
|
17
|
-
react_1.default.createElement(Path, { color: props.color, "fill-rule": "evenodd", "clip-rule": "evenodd", d: "M1.66468 16.5545L1.60623 16.5543C1.42214 16.5536 1.2726 16.7023 1.27222 16.8864C1.27184 17.0705 1.42078 17.2203 1.60487 17.2209L1.93253 17.2221C2.09272 17.5251 2.29725 17.805 2.53549 18.0511C3.10732 18.6419 3.8835 19.0488 4.73024 19.1115C5.57476 19.1741 6.46997 18.8928 7.27794 18.1457L7.27956 18.1473L9.76024 15.6895C9.8647 15.586 9.8647 15.4182 9.76024 15.3147L9.61838 15.1742L9.61601 15.1765L8.81017 14.3782L8.81254 14.3758L8.67069 14.2353C8.56622 14.1318 8.39686 14.1318 8.2924 14.2353L5.91771 16.588C5.35754 17.0597 4.64816 16.9369 4.19905 16.5135C3.97593 16.3031 3.82824 16.0264 3.80058 15.7276C3.77376 15.4377 3.858 15.1085 4.12828 14.7765L6.48347 12.4431C6.58793 12.3396 6.58793 12.1718 6.48347 12.0683L6.34161 11.9277L6.33924 11.9301L5.53341 11.1317L5.53578 11.1293L5.39392 10.9888C5.28946 10.8853 5.1201 10.8853 5.01563 10.9888L2.59608 13.386L2.5952 13.3851C1.82198 14.1335 1.51256 15.0044 1.54953 15.8427C1.56022 16.0852 1.59981 16.3237 1.66468 16.5545ZM2.01719 15.8225C1.98628 15.1215 2.2403 14.3785 2.91927 13.7198L2.92021 13.7207L4.18812 12.4645L4.99396 13.2629L3.78537 14.4603L3.81872 14.4934L3.78202 14.4633C3.42861 14.8872 3.29485 15.3423 3.33442 15.7699C3.37364 16.1937 3.58121 16.5712 3.87635 16.8495C4.46377 17.4033 5.44326 17.5956 6.22055 16.941L6.20546 16.9234L6.22332 16.9411L7.39801 15.7773L8.20385 16.5756L6.97892 17.7892L6.97811 17.7884C6.25369 18.4671 5.47724 18.7018 4.76516 18.6491C4.04771 18.5959 3.37567 18.2491 2.87336 17.7301C2.37094 17.211 2.04839 16.53 2.01719 15.8225ZM5.31013 12.9497L6.02307 12.2433L5.21724 11.4449L4.50429 12.1513L5.31013 12.9497ZM9.29984 15.4898L8.52002 16.2624L7.71418 15.464L8.494 14.6914L9.29984 15.4898Z" }),
|
|
18
|
-
react_1.default.createElement(Path, { color: props.color, d: "M5.86834 8.88C5.73908 8.88 5.63429 8.98382 5.63429 9.11189V10.2382C5.63429 10.3663 5.73908 10.4701 5.86834 10.4701C5.99761 10.4701 6.1024 10.3663 6.1024 10.2382V9.11189C6.1024 8.98382 5.99761 8.88 5.86834 8.88Z" }),
|
|
19
|
-
react_1.default.createElement(Path, { color: props.color, d: "M9.21198 12.1927C9.08272 12.1927 8.97793 12.2966 8.97793 12.4246V13.5509C8.97793 13.679 9.08272 13.7828 9.21198 13.7828C9.34125 13.7828 9.44604 13.679 9.44604 13.5509V12.4246C9.44604 12.2966 9.34125 12.1927 9.21198 12.1927Z" }),
|
|
20
|
-
react_1.default.createElement(Path, { color: props.color, d: "M6.838 11.6958C6.838 11.8239 6.94279 11.9277 7.07205 11.9277H8.20889C8.33816 11.9277 8.44295 11.8239 8.44295 11.6958C8.44295 11.5678 8.33816 11.4639 8.20889 11.4639H7.07205C6.94279 11.4639 6.838 11.5678 6.838 11.6958Z" }),
|
|
21
|
-
react_1.default.createElement(Path, { color: props.color, d: "M10.1816 15.0085C10.1816 15.1366 10.2864 15.2404 10.4157 15.2404H11.5525C11.6818 15.2404 11.7866 15.1366 11.7866 15.0085C11.7866 14.8805 11.6818 14.7767 11.5525 14.7767H10.4157C10.2864 14.7767 10.1816 14.8805 10.1816 15.0085Z" }),
|
|
22
|
-
react_1.default.createElement(Path, { color: props.color, d: "M7.80401 9.57401C7.7126 9.48345 7.56441 9.48345 7.473 9.57401L6.66914 10.3704C6.57773 10.461 6.57773 10.6078 6.66914 10.6984C6.76054 10.7889 6.90874 10.7889 7.00014 10.6984L7.80401 9.90195C7.89541 9.81139 7.89541 9.66457 7.80401 9.57401Z" }),
|
|
23
|
-
react_1.default.createElement(Path, { color: props.color, d: "M11.1476 12.8867C11.0562 12.7962 10.908 12.7962 10.8166 12.8867L10.0128 13.6832C9.92137 13.7737 9.92137 13.9206 10.0128 14.0111C10.1042 14.1017 10.2524 14.1017 10.3438 14.0111L11.1476 13.2147C11.239 13.1241 11.239 12.9773 11.1476 12.8867Z" })));
|
|
24
|
-
};
|
|
25
|
-
exports.AngleSnapping = AngleSnapping;
|
|
26
|
-
exports.AngleSnapping.iconName = 'angle-snapping';
|
|
27
|
-
exports.default = exports.AngleSnapping;
|
|
28
|
-
var templateObject_1;
|
package/dist/icons/Boundary.d.ts
DELETED
package/dist/icons/Boundary.js
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
|
|
3
|
-
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
|
|
4
|
-
return cooked;
|
|
5
|
-
};
|
|
6
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
7
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
8
|
-
};
|
|
9
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
-
exports.Boundary = void 0;
|
|
11
|
-
var react_1 = __importDefault(require("react"));
|
|
12
|
-
var styled_components_1 = __importDefault(require("styled-components"));
|
|
13
|
-
var SVG = styled_components_1.default.svg(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n .tk-icon {\n fill: ", ";\n }\n"], ["\n .tk-icon {\n fill: ", ";\n }\n"])), function (props) { return props.color || props.theme.textColor; });
|
|
14
|
-
var Boundary = function (props) {
|
|
15
|
-
return (react_1.default.createElement(SVG, { width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", xmlns: "http://www.w3.org/2000/svg", color: props.color },
|
|
16
|
-
react_1.default.createElement("path", { fillRule: "evenodd", clipRule: "evenodd", className: "tk-icon", d: "M1 3H2V18H1V3ZM18 3H19V18H18V3ZM5 10.3274H3V10.8274H5V10.3274ZM6 10.3274H8V10.8274H6V10.3274ZM11 10.3274H9V10.8274H11V10.3274ZM12 10.3274H14V10.8274H12V10.3274ZM17 10.3274H15V10.8274H17V10.3274Z" })));
|
|
17
|
-
};
|
|
18
|
-
exports.Boundary = Boundary;
|
|
19
|
-
exports.Boundary.iconName = 'boundary';
|
|
20
|
-
exports.default = exports.Boundary;
|
|
21
|
-
var templateObject_1;
|
package/dist/icons/Center.d.ts
DELETED