@threekit-tools/treble 0.0.92-next-01 → 0.0.93

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 (297) hide show
  1. package/dist/Treble/Treble.d.ts +2 -2
  2. package/dist/Treble/Treble.js +6 -5
  3. package/dist/Treble/index.d.ts +1 -1
  4. package/dist/Treble/index.js +1 -1
  5. package/dist/Treble/{snapshot.d.ts → snapshots.d.ts} +1 -1
  6. package/dist/Treble/{snapshot.js → snapshots.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.d.ts +1 -0
  10. package/dist/api/{products.js → assets.js} +12 -33
  11. package/dist/api/catalog.js +1 -1
  12. package/dist/api/configurations.d.ts +1 -0
  13. package/dist/api/configurations.js +10 -3
  14. package/dist/api/datatables.js +1 -1
  15. package/dist/api/index.d.ts +2 -2
  16. package/dist/api/index.js +2 -2
  17. package/dist/api/orders.js +1 -1
  18. package/dist/api/price.js +1 -1
  19. package/dist/components/AttributeTitle/index.d.ts +2 -2
  20. package/dist/components/AttributeValue/index.d.ts +2 -2
  21. package/dist/components/BreatheAnimation/index.js +1 -1
  22. package/dist/components/Button/index.d.ts +3 -3
  23. package/dist/components/Cards/index.d.ts +3 -3
  24. package/dist/components/DevTools/index.d.ts +2 -2
  25. package/dist/components/DraggableHint/draggableIndicator.styles.d.ts +1 -1
  26. package/dist/components/DraggableHint/index.d.ts +2 -2
  27. package/dist/components/Dropdown/index.d.ts +3 -3
  28. package/dist/components/FlatForm/index.d.ts +2 -2
  29. package/dist/components/FormComponentDescription/index.d.ts +1 -1
  30. package/dist/components/FormComponentTitle/index.d.ts +1 -1
  31. package/dist/components/Player/index.d.ts +9 -9
  32. package/dist/components/PlayerLoadingCircular/index.d.ts +2 -2
  33. package/dist/components/PlayerLoadingSpinner/index.d.ts +2 -2
  34. package/dist/components/PlayerLoadingSpinner/playerLoadingSpinner.styles.d.ts +1 -1
  35. package/dist/components/ProductDescription/index.d.ts +3 -3
  36. package/dist/components/ProductName/index.d.ts +3 -3
  37. package/dist/components/Share/index.d.ts +2 -2
  38. package/dist/components/Share/index.js +1 -1
  39. package/dist/components/Share/share.styles.d.ts +1 -1
  40. package/dist/components/Snapshots/index.d.ts +2 -2
  41. package/dist/components/Strips/index.d.ts +3 -3
  42. package/dist/components/Swatch/index.d.ts +3 -3
  43. package/dist/components/Switch/index.d.ts +3 -3
  44. package/dist/components/TextInput/index.d.ts +3 -3
  45. package/dist/components/ThreekitProvider/index.d.ts +6 -3
  46. package/dist/components/ThreekitProvider/index.js +27 -2
  47. package/dist/components/Tiles/index.d.ts +3 -3
  48. package/dist/components/TilesGroup/index.d.ts +3 -3
  49. package/dist/components/TotalPrice/index.d.ts +3 -3
  50. package/dist/components/TrebleApp/index.d.ts +3 -3
  51. package/dist/components/TurntableAnimation/index.js +1 -1
  52. package/dist/components/Upload/index.d.ts +3 -3
  53. package/dist/components/Upload/index.js +1 -1
  54. package/dist/components/UploadArea/index.d.ts +3 -3
  55. package/dist/components/UploadArea/index.js +1 -1
  56. package/dist/components/Wishlist/WishlistItem.d.ts +2 -2
  57. package/dist/components/Wishlist/index.d.ts +4 -4
  58. package/dist/components/Wishlist/index.js +1 -1
  59. package/dist/components/Zoom/index.d.ts +6 -6
  60. package/dist/components/containers/formInputContainer.d.ts +2 -2
  61. package/dist/components/formComponents.d.ts +6 -6
  62. package/dist/components/message/index.d.ts +1 -1
  63. package/dist/constants.d.ts +6 -6
  64. package/dist/hooks/useAttribute/index.d.ts +4 -4
  65. package/dist/hooks/useAttribute/index.js +3 -3
  66. package/dist/hooks/useConfigurationLoader/index.js +1 -1
  67. package/dist/hooks/useConfigurator/index.d.ts +3 -3
  68. package/dist/hooks/useConfigurator/index.js +3 -5
  69. package/dist/hooks/useDevTools/index.d.ts +1 -1
  70. package/dist/hooks/useNestedConfigurator/index.d.ts +2 -2
  71. package/dist/hooks/useNestedConfigurator/index.js +5 -4
  72. package/dist/hooks/usePlayer/index.d.ts +1 -1
  73. package/dist/hooks/usePlayerPortal/index.d.ts +1 -1
  74. package/dist/hooks/useProductCache/index.js +1 -1
  75. package/dist/hooks/useResetProduct/index.d.ts +1 -1
  76. package/dist/hooks/useResetProduct/index.js +1 -1
  77. package/dist/hooks/useRoomBuilder/RoomBuilderState.d.ts +95 -0
  78. package/dist/hooks/useRoomBuilder/RoomBuilderState.js +1237 -0
  79. package/dist/hooks/useRoomBuilder/constants.d.ts +41 -0
  80. package/dist/hooks/useRoomBuilder/constants.js +48 -0
  81. package/dist/hooks/useRoomBuilder/dataHandlers.d.ts +18 -0
  82. package/dist/hooks/useRoomBuilder/dataHandlers.js +187 -0
  83. package/dist/hooks/useRoomBuilder/draw.d.ts +55 -0
  84. package/dist/hooks/useRoomBuilder/draw.js +573 -0
  85. package/dist/hooks/useRoomBuilder/findLoops.d.ts +5 -0
  86. package/dist/hooks/{useSpaces/geometry → useRoomBuilder}/findLoops.js +13 -31
  87. package/dist/hooks/useRoomBuilder/geometry.d.ts +33 -0
  88. package/dist/hooks/useRoomBuilder/geometry.js +325 -0
  89. package/dist/hooks/useRoomBuilder/index.d.ts +40 -0
  90. package/dist/hooks/useRoomBuilder/index.js +303 -0
  91. package/dist/hooks/{useSpaces/validators → useRoomBuilder}/messaging.js +1 -1
  92. package/dist/hooks/{useSpaces/themes/index.d.ts → useRoomBuilder/themes.d.ts} +4 -3
  93. package/dist/hooks/useRoomBuilder/themes.js +273 -0
  94. package/dist/hooks/useRoomBuilder/types.d.ts +238 -0
  95. package/dist/hooks/useRoomBuilder/types.js +36 -0
  96. package/dist/hooks/useRoomBuilder/validators.d.ts +36 -0
  97. package/dist/hooks/useRoomBuilder/validators.js +362 -0
  98. package/dist/hooks/useShare/index.d.ts +1 -1
  99. package/dist/hooks/useShare/index.js +4 -2
  100. package/dist/hooks/useSingleAnimation/index.js +1 -1
  101. package/dist/hooks/useWishlist/index.d.ts +1 -1
  102. package/dist/hooks/useZoom/index.d.ts +1 -1
  103. package/dist/http/assets.d.ts +2 -0
  104. package/dist/http/assets.js +16 -0
  105. package/dist/http/index.d.ts +2 -2
  106. package/dist/http/index.js +2 -2
  107. package/dist/http/orders.d.ts +1 -1
  108. package/dist/icons/Draw.js +3 -3
  109. package/dist/icons/Spinner.d.ts +2 -2
  110. package/dist/icons/Window.js +4 -4
  111. package/dist/icons/index.js +0 -28
  112. package/dist/icons/types.d.ts +1 -1
  113. package/dist/index.d.ts +2 -17
  114. package/dist/index.js +5 -35
  115. package/dist/store/attributes.d.ts +4 -5
  116. package/dist/store/attributes.js +2 -4
  117. package/dist/store/index.d.ts +6 -13
  118. package/dist/store/index.js +1 -3
  119. package/dist/store/price.d.ts +1 -1
  120. package/dist/store/price.js +1 -1
  121. package/dist/store/product.d.ts +2 -2
  122. package/dist/store/product.js +8 -5
  123. package/dist/store/translations.d.ts +10 -8
  124. package/dist/store/translations.js +39 -19
  125. package/dist/store/treble.d.ts +2 -2
  126. package/dist/store/treble.js +22 -15
  127. package/dist/store/wishlist.d.ts +2 -2
  128. package/dist/store/wishlist.js +1 -1
  129. package/dist/types.d.ts +19 -20
  130. package/dist/types.js +9 -9
  131. package/dist/utils.d.ts +2 -6
  132. package/dist/utils.js +5 -12
  133. package/package.json +1 -2
  134. package/dist/api/products.d.ts +0 -4
  135. package/dist/hooks/useSpaces/SpacesLayout.d.ts +0 -11
  136. package/dist/hooks/useSpaces/SpacesLayout.js +0 -74
  137. package/dist/hooks/useSpaces/SpacesState.d.ts +0 -177
  138. package/dist/hooks/useSpaces/SpacesState.js +0 -1814
  139. package/dist/hooks/useSpaces/constants.d.ts +0 -79
  140. package/dist/hooks/useSpaces/constants.js +0 -130
  141. package/dist/hooks/useSpaces/dataHandlers.d.ts +0 -38
  142. package/dist/hooks/useSpaces/dataHandlers.js +0 -407
  143. package/dist/hooks/useSpaces/draw/clearCanvas.d.ts +0 -2
  144. package/dist/hooks/useSpaces/draw/clearCanvas.js +0 -9
  145. package/dist/hooks/useSpaces/draw/drawBackground.d.ts +0 -2
  146. package/dist/hooks/useSpaces/draw/drawBackground.js +0 -12
  147. package/dist/hooks/useSpaces/draw/drawDimensions.d.ts +0 -3
  148. package/dist/hooks/useSpaces/draw/drawDimensions.js +0 -53
  149. package/dist/hooks/useSpaces/draw/drawDoors.d.ts +0 -9
  150. package/dist/hooks/useSpaces/draw/drawDoors.js +0 -99
  151. package/dist/hooks/useSpaces/draw/drawFloor.d.ts +0 -3
  152. package/dist/hooks/useSpaces/draw/drawFloor.js +0 -36
  153. package/dist/hooks/useSpaces/draw/drawGrid.d.ts +0 -3
  154. package/dist/hooks/useSpaces/draw/drawGrid.js +0 -36
  155. package/dist/hooks/useSpaces/draw/drawGuides.d.ts +0 -3
  156. package/dist/hooks/useSpaces/draw/drawGuides.js +0 -23
  157. package/dist/hooks/useSpaces/draw/drawOpenings.d.ts +0 -9
  158. package/dist/hooks/useSpaces/draw/drawOpenings.js +0 -72
  159. package/dist/hooks/useSpaces/draw/drawVertices.d.ts +0 -8
  160. package/dist/hooks/useSpaces/draw/drawVertices.js +0 -61
  161. package/dist/hooks/useSpaces/draw/drawWalls.d.ts +0 -11
  162. package/dist/hooks/useSpaces/draw/drawWalls.js +0 -90
  163. package/dist/hooks/useSpaces/draw/drawWindows.d.ts +0 -9
  164. package/dist/hooks/useSpaces/draw/drawWindows.js +0 -82
  165. package/dist/hooks/useSpaces/draw/index.d.ts +0 -11
  166. package/dist/hooks/useSpaces/draw/index.js +0 -129
  167. package/dist/hooks/useSpaces/geometry/addThicknessToLine.d.ts +0 -3
  168. package/dist/hooks/useSpaces/geometry/addThicknessToLine.js +0 -13
  169. package/dist/hooks/useSpaces/geometry/areLinesEqual.d.ts +0 -3
  170. package/dist/hooks/useSpaces/geometry/areLinesEqual.js +0 -17
  171. package/dist/hooks/useSpaces/geometry/arePointsEqual.d.ts +0 -3
  172. package/dist/hooks/useSpaces/geometry/arePointsEqual.js +0 -8
  173. package/dist/hooks/useSpaces/geometry/arePointsWithinProximity.d.ts +0 -3
  174. package/dist/hooks/useSpaces/geometry/arePointsWithinProximity.js +0 -11
  175. package/dist/hooks/useSpaces/geometry/closestPointOnLine.d.ts +0 -3
  176. package/dist/hooks/useSpaces/geometry/closestPointOnLine.js +0 -13
  177. package/dist/hooks/useSpaces/geometry/doLinesOverlap.d.ts +0 -2
  178. package/dist/hooks/useSpaces/geometry/doLinesOverlap.js +0 -16
  179. package/dist/hooks/useSpaces/geometry/euclideanMod.d.ts +0 -2
  180. package/dist/hooks/useSpaces/geometry/euclideanMod.js +0 -6
  181. package/dist/hooks/useSpaces/geometry/findLoops.d.ts +0 -6
  182. package/dist/hooks/useSpaces/geometry/getAllLineIntersections.d.ts +0 -6
  183. package/dist/hooks/useSpaces/geometry/getAllLineIntersections.js +0 -23
  184. package/dist/hooks/useSpaces/geometry/getAngleOfLineSegment.d.ts +0 -3
  185. package/dist/hooks/useSpaces/geometry/getAngleOfLineSegment.js +0 -7
  186. package/dist/hooks/useSpaces/geometry/getClosestPointOnLineSegment.d.ts +0 -3
  187. package/dist/hooks/useSpaces/geometry/getClosestPointOnLineSegment.js +0 -17
  188. package/dist/hooks/useSpaces/geometry/getDistanceToLine.d.ts +0 -3
  189. package/dist/hooks/useSpaces/geometry/getDistanceToLine.js +0 -10
  190. package/dist/hooks/useSpaces/geometry/getLengthOfLineSegment.d.ts +0 -3
  191. package/dist/hooks/useSpaces/geometry/getLengthOfLineSegment.js +0 -7
  192. package/dist/hooks/useSpaces/geometry/getLineAtOffsetOnLineSegment.d.ts +0 -3
  193. package/dist/hooks/useSpaces/geometry/getLineAtOffsetOnLineSegment.js +0 -17
  194. package/dist/hooks/useSpaces/geometry/getLineOtherPoint.d.ts +0 -3
  195. package/dist/hooks/useSpaces/geometry/getLineOtherPoint.js +0 -11
  196. package/dist/hooks/useSpaces/geometry/getLineSegmentsIntersection.d.ts +0 -3
  197. package/dist/hooks/useSpaces/geometry/getLineSegmentsIntersection.js +0 -43
  198. package/dist/hooks/useSpaces/geometry/getMidpointOfLineSegment.d.ts +0 -3
  199. package/dist/hooks/useSpaces/geometry/getMidpointOfLineSegment.js +0 -9
  200. package/dist/hooks/useSpaces/geometry/getParallelLineSegmentAtDistance.d.ts +0 -3
  201. package/dist/hooks/useSpaces/geometry/getParallelLineSegmentAtDistance.js +0 -20
  202. package/dist/hooks/useSpaces/geometry/getPointAtOffsetOnLineSegment.d.ts +0 -3
  203. package/dist/hooks/useSpaces/geometry/getPointAtOffsetOnLineSegment.js +0 -11
  204. package/dist/hooks/useSpaces/geometry/getPolygonArea.d.ts +0 -3
  205. package/dist/hooks/useSpaces/geometry/getPolygonArea.js +0 -15
  206. package/dist/hooks/useSpaces/geometry/getQuadrilateralArea.d.ts +0 -3
  207. package/dist/hooks/useSpaces/geometry/getQuadrilateralArea.js +0 -16
  208. package/dist/hooks/useSpaces/geometry/getTangetIntersectionAndOffset.d.ts +0 -6
  209. package/dist/hooks/useSpaces/geometry/getTangetIntersectionAndOffset.js +0 -17
  210. package/dist/hooks/useSpaces/geometry/getTriangleArea.d.ts +0 -3
  211. package/dist/hooks/useSpaces/geometry/getTriangleArea.js +0 -9
  212. package/dist/hooks/useSpaces/geometry/getUnitVectorOfLineSegment.d.ts +0 -3
  213. package/dist/hooks/useSpaces/geometry/getUnitVectorOfLineSegment.js +0 -12
  214. package/dist/hooks/useSpaces/geometry/index.d.ts +0 -30
  215. package/dist/hooks/useSpaces/geometry/index.js +0 -64
  216. package/dist/hooks/useSpaces/geometry/isPointInPolygon.d.ts +0 -3
  217. package/dist/hooks/useSpaces/geometry/isPointInPolygon.js +0 -21
  218. package/dist/hooks/useSpaces/geometry/isPointInQuadrilateral.d.ts +0 -3
  219. package/dist/hooks/useSpaces/geometry/isPointInQuadrilateral.js +0 -25
  220. package/dist/hooks/useSpaces/geometry/orderCoordinatesOnLineSegment.d.ts +0 -3
  221. package/dist/hooks/useSpaces/geometry/orderCoordinatesOnLineSegment.js +0 -11
  222. package/dist/hooks/useSpaces/geometry/splitLineAtOffset.d.ts +0 -3
  223. package/dist/hooks/useSpaces/geometry/splitLineAtOffset.js +0 -12
  224. package/dist/hooks/useSpaces/geometry/splitLineAtPoint.d.ts +0 -3
  225. package/dist/hooks/useSpaces/geometry/splitLineAtPoint.js +0 -9
  226. package/dist/hooks/useSpaces/geometry/splitLineAtPoints.d.ts +0 -3
  227. package/dist/hooks/useSpaces/geometry/splitLineAtPoints.js +0 -28
  228. package/dist/hooks/useSpaces/index.d.ts +0 -95
  229. package/dist/hooks/useSpaces/index.js +0 -557
  230. package/dist/hooks/useSpaces/themes/blueprint.d.ts +0 -3
  231. package/dist/hooks/useSpaces/themes/blueprint.js +0 -96
  232. package/dist/hooks/useSpaces/themes/default.d.ts +0 -3
  233. package/dist/hooks/useSpaces/themes/default.js +0 -96
  234. package/dist/hooks/useSpaces/themes/index.js +0 -21
  235. package/dist/hooks/useSpaces/themes/light.d.ts +0 -3
  236. package/dist/hooks/useSpaces/themes/light.js +0 -96
  237. package/dist/hooks/useSpaces/types.d.ts +0 -378
  238. package/dist/hooks/useSpaces/types.js +0 -54
  239. package/dist/hooks/useSpaces/validators/areWallsDuplicated.d.ts +0 -3
  240. package/dist/hooks/useSpaces/validators/areWallsDuplicated.js +0 -61
  241. package/dist/hooks/useSpaces/validators/areWallsIntersecting.d.ts +0 -3
  242. package/dist/hooks/useSpaces/validators/areWallsIntersecting.js +0 -42
  243. package/dist/hooks/useSpaces/validators/areWallsOrphaningFeatures.d.ts +0 -3
  244. package/dist/hooks/useSpaces/validators/areWallsOrphaningFeatures.js +0 -52
  245. package/dist/hooks/useSpaces/validators/areWallsTooShort.d.ts +0 -3
  246. package/dist/hooks/useSpaces/validators/areWallsTooShort.js +0 -37
  247. package/dist/hooks/useSpaces/validators/index.d.ts +0 -15
  248. package/dist/hooks/useSpaces/validators/index.js +0 -40
  249. package/dist/hooks/useSpaces/validators/isFeatureCollidingWithExistingFeature.d.ts +0 -3
  250. package/dist/hooks/useSpaces/validators/isFeatureCollidingWithExistingFeature.js +0 -31
  251. package/dist/hooks/useSpaces/validators/isFeatureOutsideWallBounds.d.ts +0 -3
  252. package/dist/hooks/useSpaces/validators/isFeatureOutsideWallBounds.js +0 -19
  253. package/dist/hooks/useSpaces/validators/isLineTooShort.d.ts +0 -3
  254. package/dist/hooks/useSpaces/validators/isLineTooShort.js +0 -26
  255. package/dist/hooks/useSpaces/validators/isVertexLandingOnFeature.d.ts +0 -4
  256. package/dist/hooks/useSpaces/validators/isVertexLandingOnFeature.js +0 -19
  257. package/dist/hooks/useSpaces/validators/isWallEndingOnFeature.d.ts +0 -3
  258. package/dist/hooks/useSpaces/validators/isWallEndingOnFeature.js +0 -19
  259. package/dist/hooks/useSpaces/validators/isWallIntersectingFeature.d.ts +0 -3
  260. package/dist/hooks/useSpaces/validators/isWallIntersectingFeature.js +0 -41
  261. package/dist/hooks/useSpaces/validators/isWallOverlappingExisitingWalls.d.ts +0 -3
  262. package/dist/hooks/useSpaces/validators/isWallOverlappingExisitingWalls.js +0 -54
  263. package/dist/hooks/useSpaces/validators/isWallTooShort.d.ts +0 -3
  264. package/dist/hooks/useSpaces/validators/isWallTooShort.js +0 -10
  265. package/dist/http/products.d.ts +0 -1
  266. package/dist/http/products.js +0 -12
  267. package/dist/icons/AngleSnapping.d.ts +0 -3
  268. package/dist/icons/AngleSnapping.js +0 -28
  269. package/dist/icons/Boundary.d.ts +0 -3
  270. package/dist/icons/Boundary.js +0 -21
  271. package/dist/icons/Center.d.ts +0 -3
  272. package/dist/icons/Center.js +0 -24
  273. package/dist/icons/GridSnapping.d.ts +0 -3
  274. package/dist/icons/GridSnapping.js +0 -28
  275. package/dist/icons/LayoutAlt.d.ts +0 -3
  276. package/dist/icons/LayoutAlt.js +0 -21
  277. package/dist/icons/Magnet.d.ts +0 -3
  278. package/dist/icons/Magnet.js +0 -27
  279. package/dist/icons/Player3D.d.ts +0 -3
  280. package/dist/icons/Player3D.js +0 -21
  281. package/dist/icons/RulerBlank.d.ts +0 -3
  282. package/dist/icons/RulerBlank.js +0 -25
  283. package/dist/icons/RulerDetailed.d.ts +0 -3
  284. package/dist/icons/RulerDetailed.js +0 -27
  285. package/dist/icons/Save.d.ts +0 -3
  286. package/dist/icons/Save.js +0 -21
  287. package/dist/icons/UnitCm.d.ts +0 -3
  288. package/dist/icons/UnitCm.js +0 -22
  289. package/dist/icons/UnitFeet.d.ts +0 -3
  290. package/dist/icons/UnitFeet.js +0 -22
  291. package/dist/icons/UnitInch.d.ts +0 -3
  292. package/dist/icons/UnitInch.js +0 -22
  293. package/dist/icons/UnitMeter.d.ts +0 -3
  294. package/dist/icons/UnitMeter.js +0 -21
  295. package/dist/store/spaces.d.ts +0 -74
  296. package/dist/store/spaces.js +0 -354
  297. /package/dist/hooks/{useSpaces/validators → useRoomBuilder}/messaging.d.ts +0 -0
@@ -1,557 +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
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
14
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
15
- return new (P || (P = Promise))(function (resolve, reject) {
16
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
17
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
18
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
19
- step((generator = generator.apply(thisArg, _arguments || [])).next());
20
- });
21
- };
22
- var __generator = (this && this.__generator) || function (thisArg, body) {
23
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
24
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
25
- function verb(n) { return function (v) { return step([n, v]); }; }
26
- function step(op) {
27
- if (f) throw new TypeError("Generator is already executing.");
28
- while (_) try {
29
- if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
30
- if (y = 0, t) op = [op[0] & 2, t.value];
31
- switch (op[0]) {
32
- case 0: case 1: t = op; break;
33
- case 4: _.label++; return { value: op[1], done: false };
34
- case 5: _.label++; y = op[1]; op = [0]; continue;
35
- case 7: op = _.ops.pop(); _.trys.pop(); continue;
36
- default:
37
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
38
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
39
- if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
40
- if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
41
- if (t[2]) _.ops.pop();
42
- _.trys.pop(); continue;
43
- }
44
- op = body.call(thisArg, _);
45
- } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
46
- if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
47
- }
48
- };
49
- var __importDefault = (this && this.__importDefault) || function (mod) {
50
- return (mod && mod.__esModule) ? mod : { "default": mod };
51
- };
52
- Object.defineProperty(exports, "__esModule", { value: true });
53
- var react_1 = require("react");
54
- var types_1 = require("./types");
55
- var types_2 = require("./types");
56
- var useConfigurator_1 = __importDefault(require("../useConfigurator"));
57
- var constants_1 = require("./constants");
58
- var themes_1 = require("./themes");
59
- var SpacesLayout_1 = __importDefault(require("./SpacesLayout"));
60
- var store_1 = require("../../store");
61
- var spaces_1 = require("../../store/spaces");
62
- var useThreekitInitStatus_1 = __importDefault(require("../useThreekitInitStatus"));
63
- var useSpaces = function (props) {
64
- var _a, _b, _c, _d, _e;
65
- var attributesState = (0, useConfigurator_1.default)()[0];
66
- var hasLoaded = (0, useThreekitInitStatus_1.default)();
67
- var dispatch = (0, store_1.useThreekitDispatch)();
68
- var layouts = (0, store_1.useThreekitSelector)(spaces_1.getLayouts);
69
- var hasInitialized = (0, store_1.useThreekitSelector)(spaces_1.getInitialized);
70
- var zoom = (0, store_1.useThreekitSelector)(spaces_1.getZoom);
71
- var unit = (0, store_1.useThreekitSelector)(spaces_1.getUnit);
72
- var translation = (0, store_1.useThreekitSelector)(spaces_1.getTranslation);
73
- var modeValue = (0, store_1.useThreekitSelector)(spaces_1.getMode);
74
- var showDimensions = (0, store_1.useThreekitSelector)(spaces_1.getShowDimensions);
75
- var angleSnappingEnabled = (0, store_1.useThreekitSelector)(spaces_1.getAngleSnappingEnabled);
76
- var guideSnappingEnabled = (0, store_1.useThreekitSelector)(spaces_1.getGuideSnappingEnabled);
77
- var gridSnappingEnabled = (0, store_1.useThreekitSelector)(spaces_1.getGridSnappingEnabled);
78
- var wallMode = (0, store_1.useThreekitSelector)(spaces_1.getWallMode);
79
- var _f = (0, react_1.useState)(null), selectedElement = _f[0], setSelectedElement = _f[1];
80
- var _g = (0, react_1.useState)(false), pendingStatus = _g[0], setPendingStatus = _g[1];
81
- var canvasRef = (0, react_1.useRef)(null);
82
- var selectElementPending = (0, react_1.useRef)(null);
83
- var translationAnchorRef = (0, react_1.useRef)(null);
84
- var prevStateRef = (0, react_1.useRef)('');
85
- var attributeNames = Object.assign(constants_1.ATTRIBUTE_NAME_DEFAULTS, props.attributes);
86
- var spacesRef = (0, react_1.useRef)(null);
87
- var drawSpaces = function () { var _a; return (_a = spacesRef.current) === null || _a === void 0 ? void 0 : _a.drawSpaces(canvasRef.current); };
88
- (0, react_1.useEffect)(function () {
89
- if (!hasLoaded)
90
- return;
91
- (function () { return __awaiter(void 0, void 0, void 0, function () {
92
- var parameters, _a;
93
- var _b;
94
- return __generator(this, function (_c) {
95
- switch (_c.label) {
96
- case 0:
97
- parameters = props.config
98
- ? Object.assign({}, props.config.unit ? { unit: props.config.unit } : undefined, props.config.showDimensions
99
- ? { showDimensions: props.config.showDimensions }
100
- : undefined, 'zoomDefault' in props.config
101
- ? { zoomDefault: props.config.zoomDefault }
102
- : undefined, props.config.translateDefault
103
- ? { translateDefault: props.config.translateDefault }
104
- : undefined, 'enableAngleSnapping' in props.config
105
- ? { enableAngleSnapping: props.config.enableAngleSnapping }
106
- : undefined, 'enableGridSnapping' in props.config
107
- ? { enableGridSnapping: props.config.enableGridSnapping }
108
- : undefined, 'enableGuideSnapping' in props.config
109
- ? { enableGridSnapping: props.config.enableGuideSnapping }
110
- : undefined)
111
- : {};
112
- _a = spacesRef;
113
- return [4, dispatch((0, spaces_1.initSpaces)({
114
- parameters: __assign(__assign({}, parameters), { theme: (_b = props.config) === null || _b === void 0 ? void 0 : _b.theme }),
115
- layoutIds: props.layouts || [],
116
- attributeNames: attributeNames,
117
- canvasDimensions: canvasRef.current
118
- ? [canvasRef.current.width, canvasRef.current.height]
119
- : undefined,
120
- setPendingStatus: setPendingStatus,
121
- }))];
122
- case 1:
123
- _a.current = _c.sent();
124
- drawSpaces();
125
- return [2];
126
- }
127
- });
128
- }); })();
129
- }, [hasLoaded]);
130
- if (spacesRef.current) {
131
- var attributesDelinked = void 0;
132
- if (JSON.stringify(attributesState) !== prevStateRef.current) {
133
- prevStateRef.current = JSON.stringify(attributesState);
134
- attributesDelinked = JSON.parse(JSON.stringify(attributesState));
135
- }
136
- (_a = spacesRef.current) === null || _a === void 0 ? void 0 : _a.sync({
137
- attributesState: attributesDelinked,
138
- canvasDimensions: canvasRef.current
139
- ? [canvasRef.current.width, canvasRef.current.height]
140
- : undefined,
141
- angleSnappingEnabled: angleSnappingEnabled,
142
- gridSnappingEnabled: gridSnappingEnabled,
143
- guideSnappingEnabled: guideSnappingEnabled,
144
- showDimensions: showDimensions,
145
- unit: unit,
146
- zoom: spacesRef.current.zoom !== zoom ? zoom : undefined,
147
- translate: translation,
148
- wallMode: {
149
- value: wallMode.value,
150
- assetId: wallMode.assetId,
151
- },
152
- selectedElement: selectedElement
153
- ? {
154
- type: selectedElement.path[0],
155
- index: selectedElement.path[1],
156
- }
157
- : null,
158
- });
159
- }
160
- (0, react_1.useEffect)(function () {
161
- if (!canvasRef.current)
162
- return;
163
- if (pendingStatus)
164
- canvasRef.current.style.cursor = 'progress';
165
- else
166
- canvasRef.current.style.cursor = 'default';
167
- }, [pendingStatus, canvasRef.current]);
168
- (0, react_1.useEffect)(function () {
169
- var _a, _b;
170
- if (pendingStatus)
171
- return;
172
- if (canvasRef.current) {
173
- canvasRef.current.addEventListener('mousedown', handleDrawWallStart);
174
- canvasRef.current.addEventListener('mousemove', handleDrawWallMouseMove);
175
- document.addEventListener('mouseup', handleDrawWallFinish);
176
- canvasRef.current.addEventListener('mousemove', handleHover);
177
- canvasRef.current.addEventListener('mousedown', handleSelectElement);
178
- canvasRef.current.addEventListener('mousemove', handleMoveSelectedElement);
179
- if (!((_a = props.config) === null || _a === void 0 ? void 0 : _a.translateDisabled))
180
- canvasRef.current.addEventListener('mousemove', handleMoveCanvas);
181
- document.addEventListener('mouseup', handleFinishMove);
182
- if (!((_b = props.config) === null || _b === void 0 ? void 0 : _b.zoomDisabled))
183
- canvasRef.current.addEventListener('wheel', handleScrollToZoom);
184
- }
185
- return function () {
186
- var _a, _b;
187
- if (canvasRef.current) {
188
- canvasRef.current.removeEventListener('mousedown', handleDrawWallStart);
189
- canvasRef.current.removeEventListener('mousemove', handleDrawWallMouseMove);
190
- document.removeEventListener('mouseup', handleDrawWallFinish);
191
- canvasRef.current.removeEventListener('mousemove', handleHover);
192
- canvasRef.current.removeEventListener('mousedown', handleSelectElement);
193
- canvasRef.current.removeEventListener('mousemove', handleMoveSelectedElement);
194
- if (!((_a = props.config) === null || _a === void 0 ? void 0 : _a.translateDisabled))
195
- canvasRef.current.removeEventListener('mousemove', handleMoveCanvas);
196
- document.removeEventListener('mouseup', handleFinishMove);
197
- if (!((_b = props.config) === null || _b === void 0 ? void 0 : _b.zoomDisabled))
198
- canvasRef.current.removeEventListener('wheel', handleScrollToZoom);
199
- }
200
- };
201
- });
202
- (0, react_1.useEffect)(function () {
203
- if (hasInitialized)
204
- drawSpaces();
205
- });
206
- var updateZoom = function (value) {
207
- if (!spacesRef.current)
208
- return;
209
- var prevZoom = spacesRef.current.zoom;
210
- spacesRef.current.zoom = value;
211
- if (prevZoom === spacesRef.current.zoom)
212
- return;
213
- dispatch((0, spaces_1.setZoom)(spacesRef.current.zoom));
214
- drawSpaces();
215
- };
216
- var updateUnit = function (unit) {
217
- if (!spacesRef.current)
218
- return;
219
- spacesRef.current.unit = unit;
220
- dispatch((0, spaces_1.setUnit)(spacesRef.current.unit));
221
- };
222
- var handleRecenter = function (zoomToFit) {
223
- if (!spacesRef.current)
224
- return;
225
- spacesRef.current.centerSpace(canvasRef.current, zoomToFit);
226
- dispatch((0, spaces_1.setZoom)(spacesRef.current.zoom));
227
- dispatch((0, spaces_1.setTranslation)(spacesRef.current.translate));
228
- };
229
- var handleSelectModeHover = function (canvas, cursorPoint) {
230
- if (!spacesRef.current)
231
- return;
232
- if (spacesRef.current.activeElement !== null)
233
- return;
234
- if (translationAnchorRef.current)
235
- return;
236
- spacesRef.current.highlightElementIfInProximity(canvas, cursorPoint);
237
- };
238
- var handleSelectElement = function (e) {
239
- var _a;
240
- if (!spacesRef.current)
241
- return;
242
- if (!canvasRef.current)
243
- return;
244
- if (modeValue !== types_2.IModes.SELECT)
245
- return;
246
- var cursorPoint = [e.offsetX, e.offsetY];
247
- spacesRef.current.selectElementIfInProximity(canvasRef.current, cursorPoint);
248
- var element = spacesRef.current.getElementUiAtPoint(cursorPoint);
249
- if (!element) {
250
- if (selectedElement !== null)
251
- setSelectedElement(null);
252
- if (!((_a = props.config) === null || _a === void 0 ? void 0 : _a.translateDisabled) && !spacesRef.current.activeElement)
253
- translationAnchorRef.current = cursorPoint;
254
- return;
255
- }
256
- if (spacesRef.current.activeElement ||
257
- (selectedElement &&
258
- JSON.stringify(element.path) !== JSON.stringify(selectedElement.path)))
259
- setSelectedElement(null);
260
- selectElementPending.current = element;
261
- };
262
- var handleMoveSelectedElement = function (e) {
263
- if (!spacesRef.current)
264
- return;
265
- if (modeValue !== types_2.IModes.SELECT)
266
- return;
267
- if (!canvasRef.current)
268
- return;
269
- var point = [e.offsetX, e.offsetY];
270
- spacesRef.current.moveActiveElement(canvasRef.current, point);
271
- selectElementPending.current = null;
272
- };
273
- var handleMoveCanvas = function (e) {
274
- if (!spacesRef.current)
275
- return;
276
- if (modeValue !== types_2.IModes.SELECT)
277
- return;
278
- if (!canvasRef.current)
279
- return;
280
- if (spacesRef.current.selectedElement || !translationAnchorRef.current)
281
- return;
282
- spacesRef.current.translate = [
283
- spacesRef.current.translate[0] +
284
- e.offsetX -
285
- translationAnchorRef.current[0],
286
- spacesRef.current.translate[1] +
287
- e.offsetY -
288
- translationAnchorRef.current[1],
289
- ];
290
- translationAnchorRef.current = [e.offsetX, e.offsetY];
291
- drawSpaces();
292
- };
293
- var handleFinishMove = function (e) {
294
- var _a;
295
- if (!spacesRef.current)
296
- return;
297
- if (modeValue !== types_2.IModes.SELECT)
298
- return;
299
- if (!canvasRef.current)
300
- return;
301
- if (!((_a = canvasRef.current) === null || _a === void 0 ? void 0 : _a.contains(e.target))) {
302
- spacesRef.current.cancelMoveActiveElement(canvasRef.current);
303
- return;
304
- }
305
- spacesRef.current.finishMoveActiveElement(canvasRef.current);
306
- if (selectElementPending.current) {
307
- setSelectedElement(selectElementPending.current);
308
- selectElementPending.current = null;
309
- return;
310
- }
311
- if (translationAnchorRef.current) {
312
- translationAnchorRef.current = null;
313
- dispatch((0, spaces_1.setTranslation)(spacesRef.current.translate));
314
- }
315
- };
316
- var handleDrawModeHover = function (canvas, cursorPoint) {
317
- if (!spacesRef.current)
318
- return;
319
- if (spacesRef.current.isDrawWallActive)
320
- return;
321
- spacesRef.current.showGuideAtPoint(canvas, cursorPoint);
322
- };
323
- var handleDrawWallStart = function (e) {
324
- if (!spacesRef.current)
325
- return;
326
- if (modeValue !== types_2.IModes.DRAW)
327
- return;
328
- spacesRef.current.startDrawNewWall([e.offsetX, e.offsetY]);
329
- };
330
- var handleDrawWallMouseMove = function (e) {
331
- if (!spacesRef.current || !canvasRef.current)
332
- return;
333
- if (modeValue !== types_2.IModes.DRAW)
334
- return;
335
- if (spacesRef.current.isDrawWallActive)
336
- spacesRef.current.drawNewWall(canvasRef.current, [e.offsetX, e.offsetY]);
337
- };
338
- var handleDrawWallFinish = function (e) {
339
- var _a;
340
- if (!spacesRef.current || !canvasRef.current)
341
- return;
342
- if (modeValue !== types_2.IModes.DRAW)
343
- return;
344
- if (!((_a = canvasRef.current) === null || _a === void 0 ? void 0 : _a.contains(e.target))) {
345
- spacesRef.current.cancelDrawNewWall(canvasRef.current);
346
- return;
347
- }
348
- spacesRef.current.finishDrawNewWall(canvasRef.current);
349
- };
350
- var handleScrollToZoom = function (e) {
351
- var _a;
352
- if (!canvasRef.current)
353
- return;
354
- var zoomSensitivity = ((_a = props.config) === null || _a === void 0 ? void 0 : _a.zoomSensitivity) || constants_1.ZOOM_SENSITIVITY;
355
- updateZoom(-1 * e.deltaY * zoomSensitivity);
356
- e.preventDefault();
357
- };
358
- var handleHover = function (e) {
359
- if (!canvasRef.current)
360
- return;
361
- var cursorPoint = [e.offsetX, e.offsetY];
362
- if (modeValue === types_2.IModes.DRAW)
363
- handleDrawModeHover(canvasRef.current, cursorPoint);
364
- else if (modeValue === types_2.IModes.SELECT)
365
- handleSelectModeHover(canvasRef.current, cursorPoint);
366
- };
367
- var prepFeatureAttributeForOutput = function (type, attribute) {
368
- if (!attribute)
369
- return undefined;
370
- var values = attribute.values.map(function (val) { return (__assign(__assign({}, val), { add: function (addToWallIndex, feature) {
371
- var _a;
372
- return (_a = spacesRef.current) === null || _a === void 0 ? void 0 : _a.addFeature(type, addToWallIndex, __assign({ assetId: val.assetId }, (feature || {})));
373
- } })); });
374
- var value = attribute.value.map(function (val, i) { return (__assign(__assign({}, val), { delete: function () { var _a; return (_a = spacesRef.current) === null || _a === void 0 ? void 0 : _a.deleteFeature(type, i); } })); });
375
- return __assign(__assign({}, attribute), { values: values, value: value });
376
- };
377
- var prepWallAttributeForOutput = function (attribute) {
378
- if (!attribute)
379
- return undefined;
380
- var values = attribute.values.map(function (val) { return (__assign({}, val)); });
381
- var value = attribute.value.map(function (val, i) { return (__assign(__assign({}, val), { delete: function () { var _a; return (_a = spacesRef.current) === null || _a === void 0 ? void 0 : _a.deleteWall(i); }, splitWall: function (offset) { var _a; return (_a = spacesRef.current) === null || _a === void 0 ? void 0 : _a.splitWallAtOffset(i, offset); } })); });
382
- return __assign(__assign({}, attribute), { values: values, value: value });
383
- };
384
- var getElementFromAttributeName = function (attributeName) {
385
- var elementAttr = Object.entries(attributeNames).find(function (_a) {
386
- var _ = _a[0], attrName = _a[1];
387
- return attrName === attributeName;
388
- });
389
- if (!elementAttr)
390
- return;
391
- return elementAttr[0];
392
- };
393
- var handleSetMode = function (mode) {
394
- if (mode === modeValue)
395
- return;
396
- dispatch((0, spaces_1.setMode)(mode));
397
- setSelectedElement(null);
398
- };
399
- var handleReset = function () {
400
- var _a;
401
- (_a = spacesRef.current) === null || _a === void 0 ? void 0 : _a.deleteAll();
402
- setSelectedElement(null);
403
- };
404
- var handleDeleteElement = function (type, index) {
405
- var _a;
406
- var elementType = type;
407
- if (Object.values(attributeNames).includes(type)) {
408
- var updatedType = getElementFromAttributeName(type);
409
- if (!updatedType)
410
- return;
411
- elementType = updatedType;
412
- }
413
- (_a = spacesRef.current) === null || _a === void 0 ? void 0 : _a.deleteElement(elementType, index);
414
- setSelectedElement(null);
415
- };
416
- var handleSetShowDimensions = function (val) {
417
- dispatch((0, spaces_1.setShowDimensions)(val));
418
- };
419
- var handleToggleAngleSnapping = function (val) {
420
- if (val === undefined)
421
- dispatch((0, spaces_1.setAngleSnappingEnabled)(!angleSnappingEnabled));
422
- else
423
- dispatch((0, spaces_1.setAngleSnappingEnabled)(val));
424
- setSelectedElement(null);
425
- };
426
- var handleToggleGuideSnapping = function (val) {
427
- if (val === undefined)
428
- dispatch((0, spaces_1.setGuideSnappingEnabled)(!guideSnappingEnabled));
429
- else
430
- dispatch((0, spaces_1.setGuideSnappingEnabled)(val));
431
- setSelectedElement(null);
432
- };
433
- var handleToggleGridSnapping = function (val) {
434
- if (val === undefined)
435
- dispatch((0, spaces_1.setGridSnappingEnabled)(!gridSnappingEnabled));
436
- else
437
- dispatch((0, spaces_1.setGridSnappingEnabled)(val));
438
- setSelectedElement(null);
439
- };
440
- var handleChangeTranslate = function (delta) {
441
- if (!spacesRef.current)
442
- return;
443
- spacesRef.current.translate = [
444
- spacesRef.current.translate[0] + delta[0],
445
- spacesRef.current.translate[1] + delta[1],
446
- ];
447
- dispatch((0, spaces_1.setTranslation)(spacesRef.current.translate));
448
- };
449
- return {
450
- hasLoaded: hasInitialized,
451
- draw: drawSpaces,
452
- canvasRef: canvasRef,
453
- selectedElement: selectedElement === null
454
- ? selectedElement
455
- : __assign(__assign({}, selectedElement), { path: [
456
- attributeNames[selectedElement.path[0]],
457
- selectedElement.path[1],
458
- ], type: selectedElement.path[0], deleteElement: function () { return handleDeleteElement.apply(void 0, selectedElement.path); }, splitWall: selectedElement.path[0] !== types_2.IElements.WALL
459
- ? undefined
460
- : function (offset) {
461
- var _a;
462
- return (_a = spacesRef.current) === null || _a === void 0 ? void 0 : _a.splitWallAtOffset(selectedElement.path[1], offset);
463
- }, addFeature: selectedElement.path[0] !== types_2.IElements.WALL
464
- ? undefined
465
- : function (type, feature) {
466
- var _a;
467
- return (_a = spacesRef.current) === null || _a === void 0 ? void 0 : _a.addFeature(type, selectedElement.path[1], feature);
468
- } }),
469
- mode: {
470
- value: modeValue,
471
- options: [types_2.IModes.SELECT, types_2.IModes.DRAW].map(function (el) { return ({
472
- value: el,
473
- label: el,
474
- selected: modeValue === el,
475
- handleSelect: function () { return handleSetMode(el); },
476
- }); }),
477
- handleChange: handleSetMode,
478
- },
479
- dimensions: {
480
- value: showDimensions,
481
- options: [
482
- types_1.IDimensionOptions.NONE,
483
- types_1.IDimensionOptions.DEFAULT,
484
- types_1.IDimensionOptions.DETAILED,
485
- ].map(function (el) { return ({
486
- value: el,
487
- label: el,
488
- selected: showDimensions === el,
489
- handleSelect: function () { return handleSetShowDimensions(el); },
490
- }); }),
491
- handleChange: handleSetShowDimensions,
492
- },
493
- angleSnapping: {
494
- enabled: angleSnappingEnabled,
495
- handleToggle: handleToggleAngleSnapping,
496
- },
497
- guideSnapping: {
498
- enabled: guideSnappingEnabled,
499
- handleToggle: handleToggleGuideSnapping,
500
- },
501
- gridSnapping: {
502
- enabled: gridSnappingEnabled,
503
- handleToggle: handleToggleGridSnapping,
504
- },
505
- zoom: {
506
- min: (_c = (_b = spacesRef.current) === null || _b === void 0 ? void 0 : _b.zoomMin) !== null && _c !== void 0 ? _c : constants_1.ZOOM_MIN,
507
- max: (_e = (_d = spacesRef.current) === null || _d === void 0 ? void 0 : _d.zoomMax) !== null && _e !== void 0 ? _e : constants_1.ZOOM_MAX,
508
- value: zoom,
509
- handleChange: updateZoom,
510
- },
511
- unit: {
512
- value: unit,
513
- options: [types_2.IUnits.FEET, types_2.IUnits.METER, types_2.IUnits.INCH, types_2.IUnits.CM].map(function (el) { return ({
514
- value: el,
515
- label: el,
516
- selected: unit === el,
517
- handleSelect: function () { return updateUnit(el); },
518
- }); }),
519
- handleChange: updateUnit,
520
- },
521
- wallMode: {
522
- value: wallMode.value,
523
- options: wallMode.options.map(function (mode) { return ({
524
- value: mode,
525
- label: constants_1.wallModeLabels[mode],
526
- selected: mode === wallMode.value,
527
- handleSelect: function () { return dispatch((0, spaces_1.setWallModeValue)(mode)); },
528
- }); }),
529
- handleChange: function (wallMode) {
530
- return dispatch((0, spaces_1.setWallModeValue)(wallMode));
531
- },
532
- },
533
- translate: {
534
- handleChange: handleChangeTranslate,
535
- },
536
- reset: handleReset,
537
- recenter: handleRecenter,
538
- deleteElement: handleDeleteElement,
539
- layouts: layouts.map(function (layout) { return ({
540
- label: layout.label,
541
- loops: layout.loop,
542
- handleSelect: function () {
543
- return window.threekit.configurator.setFullConfiguration(layout.configuration);
544
- },
545
- }); }),
546
- walls: prepWallAttributeForOutput(attributesState === null || attributesState === void 0 ? void 0 : attributesState[attributeNames[types_2.IElements.WALL]]),
547
- windows: prepFeatureAttributeForOutput(types_2.IElements.WINDOW, attributesState === null || attributesState === void 0 ? void 0 : attributesState[attributeNames[types_2.IElements.WINDOW]]),
548
- doors: prepFeatureAttributeForOutput(types_2.IElements.DOOR, attributesState === null || attributesState === void 0 ? void 0 : attributesState[attributeNames[types_2.IElements.DOOR]]),
549
- openings: prepFeatureAttributeForOutput(types_2.IElements.OPENING, attributesState === null || attributesState === void 0 ? void 0 : attributesState[attributeNames[types_2.IElements.OPENING]]),
550
- };
551
- };
552
- useSpaces.themes = themes_1.IThemes;
553
- useSpaces.units = types_2.IUnits;
554
- useSpaces.modes = types_2.IModes;
555
- useSpaces.wallModes = constants_1.WallModes;
556
- useSpaces.LayoutIcon = SpacesLayout_1.default;
557
- exports.default = useSpaces;
@@ -1,3 +0,0 @@
1
- import type { ISpacesStyles } from '../types';
2
- declare const theme: ISpacesStyles;
3
- export default theme;
@@ -1,96 +0,0 @@
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;
@@ -1,3 +0,0 @@
1
- import type { ISpacesStyles } from '../types';
2
- declare const theme: ISpacesStyles;
3
- export default theme;