@threekit-tools/treble 0.0.91 → 0.0.92-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.
Files changed (189) hide show
  1. package/dist/Treble/Treble.d.ts +2 -2
  2. package/dist/Treble/Treble.js +2 -2
  3. package/dist/Treble/index.d.ts +1 -1
  4. package/dist/Treble/index.js +1 -1
  5. package/dist/components/ThreekitProvider/index.js +3 -2
  6. package/dist/connection.d.ts +4 -1
  7. package/dist/connection.js +16 -53
  8. package/dist/hooks/useAttribute/index.js +1 -5
  9. package/dist/hooks/useNestedConfigurator/index.js +1 -2
  10. package/dist/hooks/useSpaces/SpacesLayout.d.ts +11 -0
  11. package/dist/hooks/useSpaces/SpacesLayout.js +74 -0
  12. package/dist/hooks/useSpaces/SpacesState.d.ts +177 -0
  13. package/dist/hooks/useSpaces/SpacesState.js +1814 -0
  14. package/dist/hooks/useSpaces/constants.d.ts +79 -0
  15. package/dist/hooks/useSpaces/constants.js +130 -0
  16. package/dist/hooks/useSpaces/dataHandlers.d.ts +38 -0
  17. package/dist/hooks/useSpaces/dataHandlers.js +407 -0
  18. package/dist/hooks/useSpaces/draw/clearCanvas.d.ts +2 -0
  19. package/dist/hooks/useSpaces/draw/clearCanvas.js +9 -0
  20. package/dist/hooks/useSpaces/draw/drawBackground.d.ts +2 -0
  21. package/dist/hooks/useSpaces/draw/drawBackground.js +12 -0
  22. package/dist/hooks/useSpaces/draw/drawDimensions.d.ts +3 -0
  23. package/dist/hooks/useSpaces/draw/drawDimensions.js +53 -0
  24. package/dist/hooks/useSpaces/draw/drawDoors.d.ts +9 -0
  25. package/dist/hooks/useSpaces/draw/drawDoors.js +99 -0
  26. package/dist/hooks/useSpaces/draw/drawFloor.d.ts +3 -0
  27. package/dist/hooks/useSpaces/draw/drawFloor.js +36 -0
  28. package/dist/hooks/useSpaces/draw/drawGrid.d.ts +3 -0
  29. package/dist/hooks/useSpaces/draw/drawGrid.js +36 -0
  30. package/dist/hooks/useSpaces/draw/drawGuides.d.ts +3 -0
  31. package/dist/hooks/useSpaces/draw/drawGuides.js +23 -0
  32. package/dist/hooks/useSpaces/draw/drawOpenings.d.ts +9 -0
  33. package/dist/hooks/useSpaces/draw/drawOpenings.js +72 -0
  34. package/dist/hooks/useSpaces/draw/drawVertices.d.ts +8 -0
  35. package/dist/hooks/useSpaces/draw/drawVertices.js +61 -0
  36. package/dist/hooks/useSpaces/draw/drawWalls.d.ts +11 -0
  37. package/dist/hooks/useSpaces/draw/drawWalls.js +90 -0
  38. package/dist/hooks/useSpaces/draw/drawWindows.d.ts +9 -0
  39. package/dist/hooks/useSpaces/draw/drawWindows.js +82 -0
  40. package/dist/hooks/useSpaces/draw/index.d.ts +11 -0
  41. package/dist/hooks/useSpaces/draw/index.js +129 -0
  42. package/dist/hooks/useSpaces/geometry/addThicknessToLine.d.ts +3 -0
  43. package/dist/hooks/useSpaces/geometry/addThicknessToLine.js +13 -0
  44. package/dist/hooks/useSpaces/geometry/areLinesEqual.d.ts +3 -0
  45. package/dist/hooks/useSpaces/geometry/areLinesEqual.js +17 -0
  46. package/dist/hooks/useSpaces/geometry/arePointsEqual.d.ts +3 -0
  47. package/dist/hooks/useSpaces/geometry/arePointsEqual.js +8 -0
  48. package/dist/hooks/useSpaces/geometry/arePointsWithinProximity.d.ts +3 -0
  49. package/dist/hooks/useSpaces/geometry/arePointsWithinProximity.js +11 -0
  50. package/dist/hooks/useSpaces/geometry/closestPointOnLine.d.ts +3 -0
  51. package/dist/hooks/useSpaces/geometry/closestPointOnLine.js +13 -0
  52. package/dist/hooks/useSpaces/geometry/doLinesOverlap.d.ts +2 -0
  53. package/dist/hooks/useSpaces/geometry/doLinesOverlap.js +16 -0
  54. package/dist/hooks/useSpaces/geometry/euclideanMod.d.ts +2 -0
  55. package/dist/hooks/useSpaces/geometry/euclideanMod.js +6 -0
  56. package/dist/hooks/useSpaces/geometry/findLoops.d.ts +6 -0
  57. package/dist/hooks/{useRoomBuilder → useSpaces/geometry}/findLoops.js +31 -13
  58. package/dist/hooks/useSpaces/geometry/getAllLineIntersections.d.ts +6 -0
  59. package/dist/hooks/useSpaces/geometry/getAllLineIntersections.js +23 -0
  60. package/dist/hooks/useSpaces/geometry/getAngleOfLineSegment.d.ts +3 -0
  61. package/dist/hooks/useSpaces/geometry/getAngleOfLineSegment.js +7 -0
  62. package/dist/hooks/useSpaces/geometry/getClosestPointOnLineSegment.d.ts +3 -0
  63. package/dist/hooks/useSpaces/geometry/getClosestPointOnLineSegment.js +17 -0
  64. package/dist/hooks/useSpaces/geometry/getDistanceToLine.d.ts +3 -0
  65. package/dist/hooks/useSpaces/geometry/getDistanceToLine.js +10 -0
  66. package/dist/hooks/useSpaces/geometry/getLengthOfLineSegment.d.ts +3 -0
  67. package/dist/hooks/useSpaces/geometry/getLengthOfLineSegment.js +7 -0
  68. package/dist/hooks/useSpaces/geometry/getLineAtOffsetOnLineSegment.d.ts +3 -0
  69. package/dist/hooks/useSpaces/geometry/getLineAtOffsetOnLineSegment.js +17 -0
  70. package/dist/hooks/useSpaces/geometry/getLineOtherPoint.d.ts +3 -0
  71. package/dist/hooks/useSpaces/geometry/getLineOtherPoint.js +11 -0
  72. package/dist/hooks/useSpaces/geometry/getLineSegmentsIntersection.d.ts +3 -0
  73. package/dist/hooks/useSpaces/geometry/getLineSegmentsIntersection.js +43 -0
  74. package/dist/hooks/useSpaces/geometry/getMidpointOfLineSegment.d.ts +3 -0
  75. package/dist/hooks/useSpaces/geometry/getMidpointOfLineSegment.js +9 -0
  76. package/dist/hooks/useSpaces/geometry/getParallelLineSegmentAtDistance.d.ts +3 -0
  77. package/dist/hooks/useSpaces/geometry/getParallelLineSegmentAtDistance.js +20 -0
  78. package/dist/hooks/useSpaces/geometry/getPointAtOffsetOnLineSegment.d.ts +3 -0
  79. package/dist/hooks/useSpaces/geometry/getPointAtOffsetOnLineSegment.js +11 -0
  80. package/dist/hooks/useSpaces/geometry/getPolygonArea.d.ts +3 -0
  81. package/dist/hooks/useSpaces/geometry/getPolygonArea.js +15 -0
  82. package/dist/hooks/useSpaces/geometry/getQuadrilateralArea.d.ts +3 -0
  83. package/dist/hooks/useSpaces/geometry/getQuadrilateralArea.js +16 -0
  84. package/dist/hooks/useSpaces/geometry/getTangetIntersectionAndOffset.d.ts +6 -0
  85. package/dist/hooks/useSpaces/geometry/getTangetIntersectionAndOffset.js +17 -0
  86. package/dist/hooks/useSpaces/geometry/getTriangleArea.d.ts +3 -0
  87. package/dist/hooks/useSpaces/geometry/getTriangleArea.js +9 -0
  88. package/dist/hooks/useSpaces/geometry/getUnitVectorOfLineSegment.d.ts +3 -0
  89. package/dist/hooks/useSpaces/geometry/getUnitVectorOfLineSegment.js +12 -0
  90. package/dist/hooks/useSpaces/geometry/index.d.ts +30 -0
  91. package/dist/hooks/useSpaces/geometry/index.js +64 -0
  92. package/dist/hooks/useSpaces/geometry/isPointInPolygon.d.ts +3 -0
  93. package/dist/hooks/useSpaces/geometry/isPointInPolygon.js +21 -0
  94. package/dist/hooks/useSpaces/geometry/isPointInQuadrilateral.d.ts +3 -0
  95. package/dist/hooks/useSpaces/geometry/isPointInQuadrilateral.js +25 -0
  96. package/dist/hooks/useSpaces/geometry/orderCoordinatesOnLineSegment.d.ts +3 -0
  97. package/dist/hooks/useSpaces/geometry/orderCoordinatesOnLineSegment.js +11 -0
  98. package/dist/hooks/useSpaces/geometry/splitLineAtOffset.d.ts +3 -0
  99. package/dist/hooks/useSpaces/geometry/splitLineAtOffset.js +12 -0
  100. package/dist/hooks/useSpaces/geometry/splitLineAtPoint.d.ts +3 -0
  101. package/dist/hooks/useSpaces/geometry/splitLineAtPoint.js +9 -0
  102. package/dist/hooks/useSpaces/geometry/splitLineAtPoints.d.ts +3 -0
  103. package/dist/hooks/useSpaces/geometry/splitLineAtPoints.js +28 -0
  104. package/dist/hooks/useSpaces/index.d.ts +95 -0
  105. package/dist/hooks/useSpaces/index.js +557 -0
  106. package/dist/hooks/useSpaces/themes/blueprint.d.ts +3 -0
  107. package/dist/hooks/useSpaces/themes/blueprint.js +96 -0
  108. package/dist/hooks/useSpaces/themes/default.d.ts +3 -0
  109. package/dist/hooks/useSpaces/themes/default.js +96 -0
  110. package/dist/hooks/{useRoomBuilder/themes.d.ts → useSpaces/themes/index.d.ts} +3 -4
  111. package/dist/hooks/useSpaces/themes/index.js +21 -0
  112. package/dist/hooks/useSpaces/themes/light.d.ts +3 -0
  113. package/dist/hooks/useSpaces/themes/light.js +96 -0
  114. package/dist/hooks/useSpaces/types.d.ts +378 -0
  115. package/dist/hooks/{useRoomBuilder → useSpaces}/types.js +19 -1
  116. package/dist/hooks/useSpaces/validators/areWallsDuplicated.d.ts +3 -0
  117. package/dist/hooks/useSpaces/validators/areWallsDuplicated.js +61 -0
  118. package/dist/hooks/useSpaces/validators/areWallsIntersecting.d.ts +3 -0
  119. package/dist/hooks/useSpaces/validators/areWallsIntersecting.js +42 -0
  120. package/dist/hooks/useSpaces/validators/areWallsOrphaningFeatures.d.ts +3 -0
  121. package/dist/hooks/useSpaces/validators/areWallsOrphaningFeatures.js +52 -0
  122. package/dist/hooks/useSpaces/validators/areWallsTooShort.d.ts +3 -0
  123. package/dist/hooks/useSpaces/validators/areWallsTooShort.js +37 -0
  124. package/dist/hooks/useSpaces/validators/index.d.ts +15 -0
  125. package/dist/hooks/useSpaces/validators/index.js +40 -0
  126. package/dist/hooks/useSpaces/validators/isFeatureCollidingWithExistingFeature.d.ts +3 -0
  127. package/dist/hooks/useSpaces/validators/isFeatureCollidingWithExistingFeature.js +31 -0
  128. package/dist/hooks/useSpaces/validators/isFeatureOutsideWallBounds.d.ts +3 -0
  129. package/dist/hooks/useSpaces/validators/isFeatureOutsideWallBounds.js +19 -0
  130. package/dist/hooks/useSpaces/validators/isLineTooShort.d.ts +3 -0
  131. package/dist/hooks/useSpaces/validators/isLineTooShort.js +26 -0
  132. package/dist/hooks/useSpaces/validators/isVertexLandingOnFeature.d.ts +4 -0
  133. package/dist/hooks/useSpaces/validators/isVertexLandingOnFeature.js +19 -0
  134. package/dist/hooks/useSpaces/validators/isWallEndingOnFeature.d.ts +3 -0
  135. package/dist/hooks/useSpaces/validators/isWallEndingOnFeature.js +19 -0
  136. package/dist/hooks/useSpaces/validators/isWallIntersectingFeature.d.ts +3 -0
  137. package/dist/hooks/useSpaces/validators/isWallIntersectingFeature.js +41 -0
  138. package/dist/hooks/useSpaces/validators/isWallOverlappingExisitingWalls.d.ts +3 -0
  139. package/dist/hooks/useSpaces/validators/isWallOverlappingExisitingWalls.js +54 -0
  140. package/dist/hooks/useSpaces/validators/isWallTooShort.d.ts +3 -0
  141. package/dist/hooks/useSpaces/validators/isWallTooShort.js +10 -0
  142. package/dist/hooks/{useRoomBuilder → useSpaces/validators}/messaging.js +1 -1
  143. package/dist/icons/Boundary.d.ts +3 -0
  144. package/dist/icons/Boundary.js +21 -0
  145. package/dist/icons/Draw.js +3 -3
  146. package/dist/icons/Player3D.d.ts +3 -0
  147. package/dist/icons/Player3D.js +21 -0
  148. package/dist/icons/RulerBlank.d.ts +3 -0
  149. package/dist/icons/RulerBlank.js +25 -0
  150. package/dist/icons/RulerDetailed.d.ts +3 -0
  151. package/dist/icons/RulerDetailed.js +27 -0
  152. package/dist/icons/Window.js +4 -4
  153. package/dist/icons/index.js +28 -0
  154. package/dist/icons/types.d.ts +1 -1
  155. package/dist/index.d.ts +17 -2
  156. package/dist/index.js +35 -5
  157. package/dist/store/attributes.d.ts +2 -1
  158. package/dist/store/index.d.ts +17 -31
  159. package/dist/store/index.js +3 -1
  160. package/dist/store/product.js +4 -7
  161. package/dist/store/spaces.d.ts +74 -0
  162. package/dist/store/spaces.js +354 -0
  163. package/dist/store/treble.d.ts +4 -2
  164. package/dist/store/treble.js +58 -50
  165. package/dist/store/wishlist.d.ts +20 -2
  166. package/dist/types.d.ts +14 -3
  167. package/package.json +2 -1
  168. package/dist/hooks/useRoomBuilder/RoomBuilderState.d.ts +0 -95
  169. package/dist/hooks/useRoomBuilder/RoomBuilderState.js +0 -1237
  170. package/dist/hooks/useRoomBuilder/constants.d.ts +0 -41
  171. package/dist/hooks/useRoomBuilder/constants.js +0 -48
  172. package/dist/hooks/useRoomBuilder/dataHandlers.d.ts +0 -18
  173. package/dist/hooks/useRoomBuilder/dataHandlers.js +0 -187
  174. package/dist/hooks/useRoomBuilder/draw.d.ts +0 -55
  175. package/dist/hooks/useRoomBuilder/draw.js +0 -573
  176. package/dist/hooks/useRoomBuilder/findLoops.d.ts +0 -5
  177. package/dist/hooks/useRoomBuilder/geometry.d.ts +0 -33
  178. package/dist/hooks/useRoomBuilder/geometry.js +0 -325
  179. package/dist/hooks/useRoomBuilder/index.d.ts +0 -40
  180. package/dist/hooks/useRoomBuilder/index.js +0 -303
  181. package/dist/hooks/useRoomBuilder/themes.js +0 -273
  182. package/dist/hooks/useRoomBuilder/types.d.ts +0 -238
  183. package/dist/hooks/useRoomBuilder/validators.d.ts +0 -36
  184. package/dist/hooks/useRoomBuilder/validators.js +0 -362
  185. package/dist/hooks/useSpaces/Canvas.d.ts +0 -37
  186. package/dist/hooks/useSpaces/Canvas.js +0 -199
  187. /package/dist/Treble/{snapshots.d.ts → snapshot.d.ts} +0 -0
  188. /package/dist/Treble/{snapshots.js → snapshot.js} +0 -0
  189. /package/dist/hooks/{useRoomBuilder → useSpaces/validators}/messaging.d.ts +0 -0
@@ -0,0 +1,61 @@
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;
@@ -0,0 +1,3 @@
1
+ import type { IErrorElement, IMoveVertexValidatorInput, ISharedValidatorInput } from '../types';
2
+ declare function areWallsIntersecting(input: IMoveVertexValidatorInput, wallAndFeatures: ISharedValidatorInput): false | IErrorElement;
3
+ export default areWallsIntersecting;
@@ -0,0 +1,42 @@
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;
@@ -0,0 +1,3 @@
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;
@@ -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,3 @@
1
+ import type { ICoordinatesLine, IErrorElement, IWall, IWallsValidationConfig } from '../types';
2
+ declare function isLineTooShort(wallOrLine: ICoordinatesLine | IWall, validationConfig: IWallsValidationConfig): false | IErrorElement;
3
+ export default isLineTooShort;
@@ -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,4 @@
1
+ import { IErrorElement } from '../types';
2
+ import type { IMoveVertexValidatorInput } from '../types';
3
+ declare function isVertexLandingOnFeature(input: IMoveVertexValidatorInput): false | IErrorElement;
4
+ export 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 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,3 @@
1
+ import type { IErrorElement, IAddWallValidatorInput } from '../types';
2
+ declare function isWallEndingOnFeature(input: IAddWallValidatorInput): false | IErrorElement;
3
+ export default isWallEndingOnFeature;
@@ -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("./constants");
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,3 @@
1
+ import { IIcon } from './types';
2
+ export declare const Boundary: IIcon;
3
+ export default Boundary;
@@ -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.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;
@@ -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 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; });
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(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", 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", className: "tk-icon" })));
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,3 @@
1
+ import { IIcon } from './types';
2
+ export declare const Player3D: IIcon;
3
+ export default Player3D;
@@ -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.Player3D = 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 Player3D = 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", d: "M10.1678 1.05955L10.0003 1L9.83285 1.05955L3.5161 3.30527L3.18359 3.42348V3.77638V11.6364V11.9893L3.5161 12.1075L9.83285 14.3533L10.0003 14.4128L10.1678 14.3533L16.4845 12.1075L16.817 11.9893V11.6364V3.77638V3.42348L16.4845 3.30527L10.1678 1.05955ZM9.50034 6.375L4.18359 4.4848V11.2835L9.50034 13.1738V6.375ZM15.817 11.2835L10.5003 13.1737V6.375L15.817 4.4848V11.2835ZM14.8244 3.77638L10.0003 5.49144L5.17622 3.77638L10.0003 2.06132L14.8244 3.77638ZM2.21438 8.32289C0.919876 9.24063 0 10.4827 0 11.9723C0 13.8117 1.40245 15.2735 3.1809 16.2135C4.71477 17.0242 6.6857 17.5461 8.83542 17.6854L8.17982 18.126C7.95064 18.28 7.88972 18.5907 8.04376 18.8199C8.1978 19.0491 8.50847 19.11 8.73766 18.956L10.7929 17.5746L11.4103 17.1596L10.7929 16.7447L10.5744 16.5978V16.579L10.5477 16.5799L8.73767 15.3632C8.50849 15.2091 8.19782 15.2701 8.04377 15.4992C7.88972 15.7284 7.95063 16.0391 8.17981 16.1931L8.69201 16.5374C4.48846 16.2038 1.26536 14.287 1.26536 11.9723C1.26536 11.2181 1.60756 10.5062 2.21438 9.87745V8.32289ZM18.3477 10.6094C18.5992 11.0402 18.7346 11.4979 18.7346 11.9723C18.7346 13.9903 16.2848 15.7059 12.8714 16.3336V17.489C14.3526 17.2412 15.7018 16.804 16.8191 16.2135C18.5975 15.2735 20 13.8117 20 11.9723C20 10.709 19.3383 9.6237 18.3477 8.76332V10.6094Z", className: "tk-icon" })));
17
+ };
18
+ exports.Player3D = Player3D;
19
+ exports.Player3D.iconName = 'player-3d';
20
+ exports.default = exports.Player3D;
21
+ var templateObject_1;
@@ -0,0 +1,3 @@
1
+ import { IIcon } from './types';
2
+ export declare const Ruler: IIcon;
3
+ export default Ruler;