@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.
Files changed (284) hide show
  1. package/dist/Treble/Treble.d.ts +2 -2
  2. package/dist/Treble/Treble.js +3 -3
  3. package/dist/Treble/index.d.ts +1 -1
  4. package/dist/Treble/index.js +1 -1
  5. package/dist/Treble/{snapshots.d.ts → snapshot.d.ts} +1 -1
  6. package/dist/Treble/{snapshots.js → snapshot.js} +1 -1
  7. package/dist/Treble/wishlist.d.ts +1 -1
  8. package/dist/Treble/wishlist.js +1 -1
  9. package/dist/api/assets.js +1 -1
  10. package/dist/api/catalog.js +1 -1
  11. package/dist/api/configurations.js +1 -1
  12. package/dist/api/datatables.js +1 -1
  13. package/dist/api/orders.js +1 -1
  14. package/dist/api/price.js +1 -1
  15. package/dist/components/AttributeTitle/index.d.ts +2 -2
  16. package/dist/components/AttributeValue/index.d.ts +2 -2
  17. package/dist/components/BreatheAnimation/index.js +1 -1
  18. package/dist/components/Button/index.d.ts +3 -3
  19. package/dist/components/Cards/index.d.ts +3 -3
  20. package/dist/components/DevTools/index.d.ts +2 -2
  21. package/dist/components/DraggableHint/draggableIndicator.styles.d.ts +1 -1
  22. package/dist/components/DraggableHint/index.d.ts +2 -2
  23. package/dist/components/Dropdown/index.d.ts +3 -3
  24. package/dist/components/FlatForm/index.d.ts +2 -2
  25. package/dist/components/FormComponentDescription/index.d.ts +1 -1
  26. package/dist/components/FormComponentTitle/index.d.ts +1 -1
  27. package/dist/components/Player/index.d.ts +9 -9
  28. package/dist/components/PlayerLoadingCircular/index.d.ts +2 -2
  29. package/dist/components/PlayerLoadingSpinner/index.d.ts +2 -2
  30. package/dist/components/PlayerLoadingSpinner/playerLoadingSpinner.styles.d.ts +1 -1
  31. package/dist/components/ProductDescription/index.d.ts +3 -3
  32. package/dist/components/ProductName/index.d.ts +3 -3
  33. package/dist/components/Share/index.d.ts +2 -2
  34. package/dist/components/Share/index.js +1 -1
  35. package/dist/components/Share/share.styles.d.ts +1 -1
  36. package/dist/components/Snapshots/index.d.ts +2 -2
  37. package/dist/components/Strips/index.d.ts +3 -3
  38. package/dist/components/Swatch/index.d.ts +3 -3
  39. package/dist/components/Switch/index.d.ts +3 -3
  40. package/dist/components/TextInput/index.d.ts +3 -3
  41. package/dist/components/ThreekitProvider/index.d.ts +1 -1
  42. package/dist/components/Tiles/index.d.ts +3 -3
  43. package/dist/components/TilesGroup/index.d.ts +3 -3
  44. package/dist/components/TotalPrice/index.d.ts +3 -3
  45. package/dist/components/TrebleApp/index.d.ts +3 -3
  46. package/dist/components/TurntableAnimation/index.js +1 -1
  47. package/dist/components/Upload/index.d.ts +3 -3
  48. package/dist/components/Upload/index.js +1 -1
  49. package/dist/components/UploadArea/index.d.ts +3 -3
  50. package/dist/components/UploadArea/index.js +1 -1
  51. package/dist/components/Wishlist/WishlistItem.d.ts +2 -2
  52. package/dist/components/Wishlist/index.d.ts +4 -4
  53. package/dist/components/Wishlist/index.js +1 -1
  54. package/dist/components/Zoom/index.d.ts +6 -6
  55. package/dist/components/containers/formInputContainer.d.ts +2 -2
  56. package/dist/components/formComponents.d.ts +6 -6
  57. package/dist/components/message/index.d.ts +1 -1
  58. package/dist/constants.d.ts +6 -6
  59. package/dist/hooks/useAttribute/index.d.ts +4 -4
  60. package/dist/hooks/useAttribute/index.js +1 -1
  61. package/dist/hooks/useConfigurationLoader/index.js +1 -1
  62. package/dist/hooks/useConfigurator/index.d.ts +3 -3
  63. package/dist/hooks/useDevTools/index.d.ts +1 -1
  64. package/dist/hooks/useNestedConfigurator/index.d.ts +2 -2
  65. package/dist/hooks/useNestedConfigurator/index.js +3 -4
  66. package/dist/hooks/usePlayer/index.d.ts +1 -1
  67. package/dist/hooks/usePlayerPortal/index.d.ts +1 -1
  68. package/dist/hooks/useProductCache/index.js +1 -1
  69. package/dist/hooks/useResetProduct/index.d.ts +1 -1
  70. package/dist/hooks/useResetProduct/index.js +1 -1
  71. package/dist/hooks/useShare/index.d.ts +1 -1
  72. package/dist/hooks/useShare/index.js +1 -1
  73. package/dist/hooks/useSingleAnimation/index.js +1 -1
  74. package/dist/hooks/useSpaces/SpacesLayout.d.ts +11 -0
  75. package/dist/hooks/useSpaces/SpacesLayout.js +74 -0
  76. package/dist/hooks/useSpaces/SpacesState.d.ts +177 -0
  77. package/dist/hooks/useSpaces/SpacesState.js +1816 -0
  78. package/dist/hooks/useSpaces/constants.d.ts +79 -0
  79. package/dist/hooks/useSpaces/constants.js +130 -0
  80. package/dist/hooks/useSpaces/dataHandlers.d.ts +38 -0
  81. package/dist/hooks/useSpaces/dataHandlers.js +411 -0
  82. package/dist/hooks/useSpaces/draw/clearCanvas.d.ts +2 -0
  83. package/dist/hooks/useSpaces/draw/clearCanvas.js +9 -0
  84. package/dist/hooks/useSpaces/draw/drawBackground.d.ts +2 -0
  85. package/dist/hooks/useSpaces/draw/drawBackground.js +12 -0
  86. package/dist/hooks/useSpaces/draw/drawDimensions.d.ts +3 -0
  87. package/dist/hooks/useSpaces/draw/drawDimensions.js +53 -0
  88. package/dist/hooks/useSpaces/draw/drawDoors.d.ts +9 -0
  89. package/dist/hooks/useSpaces/draw/drawDoors.js +99 -0
  90. package/dist/hooks/useSpaces/draw/drawFloor.d.ts +3 -0
  91. package/dist/hooks/useSpaces/draw/drawFloor.js +36 -0
  92. package/dist/hooks/useSpaces/draw/drawGrid.d.ts +3 -0
  93. package/dist/hooks/useSpaces/draw/drawGrid.js +36 -0
  94. package/dist/hooks/useSpaces/draw/drawGuides.d.ts +3 -0
  95. package/dist/hooks/useSpaces/draw/drawGuides.js +23 -0
  96. package/dist/hooks/useSpaces/draw/drawOpenings.d.ts +9 -0
  97. package/dist/hooks/useSpaces/draw/drawOpenings.js +72 -0
  98. package/dist/hooks/useSpaces/draw/drawVertices.d.ts +8 -0
  99. package/dist/hooks/useSpaces/draw/drawVertices.js +61 -0
  100. package/dist/hooks/useSpaces/draw/drawWalls.d.ts +11 -0
  101. package/dist/hooks/useSpaces/draw/drawWalls.js +90 -0
  102. package/dist/hooks/useSpaces/draw/drawWindows.d.ts +9 -0
  103. package/dist/hooks/useSpaces/draw/drawWindows.js +82 -0
  104. package/dist/hooks/useSpaces/draw/index.d.ts +11 -0
  105. package/dist/hooks/useSpaces/draw/index.js +129 -0
  106. package/dist/hooks/useSpaces/geometry/addThicknessToLine.d.ts +3 -0
  107. package/dist/hooks/useSpaces/geometry/addThicknessToLine.js +13 -0
  108. package/dist/hooks/useSpaces/geometry/areLinesEqual.d.ts +3 -0
  109. package/dist/hooks/useSpaces/geometry/areLinesEqual.js +17 -0
  110. package/dist/hooks/useSpaces/geometry/arePointsEqual.d.ts +3 -0
  111. package/dist/hooks/useSpaces/geometry/arePointsEqual.js +8 -0
  112. package/dist/hooks/useSpaces/geometry/arePointsWithinProximity.d.ts +3 -0
  113. package/dist/hooks/useSpaces/geometry/arePointsWithinProximity.js +11 -0
  114. package/dist/hooks/useSpaces/geometry/closestPointOnLine.d.ts +3 -0
  115. package/dist/hooks/useSpaces/geometry/closestPointOnLine.js +13 -0
  116. package/dist/hooks/useSpaces/geometry/doLinesOverlap.d.ts +2 -0
  117. package/dist/hooks/useSpaces/geometry/doLinesOverlap.js +16 -0
  118. package/dist/hooks/useSpaces/geometry/euclideanMod.d.ts +2 -0
  119. package/dist/hooks/useSpaces/geometry/euclideanMod.js +6 -0
  120. package/dist/hooks/useSpaces/geometry/findLoops.d.ts +6 -0
  121. package/dist/hooks/{useRoomBuilder → useSpaces/geometry}/findLoops.js +31 -13
  122. package/dist/hooks/useSpaces/geometry/getAllLineIntersections.d.ts +6 -0
  123. package/dist/hooks/useSpaces/geometry/getAllLineIntersections.js +23 -0
  124. package/dist/hooks/useSpaces/geometry/getAngleOfLineSegment.d.ts +3 -0
  125. package/dist/hooks/useSpaces/geometry/getAngleOfLineSegment.js +7 -0
  126. package/dist/hooks/useSpaces/geometry/getClosestPointOnLineSegment.d.ts +3 -0
  127. package/dist/hooks/useSpaces/geometry/getClosestPointOnLineSegment.js +17 -0
  128. package/dist/hooks/useSpaces/geometry/getDistanceToLine.d.ts +3 -0
  129. package/dist/hooks/useSpaces/geometry/getDistanceToLine.js +10 -0
  130. package/dist/hooks/useSpaces/geometry/getLengthOfLineSegment.d.ts +3 -0
  131. package/dist/hooks/useSpaces/geometry/getLengthOfLineSegment.js +7 -0
  132. package/dist/hooks/useSpaces/geometry/getLineAtOffsetOnLineSegment.d.ts +3 -0
  133. package/dist/hooks/useSpaces/geometry/getLineAtOffsetOnLineSegment.js +17 -0
  134. package/dist/hooks/useSpaces/geometry/getLineOtherPoint.d.ts +3 -0
  135. package/dist/hooks/useSpaces/geometry/getLineOtherPoint.js +11 -0
  136. package/dist/hooks/useSpaces/geometry/getLineSegmentsIntersection.d.ts +3 -0
  137. package/dist/hooks/useSpaces/geometry/getLineSegmentsIntersection.js +43 -0
  138. package/dist/hooks/useSpaces/geometry/getMidpointOfLineSegment.d.ts +3 -0
  139. package/dist/hooks/useSpaces/geometry/getMidpointOfLineSegment.js +9 -0
  140. package/dist/hooks/useSpaces/geometry/getParallelLineSegmentAtDistance.d.ts +3 -0
  141. package/dist/hooks/useSpaces/geometry/getParallelLineSegmentAtDistance.js +20 -0
  142. package/dist/hooks/useSpaces/geometry/getPointAtOffsetOnLineSegment.d.ts +3 -0
  143. package/dist/hooks/useSpaces/geometry/getPointAtOffsetOnLineSegment.js +11 -0
  144. package/dist/hooks/useSpaces/geometry/getPolygonArea.d.ts +3 -0
  145. package/dist/hooks/useSpaces/geometry/getPolygonArea.js +15 -0
  146. package/dist/hooks/useSpaces/geometry/getQuadrilateralArea.d.ts +3 -0
  147. package/dist/hooks/useSpaces/geometry/getQuadrilateralArea.js +16 -0
  148. package/dist/hooks/useSpaces/geometry/getTangetIntersectionAndOffset.d.ts +6 -0
  149. package/dist/hooks/useSpaces/geometry/getTangetIntersectionAndOffset.js +17 -0
  150. package/dist/hooks/useSpaces/geometry/getTriangleArea.d.ts +3 -0
  151. package/dist/hooks/useSpaces/geometry/getTriangleArea.js +9 -0
  152. package/dist/hooks/useSpaces/geometry/getUnitVectorOfLineSegment.d.ts +3 -0
  153. package/dist/hooks/useSpaces/geometry/getUnitVectorOfLineSegment.js +12 -0
  154. package/dist/hooks/useSpaces/geometry/index.d.ts +30 -0
  155. package/dist/hooks/useSpaces/geometry/index.js +64 -0
  156. package/dist/hooks/useSpaces/geometry/isPointInPolygon.d.ts +3 -0
  157. package/dist/hooks/useSpaces/geometry/isPointInPolygon.js +21 -0
  158. package/dist/hooks/useSpaces/geometry/isPointInQuadrilateral.d.ts +3 -0
  159. package/dist/hooks/useSpaces/geometry/isPointInQuadrilateral.js +25 -0
  160. package/dist/hooks/useSpaces/geometry/orderCoordinatesOnLineSegment.d.ts +3 -0
  161. package/dist/hooks/useSpaces/geometry/orderCoordinatesOnLineSegment.js +11 -0
  162. package/dist/hooks/useSpaces/geometry/splitLineAtOffset.d.ts +3 -0
  163. package/dist/hooks/useSpaces/geometry/splitLineAtOffset.js +12 -0
  164. package/dist/hooks/useSpaces/geometry/splitLineAtPoint.d.ts +3 -0
  165. package/dist/hooks/useSpaces/geometry/splitLineAtPoint.js +9 -0
  166. package/dist/hooks/useSpaces/geometry/splitLineAtPoints.d.ts +3 -0
  167. package/dist/hooks/useSpaces/geometry/splitLineAtPoints.js +28 -0
  168. package/dist/hooks/useSpaces/index.d.ts +95 -0
  169. package/dist/hooks/useSpaces/index.js +625 -0
  170. package/dist/hooks/useSpaces/themes/blueprint.d.ts +3 -0
  171. package/dist/hooks/useSpaces/themes/blueprint.js +96 -0
  172. package/dist/hooks/useSpaces/themes/default.d.ts +3 -0
  173. package/dist/hooks/useSpaces/themes/default.js +96 -0
  174. package/dist/hooks/{useRoomBuilder/themes.d.ts → useSpaces/themes/index.d.ts} +3 -4
  175. package/dist/hooks/useSpaces/themes/index.js +21 -0
  176. package/dist/hooks/useSpaces/themes/light.d.ts +3 -0
  177. package/dist/hooks/useSpaces/themes/light.js +96 -0
  178. package/dist/hooks/useSpaces/types.d.ts +378 -0
  179. package/dist/hooks/useSpaces/types.js +54 -0
  180. package/dist/hooks/useSpaces/validators/areWallsDuplicated.d.ts +3 -0
  181. package/dist/hooks/useSpaces/validators/areWallsDuplicated.js +61 -0
  182. package/dist/hooks/useSpaces/validators/areWallsIntersecting.d.ts +3 -0
  183. package/dist/hooks/useSpaces/validators/areWallsIntersecting.js +42 -0
  184. package/dist/hooks/useSpaces/validators/areWallsOrphaningFeatures.d.ts +3 -0
  185. package/dist/hooks/useSpaces/validators/areWallsOrphaningFeatures.js +52 -0
  186. package/dist/hooks/useSpaces/validators/areWallsTooShort.d.ts +3 -0
  187. package/dist/hooks/useSpaces/validators/areWallsTooShort.js +37 -0
  188. package/dist/hooks/useSpaces/validators/index.d.ts +15 -0
  189. package/dist/hooks/useSpaces/validators/index.js +40 -0
  190. package/dist/hooks/useSpaces/validators/isFeatureCollidingWithExistingFeature.d.ts +3 -0
  191. package/dist/hooks/useSpaces/validators/isFeatureCollidingWithExistingFeature.js +31 -0
  192. package/dist/hooks/useSpaces/validators/isFeatureOutsideWallBounds.d.ts +3 -0
  193. package/dist/hooks/useSpaces/validators/isFeatureOutsideWallBounds.js +19 -0
  194. package/dist/hooks/useSpaces/validators/isLineTooShort.d.ts +3 -0
  195. package/dist/hooks/useSpaces/validators/isLineTooShort.js +26 -0
  196. package/dist/hooks/useSpaces/validators/isVertexLandingOnFeature.d.ts +4 -0
  197. package/dist/hooks/useSpaces/validators/isVertexLandingOnFeature.js +19 -0
  198. package/dist/hooks/useSpaces/validators/isWallEndingOnFeature.d.ts +3 -0
  199. package/dist/hooks/useSpaces/validators/isWallEndingOnFeature.js +19 -0
  200. package/dist/hooks/useSpaces/validators/isWallIntersectingFeature.d.ts +3 -0
  201. package/dist/hooks/useSpaces/validators/isWallIntersectingFeature.js +41 -0
  202. package/dist/hooks/useSpaces/validators/isWallOverlappingExisitingWalls.d.ts +3 -0
  203. package/dist/hooks/useSpaces/validators/isWallOverlappingExisitingWalls.js +54 -0
  204. package/dist/hooks/useSpaces/validators/isWallTooShort.d.ts +3 -0
  205. package/dist/hooks/useSpaces/validators/isWallTooShort.js +10 -0
  206. package/dist/hooks/{useRoomBuilder → useSpaces/validators}/messaging.js +1 -1
  207. package/dist/hooks/useWishlist/index.d.ts +1 -1
  208. package/dist/hooks/useZoom/index.d.ts +1 -1
  209. package/dist/http/assets.d.ts +1 -1
  210. package/dist/http/orders.d.ts +1 -1
  211. package/dist/icons/AngleSnapping.d.ts +3 -0
  212. package/dist/icons/AngleSnapping.js +28 -0
  213. package/dist/icons/Boundary.d.ts +3 -0
  214. package/dist/icons/Boundary.js +21 -0
  215. package/dist/icons/Center.d.ts +3 -0
  216. package/dist/icons/Center.js +24 -0
  217. package/dist/icons/Draw.js +3 -3
  218. package/dist/icons/GridSnapping.d.ts +3 -0
  219. package/dist/icons/GridSnapping.js +28 -0
  220. package/dist/icons/LayoutAlt.d.ts +3 -0
  221. package/dist/icons/LayoutAlt.js +21 -0
  222. package/dist/icons/Magnet.d.ts +3 -0
  223. package/dist/icons/Magnet.js +27 -0
  224. package/dist/icons/Player3D.d.ts +3 -0
  225. package/dist/icons/Player3D.js +21 -0
  226. package/dist/icons/RulerBlank.d.ts +3 -0
  227. package/dist/icons/RulerBlank.js +25 -0
  228. package/dist/icons/RulerDetailed.d.ts +3 -0
  229. package/dist/icons/RulerDetailed.js +27 -0
  230. package/dist/icons/Save.d.ts +3 -0
  231. package/dist/icons/Save.js +21 -0
  232. package/dist/icons/Spinner.d.ts +2 -2
  233. package/dist/icons/UnitCm.d.ts +3 -0
  234. package/dist/icons/UnitCm.js +22 -0
  235. package/dist/icons/UnitFeet.d.ts +3 -0
  236. package/dist/icons/UnitFeet.js +22 -0
  237. package/dist/icons/UnitInch.d.ts +3 -0
  238. package/dist/icons/UnitInch.js +22 -0
  239. package/dist/icons/UnitMeter.d.ts +3 -0
  240. package/dist/icons/UnitMeter.js +21 -0
  241. package/dist/icons/Window.js +4 -4
  242. package/dist/icons/index.js +28 -0
  243. package/dist/index.d.ts +17 -2
  244. package/dist/index.js +35 -5
  245. package/dist/store/attributes.d.ts +4 -3
  246. package/dist/store/attributes.js +1 -1
  247. package/dist/store/index.d.ts +43 -12
  248. package/dist/store/index.js +3 -1
  249. package/dist/store/price.d.ts +1 -1
  250. package/dist/store/price.js +1 -1
  251. package/dist/store/product.d.ts +2 -2
  252. package/dist/store/product.js +5 -8
  253. package/dist/store/spaces.d.ts +74 -0
  254. package/dist/store/spaces.js +354 -0
  255. package/dist/store/translations.d.ts +1 -1
  256. package/dist/store/translations.js +1 -1
  257. package/dist/store/treble.d.ts +2 -2
  258. package/dist/store/treble.js +15 -22
  259. package/dist/store/wishlist.d.ts +4 -22
  260. package/dist/store/wishlist.js +1 -1
  261. package/dist/types.d.ts +20 -18
  262. package/dist/types.js +9 -9
  263. package/dist/utils.d.ts +2 -2
  264. package/dist/utils.js +3 -3
  265. package/package.json +1 -1
  266. package/dist/hooks/useRoomBuilder/RoomBuilderState.d.ts +0 -95
  267. package/dist/hooks/useRoomBuilder/RoomBuilderState.js +0 -1237
  268. package/dist/hooks/useRoomBuilder/constants.d.ts +0 -41
  269. package/dist/hooks/useRoomBuilder/constants.js +0 -48
  270. package/dist/hooks/useRoomBuilder/dataHandlers.d.ts +0 -18
  271. package/dist/hooks/useRoomBuilder/dataHandlers.js +0 -187
  272. package/dist/hooks/useRoomBuilder/draw.d.ts +0 -55
  273. package/dist/hooks/useRoomBuilder/draw.js +0 -573
  274. package/dist/hooks/useRoomBuilder/findLoops.d.ts +0 -5
  275. package/dist/hooks/useRoomBuilder/geometry.d.ts +0 -33
  276. package/dist/hooks/useRoomBuilder/geometry.js +0 -325
  277. package/dist/hooks/useRoomBuilder/index.d.ts +0 -40
  278. package/dist/hooks/useRoomBuilder/index.js +0 -303
  279. package/dist/hooks/useRoomBuilder/themes.js +0 -273
  280. package/dist/hooks/useRoomBuilder/types.d.ts +0 -238
  281. package/dist/hooks/useRoomBuilder/types.js +0 -36
  282. package/dist/hooks/useRoomBuilder/validators.d.ts +0 -36
  283. package/dist/hooks/useRoomBuilder/validators.js +0 -362
  284. /package/dist/hooks/{useRoomBuilder → useSpaces/validators}/messaging.d.ts +0 -0
@@ -1,41 +0,0 @@
1
- export declare enum IWallAttributes {
2
- START_X = "Start X",
3
- START_Z = "Start Z",
4
- END_X = "End X",
5
- END_Z = "End Z",
6
- HEIGHT = "Height",
7
- THICKNESS = "Thickness",
8
- CONNECTIONS = "Connections"
9
- }
10
- export declare enum IFeatureAttribute {
11
- POSITION_X = "Start X",
12
- POSITION_Y = "Start Y",
13
- POSITION_Z = "Start Z",
14
- HEIGHT = "Height",
15
- LENGTH = "Length",
16
- CONNECTED_TO = "Connected To"
17
- }
18
- export declare const SCALE = 0.02;
19
- export declare const SNAP_PROXIMITY = 10;
20
- export declare const MIN_WALL_LENGTH = 50;
21
- export declare const WALL_PADDING_FOR_FEATURE = 20;
22
- export declare const UNIT_LABELS: {
23
- feet: string;
24
- meter: string;
25
- inch: string;
26
- cm: string;
27
- };
28
- export declare const UNIT_FACTORS: {
29
- cm: number;
30
- meter: number;
31
- feet: number;
32
- inch: number;
33
- };
34
- export declare const FEATURE_LABELS: {
35
- windows: string;
36
- doors: string;
37
- openings: string;
38
- };
39
- export declare const FEATURE_LENGTH = 120;
40
- export declare const UI_ANCHOR_DISTANCE = -60;
41
- export declare const WALL_SNAP_DISTANCE = 12;
@@ -1,48 +0,0 @@
1
- "use strict";
2
- var _a, _b, _c;
3
- Object.defineProperty(exports, "__esModule", { value: true });
4
- exports.WALL_SNAP_DISTANCE = exports.UI_ANCHOR_DISTANCE = exports.FEATURE_LENGTH = exports.FEATURE_LABELS = exports.UNIT_FACTORS = exports.UNIT_LABELS = exports.WALL_PADDING_FOR_FEATURE = exports.MIN_WALL_LENGTH = exports.SNAP_PROXIMITY = exports.SCALE = exports.IFeatureAttribute = exports.IWallAttributes = void 0;
5
- var types_1 = require("./types");
6
- var IWallAttributes;
7
- (function (IWallAttributes) {
8
- IWallAttributes["START_X"] = "Start X";
9
- IWallAttributes["START_Z"] = "Start Z";
10
- IWallAttributes["END_X"] = "End X";
11
- IWallAttributes["END_Z"] = "End Z";
12
- IWallAttributes["HEIGHT"] = "Height";
13
- IWallAttributes["THICKNESS"] = "Thickness";
14
- IWallAttributes["CONNECTIONS"] = "Connections";
15
- })(IWallAttributes || (exports.IWallAttributes = IWallAttributes = {}));
16
- var IFeatureAttribute;
17
- (function (IFeatureAttribute) {
18
- IFeatureAttribute["POSITION_X"] = "Start X";
19
- IFeatureAttribute["POSITION_Y"] = "Start Y";
20
- IFeatureAttribute["POSITION_Z"] = "Start Z";
21
- IFeatureAttribute["HEIGHT"] = "Height";
22
- IFeatureAttribute["LENGTH"] = "Length";
23
- IFeatureAttribute["CONNECTED_TO"] = "Connected To";
24
- })(IFeatureAttribute || (exports.IFeatureAttribute = IFeatureAttribute = {}));
25
- exports.SCALE = 0.02;
26
- exports.SNAP_PROXIMITY = 10;
27
- exports.MIN_WALL_LENGTH = 50;
28
- exports.WALL_PADDING_FOR_FEATURE = 20;
29
- exports.UNIT_LABELS = (_a = {},
30
- _a[types_1.IUnits.FEET] = 'ft',
31
- _a[types_1.IUnits.METER] = 'm',
32
- _a[types_1.IUnits.INCH] = 'in',
33
- _a[types_1.IUnits.CM] = 'cm',
34
- _a);
35
- exports.UNIT_FACTORS = (_b = {},
36
- _b[types_1.IUnits.CM] = 100,
37
- _b[types_1.IUnits.METER] = 1,
38
- _b[types_1.IUnits.FEET] = 3.28084,
39
- _b[types_1.IUnits.INCH] = 39.37,
40
- _b);
41
- exports.FEATURE_LABELS = (_c = {},
42
- _c[types_1.IElements.WINDOW] = 'Window',
43
- _c[types_1.IElements.DOOR] = 'Door',
44
- _c[types_1.IElements.OPENING] = 'Opening',
45
- _c);
46
- exports.FEATURE_LENGTH = 120;
47
- exports.UI_ANCHOR_DISTANCE = -60;
48
- exports.WALL_SNAP_DISTANCE = 12;
@@ -1,18 +0,0 @@
1
- import type { IWalls, IRoomBuilderStateProps, IVerticesState, IFeatures } from './types';
2
- import { IUnits } from './types';
3
- import type { IConfiguration, IHydratedAttribute } from '../../types';
4
- export declare function prepAttributesIncoming(attributes: Record<string, IHydratedAttribute>, config: IRoomBuilderStateProps): {
5
- features: IFeatures;
6
- walls: IWalls;
7
- vertex: IVerticesState;
8
- };
9
- export declare function prepAttributesOutgoing(walls: IWalls, features: IFeatures, config: IRoomBuilderStateProps): {
10
- [x: string]: import("../../types").IConfigurationAttribute | {
11
- assetId: string;
12
- configuration: IConfiguration;
13
- }[];
14
- };
15
- export declare function convertLengthUnit(value: number, from: IUnits, to: IUnits): number;
16
- export declare function convertAreaUnit(value: number, from: IUnits, to: IUnits): number;
17
- export declare function prepLengthForUser(value: number, unit: IUnits): string;
18
- export declare function prepAreaForUser(value: number, unit: IUnits): string;
@@ -1,187 +0,0 @@
1
- "use strict";
2
- var __assign = (this && this.__assign) || function () {
3
- __assign = Object.assign || function(t) {
4
- for (var s, i = 1, n = arguments.length; i < n; i++) {
5
- s = arguments[i];
6
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
7
- t[p] = s[p];
8
- }
9
- return t;
10
- };
11
- return __assign.apply(this, arguments);
12
- };
13
- Object.defineProperty(exports, "__esModule", { value: true });
14
- exports.prepAreaForUser = exports.prepLengthForUser = exports.convertAreaUnit = exports.convertLengthUnit = exports.prepAttributesOutgoing = exports.prepAttributesIncoming = void 0;
15
- var types_1 = require("./types");
16
- var constants_1 = require("./constants");
17
- var geometry_1 = require("./geometry");
18
- function prepConnectionOutgoing(connection) {
19
- return "".concat(connection[0], ".").concat(connection[1]);
20
- }
21
- function prepConnectionIncoming(connection) {
22
- var _a = connection.split('.'), attributeName = _a[0], indexStr = _a[1];
23
- return [attributeName, parseInt(indexStr)];
24
- }
25
- function prepWallsAndVerticesIncoming(wallsAttribute, config) {
26
- var _a;
27
- var walls = [];
28
- var vertices = {};
29
- ((wallsAttribute === null || wallsAttribute === void 0 ? void 0 : wallsAttribute.value) || []).forEach(function (_a, i) {
30
- var assetId = _a.assetId, configuration = _a.configuration;
31
- var point1 = [
32
- (configuration === null || configuration === void 0 ? void 0 : configuration[constants_1.IWallAttributes.START_X]) / config.config.scale,
33
- (configuration === null || configuration === void 0 ? void 0 : configuration[constants_1.IWallAttributes.START_Z]) / config.config.scale,
34
- ];
35
- var point2 = [
36
- (configuration === null || configuration === void 0 ? void 0 : configuration[constants_1.IWallAttributes.END_X]) / config.config.scale,
37
- (configuration === null || configuration === void 0 ? void 0 : configuration[constants_1.IWallAttributes.END_Z]) / config.config.scale,
38
- ];
39
- var point1Str = JSON.stringify(point1);
40
- var point2Str = JSON.stringify(point2);
41
- if (vertices[point1Str])
42
- vertices[point1Str].push([i, 0]);
43
- else
44
- vertices[point1Str] = [[i, 0]];
45
- if (vertices[point2Str])
46
- vertices[point2Str].push([i, 1]);
47
- else
48
- vertices[point2Str] = [[i, 1]];
49
- var connections = [];
50
- walls.push({
51
- assetId: assetId,
52
- line: [point1, point2],
53
- path: (0, geometry_1.addThicknessToLine)([point1, point2], config.config.styles.wall.thickness),
54
- height: configuration === null || configuration === void 0 ? void 0 : configuration[constants_1.IWallAttributes.HEIGHT],
55
- thickness: configuration === null || configuration === void 0 ? void 0 : configuration[constants_1.IWallAttributes.THICKNESS],
56
- connections: connections,
57
- });
58
- });
59
- return _a = {}, _a[types_1.IElements.WALL] = walls, _a[types_1.IElements.VERTEX] = vertices, _a;
60
- }
61
- function prepFeatureIncoming(walls, featureAttribute, config) {
62
- var _a;
63
- var feature = [];
64
- (_a = featureAttribute === null || featureAttribute === void 0 ? void 0 : featureAttribute.value) === null || _a === void 0 ? void 0 : _a.forEach(function (_a) {
65
- var assetId = _a.assetId, configuration = _a.configuration;
66
- var offset = (configuration === null || configuration === void 0 ? void 0 : configuration[constants_1.IFeatureAttribute.POSITION_X]) / config.config.scale;
67
- var length = (configuration === null || configuration === void 0 ? void 0 : configuration[constants_1.IFeatureAttribute.LENGTH]) / config.config.scale ||
68
- constants_1.FEATURE_LENGTH;
69
- var connectedTo = (configuration === null || configuration === void 0 ? void 0 : configuration[constants_1.IFeatureAttribute.CONNECTED_TO]) || '';
70
- var wallIndex = prepConnectionIncoming(connectedTo)[1];
71
- var featureLine = (0, geometry_1.getLineAtOffsetOnLineSegment)(walls[wallIndex].line, offset, length);
72
- var path = (0, geometry_1.addThicknessToLine)(featureLine, config.config.styles.feature.thickness);
73
- feature.push({
74
- assetId: assetId,
75
- offset: offset,
76
- length: length,
77
- path: path,
78
- connectedTo: [types_1.IElements.WALL, wallIndex],
79
- });
80
- });
81
- return feature;
82
- }
83
- function prepAttributesIncoming(attributes, config) {
84
- var _a;
85
- var featuresList = [types_1.IElements.WINDOW, types_1.IElements.DOOR, types_1.IElements.OPENING];
86
- var wallsAndVertices = prepWallsAndVerticesIncoming(attributes[config.attributes[types_1.IElements.WALL]], config);
87
- var featuresData = featuresList.reduce(function (output, type) {
88
- output[type] = prepFeatureIncoming(wallsAndVertices[types_1.IElements.WALL], attributes[config.attributes[type]], config);
89
- return output;
90
- }, {});
91
- return __assign(__assign({}, wallsAndVertices), (_a = {}, _a[types_1.IElements.FEATURE] = featuresData, _a));
92
- }
93
- exports.prepAttributesIncoming = prepAttributesIncoming;
94
- function prepFeaturesOutgoing(features, config) {
95
- return features.map(function (feature) {
96
- var _a, _b;
97
- var assetId = feature.assetId, offset = feature.offset, length = feature.length;
98
- var connectedTo = prepConnectionOutgoing([
99
- config.attributes[feature.connectedTo[0]],
100
- feature.connectedTo[1],
101
- ]);
102
- var configuration = Object.entries((_a = {},
103
- _a[constants_1.IFeatureAttribute.LENGTH] = length,
104
- _a[constants_1.IFeatureAttribute.POSITION_X] = offset,
105
- _a)).reduce(function (output, _a) {
106
- var _b;
107
- var key = _a[0], value = _a[1];
108
- return Object.assign(output, (_b = {},
109
- _b[key] = value ? value * config.config.scale : value,
110
- _b));
111
- }, (_b = {},
112
- _b[constants_1.IFeatureAttribute.CONNECTED_TO] = connectedTo,
113
- _b));
114
- return {
115
- assetId: assetId,
116
- configuration: configuration,
117
- };
118
- });
119
- }
120
- function prepWallsOutgoing(walls, config) {
121
- return walls.map(function (wall) {
122
- var _a, _b;
123
- var line = wall.line, height = wall.height, thickness = wall.thickness;
124
- var connections = wall.connections.map(function (connection) {
125
- var attributeName = config.attributes[connection[0]];
126
- if (!attributeName)
127
- return;
128
- return prepConnectionOutgoing([attributeName, connection[1]]);
129
- });
130
- var _c = line.flat(), x1 = _c[0], y1 = _c[1], x2 = _c[2], y2 = _c[3];
131
- var configuration = Object.entries((_a = {},
132
- _a[constants_1.IWallAttributes.START_X] = x1,
133
- _a[constants_1.IWallAttributes.START_Z] = y1,
134
- _a[constants_1.IWallAttributes.END_X] = x2,
135
- _a[constants_1.IWallAttributes.END_Z] = y2,
136
- _a[constants_1.IWallAttributes.HEIGHT] = height,
137
- _a[constants_1.IWallAttributes.THICKNESS] = thickness,
138
- _a)).reduce(function (output, _a) {
139
- var _b;
140
- var key = _a[0], value = _a[1];
141
- return Object.assign(output, (_b = {},
142
- _b[key] = value ? value * config.config.scale : value,
143
- _b));
144
- }, (_b = {},
145
- _b[constants_1.IWallAttributes.CONNECTIONS] = JSON.stringify(connections),
146
- _b));
147
- return {
148
- assetId: wall.assetId,
149
- configuration: configuration,
150
- };
151
- });
152
- }
153
- function prepAttributesOutgoing(walls, features, config) {
154
- var _a;
155
- var wallsAttribute = prepWallsOutgoing(walls, config);
156
- var featuresAttributes = Object.entries(features).reduce(function (output, _a) {
157
- var type = _a[0], features = _a[1];
158
- var attributeName = config.attributes[type];
159
- if (!attributeName)
160
- return output;
161
- output[attributeName] = prepFeaturesOutgoing(features, config);
162
- return output;
163
- }, {});
164
- return __assign(__assign({}, featuresAttributes), (_a = {}, _a[config.attributes[types_1.IElements.WALL]] = wallsAttribute, _a));
165
- }
166
- exports.prepAttributesOutgoing = prepAttributesOutgoing;
167
- function convertLengthUnit(value, from, to) {
168
- return (value / constants_1.UNIT_FACTORS[from]) * constants_1.UNIT_FACTORS[to];
169
- }
170
- exports.convertLengthUnit = convertLengthUnit;
171
- function convertAreaUnit(value, from, to) {
172
- return (value / constants_1.UNIT_FACTORS[from]) * Math.pow(constants_1.UNIT_FACTORS[to], 2);
173
- }
174
- exports.convertAreaUnit = convertAreaUnit;
175
- function prepLengthForUser(value, unit) {
176
- if (unit === types_1.IUnits.FEET) {
177
- var feet = Math.floor(value);
178
- var inches = 1.2 * (value % 1);
179
- return "".concat(feet).concat(constants_1.UNIT_LABELS[types_1.IUnits.FEET], " ").concat(inches.toFixed(2)).concat(constants_1.UNIT_LABELS[types_1.IUnits.INCH]);
180
- }
181
- return "".concat(value.toFixed(2), " ").concat(constants_1.UNIT_LABELS[unit]);
182
- }
183
- exports.prepLengthForUser = prepLengthForUser;
184
- function prepAreaForUser(value, unit) {
185
- return "".concat(value.toFixed(2), " sq-").concat(constants_1.UNIT_LABELS[unit]);
186
- }
187
- exports.prepAreaForUser = prepAreaForUser;
@@ -1,55 +0,0 @@
1
- import { IWall, ICoordinate2D, ICoordinatesLine, IFeatures, IFeature, IElementAddress, IRoomBuilderStyles, IRoomBuilderConfigInternal, IStylesGrid, IStylesWall, IStylesVertex, ILineDimensions, IVertex, IElementStyleModes, IStylesFloor, IEnclosedSpace } from './types';
2
- interface IWallToDraw extends Omit<IWall, 'assetId' | 'connections'> {
3
- }
4
- interface IWallsToDraw extends Array<IWallToDraw> {
5
- }
6
- export declare function clearCanvas(canvas: HTMLCanvasElement): void;
7
- export declare function drawBackground(canvas: HTMLCanvasElement, color?: string): void;
8
- export declare function drawGrid(canvas: HTMLCanvasElement, styles: IStylesGrid): void;
9
- export declare function drawFloor(canvas: HTMLCanvasElement, enclosedSpaces: Array<IEnclosedSpace>, styles: IStylesFloor): void;
10
- export declare function drawVertex(canvas: HTMLCanvasElement, point: ICoordinate2D, style: IStylesVertex, mode?: IElementStyleModes): void;
11
- export declare function drawNewWall(canvas: HTMLCanvasElement, line: ICoordinatesLine, styles: IRoomBuilderStyles, mode?: IElementStyleModes.ERROR): void;
12
- export declare function drawWalls(canvas: HTMLCanvasElement, walls: IWallsToDraw, selections: {
13
- active: Array<number>;
14
- highlighted: Array<number>;
15
- error: Array<number>;
16
- hidden: Array<number>;
17
- }, styles: IStylesWall): void;
18
- export declare function drawVertices(canvas: HTMLCanvasElement, vertices: Array<IVertex>, selections: {
19
- active: Array<number>;
20
- highlighted: Array<number>;
21
- error: Array<number>;
22
- hidden: Array<number>;
23
- }, styles: IStylesVertex): void;
24
- export declare function drawDimensions(canvas: HTMLCanvasElement, dimensions: Array<ILineDimensions>, config: IRoomBuilderConfigInternal): void;
25
- export declare function drawWindows(canvas: HTMLCanvasElement, walls: IWallsToDraw, windows: Array<IFeature>, selections: {
26
- active: Array<number>;
27
- highlighted: Array<number>;
28
- error: Array<number>;
29
- hidden: Array<number>;
30
- }, styles: IRoomBuilderStyles): void;
31
- export declare function drawDoors(canvas: HTMLCanvasElement, walls: IWallsToDraw, doors: Array<IFeature>, selections: {
32
- active: Array<number>;
33
- highlighted: Array<number>;
34
- error: Array<number>;
35
- hidden: Array<number>;
36
- }, styles: IRoomBuilderStyles): void;
37
- export declare function drawOpenings(canvas: HTMLCanvasElement, walls: IWallsToDraw, openings: Array<IFeature>, selections: {
38
- active: Array<number>;
39
- highlighted: Array<number>;
40
- error: Array<number>;
41
- hidden: Array<number>;
42
- }, styles: IRoomBuilderStyles): void;
43
- export declare function drawElements(canvas: HTMLCanvasElement, walls: IWallsToDraw, vertices: Array<IVertex>, features: IFeatures, selections: {
44
- active: Array<IElementAddress>;
45
- highlighted: Array<IElementAddress>;
46
- hidden: Array<IElementAddress>;
47
- error: Array<IElementAddress>;
48
- }, styles: IRoomBuilderStyles): void;
49
- export declare function drawRoom(canvas: HTMLCanvasElement, enclosedSpaces: Array<IEnclosedSpace>, walls: IWallsToDraw, vertices: Array<IVertex>, features: IFeatures, dimensions: Array<ILineDimensions> | undefined, selections: {
50
- active?: Array<IElementAddress> | IElementAddress;
51
- highlighted?: Array<IElementAddress> | IElementAddress;
52
- hidden?: Array<IElementAddress> | IElementAddress;
53
- error?: Array<IElementAddress> | IElementAddress;
54
- }, config: IRoomBuilderConfigInternal): void;
55
- export {};