@threekit-tools/treble 0.0.94 → 0.0.95-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 +3 -3
- package/dist/Treble/index.d.ts +1 -1
- package/dist/Treble/index.js +1 -1
- package/dist/Treble/{snapshots.d.ts → snapshot.d.ts} +1 -1
- package/dist/Treble/{snapshots.js → snapshot.js} +1 -1
- package/dist/Treble/wishlist.d.ts +1 -1
- package/dist/Treble/wishlist.js +1 -1
- package/dist/api/assets.js +1 -1
- package/dist/api/catalog.js +1 -1
- package/dist/api/configurations.js +1 -1
- package/dist/api/datatables.js +1 -1
- package/dist/api/orders.js +1 -1
- package/dist/api/price.js +1 -1
- package/dist/components/AttributeTitle/index.d.ts +2 -2
- package/dist/components/AttributeValue/index.d.ts +2 -2
- package/dist/components/BreatheAnimation/index.js +1 -1
- package/dist/components/Button/index.d.ts +3 -3
- package/dist/components/Cards/index.d.ts +3 -3
- package/dist/components/DevTools/index.d.ts +2 -2
- package/dist/components/DraggableHint/draggableIndicator.styles.d.ts +1 -1
- package/dist/components/DraggableHint/index.d.ts +2 -2
- package/dist/components/Dropdown/index.d.ts +3 -3
- package/dist/components/FlatForm/index.d.ts +2 -2
- package/dist/components/FormComponentDescription/index.d.ts +1 -1
- package/dist/components/FormComponentTitle/index.d.ts +1 -1
- package/dist/components/Player/index.d.ts +9 -9
- package/dist/components/PlayerLoadingCircular/index.d.ts +2 -2
- package/dist/components/PlayerLoadingSpinner/index.d.ts +2 -2
- package/dist/components/PlayerLoadingSpinner/playerLoadingSpinner.styles.d.ts +1 -1
- package/dist/components/ProductDescription/index.d.ts +3 -3
- package/dist/components/ProductName/index.d.ts +3 -3
- package/dist/components/Share/index.d.ts +2 -2
- package/dist/components/Share/index.js +1 -1
- package/dist/components/Share/share.styles.d.ts +1 -1
- package/dist/components/Snapshots/index.d.ts +2 -2
- package/dist/components/Strips/index.d.ts +3 -3
- package/dist/components/Swatch/index.d.ts +3 -3
- package/dist/components/Switch/index.d.ts +3 -3
- package/dist/components/TextInput/index.d.ts +3 -3
- package/dist/components/ThreekitProvider/index.d.ts +1 -1
- package/dist/components/Tiles/index.d.ts +3 -3
- package/dist/components/TilesGroup/index.d.ts +3 -3
- package/dist/components/TotalPrice/index.d.ts +3 -3
- package/dist/components/TrebleApp/index.d.ts +3 -3
- package/dist/components/TurntableAnimation/index.js +1 -1
- package/dist/components/Upload/index.d.ts +3 -3
- package/dist/components/Upload/index.js +1 -1
- package/dist/components/UploadArea/index.d.ts +3 -3
- package/dist/components/UploadArea/index.js +1 -1
- package/dist/components/Wishlist/WishlistItem.d.ts +2 -2
- package/dist/components/Wishlist/index.d.ts +4 -4
- package/dist/components/Wishlist/index.js +1 -1
- package/dist/components/Zoom/index.d.ts +6 -6
- package/dist/components/containers/formInputContainer.d.ts +2 -2
- package/dist/components/formComponents.d.ts +6 -6
- package/dist/components/message/index.d.ts +1 -1
- package/dist/constants.d.ts +6 -6
- package/dist/hooks/useAttribute/index.d.ts +4 -4
- package/dist/hooks/useAttribute/index.js +1 -1
- package/dist/hooks/useConfigurationLoader/index.js +1 -1
- package/dist/hooks/useConfigurator/index.d.ts +3 -3
- package/dist/hooks/useDevTools/index.d.ts +1 -1
- package/dist/hooks/useNestedConfigurator/index.d.ts +2 -2
- package/dist/hooks/useNestedConfigurator/index.js +3 -4
- package/dist/hooks/usePlayer/index.d.ts +1 -1
- package/dist/hooks/usePlayerPortal/index.d.ts +1 -1
- package/dist/hooks/useProductCache/index.js +1 -1
- package/dist/hooks/useResetProduct/index.d.ts +1 -1
- package/dist/hooks/useResetProduct/index.js +1 -1
- package/dist/hooks/useShare/index.d.ts +1 -1
- package/dist/hooks/useShare/index.js +1 -1
- package/dist/hooks/useSingleAnimation/index.js +1 -1
- package/dist/hooks/useSpaces/SpacesLayout.d.ts +11 -0
- package/dist/hooks/useSpaces/SpacesLayout.js +74 -0
- package/dist/hooks/useSpaces/SpacesState.d.ts +177 -0
- package/dist/hooks/useSpaces/SpacesState.js +1816 -0
- package/dist/hooks/useSpaces/constants.d.ts +79 -0
- package/dist/hooks/useSpaces/constants.js +130 -0
- package/dist/hooks/useSpaces/dataHandlers.d.ts +38 -0
- package/dist/hooks/useSpaces/dataHandlers.js +411 -0
- 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 +99 -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 +36 -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 +11 -0
- package/dist/hooks/useSpaces/draw/drawWalls.js +90 -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 +31 -13
- 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 +95 -0
- package/dist/hooks/useSpaces/index.js +625 -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/useSpaces/types.d.ts +378 -0
- package/dist/hooks/useSpaces/types.js +54 -0
- 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/hooks/useWishlist/index.d.ts +1 -1
- package/dist/hooks/useZoom/index.d.ts +1 -1
- package/dist/http/assets.d.ts +1 -1
- package/dist/http/orders.d.ts +1 -1
- package/dist/icons/AngleSnapping.d.ts +3 -0
- package/dist/icons/AngleSnapping.js +28 -0
- package/dist/icons/Boundary.d.ts +3 -0
- package/dist/icons/Boundary.js +21 -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/RulerBlank.d.ts +3 -0
- package/dist/icons/RulerBlank.js +25 -0
- package/dist/icons/RulerDetailed.d.ts +3 -0
- package/dist/icons/RulerDetailed.js +27 -0
- package/dist/icons/Save.d.ts +3 -0
- package/dist/icons/Save.js +21 -0
- package/dist/icons/Spinner.d.ts +2 -2
- 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 +28 -0
- package/dist/index.d.ts +17 -2
- package/dist/index.js +35 -5
- package/dist/store/attributes.d.ts +4 -3
- package/dist/store/attributes.js +1 -1
- package/dist/store/index.d.ts +43 -12
- package/dist/store/index.js +3 -1
- package/dist/store/price.d.ts +1 -1
- package/dist/store/price.js +1 -1
- package/dist/store/product.d.ts +2 -2
- package/dist/store/product.js +5 -8
- package/dist/store/spaces.d.ts +74 -0
- package/dist/store/spaces.js +354 -0
- package/dist/store/translations.d.ts +1 -1
- package/dist/store/translations.js +1 -1
- package/dist/store/treble.d.ts +2 -2
- package/dist/store/treble.js +15 -22
- package/dist/store/wishlist.d.ts +4 -22
- package/dist/store/wishlist.js +1 -1
- package/dist/types.d.ts +20 -18
- package/dist/types.js +9 -9
- package/dist/utils.d.ts +2 -2
- package/dist/utils.js +3 -3
- package/package.json +1 -1
- 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/dataHandlers.d.ts +0 -18
- package/dist/hooks/useRoomBuilder/dataHandlers.js +0 -187
- 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/types.d.ts +0 -238
- package/dist/hooks/useRoomBuilder/types.js +0 -36
- package/dist/hooks/useRoomBuilder/validators.d.ts +0 -36
- package/dist/hooks/useRoomBuilder/validators.js +0 -362
- /package/dist/hooks/{useRoomBuilder → useSpaces/validators}/messaging.d.ts +0 -0
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
var WALL_THICKNESS = 22;
|
|
4
|
+
var VERTEX_RADIUS = (WALL_THICKNESS - 8) / 2;
|
|
5
|
+
var FEATURE_THICKNESS = WALL_THICKNESS + 6;
|
|
6
|
+
var HIGHLIGHT_COLOR = '#36738E';
|
|
7
|
+
var ACTIVE_COLOR = 'green';
|
|
8
|
+
var ERROR_COLOR = 'red';
|
|
9
|
+
var theme = {
|
|
10
|
+
grid: {
|
|
11
|
+
lineThickness: 2,
|
|
12
|
+
lineColor: '#fff',
|
|
13
|
+
showSubdivisions: true,
|
|
14
|
+
subdivisionLineThickness: 1,
|
|
15
|
+
subdivisionLineColor: '#fff',
|
|
16
|
+
subdivisionThreshold: 20,
|
|
17
|
+
backgroundColor: '#37588B',
|
|
18
|
+
},
|
|
19
|
+
guides: {
|
|
20
|
+
color: 'red',
|
|
21
|
+
thickness: 1,
|
|
22
|
+
},
|
|
23
|
+
floor: {
|
|
24
|
+
color: '#eee',
|
|
25
|
+
textColor: '#666',
|
|
26
|
+
},
|
|
27
|
+
dimensions: {
|
|
28
|
+
padding: WALL_THICKNESS / 2 + 12,
|
|
29
|
+
lineThickness: 1,
|
|
30
|
+
lineColor: '#fff',
|
|
31
|
+
fontSize: 14,
|
|
32
|
+
font: 'Helvetica',
|
|
33
|
+
textColor: '#444',
|
|
34
|
+
textBackgroundColor: '#fff',
|
|
35
|
+
},
|
|
36
|
+
wall: {
|
|
37
|
+
fill: '#848484',
|
|
38
|
+
stroke: '#fff',
|
|
39
|
+
strokeWidth: 1,
|
|
40
|
+
thickness: WALL_THICKNESS,
|
|
41
|
+
highlight: {
|
|
42
|
+
fill: HIGHLIGHT_COLOR,
|
|
43
|
+
stroke: HIGHLIGHT_COLOR,
|
|
44
|
+
},
|
|
45
|
+
active: {
|
|
46
|
+
fill: ACTIVE_COLOR,
|
|
47
|
+
stroke: ACTIVE_COLOR,
|
|
48
|
+
},
|
|
49
|
+
error: {
|
|
50
|
+
fill: ERROR_COLOR,
|
|
51
|
+
stroke: ERROR_COLOR,
|
|
52
|
+
},
|
|
53
|
+
},
|
|
54
|
+
vertex: {
|
|
55
|
+
innerFill: '#fff',
|
|
56
|
+
outerFill: '#fff',
|
|
57
|
+
stroke: '#36738E',
|
|
58
|
+
strokeWidth: 0,
|
|
59
|
+
outerRadius: VERTEX_RADIUS,
|
|
60
|
+
innerRadius: VERTEX_RADIUS / 2,
|
|
61
|
+
highlight: {
|
|
62
|
+
innerFill: HIGHLIGHT_COLOR,
|
|
63
|
+
outerFill: HIGHLIGHT_COLOR,
|
|
64
|
+
stroke: HIGHLIGHT_COLOR,
|
|
65
|
+
},
|
|
66
|
+
active: {
|
|
67
|
+
innerFill: ACTIVE_COLOR,
|
|
68
|
+
outerFill: ACTIVE_COLOR,
|
|
69
|
+
stroke: ACTIVE_COLOR,
|
|
70
|
+
},
|
|
71
|
+
error: {
|
|
72
|
+
innerFill: ERROR_COLOR,
|
|
73
|
+
outerFill: ERROR_COLOR,
|
|
74
|
+
stroke: ERROR_COLOR,
|
|
75
|
+
},
|
|
76
|
+
},
|
|
77
|
+
feature: {
|
|
78
|
+
fill: '#888',
|
|
79
|
+
stroke: '#888',
|
|
80
|
+
strokeWidth: 0,
|
|
81
|
+
thickness: FEATURE_THICKNESS,
|
|
82
|
+
highlight: {
|
|
83
|
+
fill: HIGHLIGHT_COLOR,
|
|
84
|
+
stroke: HIGHLIGHT_COLOR,
|
|
85
|
+
},
|
|
86
|
+
active: {
|
|
87
|
+
fill: ACTIVE_COLOR,
|
|
88
|
+
stroke: ACTIVE_COLOR,
|
|
89
|
+
},
|
|
90
|
+
error: {
|
|
91
|
+
fill: ERROR_COLOR,
|
|
92
|
+
stroke: ERROR_COLOR,
|
|
93
|
+
},
|
|
94
|
+
},
|
|
95
|
+
};
|
|
96
|
+
exports.default = theme;
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
var HIGHLIGHT_COLOR = '#36738E';
|
|
4
|
+
var ACTIVE_COLOR = 'green';
|
|
5
|
+
var ERROR_COLOR = 'red';
|
|
6
|
+
var WALL_THICKNESS = 18;
|
|
7
|
+
var VERTEX_RADIUS = (WALL_THICKNESS - 6) / 2;
|
|
8
|
+
var FEATURE_THICKNESS = WALL_THICKNESS + 6;
|
|
9
|
+
var theme = {
|
|
10
|
+
grid: {
|
|
11
|
+
lineThickness: 2,
|
|
12
|
+
lineColor: '#ddd',
|
|
13
|
+
showSubdivisions: true,
|
|
14
|
+
subdivisionLineThickness: 1,
|
|
15
|
+
subdivisionLineColor: '#ddd',
|
|
16
|
+
subdivisionThreshold: 20,
|
|
17
|
+
backgroundColor: '#fff',
|
|
18
|
+
},
|
|
19
|
+
guides: {
|
|
20
|
+
color: '#00F8FB',
|
|
21
|
+
thickness: 1,
|
|
22
|
+
},
|
|
23
|
+
floor: {
|
|
24
|
+
color: '#eee',
|
|
25
|
+
textColor: '#666',
|
|
26
|
+
},
|
|
27
|
+
dimensions: {
|
|
28
|
+
padding: WALL_THICKNESS / 2 + 12,
|
|
29
|
+
lineThickness: 1,
|
|
30
|
+
lineColor: '#444',
|
|
31
|
+
fontSize: 14,
|
|
32
|
+
font: 'Helvetica',
|
|
33
|
+
textColor: '#444',
|
|
34
|
+
textBackgroundColor: 'white',
|
|
35
|
+
},
|
|
36
|
+
wall: {
|
|
37
|
+
fill: '#d9d9d9',
|
|
38
|
+
stroke: '#d9d9d9',
|
|
39
|
+
strokeWidth: 0,
|
|
40
|
+
thickness: WALL_THICKNESS,
|
|
41
|
+
highlight: {
|
|
42
|
+
fill: HIGHLIGHT_COLOR,
|
|
43
|
+
stroke: HIGHLIGHT_COLOR,
|
|
44
|
+
},
|
|
45
|
+
active: {
|
|
46
|
+
fill: ACTIVE_COLOR,
|
|
47
|
+
stroke: ACTIVE_COLOR,
|
|
48
|
+
},
|
|
49
|
+
error: {
|
|
50
|
+
fill: ERROR_COLOR,
|
|
51
|
+
stroke: ERROR_COLOR,
|
|
52
|
+
},
|
|
53
|
+
},
|
|
54
|
+
vertex: {
|
|
55
|
+
innerFill: '#36738E',
|
|
56
|
+
outerFill: 'white',
|
|
57
|
+
stroke: '#36738E',
|
|
58
|
+
strokeWidth: 2,
|
|
59
|
+
outerRadius: VERTEX_RADIUS,
|
|
60
|
+
innerRadius: VERTEX_RADIUS / 2,
|
|
61
|
+
highlight: {
|
|
62
|
+
innerFill: HIGHLIGHT_COLOR,
|
|
63
|
+
outerFill: HIGHLIGHT_COLOR,
|
|
64
|
+
stroke: HIGHLIGHT_COLOR,
|
|
65
|
+
},
|
|
66
|
+
active: {
|
|
67
|
+
innerFill: ACTIVE_COLOR,
|
|
68
|
+
outerFill: ACTIVE_COLOR,
|
|
69
|
+
stroke: ACTIVE_COLOR,
|
|
70
|
+
},
|
|
71
|
+
error: {
|
|
72
|
+
innerFill: ERROR_COLOR,
|
|
73
|
+
outerFill: ERROR_COLOR,
|
|
74
|
+
stroke: ERROR_COLOR,
|
|
75
|
+
},
|
|
76
|
+
},
|
|
77
|
+
feature: {
|
|
78
|
+
fill: '#888',
|
|
79
|
+
stroke: '#888',
|
|
80
|
+
strokeWidth: 0,
|
|
81
|
+
thickness: FEATURE_THICKNESS,
|
|
82
|
+
highlight: {
|
|
83
|
+
fill: HIGHLIGHT_COLOR,
|
|
84
|
+
stroke: HIGHLIGHT_COLOR,
|
|
85
|
+
},
|
|
86
|
+
active: {
|
|
87
|
+
fill: ACTIVE_COLOR,
|
|
88
|
+
stroke: ACTIVE_COLOR,
|
|
89
|
+
},
|
|
90
|
+
error: {
|
|
91
|
+
fill: ERROR_COLOR,
|
|
92
|
+
stroke: ERROR_COLOR,
|
|
93
|
+
},
|
|
94
|
+
},
|
|
95
|
+
};
|
|
96
|
+
exports.default = theme;
|
|
@@ -1,12 +1,11 @@
|
|
|
1
|
-
import type { IRoomBuilderStyles } from './types';
|
|
2
1
|
export declare enum IThemes {
|
|
3
2
|
DEFAULT = "default",
|
|
4
3
|
BLUEPRINT = "blueprint",
|
|
5
4
|
LIGHT = "light"
|
|
6
5
|
}
|
|
7
6
|
declare const _default: {
|
|
8
|
-
default:
|
|
9
|
-
blueprint:
|
|
10
|
-
light:
|
|
7
|
+
default: import("../types").ISpacesStyles;
|
|
8
|
+
blueprint: import("../types").ISpacesStyles;
|
|
9
|
+
light: import("../types").ISpacesStyles;
|
|
11
10
|
};
|
|
12
11
|
export default _default;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
var _a;
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
exports.IThemes = void 0;
|
|
8
|
+
var default_1 = __importDefault(require("./default"));
|
|
9
|
+
var blueprint_1 = __importDefault(require("./blueprint"));
|
|
10
|
+
var light_1 = __importDefault(require("./light"));
|
|
11
|
+
var IThemes;
|
|
12
|
+
(function (IThemes) {
|
|
13
|
+
IThemes["DEFAULT"] = "default";
|
|
14
|
+
IThemes["BLUEPRINT"] = "blueprint";
|
|
15
|
+
IThemes["LIGHT"] = "light";
|
|
16
|
+
})(IThemes = exports.IThemes || (exports.IThemes = {}));
|
|
17
|
+
exports.default = (_a = {},
|
|
18
|
+
_a[IThemes.DEFAULT] = default_1.default,
|
|
19
|
+
_a[IThemes.BLUEPRINT] = blueprint_1.default,
|
|
20
|
+
_a[IThemes.LIGHT] = light_1.default,
|
|
21
|
+
_a);
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
var HIGHCOLOR = '#36738E';
|
|
4
|
+
var ACTIVE_COLOR = 'green';
|
|
5
|
+
var ERROR_COLOR = 'red';
|
|
6
|
+
var WALL_THICKNESS = 8;
|
|
7
|
+
var VERTEX_RADIUS = (WALL_THICKNESS + 8) / 2;
|
|
8
|
+
var FEATURE_THICKNESS = WALL_THICKNESS + 4;
|
|
9
|
+
var theme = {
|
|
10
|
+
grid: {
|
|
11
|
+
lineThickness: 2,
|
|
12
|
+
lineColor: '#ddd',
|
|
13
|
+
showSubdivisions: true,
|
|
14
|
+
subdivisionLineThickness: 1,
|
|
15
|
+
subdivisionLineColor: '#ddd',
|
|
16
|
+
subdivisionThreshold: 20,
|
|
17
|
+
backgroundColor: '#fff',
|
|
18
|
+
},
|
|
19
|
+
guides: {
|
|
20
|
+
color: '#00F8FB',
|
|
21
|
+
thickness: 1,
|
|
22
|
+
},
|
|
23
|
+
floor: {
|
|
24
|
+
color: '#eee',
|
|
25
|
+
textColor: '#666',
|
|
26
|
+
},
|
|
27
|
+
dimensions: {
|
|
28
|
+
padding: WALL_THICKNESS / 2 + 12,
|
|
29
|
+
lineThickness: 1,
|
|
30
|
+
lineColor: '#444',
|
|
31
|
+
fontSize: 14,
|
|
32
|
+
font: 'Helvetica',
|
|
33
|
+
textColor: '#444',
|
|
34
|
+
textBackgroundColor: '#fff',
|
|
35
|
+
},
|
|
36
|
+
wall: {
|
|
37
|
+
fill: '#000',
|
|
38
|
+
stroke: '#000',
|
|
39
|
+
strokeWidth: 0,
|
|
40
|
+
thickness: WALL_THICKNESS,
|
|
41
|
+
highlight: {
|
|
42
|
+
fill: HIGHCOLOR,
|
|
43
|
+
stroke: HIGHCOLOR,
|
|
44
|
+
},
|
|
45
|
+
active: {
|
|
46
|
+
fill: ACTIVE_COLOR,
|
|
47
|
+
stroke: ACTIVE_COLOR,
|
|
48
|
+
},
|
|
49
|
+
error: {
|
|
50
|
+
fill: ERROR_COLOR,
|
|
51
|
+
stroke: ERROR_COLOR,
|
|
52
|
+
},
|
|
53
|
+
},
|
|
54
|
+
vertex: {
|
|
55
|
+
innerFill: '#aaa',
|
|
56
|
+
outerFill: '#fff',
|
|
57
|
+
stroke: '#000',
|
|
58
|
+
strokeWidth: 1,
|
|
59
|
+
outerRadius: VERTEX_RADIUS,
|
|
60
|
+
innerRadius: (VERTEX_RADIUS / 5) * 3,
|
|
61
|
+
highlight: {
|
|
62
|
+
innerFill: HIGHCOLOR,
|
|
63
|
+
outerFill: '#fff',
|
|
64
|
+
stroke: '#000',
|
|
65
|
+
},
|
|
66
|
+
active: {
|
|
67
|
+
innerFill: ACTIVE_COLOR,
|
|
68
|
+
outerFill: '#fff',
|
|
69
|
+
stroke: '#000',
|
|
70
|
+
},
|
|
71
|
+
error: {
|
|
72
|
+
innerFill: ERROR_COLOR,
|
|
73
|
+
outerFill: ERROR_COLOR,
|
|
74
|
+
stroke: ERROR_COLOR,
|
|
75
|
+
},
|
|
76
|
+
},
|
|
77
|
+
feature: {
|
|
78
|
+
fill: '#888',
|
|
79
|
+
stroke: '#888',
|
|
80
|
+
strokeWidth: 0,
|
|
81
|
+
thickness: FEATURE_THICKNESS,
|
|
82
|
+
highlight: {
|
|
83
|
+
fill: HIGHCOLOR,
|
|
84
|
+
stroke: HIGHCOLOR,
|
|
85
|
+
},
|
|
86
|
+
active: {
|
|
87
|
+
fill: ACTIVE_COLOR,
|
|
88
|
+
stroke: ACTIVE_COLOR,
|
|
89
|
+
},
|
|
90
|
+
error: {
|
|
91
|
+
fill: ERROR_COLOR,
|
|
92
|
+
stroke: ERROR_COLOR,
|
|
93
|
+
},
|
|
94
|
+
},
|
|
95
|
+
};
|
|
96
|
+
exports.default = theme;
|
|
@@ -0,0 +1,378 @@
|
|
|
1
|
+
import { IHydratedAttribute } from '../../types';
|
|
2
|
+
import { DoorOpeningDirections, DoorOrientations, DoorShowSwing, WallModes } from './constants';
|
|
3
|
+
export declare type ICoordinate2D = [x: number, y: number];
|
|
4
|
+
export declare type ICoordinate3D = [x: number, y: number, z: number];
|
|
5
|
+
export declare type ICoordinatesLine = [
|
|
6
|
+
startPoint: ICoordinate2D,
|
|
7
|
+
endPoint: ICoordinate2D
|
|
8
|
+
];
|
|
9
|
+
export declare type ICoordinatesQuadrilateral = [
|
|
10
|
+
point1: ICoordinate2D,
|
|
11
|
+
point2: ICoordinate2D,
|
|
12
|
+
point3: ICoordinate2D,
|
|
13
|
+
point4: ICoordinate2D
|
|
14
|
+
];
|
|
15
|
+
export declare enum IElements {
|
|
16
|
+
WALL = "walls",
|
|
17
|
+
VERTEX = "vertex",
|
|
18
|
+
FEATURE = "features",
|
|
19
|
+
WINDOW = "windows",
|
|
20
|
+
DOOR = "doors",
|
|
21
|
+
OPENING = "openings"
|
|
22
|
+
}
|
|
23
|
+
export declare type IFeatureName = IElements.WINDOW | IElements.DOOR | IElements.OPENING;
|
|
24
|
+
export declare type IElementName = IElements.WALL | IElements.VERTEX | IFeatureName;
|
|
25
|
+
export interface IWall {
|
|
26
|
+
assetId: string;
|
|
27
|
+
line: ICoordinatesLine;
|
|
28
|
+
path?: ICoordinatesQuadrilateral;
|
|
29
|
+
connections: Array<[elementType: IFeatureName, index: number]>;
|
|
30
|
+
restConfiguration: string;
|
|
31
|
+
mode: WallModes;
|
|
32
|
+
}
|
|
33
|
+
export interface IWalls extends Array<IWall> {
|
|
34
|
+
}
|
|
35
|
+
export interface INewWall {
|
|
36
|
+
start: ISnapPoint;
|
|
37
|
+
end?: ISnapPoint;
|
|
38
|
+
}
|
|
39
|
+
export interface IVertexConnections extends Array<[wallIndex: number, anchorIndex: number]> {
|
|
40
|
+
}
|
|
41
|
+
export interface IVerticesState extends Record<string, IVertexConnections> {
|
|
42
|
+
}
|
|
43
|
+
export interface IVertex {
|
|
44
|
+
point: ICoordinate2D;
|
|
45
|
+
connections: IVertexConnections;
|
|
46
|
+
}
|
|
47
|
+
export interface ILineDimensions {
|
|
48
|
+
label: string;
|
|
49
|
+
line: ICoordinatesLine;
|
|
50
|
+
}
|
|
51
|
+
export interface IEnclosedSpace {
|
|
52
|
+
area: string;
|
|
53
|
+
center: ICoordinate2D;
|
|
54
|
+
loop: Array<ICoordinate2D>;
|
|
55
|
+
}
|
|
56
|
+
export interface IFeature {
|
|
57
|
+
assetId: string;
|
|
58
|
+
offset: number;
|
|
59
|
+
length: number;
|
|
60
|
+
height: number;
|
|
61
|
+
altitude: number;
|
|
62
|
+
path?: ICoordinatesQuadrilateral;
|
|
63
|
+
connectedTo: [elementType: IElements.WALL, index: number];
|
|
64
|
+
restConfiguration: string;
|
|
65
|
+
}
|
|
66
|
+
export interface IFeatureDoor extends IFeature {
|
|
67
|
+
orientation: DoorOrientations;
|
|
68
|
+
openingDirection: DoorOpeningDirections;
|
|
69
|
+
showSwing: DoorShowSwing;
|
|
70
|
+
}
|
|
71
|
+
interface IFeatureHydratedShared {
|
|
72
|
+
line: ICoordinatesLine;
|
|
73
|
+
}
|
|
74
|
+
export interface IFeatureHydrated extends IFeature, IFeatureHydratedShared {
|
|
75
|
+
}
|
|
76
|
+
export interface IFeatureDoorHydrated extends IFeatureDoor, IFeatureHydratedShared {
|
|
77
|
+
}
|
|
78
|
+
export interface IFeaturesShared<T, D> {
|
|
79
|
+
[IElements.WINDOW]?: Array<T>;
|
|
80
|
+
[IElements.DOOR]?: Array<D>;
|
|
81
|
+
[IElements.OPENING]?: Array<T>;
|
|
82
|
+
}
|
|
83
|
+
export interface IFeatures extends IFeaturesShared<IFeature, IFeatureDoor> {
|
|
84
|
+
}
|
|
85
|
+
export interface IFeaturesHydrated extends IFeaturesShared<IFeatureHydrated, IFeatureDoorHydrated> {
|
|
86
|
+
}
|
|
87
|
+
export declare enum IElementStyleModes {
|
|
88
|
+
HIGHLIGHT = "highlight",
|
|
89
|
+
ACTIVE = "active",
|
|
90
|
+
ERROR = "error"
|
|
91
|
+
}
|
|
92
|
+
export interface ISpacesStylesShared {
|
|
93
|
+
fill: string;
|
|
94
|
+
stroke?: string;
|
|
95
|
+
strokeWidth?: number;
|
|
96
|
+
[IElementStyleModes.HIGHLIGHT]: {
|
|
97
|
+
fill: string;
|
|
98
|
+
stroke: string;
|
|
99
|
+
};
|
|
100
|
+
[IElementStyleModes.ACTIVE]: {
|
|
101
|
+
fill: string;
|
|
102
|
+
stroke: string;
|
|
103
|
+
};
|
|
104
|
+
[IElementStyleModes.ERROR]: {
|
|
105
|
+
fill: string;
|
|
106
|
+
stroke: string;
|
|
107
|
+
};
|
|
108
|
+
}
|
|
109
|
+
export interface IStylesGrid {
|
|
110
|
+
lineThickness: number;
|
|
111
|
+
lineColor: string;
|
|
112
|
+
showSubdivisions: boolean;
|
|
113
|
+
subdivisionLineThickness: number;
|
|
114
|
+
subdivisionLineColor: string;
|
|
115
|
+
subdivisionThreshold: number;
|
|
116
|
+
backgroundColor?: string;
|
|
117
|
+
}
|
|
118
|
+
export interface IStylesGuides {
|
|
119
|
+
color: string;
|
|
120
|
+
thickness: number;
|
|
121
|
+
}
|
|
122
|
+
export interface IStylesFloor {
|
|
123
|
+
color: string;
|
|
124
|
+
textColor: string;
|
|
125
|
+
}
|
|
126
|
+
export interface IStylesDimension {
|
|
127
|
+
padding: number;
|
|
128
|
+
lineThickness: number;
|
|
129
|
+
lineColor: string;
|
|
130
|
+
fontSize: number;
|
|
131
|
+
font: string;
|
|
132
|
+
textColor: string;
|
|
133
|
+
textBackgroundColor: string;
|
|
134
|
+
}
|
|
135
|
+
export interface IStylesWall extends ISpacesStylesShared {
|
|
136
|
+
thickness: number;
|
|
137
|
+
}
|
|
138
|
+
export interface IStylesVertex extends Omit<ISpacesStylesShared, 'fill' | IElementStyleModes.HIGHLIGHT | IElementStyleModes.ACTIVE | IElementStyleModes.ERROR> {
|
|
139
|
+
innerFill: string;
|
|
140
|
+
outerFill: string;
|
|
141
|
+
innerRadius: number;
|
|
142
|
+
outerRadius?: number;
|
|
143
|
+
[IElementStyleModes.HIGHLIGHT]: {
|
|
144
|
+
innerFill: string;
|
|
145
|
+
outerFill: string;
|
|
146
|
+
stroke?: string;
|
|
147
|
+
};
|
|
148
|
+
[IElementStyleModes.ACTIVE]: {
|
|
149
|
+
innerFill: string;
|
|
150
|
+
outerFill: string;
|
|
151
|
+
stroke?: string;
|
|
152
|
+
};
|
|
153
|
+
[IElementStyleModes.ERROR]: {
|
|
154
|
+
innerFill: string;
|
|
155
|
+
outerFill: string;
|
|
156
|
+
stroke?: string;
|
|
157
|
+
};
|
|
158
|
+
}
|
|
159
|
+
export interface IStylesFeature extends IStylesWall {
|
|
160
|
+
}
|
|
161
|
+
export interface ISpacesStyles {
|
|
162
|
+
grid: IStylesGrid;
|
|
163
|
+
guides: IStylesGuides;
|
|
164
|
+
floor: IStylesFloor;
|
|
165
|
+
dimensions: IStylesDimension;
|
|
166
|
+
wall: IStylesWall;
|
|
167
|
+
vertex: IStylesVertex;
|
|
168
|
+
feature: IStylesFeature;
|
|
169
|
+
}
|
|
170
|
+
export interface ISpacesThemePartial {
|
|
171
|
+
grid: Partial<IStylesGrid>;
|
|
172
|
+
guides: Partial<IStylesGuides>;
|
|
173
|
+
floor: Partial<IStylesFloor>;
|
|
174
|
+
dimensions: Partial<IStylesDimension>;
|
|
175
|
+
wall: Partial<IStylesWall>;
|
|
176
|
+
vertex: Partial<IStylesVertex>;
|
|
177
|
+
feature: Partial<IStylesFeature>;
|
|
178
|
+
}
|
|
179
|
+
export interface IGridToDraw {
|
|
180
|
+
unitLength: number;
|
|
181
|
+
offset: ICoordinate2D;
|
|
182
|
+
subdivisions: number;
|
|
183
|
+
showSubdivisions: boolean;
|
|
184
|
+
}
|
|
185
|
+
export interface IWallsValidationConfig {
|
|
186
|
+
minLength: number;
|
|
187
|
+
padding: number;
|
|
188
|
+
}
|
|
189
|
+
export interface ISharedValidatorInput {
|
|
190
|
+
walls: IWalls;
|
|
191
|
+
features: IFeatures;
|
|
192
|
+
}
|
|
193
|
+
export interface IFeatureValidatorInput {
|
|
194
|
+
wall: IWall;
|
|
195
|
+
updatedFeature: Pick<IFeature, 'length' | 'offset'> & {
|
|
196
|
+
address: IElementAddress;
|
|
197
|
+
};
|
|
198
|
+
}
|
|
199
|
+
export interface IAddWallValidatorInput {
|
|
200
|
+
newWall: Pick<IWall, 'line'> & Pick<INewWall, 'start' | 'end'>;
|
|
201
|
+
}
|
|
202
|
+
export interface IMoveVertexValidatorInput {
|
|
203
|
+
updatedPosition: ISnapPoint;
|
|
204
|
+
vertex: IVertex;
|
|
205
|
+
}
|
|
206
|
+
export declare type IValidatorFunction<T> = (input: T, wallsAndFeatures: ISharedValidatorInput, validationConfig: IWallsValidationConfig) => false | IErrorElement;
|
|
207
|
+
export declare enum SNAPPING_TYPES {
|
|
208
|
+
NONE = "none",
|
|
209
|
+
ANGLE = "angle",
|
|
210
|
+
GUIDE = "guide",
|
|
211
|
+
GRID = "grid"
|
|
212
|
+
}
|
|
213
|
+
export declare enum GUIDE_ORIENTATIONS {
|
|
214
|
+
HORIZONTAL = "horizontal",
|
|
215
|
+
VERTICAL = "vertical"
|
|
216
|
+
}
|
|
217
|
+
export interface IGuides {
|
|
218
|
+
point: ICoordinate2D;
|
|
219
|
+
orientations: Array<GUIDE_ORIENTATIONS>;
|
|
220
|
+
}
|
|
221
|
+
export interface IElementAddress {
|
|
222
|
+
type: IElementName;
|
|
223
|
+
index: number;
|
|
224
|
+
}
|
|
225
|
+
export interface IFeatureAddress {
|
|
226
|
+
type: IFeatureName;
|
|
227
|
+
index: number;
|
|
228
|
+
}
|
|
229
|
+
export interface ISnapPointShared<T> {
|
|
230
|
+
type: T;
|
|
231
|
+
point: ICoordinate2D;
|
|
232
|
+
locked: [boolean, boolean];
|
|
233
|
+
}
|
|
234
|
+
export interface ISnapPointNone extends ISnapPointShared<SNAPPING_TYPES.NONE> {
|
|
235
|
+
locked: [false, false];
|
|
236
|
+
}
|
|
237
|
+
export interface ISnapPointVertex extends ISnapPointShared<IElements.VERTEX> {
|
|
238
|
+
index: number;
|
|
239
|
+
locked: [true, true];
|
|
240
|
+
}
|
|
241
|
+
export interface ISnapPointWall extends ISnapPointShared<IElements.WALL> {
|
|
242
|
+
offset: number;
|
|
243
|
+
index: number;
|
|
244
|
+
}
|
|
245
|
+
export interface ISnapPointFeature extends ISnapPointShared<IFeatureName> {
|
|
246
|
+
index: number;
|
|
247
|
+
}
|
|
248
|
+
export interface ISnapPointAngle extends ISnapPointShared<SNAPPING_TYPES.ANGLE>, Pick<IGuides, 'orientations'> {
|
|
249
|
+
}
|
|
250
|
+
export interface ISnapPointGuide extends ISnapPointShared<SNAPPING_TYPES.GUIDE>, Pick<IGuides, 'orientations'> {
|
|
251
|
+
}
|
|
252
|
+
export interface ISnapPointGrid extends ISnapPointShared<SNAPPING_TYPES.GRID>, Pick<IGuides, 'orientations'> {
|
|
253
|
+
locked: [true, true];
|
|
254
|
+
}
|
|
255
|
+
export declare type ISnapPoint = ISnapPointNone | ISnapPointVertex | ISnapPointWall | ISnapPointFeature | ISnapPointAngle | ISnapPointGuide | ISnapPointGrid;
|
|
256
|
+
export interface IActiveElement extends IElementAddress {
|
|
257
|
+
snapPoint?: ISnapPoint;
|
|
258
|
+
}
|
|
259
|
+
export declare enum IErrorTypes {
|
|
260
|
+
HARD = "hard",
|
|
261
|
+
SOFT = "soft",
|
|
262
|
+
WARN = "warning"
|
|
263
|
+
}
|
|
264
|
+
export interface IErrorElement {
|
|
265
|
+
address?: IElementAddress;
|
|
266
|
+
message: string;
|
|
267
|
+
type: IErrorTypes;
|
|
268
|
+
}
|
|
269
|
+
export interface IElementUi {
|
|
270
|
+
path: [type: IFeatureName | IElements.WALL, index: number];
|
|
271
|
+
uiAnchor: ICoordinate2D;
|
|
272
|
+
}
|
|
273
|
+
export interface IElementPublic extends Pick<IElementUi, 'uiAnchor'> {
|
|
274
|
+
path: [attribute: string, index: number];
|
|
275
|
+
type: IFeatureName | IElements.WALL;
|
|
276
|
+
deleteElement: () => void;
|
|
277
|
+
splitWall?: (offset?: number) => void;
|
|
278
|
+
addFeature?: (type: IFeatureName, feature?: Partial<IFeature>) => void;
|
|
279
|
+
}
|
|
280
|
+
export declare enum IModes {
|
|
281
|
+
SELECT = "select",
|
|
282
|
+
DRAW = "draw"
|
|
283
|
+
}
|
|
284
|
+
export declare enum IUnits {
|
|
285
|
+
FEET = "feet",
|
|
286
|
+
METER = "meter",
|
|
287
|
+
INCH = "inch",
|
|
288
|
+
CM = "cm"
|
|
289
|
+
}
|
|
290
|
+
export declare enum IDimensionOptions {
|
|
291
|
+
NONE = "none",
|
|
292
|
+
DEFAULT = "default",
|
|
293
|
+
DETAILED = "detailed"
|
|
294
|
+
}
|
|
295
|
+
export interface ISpacesConfigShared<T> {
|
|
296
|
+
scale: number;
|
|
297
|
+
unit: IUnits;
|
|
298
|
+
snapProximity: number;
|
|
299
|
+
styles: T;
|
|
300
|
+
zoomDefault: number;
|
|
301
|
+
zoomMin: number;
|
|
302
|
+
zoomMax: number;
|
|
303
|
+
translateDefault: ICoordinate2D;
|
|
304
|
+
enableAngleSnapping: boolean;
|
|
305
|
+
enableGuideSnapping: boolean;
|
|
306
|
+
enableGridSnapping: boolean;
|
|
307
|
+
showDimensions: IDimensionOptions;
|
|
308
|
+
}
|
|
309
|
+
export interface ISpacesConfigInternal extends ISpacesConfigShared<ISpacesStyles> {
|
|
310
|
+
}
|
|
311
|
+
export interface ISpacesConfigUser extends ISpacesConfigShared<Partial<ISpacesStyles>> {
|
|
312
|
+
theme: string;
|
|
313
|
+
zoomDisabled: boolean;
|
|
314
|
+
translateDisabled: boolean;
|
|
315
|
+
zoomSensitivity: number;
|
|
316
|
+
}
|
|
317
|
+
export interface ISpacesAttributes {
|
|
318
|
+
[IElements.WALL]: string;
|
|
319
|
+
[IElements.WINDOW]: string;
|
|
320
|
+
[IElements.DOOR]: string;
|
|
321
|
+
[IElements.OPENING]: string;
|
|
322
|
+
featurePositionX: string;
|
|
323
|
+
featurePositionY: string;
|
|
324
|
+
featureConnectedTo: string;
|
|
325
|
+
featureHeight: string;
|
|
326
|
+
featureLength: string;
|
|
327
|
+
wallStartX: string;
|
|
328
|
+
wallStartY: string;
|
|
329
|
+
wallStartZ: string;
|
|
330
|
+
wallEndX: string;
|
|
331
|
+
wallEndY: string;
|
|
332
|
+
wallEndZ: string;
|
|
333
|
+
wallConnections: string;
|
|
334
|
+
wallMode: string;
|
|
335
|
+
doorOrientation: string;
|
|
336
|
+
doorOpeningDirection: string;
|
|
337
|
+
doorShowSwing: string;
|
|
338
|
+
}
|
|
339
|
+
export interface IAttributeDefaults extends Partial<Record<IElements.WALL | IElements.WINDOW | IElements.DOOR | IElements.OPENING, string>> {
|
|
340
|
+
doorOrientation: DoorOrientations;
|
|
341
|
+
doorOpeningDirection: DoorOpeningDirections;
|
|
342
|
+
doorShowSwing: DoorShowSwing;
|
|
343
|
+
}
|
|
344
|
+
interface ISpacesPropsShared<T, U> {
|
|
345
|
+
config: T;
|
|
346
|
+
attributes: U;
|
|
347
|
+
layouts?: Array<string>;
|
|
348
|
+
}
|
|
349
|
+
export interface ISpacesHookProps extends ISpacesPropsShared<undefined | Partial<ISpacesConfigUser>, undefined | Partial<ISpacesAttributes>> {
|
|
350
|
+
}
|
|
351
|
+
export interface ISpacesStateProps extends ISpacesPropsShared<ISpacesConfigInternal, ISpacesAttributes> {
|
|
352
|
+
attributesState?: Record<string, IHydratedAttribute>;
|
|
353
|
+
attributeDefaults: IAttributeDefaults;
|
|
354
|
+
canvasDimensions?: ICoordinate2D;
|
|
355
|
+
wallMode: {
|
|
356
|
+
value: WallModes;
|
|
357
|
+
assetId: string;
|
|
358
|
+
};
|
|
359
|
+
setPendingStatus: (status: boolean) => void;
|
|
360
|
+
}
|
|
361
|
+
export interface ISpacesSync extends Pick<ISpacesConfigInternal, 'unit' | 'showDimensions'> {
|
|
362
|
+
canvasDimensions: ICoordinate2D;
|
|
363
|
+
angleSnappingEnabled: boolean;
|
|
364
|
+
guideSnappingEnabled: boolean;
|
|
365
|
+
gridSnappingEnabled: boolean;
|
|
366
|
+
translate: ICoordinate2D;
|
|
367
|
+
zoom: number;
|
|
368
|
+
wallMode: {
|
|
369
|
+
value: WallModes;
|
|
370
|
+
assetId: string;
|
|
371
|
+
};
|
|
372
|
+
selectedElement: {
|
|
373
|
+
type: IElementName;
|
|
374
|
+
index: number;
|
|
375
|
+
} | null;
|
|
376
|
+
attributesState: Record<string, IHydratedAttribute>;
|
|
377
|
+
}
|
|
378
|
+
export {};
|