@threekit-tools/treble 0.0.90 → 0.0.91-next-01
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/components/BreatheAnimation/index.js +2 -2
- package/dist/components/TurntableAnimation/index.js +2 -2
- package/dist/components/containers/formInputContainer.js +3 -3
- package/dist/hooks/useAttribute/index.js +1 -5
- package/dist/hooks/useConfigurationChangeStatus/index.d.ts +2 -0
- package/dist/hooks/{usePlayerLoadingStatus → useConfigurationChangeStatus}/index.js +2 -2
- package/dist/hooks/useNestedConfigurator/index.js +1 -2
- package/dist/hooks/usePlayerReady/index.d.ts +2 -0
- package/dist/hooks/{useAnimationStart → usePlayerReady}/index.js +2 -2
- package/dist/hooks/useSpaces/Canvas.d.ts +37 -0
- package/dist/hooks/useSpaces/Canvas.js +199 -0
- package/dist/hooks/useSpaces/SpacesLayout.d.ts +11 -0
- package/dist/hooks/useSpaces/SpacesLayout.js +74 -0
- package/dist/hooks/useSpaces/SpacesState.d.ts +162 -0
- package/dist/hooks/useSpaces/SpacesState.js +1791 -0
- package/dist/hooks/useSpaces/constants.d.ts +44 -0
- package/dist/hooks/useSpaces/constants.js +105 -0
- package/dist/hooks/{useRoomBuilder → useSpaces}/dataHandlers.d.ts +6 -4
- package/dist/hooks/{useRoomBuilder → useSpaces}/dataHandlers.js +104 -42
- package/dist/hooks/useSpaces/draw/clearCanvas.d.ts +2 -0
- package/dist/hooks/useSpaces/draw/clearCanvas.js +9 -0
- package/dist/hooks/useSpaces/draw/drawBackground.d.ts +2 -0
- package/dist/hooks/useSpaces/draw/drawBackground.js +12 -0
- package/dist/hooks/useSpaces/draw/drawDimensions.d.ts +3 -0
- package/dist/hooks/useSpaces/draw/drawDimensions.js +53 -0
- package/dist/hooks/useSpaces/draw/drawDoors.d.ts +9 -0
- package/dist/hooks/useSpaces/draw/drawDoors.js +93 -0
- package/dist/hooks/useSpaces/draw/drawFloor.d.ts +3 -0
- package/dist/hooks/useSpaces/draw/drawFloor.js +36 -0
- package/dist/hooks/useSpaces/draw/drawGrid.d.ts +3 -0
- package/dist/hooks/useSpaces/draw/drawGrid.js +31 -0
- package/dist/hooks/useSpaces/draw/drawGuides.d.ts +3 -0
- package/dist/hooks/useSpaces/draw/drawGuides.js +23 -0
- package/dist/hooks/useSpaces/draw/drawOpenings.d.ts +9 -0
- package/dist/hooks/useSpaces/draw/drawOpenings.js +72 -0
- package/dist/hooks/useSpaces/draw/drawVertices.d.ts +8 -0
- package/dist/hooks/useSpaces/draw/drawVertices.js +61 -0
- package/dist/hooks/useSpaces/draw/drawWalls.d.ts +10 -0
- package/dist/hooks/useSpaces/draw/drawWalls.js +64 -0
- package/dist/hooks/useSpaces/draw/drawWindows.d.ts +9 -0
- package/dist/hooks/useSpaces/draw/drawWindows.js +82 -0
- package/dist/hooks/useSpaces/draw/index.d.ts +11 -0
- package/dist/hooks/useSpaces/draw/index.js +129 -0
- package/dist/hooks/useSpaces/geometry/addThicknessToLine.d.ts +3 -0
- package/dist/hooks/useSpaces/geometry/addThicknessToLine.js +13 -0
- package/dist/hooks/useSpaces/geometry/areLinesEqual.d.ts +3 -0
- package/dist/hooks/useSpaces/geometry/areLinesEqual.js +17 -0
- package/dist/hooks/useSpaces/geometry/arePointsEqual.d.ts +3 -0
- package/dist/hooks/useSpaces/geometry/arePointsEqual.js +8 -0
- package/dist/hooks/useSpaces/geometry/arePointsWithinProximity.d.ts +3 -0
- package/dist/hooks/useSpaces/geometry/arePointsWithinProximity.js +11 -0
- package/dist/hooks/useSpaces/geometry/closestPointOnLine.d.ts +3 -0
- package/dist/hooks/useSpaces/geometry/closestPointOnLine.js +13 -0
- package/dist/hooks/useSpaces/geometry/doLinesOverlap.d.ts +2 -0
- package/dist/hooks/useSpaces/geometry/doLinesOverlap.js +16 -0
- package/dist/hooks/useSpaces/geometry/euclideanMod.d.ts +2 -0
- package/dist/hooks/useSpaces/geometry/euclideanMod.js +6 -0
- package/dist/hooks/useSpaces/geometry/findLoops.d.ts +6 -0
- package/dist/hooks/{useRoomBuilder → useSpaces/geometry}/findLoops.js +14 -9
- package/dist/hooks/useSpaces/geometry/getAllLineIntersections.d.ts +6 -0
- package/dist/hooks/useSpaces/geometry/getAllLineIntersections.js +23 -0
- package/dist/hooks/useSpaces/geometry/getAngleOfLineSegment.d.ts +3 -0
- package/dist/hooks/useSpaces/geometry/getAngleOfLineSegment.js +7 -0
- package/dist/hooks/useSpaces/geometry/getClosestPointOnLineSegment.d.ts +3 -0
- package/dist/hooks/useSpaces/geometry/getClosestPointOnLineSegment.js +17 -0
- package/dist/hooks/useSpaces/geometry/getDistanceToLine.d.ts +3 -0
- package/dist/hooks/useSpaces/geometry/getDistanceToLine.js +10 -0
- package/dist/hooks/useSpaces/geometry/getLengthOfLineSegment.d.ts +3 -0
- package/dist/hooks/useSpaces/geometry/getLengthOfLineSegment.js +7 -0
- package/dist/hooks/useSpaces/geometry/getLineAtOffsetOnLineSegment.d.ts +3 -0
- package/dist/hooks/useSpaces/geometry/getLineAtOffsetOnLineSegment.js +17 -0
- package/dist/hooks/useSpaces/geometry/getLineOtherPoint.d.ts +3 -0
- package/dist/hooks/useSpaces/geometry/getLineOtherPoint.js +11 -0
- package/dist/hooks/useSpaces/geometry/getLineSegmentsIntersection.d.ts +3 -0
- package/dist/hooks/useSpaces/geometry/getLineSegmentsIntersection.js +43 -0
- package/dist/hooks/useSpaces/geometry/getMidpointOfLineSegment.d.ts +3 -0
- package/dist/hooks/useSpaces/geometry/getMidpointOfLineSegment.js +9 -0
- package/dist/hooks/useSpaces/geometry/getParallelLineSegmentAtDistance.d.ts +3 -0
- package/dist/hooks/useSpaces/geometry/getParallelLineSegmentAtDistance.js +20 -0
- package/dist/hooks/useSpaces/geometry/getPointAtOffsetOnLineSegment.d.ts +3 -0
- package/dist/hooks/useSpaces/geometry/getPointAtOffsetOnLineSegment.js +11 -0
- package/dist/hooks/useSpaces/geometry/getPolygonArea.d.ts +3 -0
- package/dist/hooks/useSpaces/geometry/getPolygonArea.js +15 -0
- package/dist/hooks/useSpaces/geometry/getQuadrilateralArea.d.ts +3 -0
- package/dist/hooks/useSpaces/geometry/getQuadrilateralArea.js +16 -0
- package/dist/hooks/useSpaces/geometry/getTangetIntersectionAndOffset.d.ts +6 -0
- package/dist/hooks/useSpaces/geometry/getTangetIntersectionAndOffset.js +17 -0
- package/dist/hooks/useSpaces/geometry/getTriangleArea.d.ts +3 -0
- package/dist/hooks/useSpaces/geometry/getTriangleArea.js +9 -0
- package/dist/hooks/useSpaces/geometry/getUnitVectorOfLineSegment.d.ts +3 -0
- package/dist/hooks/useSpaces/geometry/getUnitVectorOfLineSegment.js +12 -0
- package/dist/hooks/useSpaces/geometry/index.d.ts +30 -0
- package/dist/hooks/useSpaces/geometry/index.js +64 -0
- package/dist/hooks/useSpaces/geometry/isPointInPolygon.d.ts +3 -0
- package/dist/hooks/useSpaces/geometry/isPointInPolygon.js +21 -0
- package/dist/hooks/useSpaces/geometry/isPointInQuadrilateral.d.ts +3 -0
- package/dist/hooks/useSpaces/geometry/isPointInQuadrilateral.js +25 -0
- package/dist/hooks/useSpaces/geometry/orderCoordinatesOnLineSegment.d.ts +3 -0
- package/dist/hooks/useSpaces/geometry/orderCoordinatesOnLineSegment.js +11 -0
- package/dist/hooks/useSpaces/geometry/splitLineAtOffset.d.ts +3 -0
- package/dist/hooks/useSpaces/geometry/splitLineAtOffset.js +12 -0
- package/dist/hooks/useSpaces/geometry/splitLineAtPoint.d.ts +3 -0
- package/dist/hooks/useSpaces/geometry/splitLineAtPoint.js +9 -0
- package/dist/hooks/useSpaces/geometry/splitLineAtPoints.d.ts +3 -0
- package/dist/hooks/useSpaces/geometry/splitLineAtPoints.js +28 -0
- package/dist/hooks/useSpaces/index.d.ts +76 -0
- package/dist/hooks/useSpaces/index.js +475 -0
- package/dist/hooks/useSpaces/themes/blueprint.d.ts +3 -0
- package/dist/hooks/useSpaces/themes/blueprint.js +96 -0
- package/dist/hooks/useSpaces/themes/default.d.ts +3 -0
- package/dist/hooks/useSpaces/themes/default.js +96 -0
- package/dist/hooks/{useRoomBuilder/themes.d.ts → useSpaces/themes/index.d.ts} +3 -4
- package/dist/hooks/useSpaces/themes/index.js +21 -0
- package/dist/hooks/useSpaces/themes/light.d.ts +3 -0
- package/dist/hooks/useSpaces/themes/light.js +96 -0
- package/dist/hooks/{useRoomBuilder → useSpaces}/types.d.ts +131 -35
- package/dist/hooks/{useRoomBuilder → useSpaces}/types.js +13 -1
- package/dist/hooks/useSpaces/validators/areWallsDuplicated.d.ts +3 -0
- package/dist/hooks/useSpaces/validators/areWallsDuplicated.js +61 -0
- package/dist/hooks/useSpaces/validators/areWallsIntersecting.d.ts +3 -0
- package/dist/hooks/useSpaces/validators/areWallsIntersecting.js +42 -0
- package/dist/hooks/useSpaces/validators/areWallsOrphaningFeatures.d.ts +3 -0
- package/dist/hooks/useSpaces/validators/areWallsOrphaningFeatures.js +52 -0
- package/dist/hooks/useSpaces/validators/areWallsTooShort.d.ts +3 -0
- package/dist/hooks/useSpaces/validators/areWallsTooShort.js +37 -0
- package/dist/hooks/useSpaces/validators/index.d.ts +15 -0
- package/dist/hooks/useSpaces/validators/index.js +40 -0
- package/dist/hooks/useSpaces/validators/isFeatureCollidingWithExistingFeature.d.ts +3 -0
- package/dist/hooks/useSpaces/validators/isFeatureCollidingWithExistingFeature.js +31 -0
- package/dist/hooks/useSpaces/validators/isFeatureOutsideWallBounds.d.ts +3 -0
- package/dist/hooks/useSpaces/validators/isFeatureOutsideWallBounds.js +19 -0
- package/dist/hooks/useSpaces/validators/isLineTooShort.d.ts +3 -0
- package/dist/hooks/useSpaces/validators/isLineTooShort.js +26 -0
- package/dist/hooks/useSpaces/validators/isVertexLandingOnFeature.d.ts +4 -0
- package/dist/hooks/useSpaces/validators/isVertexLandingOnFeature.js +19 -0
- package/dist/hooks/useSpaces/validators/isWallEndingOnFeature.d.ts +3 -0
- package/dist/hooks/useSpaces/validators/isWallEndingOnFeature.js +19 -0
- package/dist/hooks/useSpaces/validators/isWallIntersectingFeature.d.ts +3 -0
- package/dist/hooks/useSpaces/validators/isWallIntersectingFeature.js +41 -0
- package/dist/hooks/useSpaces/validators/isWallOverlappingExisitingWalls.d.ts +3 -0
- package/dist/hooks/useSpaces/validators/isWallOverlappingExisitingWalls.js +54 -0
- package/dist/hooks/useSpaces/validators/isWallTooShort.d.ts +3 -0
- package/dist/hooks/useSpaces/validators/isWallTooShort.js +10 -0
- package/dist/hooks/{useRoomBuilder → useSpaces/validators}/messaging.js +1 -1
- package/dist/icons/AngleSnapping.d.ts +3 -0
- package/dist/icons/AngleSnapping.js +28 -0
- package/dist/icons/Center.d.ts +3 -0
- package/dist/icons/Center.js +24 -0
- package/dist/icons/Draw.js +3 -3
- package/dist/icons/GridSnapping.d.ts +3 -0
- package/dist/icons/GridSnapping.js +28 -0
- package/dist/icons/LayoutAlt.d.ts +3 -0
- package/dist/icons/LayoutAlt.js +21 -0
- package/dist/icons/Magnet.d.ts +3 -0
- package/dist/icons/Magnet.js +27 -0
- package/dist/icons/Player3D.d.ts +3 -0
- package/dist/icons/Player3D.js +21 -0
- package/dist/icons/Save.d.ts +3 -0
- package/dist/icons/Save.js +21 -0
- package/dist/icons/UnitCm.d.ts +3 -0
- package/dist/icons/UnitCm.js +22 -0
- package/dist/icons/UnitFeet.d.ts +3 -0
- package/dist/icons/UnitFeet.js +22 -0
- package/dist/icons/UnitInch.d.ts +3 -0
- package/dist/icons/UnitInch.js +22 -0
- package/dist/icons/UnitMeter.d.ts +3 -0
- package/dist/icons/UnitMeter.js +21 -0
- package/dist/icons/Window.js +4 -4
- package/dist/icons/index.js +22 -0
- package/dist/icons/types.d.ts +1 -1
- package/dist/index.d.ts +17 -3
- package/dist/index.js +35 -7
- package/dist/store/attributes.d.ts +1 -0
- package/dist/store/index.d.ts +39 -8
- package/dist/store/index.js +3 -1
- package/dist/store/product.js +4 -7
- package/dist/store/spaces.d.ts +47 -0
- package/dist/store/spaces.js +197 -0
- package/dist/store/treble.d.ts +1 -1
- package/dist/store/treble.js +24 -26
- package/dist/types.d.ts +6 -0
- package/package.json +1 -1
- package/dist/hooks/useAnimationStart/index.d.ts +0 -2
- package/dist/hooks/usePlayerLoadingStatus/index.d.ts +0 -2
- package/dist/hooks/useRoomBuilder/RoomBuilderState.d.ts +0 -95
- package/dist/hooks/useRoomBuilder/RoomBuilderState.js +0 -1237
- package/dist/hooks/useRoomBuilder/constants.d.ts +0 -41
- package/dist/hooks/useRoomBuilder/constants.js +0 -48
- package/dist/hooks/useRoomBuilder/draw.d.ts +0 -55
- package/dist/hooks/useRoomBuilder/draw.js +0 -573
- package/dist/hooks/useRoomBuilder/findLoops.d.ts +0 -5
- package/dist/hooks/useRoomBuilder/geometry.d.ts +0 -33
- package/dist/hooks/useRoomBuilder/geometry.js +0 -325
- package/dist/hooks/useRoomBuilder/index.d.ts +0 -40
- package/dist/hooks/useRoomBuilder/index.js +0 -303
- package/dist/hooks/useRoomBuilder/themes.js +0 -273
- package/dist/hooks/useRoomBuilder/validators.d.ts +0 -36
- package/dist/hooks/useRoomBuilder/validators.js +0 -362
- /package/dist/Treble/{snapshots.d.ts → snapshot.d.ts} +0 -0
- /package/dist/Treble/{snapshots.js → snapshot.js} +0 -0
- /package/dist/hooks/{useRoomBuilder → useSpaces/validators}/messaging.d.ts +0 -0
|
@@ -0,0 +1,52 @@
|
|
|
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;
|
|
@@ -0,0 +1,3 @@
|
|
|
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;
|
|
@@ -0,0 +1,37 @@
|
|
|
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;
|
|
@@ -0,0 +1,15 @@
|
|
|
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;
|
|
@@ -0,0 +1,40 @@
|
|
|
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;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { IFeatureValidatorInput, ISharedValidatorInput, IErrorElement } from '../types';
|
|
2
|
+
declare function isFeatureCollidingWithExistingFeature(input: IFeatureValidatorInput, wallAndFeatures: ISharedValidatorInput): false | IErrorElement;
|
|
3
|
+
export default isFeatureCollidingWithExistingFeature;
|
|
@@ -0,0 +1,31 @@
|
|
|
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;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { IErrorElement, IWallsValidationConfig, IFeatureValidatorInput, ISharedValidatorInput } from '../types';
|
|
2
|
+
declare function isFeatureOutsideWallBounds(input: IFeatureValidatorInput, _: ISharedValidatorInput, validationConfig: IWallsValidationConfig): false | IErrorElement;
|
|
3
|
+
export default isFeatureOutsideWallBounds;
|
|
@@ -0,0 +1,19 @@
|
|
|
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;
|
|
@@ -0,0 +1,26 @@
|
|
|
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;
|
|
@@ -0,0 +1,19 @@
|
|
|
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;
|
|
@@ -0,0 +1,19 @@
|
|
|
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;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { IAddWallValidatorInput, ISharedValidatorInput, IErrorElement } from '../types';
|
|
2
|
+
declare function isWallIntersectingFeature(input: IAddWallValidatorInput, wallAndFeatures: ISharedValidatorInput): false | IErrorElement;
|
|
3
|
+
export default isWallIntersectingFeature;
|
|
@@ -0,0 +1,41 @@
|
|
|
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;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { IErrorElement, IAddWallValidatorInput, ISharedValidatorInput } from '../types';
|
|
2
|
+
declare function isWallOverlappingExisitingWalls(input: IAddWallValidatorInput, wallAndFeatures: ISharedValidatorInput): false | IErrorElement;
|
|
3
|
+
export default isWallOverlappingExisitingWalls;
|
|
@@ -0,0 +1,54 @@
|
|
|
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;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { IAddWallValidatorInput, ISharedValidatorInput, IErrorElement, IWallsValidationConfig } from '../types';
|
|
2
|
+
declare function isWallTooShort(input: IAddWallValidatorInput, _: ISharedValidatorInput, validationConfig: IWallsValidationConfig): false | IErrorElement;
|
|
3
|
+
export default isWallTooShort;
|
|
@@ -0,0 +1,10 @@
|
|
|
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,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.errorMessages = void 0;
|
|
4
|
-
var constants_1 = require("
|
|
4
|
+
var constants_1 = require("../constants");
|
|
5
5
|
exports.errorMessages = {
|
|
6
6
|
addWallCollidingWithWall: function () { return 'Wall cannot collide with another wall.'; },
|
|
7
7
|
addWallCollidingWithFeature: function (feature) {
|
|
@@ -0,0 +1,28 @@
|
|
|
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;
|
|
@@ -0,0 +1,24 @@
|
|
|
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.Center = 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 || 'white'; });
|
|
14
|
+
var Center = 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, d: "M1.52851 2.47141L5.72377 6.66666H3.99992C3.63173 6.66666 3.33325 6.96513 3.33325 7.33332C3.33325 7.70151 3.63173 7.99999 3.99992 7.99999H7.33325C7.70144 7.99999 7.99992 7.70151 7.99992 7.33332V3.99999C7.99992 3.6318 7.70144 3.33332 7.33325 3.33332C6.96506 3.33332 6.66659 3.6318 6.66659 3.99999V5.72386L2.47132 1.5286C2.21097 1.26825 1.78886 1.26825 1.52851 1.5286C1.26816 1.78895 1.26816 2.21106 1.52851 2.47141Z" }),
|
|
17
|
+
react_1.default.createElement(Path, { color: props.color, d: "M18.4713 2.47141L14.2761 6.66666H15.9999C16.3681 6.66666 16.6666 6.96513 16.6666 7.33332C16.6666 7.70151 16.3681 7.99999 15.9999 7.99999H12.6666C12.2984 7.99999 11.9999 7.70151 11.9999 7.33332V3.99999C11.9999 3.6318 12.2984 3.33332 12.6666 3.33332C13.0348 3.33332 13.3333 3.6318 13.3333 3.99999V5.72386L17.5285 1.5286C17.7889 1.26825 18.211 1.26825 18.4713 1.5286C18.7317 1.78895 18.7317 2.21106 18.4713 2.47141Z" }),
|
|
18
|
+
react_1.default.createElement(Path, { color: props.color, d: "M14.2761 13.3334L18.4713 17.5286C18.7317 17.7889 18.7317 18.2111 18.4713 18.4714C18.211 18.7318 17.7889 18.7318 17.5285 18.4714L13.3333 14.2761V16C13.3333 16.3682 13.0348 16.6667 12.6666 16.6667C12.2984 16.6667 11.9999 16.3682 11.9999 16V12.6667C11.9999 12.2985 12.2984 12 12.6666 12H15.9999C16.3681 12 16.6666 12.2985 16.6666 12.6667C16.6666 13.0349 16.3681 13.3334 15.9999 13.3334H14.2761Z" }),
|
|
19
|
+
react_1.default.createElement(Path, { color: props.color, d: "M1.52851 17.5286L5.72377 13.3334H3.99992C3.63173 13.3334 3.33325 13.0349 3.33325 12.6667C3.33325 12.2985 3.63173 12 3.99992 12H7.33325C7.70144 12 7.99992 12.2985 7.99992 12.6667V16C7.99992 16.3682 7.70144 16.6667 7.33325 16.6667C6.96506 16.6667 6.66659 16.3682 6.66659 16V14.2761L2.47132 18.4714C2.21097 18.7318 1.78886 18.7318 1.52851 18.4714C1.26816 18.2111 1.26816 17.7889 1.52851 17.5286Z" })));
|
|
20
|
+
};
|
|
21
|
+
exports.Center = Center;
|
|
22
|
+
exports.Center.iconName = 'center';
|
|
23
|
+
exports.default = exports.Center;
|
|
24
|
+
var templateObject_1;
|
package/dist/icons/Draw.js
CHANGED
|
@@ -10,10 +10,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
10
10
|
exports.Draw = void 0;
|
|
11
11
|
var react_1 = __importDefault(require("react"));
|
|
12
12
|
var styled_components_1 = __importDefault(require("styled-components"));
|
|
13
|
-
var
|
|
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
14
|
var Draw = function (props) {
|
|
15
|
-
return (react_1.default.createElement(
|
|
16
|
-
react_1.default.createElement(
|
|
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, { fillRule: "evenodd", clipRule: "evenodd", d: "M3.74417 0.637287C4.59388 -0.212428 5.97154 -0.21243 6.82126 0.637287L19.3627 13.1787C19.7708 13.5868 20 14.1402 20 14.7173V20H14.7173C14.1402 20 13.5868 19.7708 13.1787 19.3627L0.637287 6.82126C-0.21243 5.97154 -0.21243 4.59388 0.637286 3.74417L3.74417 0.637287ZM5.50251 1.95604C5.38112 1.83465 5.18431 1.83465 5.06292 1.95604L1.95604 5.06292C1.83465 5.18431 1.83465 5.38112 1.95604 5.50251L4.20155 7.74802L7.74802 4.20155L5.50251 1.95604ZM9.06677 5.52031L18.044 14.4975C18.1023 14.5558 18.135 14.6348 18.135 14.7173V18.135H14.7173C14.6348 18.135 14.5558 18.1023 14.4975 18.044L5.52031 9.06677L9.06677 5.52031Z", color: props.color })));
|
|
17
17
|
};
|
|
18
18
|
exports.Draw = Draw;
|
|
19
19
|
exports.Draw.iconName = 'draw';
|
|
@@ -0,0 +1,28 @@
|
|
|
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.GridSnapping = 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 GridSnapping = 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, d: "M5.99992 1.33333V5.99999H12.6666V1.33333H13.3333V5.99999H17.9999V6.66666H13.3333V12.6667H17.9999V13.3333H13.3333V18H12.6666V6.66666H5.99992V8.66666H5.33325V6.66666H1.33325V5.99999H5.33325V1.33333H5.99992Z" }),
|
|
17
|
+
react_1.default.createElement(Path, { color: props.color, fillRule: "evenodd", clipRule: "evenodd", d: "M5.99992 17.097C6.65804 17.0159 7.32682 16.7169 7.94461 16.1457L7.94623 16.1473L10.4269 13.6895C10.5314 13.586 10.5314 13.4182 10.4269 13.3147L10.285 13.1742L10.2827 13.1765L9.47684 12.3781L9.47921 12.3758L9.33735 12.2352C9.23289 12.1318 9.06352 12.1318 8.95906 12.2352L6.58437 14.588C6.02421 15.0597 5.31483 14.9369 4.86572 14.5135C4.6426 14.3031 4.4949 14.0264 4.46724 13.7276C4.44042 13.4377 4.52466 13.1085 4.79494 12.7765L7.15014 10.443C7.2546 10.3396 7.2546 10.1718 7.15014 10.0683L7.00828 9.92771L7.00591 9.93006L6.20007 9.13168L6.20245 9.12932L6.06059 8.98878C5.95613 8.88528 5.78676 8.88528 5.6823 8.98878L3.26274 11.386L3.26186 11.3851C2.84852 11.7852 2.56771 12.2203 2.40152 12.6667H1.33325V13.3333H2.23699C2.21536 13.5036 2.20875 13.6738 2.21619 13.8427C2.25291 14.6756 2.63043 15.4604 3.20216 16.0511C3.75963 16.6271 4.51131 17.0282 5.33325 17.1062V18H5.99992V17.097ZM2.68386 13.8225C2.65295 13.1214 2.90696 12.3785 3.58593 11.7198L3.58688 11.7207L4.85479 10.4645L5.66062 11.2629L4.45203 12.4603L4.48538 12.4934L4.44869 12.4633C4.09527 12.8872 3.96152 13.3423 4.00109 13.7699C4.04031 14.1936 4.24787 14.5712 4.54302 14.8495C5.13044 15.4033 6.10992 15.5956 6.88722 14.941L6.87213 14.9234L6.88999 14.9411L8.06468 13.7772L8.87052 14.5756L7.64559 15.7892L7.64478 15.7884C6.92035 16.4671 6.1439 16.7018 5.43183 16.6491C4.71437 16.5959 4.04234 16.2491 3.54002 15.7301C3.03761 15.211 2.71505 14.53 2.68386 13.8225ZM5.97679 10.9497L6.68974 10.2433L5.8839 9.44492L5.17096 10.1513L5.97679 10.9497ZM9.9665 13.4898L9.18669 14.2624L8.38085 13.464L9.16067 12.6914L9.9665 13.4898Z" }),
|
|
18
|
+
react_1.default.createElement(Path, { color: props.color, d: "M6.53501 6.87999C6.40574 6.87999 6.30095 6.98382 6.30095 7.11189V8.23821C6.30095 8.36628 6.40574 8.4701 6.53501 8.4701C6.66427 8.4701 6.76906 8.36628 6.76906 8.23821V7.11189C6.76906 6.98382 6.66427 6.87999 6.53501 6.87999Z" }),
|
|
19
|
+
react_1.default.createElement(Path, { color: props.color, d: "M9.87865 10.1927C9.74938 10.1927 9.64459 10.2965 9.64459 10.4246V11.5509C9.64459 11.679 9.74938 11.7828 9.87865 11.7828C10.0079 11.7828 10.1127 11.679 10.1127 11.5509V10.4246C10.1127 10.2965 10.0079 10.1927 9.87865 10.1927Z" }),
|
|
20
|
+
react_1.default.createElement(Path, { color: props.color, d: "M7.50466 9.69581C7.50466 9.82388 7.60945 9.92771 7.73872 9.92771H8.87556C9.00482 9.92771 9.10961 9.82388 9.10961 9.69581C9.10961 9.56774 9.00482 9.46392 8.87556 9.46392H7.73872C7.60945 9.46392 7.50466 9.56774 7.50466 9.69581Z" }),
|
|
21
|
+
react_1.default.createElement(Path, { color: props.color, d: "M10.8483 13.0085C10.8483 13.1366 10.9531 13.2404 11.0824 13.2404H12.2192C12.3485 13.2404 12.4533 13.1366 12.4533 13.0085C12.4533 12.8805 12.3485 12.7767 12.2192 12.7767H11.0824C10.9531 12.7767 10.8483 12.8805 10.8483 13.0085Z" }),
|
|
22
|
+
react_1.default.createElement(Path, { color: props.color, d: "M8.47067 7.574C8.37927 7.48344 8.23107 7.48344 8.13967 7.574L7.3358 8.37044C7.2444 8.461 7.2444 8.60782 7.3358 8.69838C7.42721 8.78894 7.5754 8.78894 7.66681 8.69838L8.47067 7.90195C8.56208 7.81139 8.56208 7.66456 8.47067 7.574Z" }),
|
|
23
|
+
react_1.default.createElement(Path, { color: props.color, d: "M11.8143 10.8867C11.7229 10.7962 11.5747 10.7962 11.4833 10.8867L10.6794 11.6832C10.588 11.7737 10.588 11.9205 10.6794 12.0111C10.7708 12.1017 10.919 12.1017 11.0104 12.0111L11.8143 11.2147C11.9057 11.1241 11.9057 10.9773 11.8143 10.8867Z" })));
|
|
24
|
+
};
|
|
25
|
+
exports.GridSnapping = GridSnapping;
|
|
26
|
+
exports.GridSnapping.iconName = 'grid-snapping';
|
|
27
|
+
exports.default = exports.GridSnapping;
|
|
28
|
+
var templateObject_1;
|
|
@@ -0,0 +1,21 @@
|
|
|
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.LayoutAlt = 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 stroke: ", ";\n }\n"], ["\n .tk-icon {\n stroke: ", ";\n }\n"])), function (props) { return props.color || props.theme.textColor; });
|
|
14
|
+
var LayoutAlt = 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", { d: "M1 19V1H9V9.6C9 10.3732 9.62681 11 10.4 11H19V19H1Z", className: "tk-icon", strokeWidth: "2" })));
|
|
17
|
+
};
|
|
18
|
+
exports.LayoutAlt = LayoutAlt;
|
|
19
|
+
exports.LayoutAlt.iconName = 'layout-alt';
|
|
20
|
+
exports.default = exports.LayoutAlt;
|
|
21
|
+
var templateObject_1;
|