@threekit-tools/treble 0.0.90 → 0.0.91-next-02

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 (247) 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/catalog.js +1 -1
  10. package/dist/api/configurations.js +1 -1
  11. package/dist/api/datatables.js +1 -1
  12. package/dist/api/orders.js +1 -1
  13. package/dist/api/price.js +1 -1
  14. package/dist/api/products.d.ts +2 -2
  15. package/dist/api/products.js +1 -1
  16. package/dist/components/BreatheAnimation/index.js +3 -3
  17. package/dist/components/Button/index.d.ts +2 -2
  18. package/dist/components/DraggableHint/draggableIndicator.styles.d.ts +1 -1
  19. package/dist/components/PlayerLoadingSpinner/playerLoadingSpinner.styles.d.ts +1 -1
  20. package/dist/components/Share/index.js +1 -1
  21. package/dist/components/Share/share.styles.d.ts +1 -1
  22. package/dist/components/TurntableAnimation/index.js +3 -3
  23. package/dist/components/Upload/index.js +1 -1
  24. package/dist/components/UploadArea/index.js +1 -1
  25. package/dist/components/Wishlist/index.js +1 -1
  26. package/dist/components/containers/formInputContainer.js +3 -3
  27. package/dist/connection.js +1 -1
  28. package/dist/hooks/useAttribute/index.d.ts +4 -4
  29. package/dist/hooks/useAttribute/index.js +1 -1
  30. package/dist/hooks/useConfigurationChangeStatus/index.d.ts +2 -0
  31. package/dist/hooks/{usePlayerLoadingStatus → useConfigurationChangeStatus}/index.js +2 -2
  32. package/dist/hooks/useConfigurationLoader/index.js +1 -1
  33. package/dist/hooks/useConfigurator/index.d.ts +3 -3
  34. package/dist/hooks/useDevTools/index.d.ts +1 -1
  35. package/dist/hooks/useNestedConfigurator/index.d.ts +2 -2
  36. package/dist/hooks/useNestedConfigurator/index.js +2 -3
  37. package/dist/hooks/usePlayer/index.d.ts +1 -1
  38. package/dist/hooks/usePlayerPortal/index.d.ts +1 -1
  39. package/dist/hooks/usePlayerReady/index.d.ts +2 -0
  40. package/dist/hooks/{useAnimationStart → usePlayerReady}/index.js +2 -2
  41. package/dist/hooks/useProductCache/index.js +1 -1
  42. package/dist/hooks/useResetProduct/index.d.ts +1 -1
  43. package/dist/hooks/useResetProduct/index.js +1 -1
  44. package/dist/hooks/useShare/index.d.ts +1 -1
  45. package/dist/hooks/useShare/index.js +1 -1
  46. package/dist/hooks/useSingleAnimation/index.js +1 -1
  47. package/dist/hooks/useSpaces/SpacesLayout.d.ts +11 -0
  48. package/dist/hooks/useSpaces/SpacesLayout.js +74 -0
  49. package/dist/hooks/useSpaces/SpacesState.d.ts +164 -0
  50. package/dist/hooks/useSpaces/SpacesState.js +1751 -0
  51. package/dist/hooks/useSpaces/constants.d.ts +64 -0
  52. package/dist/hooks/useSpaces/constants.js +109 -0
  53. package/dist/hooks/{useRoomBuilder → useSpaces}/dataHandlers.d.ts +6 -4
  54. package/dist/hooks/useSpaces/dataHandlers.js +254 -0
  55. package/dist/hooks/useSpaces/draw/clearCanvas.d.ts +2 -0
  56. package/dist/hooks/useSpaces/draw/clearCanvas.js +9 -0
  57. package/dist/hooks/useSpaces/draw/drawBackground.d.ts +2 -0
  58. package/dist/hooks/useSpaces/draw/drawBackground.js +12 -0
  59. package/dist/hooks/useSpaces/draw/drawDimensions.d.ts +3 -0
  60. package/dist/hooks/useSpaces/draw/drawDimensions.js +53 -0
  61. package/dist/hooks/useSpaces/draw/drawDoors.d.ts +9 -0
  62. package/dist/hooks/useSpaces/draw/drawDoors.js +99 -0
  63. package/dist/hooks/useSpaces/draw/drawFloor.d.ts +3 -0
  64. package/dist/hooks/useSpaces/draw/drawFloor.js +36 -0
  65. package/dist/hooks/useSpaces/draw/drawGrid.d.ts +3 -0
  66. package/dist/hooks/useSpaces/draw/drawGrid.js +33 -0
  67. package/dist/hooks/useSpaces/draw/drawGuides.d.ts +3 -0
  68. package/dist/hooks/useSpaces/draw/drawGuides.js +23 -0
  69. package/dist/hooks/useSpaces/draw/drawOpenings.d.ts +9 -0
  70. package/dist/hooks/useSpaces/draw/drawOpenings.js +72 -0
  71. package/dist/hooks/useSpaces/draw/drawVertices.d.ts +8 -0
  72. package/dist/hooks/useSpaces/draw/drawVertices.js +61 -0
  73. package/dist/hooks/useSpaces/draw/drawWalls.d.ts +10 -0
  74. package/dist/hooks/useSpaces/draw/drawWalls.js +88 -0
  75. package/dist/hooks/useSpaces/draw/drawWindows.d.ts +9 -0
  76. package/dist/hooks/useSpaces/draw/drawWindows.js +82 -0
  77. package/dist/hooks/useSpaces/draw/index.d.ts +11 -0
  78. package/dist/hooks/useSpaces/draw/index.js +129 -0
  79. package/dist/hooks/useSpaces/geometry/addThicknessToLine.d.ts +3 -0
  80. package/dist/hooks/useSpaces/geometry/addThicknessToLine.js +13 -0
  81. package/dist/hooks/useSpaces/geometry/areLinesEqual.d.ts +3 -0
  82. package/dist/hooks/useSpaces/geometry/areLinesEqual.js +17 -0
  83. package/dist/hooks/useSpaces/geometry/arePointsEqual.d.ts +3 -0
  84. package/dist/hooks/useSpaces/geometry/arePointsEqual.js +8 -0
  85. package/dist/hooks/useSpaces/geometry/arePointsWithinProximity.d.ts +3 -0
  86. package/dist/hooks/useSpaces/geometry/arePointsWithinProximity.js +11 -0
  87. package/dist/hooks/useSpaces/geometry/closestPointOnLine.d.ts +3 -0
  88. package/dist/hooks/useSpaces/geometry/closestPointOnLine.js +13 -0
  89. package/dist/hooks/useSpaces/geometry/doLinesOverlap.d.ts +2 -0
  90. package/dist/hooks/useSpaces/geometry/doLinesOverlap.js +16 -0
  91. package/dist/hooks/useSpaces/geometry/euclideanMod.d.ts +2 -0
  92. package/dist/hooks/useSpaces/geometry/euclideanMod.js +6 -0
  93. package/dist/hooks/useSpaces/geometry/findLoops.d.ts +6 -0
  94. package/dist/hooks/{useRoomBuilder → useSpaces/geometry}/findLoops.js +31 -13
  95. package/dist/hooks/useSpaces/geometry/getAllLineIntersections.d.ts +6 -0
  96. package/dist/hooks/useSpaces/geometry/getAllLineIntersections.js +23 -0
  97. package/dist/hooks/useSpaces/geometry/getAngleOfLineSegment.d.ts +3 -0
  98. package/dist/hooks/useSpaces/geometry/getAngleOfLineSegment.js +7 -0
  99. package/dist/hooks/useSpaces/geometry/getClosestPointOnLineSegment.d.ts +3 -0
  100. package/dist/hooks/useSpaces/geometry/getClosestPointOnLineSegment.js +17 -0
  101. package/dist/hooks/useSpaces/geometry/getDistanceToLine.d.ts +3 -0
  102. package/dist/hooks/useSpaces/geometry/getDistanceToLine.js +10 -0
  103. package/dist/hooks/useSpaces/geometry/getLengthOfLineSegment.d.ts +3 -0
  104. package/dist/hooks/useSpaces/geometry/getLengthOfLineSegment.js +7 -0
  105. package/dist/hooks/useSpaces/geometry/getLineAtOffsetOnLineSegment.d.ts +3 -0
  106. package/dist/hooks/useSpaces/geometry/getLineAtOffsetOnLineSegment.js +17 -0
  107. package/dist/hooks/useSpaces/geometry/getLineOtherPoint.d.ts +3 -0
  108. package/dist/hooks/useSpaces/geometry/getLineOtherPoint.js +11 -0
  109. package/dist/hooks/useSpaces/geometry/getLineSegmentsIntersection.d.ts +3 -0
  110. package/dist/hooks/useSpaces/geometry/getLineSegmentsIntersection.js +43 -0
  111. package/dist/hooks/useSpaces/geometry/getMidpointOfLineSegment.d.ts +3 -0
  112. package/dist/hooks/useSpaces/geometry/getMidpointOfLineSegment.js +9 -0
  113. package/dist/hooks/useSpaces/geometry/getParallelLineSegmentAtDistance.d.ts +3 -0
  114. package/dist/hooks/useSpaces/geometry/getParallelLineSegmentAtDistance.js +20 -0
  115. package/dist/hooks/useSpaces/geometry/getPointAtOffsetOnLineSegment.d.ts +3 -0
  116. package/dist/hooks/useSpaces/geometry/getPointAtOffsetOnLineSegment.js +11 -0
  117. package/dist/hooks/useSpaces/geometry/getPolygonArea.d.ts +3 -0
  118. package/dist/hooks/useSpaces/geometry/getPolygonArea.js +15 -0
  119. package/dist/hooks/useSpaces/geometry/getQuadrilateralArea.d.ts +3 -0
  120. package/dist/hooks/useSpaces/geometry/getQuadrilateralArea.js +16 -0
  121. package/dist/hooks/useSpaces/geometry/getTangetIntersectionAndOffset.d.ts +6 -0
  122. package/dist/hooks/useSpaces/geometry/getTangetIntersectionAndOffset.js +17 -0
  123. package/dist/hooks/useSpaces/geometry/getTriangleArea.d.ts +3 -0
  124. package/dist/hooks/useSpaces/geometry/getTriangleArea.js +9 -0
  125. package/dist/hooks/useSpaces/geometry/getUnitVectorOfLineSegment.d.ts +3 -0
  126. package/dist/hooks/useSpaces/geometry/getUnitVectorOfLineSegment.js +12 -0
  127. package/dist/hooks/useSpaces/geometry/index.d.ts +30 -0
  128. package/dist/hooks/useSpaces/geometry/index.js +64 -0
  129. package/dist/hooks/useSpaces/geometry/isPointInPolygon.d.ts +3 -0
  130. package/dist/hooks/useSpaces/geometry/isPointInPolygon.js +21 -0
  131. package/dist/hooks/useSpaces/geometry/isPointInQuadrilateral.d.ts +3 -0
  132. package/dist/hooks/useSpaces/geometry/isPointInQuadrilateral.js +25 -0
  133. package/dist/hooks/useSpaces/geometry/orderCoordinatesOnLineSegment.d.ts +3 -0
  134. package/dist/hooks/useSpaces/geometry/orderCoordinatesOnLineSegment.js +11 -0
  135. package/dist/hooks/useSpaces/geometry/splitLineAtOffset.d.ts +3 -0
  136. package/dist/hooks/useSpaces/geometry/splitLineAtOffset.js +12 -0
  137. package/dist/hooks/useSpaces/geometry/splitLineAtPoint.d.ts +3 -0
  138. package/dist/hooks/useSpaces/geometry/splitLineAtPoint.js +9 -0
  139. package/dist/hooks/useSpaces/geometry/splitLineAtPoints.d.ts +3 -0
  140. package/dist/hooks/useSpaces/geometry/splitLineAtPoints.js +28 -0
  141. package/dist/hooks/useSpaces/index.d.ts +76 -0
  142. package/dist/hooks/useSpaces/index.js +475 -0
  143. package/dist/hooks/useSpaces/themes/blueprint.d.ts +3 -0
  144. package/dist/hooks/useSpaces/themes/blueprint.js +96 -0
  145. package/dist/hooks/useSpaces/themes/default.d.ts +3 -0
  146. package/dist/hooks/useSpaces/themes/default.js +96 -0
  147. package/dist/hooks/{useRoomBuilder/themes.d.ts → useSpaces/themes/index.d.ts} +3 -4
  148. package/dist/hooks/useSpaces/themes/index.js +21 -0
  149. package/dist/hooks/useSpaces/themes/light.d.ts +3 -0
  150. package/dist/hooks/useSpaces/themes/light.js +96 -0
  151. package/dist/hooks/useSpaces/types.d.ts +334 -0
  152. package/dist/hooks/{useRoomBuilder → useSpaces}/types.js +13 -1
  153. package/dist/hooks/useSpaces/validators/areWallsDuplicated.d.ts +3 -0
  154. package/dist/hooks/useSpaces/validators/areWallsDuplicated.js +61 -0
  155. package/dist/hooks/useSpaces/validators/areWallsIntersecting.d.ts +3 -0
  156. package/dist/hooks/useSpaces/validators/areWallsIntersecting.js +42 -0
  157. package/dist/hooks/useSpaces/validators/areWallsOrphaningFeatures.d.ts +3 -0
  158. package/dist/hooks/useSpaces/validators/areWallsOrphaningFeatures.js +52 -0
  159. package/dist/hooks/useSpaces/validators/areWallsTooShort.d.ts +3 -0
  160. package/dist/hooks/useSpaces/validators/areWallsTooShort.js +37 -0
  161. package/dist/hooks/useSpaces/validators/index.d.ts +15 -0
  162. package/dist/hooks/useSpaces/validators/index.js +40 -0
  163. package/dist/hooks/useSpaces/validators/isFeatureCollidingWithExistingFeature.d.ts +3 -0
  164. package/dist/hooks/useSpaces/validators/isFeatureCollidingWithExistingFeature.js +31 -0
  165. package/dist/hooks/useSpaces/validators/isFeatureOutsideWallBounds.d.ts +3 -0
  166. package/dist/hooks/useSpaces/validators/isFeatureOutsideWallBounds.js +19 -0
  167. package/dist/hooks/useSpaces/validators/isLineTooShort.d.ts +3 -0
  168. package/dist/hooks/useSpaces/validators/isLineTooShort.js +26 -0
  169. package/dist/hooks/useSpaces/validators/isVertexLandingOnFeature.d.ts +4 -0
  170. package/dist/hooks/useSpaces/validators/isVertexLandingOnFeature.js +19 -0
  171. package/dist/hooks/useSpaces/validators/isWallEndingOnFeature.d.ts +3 -0
  172. package/dist/hooks/useSpaces/validators/isWallEndingOnFeature.js +19 -0
  173. package/dist/hooks/useSpaces/validators/isWallIntersectingFeature.d.ts +3 -0
  174. package/dist/hooks/useSpaces/validators/isWallIntersectingFeature.js +41 -0
  175. package/dist/hooks/useSpaces/validators/isWallOverlappingExisitingWalls.d.ts +3 -0
  176. package/dist/hooks/useSpaces/validators/isWallOverlappingExisitingWalls.js +54 -0
  177. package/dist/hooks/useSpaces/validators/isWallTooShort.d.ts +3 -0
  178. package/dist/hooks/useSpaces/validators/isWallTooShort.js +10 -0
  179. package/dist/hooks/{useRoomBuilder → useSpaces/validators}/messaging.js +1 -1
  180. package/dist/hooks/useWishlist/index.d.ts +1 -1
  181. package/dist/hooks/useZoom/index.d.ts +1 -1
  182. package/dist/http/orders.d.ts +1 -1
  183. package/dist/icons/AngleSnapping.d.ts +3 -0
  184. package/dist/icons/AngleSnapping.js +28 -0
  185. package/dist/icons/Center.d.ts +3 -0
  186. package/dist/icons/Center.js +24 -0
  187. package/dist/icons/Draw.js +3 -3
  188. package/dist/icons/GridSnapping.d.ts +3 -0
  189. package/dist/icons/GridSnapping.js +28 -0
  190. package/dist/icons/LayoutAlt.d.ts +3 -0
  191. package/dist/icons/LayoutAlt.js +21 -0
  192. package/dist/icons/Magnet.d.ts +3 -0
  193. package/dist/icons/Magnet.js +27 -0
  194. package/dist/icons/Player3D.d.ts +3 -0
  195. package/dist/icons/Player3D.js +21 -0
  196. package/dist/icons/Save.d.ts +3 -0
  197. package/dist/icons/Save.js +21 -0
  198. package/dist/icons/UnitCm.d.ts +3 -0
  199. package/dist/icons/UnitCm.js +22 -0
  200. package/dist/icons/UnitFeet.d.ts +3 -0
  201. package/dist/icons/UnitFeet.js +22 -0
  202. package/dist/icons/UnitInch.d.ts +3 -0
  203. package/dist/icons/UnitInch.js +22 -0
  204. package/dist/icons/UnitMeter.d.ts +3 -0
  205. package/dist/icons/UnitMeter.js +21 -0
  206. package/dist/icons/Window.js +4 -4
  207. package/dist/icons/index.js +22 -0
  208. package/dist/icons/types.d.ts +1 -1
  209. package/dist/index.d.ts +17 -3
  210. package/dist/index.js +35 -7
  211. package/dist/store/attributes.d.ts +3 -2
  212. package/dist/store/attributes.js +1 -1
  213. package/dist/store/index.d.ts +15 -8
  214. package/dist/store/index.js +3 -1
  215. package/dist/store/price.js +1 -1
  216. package/dist/store/product.d.ts +1 -1
  217. package/dist/store/product.js +5 -8
  218. package/dist/store/spaces.d.ts +47 -0
  219. package/dist/store/spaces.js +197 -0
  220. package/dist/store/translations.js +1 -1
  221. package/dist/store/treble.d.ts +1 -1
  222. package/dist/store/treble.js +27 -27
  223. package/dist/store/wishlist.d.ts +21 -3
  224. package/dist/store/wishlist.js +1 -1
  225. package/dist/types.d.ts +25 -17
  226. package/dist/utils.d.ts +1 -1
  227. package/dist/utils.js +1 -1
  228. package/package.json +1 -1
  229. package/dist/hooks/useAnimationStart/index.d.ts +0 -2
  230. package/dist/hooks/usePlayerLoadingStatus/index.d.ts +0 -2
  231. package/dist/hooks/useRoomBuilder/RoomBuilderState.d.ts +0 -95
  232. package/dist/hooks/useRoomBuilder/RoomBuilderState.js +0 -1237
  233. package/dist/hooks/useRoomBuilder/constants.d.ts +0 -41
  234. package/dist/hooks/useRoomBuilder/constants.js +0 -48
  235. package/dist/hooks/useRoomBuilder/dataHandlers.js +0 -187
  236. package/dist/hooks/useRoomBuilder/draw.d.ts +0 -55
  237. package/dist/hooks/useRoomBuilder/draw.js +0 -573
  238. package/dist/hooks/useRoomBuilder/findLoops.d.ts +0 -5
  239. package/dist/hooks/useRoomBuilder/geometry.d.ts +0 -33
  240. package/dist/hooks/useRoomBuilder/geometry.js +0 -325
  241. package/dist/hooks/useRoomBuilder/index.d.ts +0 -40
  242. package/dist/hooks/useRoomBuilder/index.js +0 -303
  243. package/dist/hooks/useRoomBuilder/themes.js +0 -273
  244. package/dist/hooks/useRoomBuilder/types.d.ts +0 -238
  245. package/dist/hooks/useRoomBuilder/validators.d.ts +0 -36
  246. package/dist/hooks/useRoomBuilder/validators.js +0 -362
  247. /package/dist/hooks/{useRoomBuilder → useSpaces/validators}/messaging.d.ts +0 -0
@@ -1,7 +1,7 @@
1
1
  import threekitAPI from '../api';
2
2
  import { IThreekitPlayer, IThreekitPrivatePlayer, IThreekitPrivateConfigurator } from '../types';
3
3
  import { IWishlist } from './wishlist';
4
- import snapshots from './snapshots';
4
+ import snapshot from './snapshot';
5
5
  import { ISaveConfiguration } from '../api/configurations';
6
6
  import { ICreateOrder } from '../api/orders';
7
7
  import { ICartItem } from '../http/orders';
@@ -22,7 +22,7 @@ declare class Treble {
22
22
  _player: IThreekitPrivatePlayer;
23
23
  wishlist: IWishlist;
24
24
  private _snapshots;
25
- takeSnapshots: typeof snapshots['takeSnapshots'];
25
+ takeSnapshots: (typeof snapshot)['takeSnapshots'];
26
26
  _debugMode: boolean;
27
27
  constructor({ player, orgId }: ITreble);
28
28
  createOrder: (order?: IOrder) => Promise<import("../http/orders").IOrderResponse>;
@@ -14,7 +14,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
14
14
  function verb(n) { return function (v) { return step([n, v]); }; }
15
15
  function step(op) {
16
16
  if (f) throw new TypeError("Generator is already executing.");
17
- while (_) try {
17
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
18
18
  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;
19
19
  if (y = 0, t) op = [op[0] & 2, t.value];
20
20
  switch (op[0]) {
@@ -45,7 +45,7 @@ var types_1 = require("../types");
45
45
  var constants_1 = require("../constants");
46
46
  var utils_1 = require("../utils");
47
47
  var wishlist_1 = __importDefault(require("./wishlist"));
48
- var snapshots_1 = __importDefault(require("./snapshots"));
48
+ var snapshot_1 = __importDefault(require("./snapshot"));
49
49
  var Treble = (function () {
50
50
  function Treble(_a) {
51
51
  var player = _a.player, orgId = _a.orgId;
@@ -147,7 +147,7 @@ var Treble = (function () {
147
147
  };
148
148
  this._api = api_1.default;
149
149
  this.wishlist = (0, wishlist_1.default)(orgId);
150
- this._snapshots = snapshots_1.default;
150
+ this._snapshots = snapshot_1.default;
151
151
  this.takeSnapshots = this._snapshots.takeSnapshots;
152
152
  this._player = player.enableApi(types_1.PRIVATE_APIS.PLAYER);
153
153
  this._debugMode = constants_1.TREBLE_DEBUG;
@@ -1,5 +1,5 @@
1
1
  import Treble from './Treble';
2
2
  export * from './Treble';
3
- export * from './snapshots';
3
+ export * from './snapshot';
4
4
  export * from './wishlist';
5
5
  export default Treble;
@@ -19,6 +19,6 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
19
19
  Object.defineProperty(exports, "__esModule", { value: true });
20
20
  var Treble_1 = __importDefault(require("./Treble"));
21
21
  __exportStar(require("./Treble"), exports);
22
- __exportStar(require("./snapshots"), exports);
22
+ __exportStar(require("./snapshot"), exports);
23
23
  __exportStar(require("./wishlist"), exports);
24
24
  exports.default = Treble_1.default;
@@ -1,4 +1,4 @@
1
- export declare type ISnapshotsCameras = undefined | string | Array<string | undefined>;
1
+ export type ISnapshotsCameras = undefined | string | Array<string | undefined>;
2
2
  interface SnapshotSize {
3
3
  width: number;
4
4
  height: number;
@@ -14,7 +14,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
14
14
  function verb(n) { return function (v) { return step([n, v]); }; }
15
15
  function step(op) {
16
16
  if (f) throw new TypeError("Generator is already executing.");
17
- while (_) try {
17
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
18
18
  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;
19
19
  if (y = 0, t) op = [op[0] & 2, t.value];
20
20
  switch (op[0]) {
@@ -1,6 +1,6 @@
1
1
  import { IConfigurationResponse } from '../http/configurations';
2
2
  import { ISaveConfiguration } from '../api/configurations';
3
- export declare type WishlistArray = Array<IConfigurationResponse>;
3
+ export type WishlistArray = Array<IConfigurationResponse>;
4
4
  export interface IWishlist {
5
5
  getWishlist(): Promise<Array<IConfigurationResponse>>;
6
6
  addItem(config?: Omit<ISaveConfiguration, 'configuration'>): Promise<Array<IConfigurationResponse>>;
@@ -14,7 +14,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
14
14
  function verb(n) { return function (v) { return step([n, v]); }; }
15
15
  function step(op) {
16
16
  if (f) throw new TypeError("Generator is already executing.");
17
- while (_) try {
17
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
18
18
  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;
19
19
  if (y = 0, t) op = [op[0] & 2, t.value];
20
20
  switch (op[0]) {
@@ -14,7 +14,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
14
14
  function verb(n) { return function (v) { return step([n, v]); }; }
15
15
  function step(op) {
16
16
  if (f) throw new TypeError("Generator is already executing.");
17
- while (_) try {
17
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
18
18
  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;
19
19
  if (y = 0, t) op = [op[0] & 2, t.value];
20
20
  switch (op[0]) {
@@ -14,7 +14,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
14
14
  function verb(n) { return function (v) { return step([n, v]); }; }
15
15
  function step(op) {
16
16
  if (f) throw new TypeError("Generator is already executing.");
17
- while (_) try {
17
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
18
18
  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;
19
19
  if (y = 0, t) op = [op[0] & 2, t.value];
20
20
  switch (op[0]) {
@@ -14,7 +14,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
14
14
  function verb(n) { return function (v) { return step([n, v]); }; }
15
15
  function step(op) {
16
16
  if (f) throw new TypeError("Generator is already executing.");
17
- while (_) try {
17
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
18
18
  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;
19
19
  if (y = 0, t) op = [op[0] & 2, t.value];
20
20
  switch (op[0]) {
@@ -14,7 +14,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
14
14
  function verb(n) { return function (v) { return step([n, v]); }; }
15
15
  function step(op) {
16
16
  if (f) throw new TypeError("Generator is already executing.");
17
- while (_) try {
17
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
18
18
  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;
19
19
  if (y = 0, t) op = [op[0] & 2, t.value];
20
20
  switch (op[0]) {
package/dist/api/price.js CHANGED
@@ -14,7 +14,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
14
14
  function verb(n) { return function (v) { return step([n, v]); }; }
15
15
  function step(op) {
16
16
  if (f) throw new TypeError("Generator is already executing.");
17
- while (_) try {
17
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
18
18
  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;
19
19
  if (y = 0, t) op = [op[0] & 2, t.value];
20
20
  switch (op[0]) {
@@ -1,4 +1,4 @@
1
- declare type ITranslation = Record<string, string | undefined>;
2
- export declare type ITranslationMap = Record<string, ITranslation>;
1
+ type ITranslation = Record<string, string | undefined>;
2
+ export type ITranslationMap = Record<string, ITranslation>;
3
3
  export declare const fetchTranslations: () => Promise<ITranslationMap>;
4
4
  export {};
@@ -14,7 +14,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
14
14
  function verb(n) { return function (v) { return step([n, v]); }; }
15
15
  function step(op) {
16
16
  if (f) throw new TypeError("Generator is already executing.");
17
- while (_) try {
17
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
18
18
  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;
19
19
  if (y = 0, t) op = [op[0] & 2, t.value];
20
20
  switch (op[0]) {
@@ -14,7 +14,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
14
14
  function verb(n) { return function (v) { return step([n, v]); }; }
15
15
  function step(op) {
16
16
  if (f) throw new TypeError("Generator is already executing.");
17
- while (_) try {
17
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
18
18
  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;
19
19
  if (y = 0, t) op = [op[0] & 2, t.value];
20
20
  switch (op[0]) {
@@ -40,10 +40,10 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
40
40
  };
41
41
  Object.defineProperty(exports, "__esModule", { value: true });
42
42
  var react_1 = require("react");
43
- var useAnimationStart_1 = __importDefault(require("../../hooks/useAnimationStart"));
43
+ var usePlayerReady_1 = __importDefault(require("../../hooks/usePlayerReady"));
44
44
  var types_1 = require("../../types");
45
45
  var BreatheAnimation = function (props) {
46
- var readyToAnimate = (0, useAnimationStart_1.default)();
46
+ var readyToAnimate = (0, usePlayerReady_1.default)();
47
47
  var initialTranslation = (0, react_1.useRef)(null);
48
48
  var initialRotation = (0, react_1.useRef)(null);
49
49
  var animationInProgress = (0, react_1.useRef)(false);
@@ -1,7 +1,7 @@
1
1
  import React from 'react';
2
2
  import PropTypes from 'prop-types';
3
- export declare type BUTTON_TYPES = 'hollow' | 'standard' | 'accent' | 'primary' | 'threekit';
4
- export declare type BUTTON_SHAPES = 'round' | 'shape';
3
+ export type BUTTON_TYPES = 'hollow' | 'standard' | 'accent' | 'primary' | 'threekit';
4
+ export type BUTTON_SHAPES = 'round' | 'shape';
5
5
  interface IButton {
6
6
  type: BUTTON_TYPES;
7
7
  icon?: string;
@@ -1,5 +1,5 @@
1
1
  import { DraggableIndicatorProps } from './index';
2
- declare type HandWrapperProps = Pick<DraggableIndicatorProps, 'color' | 'duration'>;
2
+ type HandWrapperProps = Pick<DraggableIndicatorProps, 'color' | 'duration'>;
3
3
  export declare const Wrapper: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
4
4
  export declare const HandWrapper: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, HandWrapperProps, never>;
5
5
  export {};
@@ -1,4 +1,4 @@
1
1
  import { PlayerLoadingSpinnerProps } from './index';
2
- declare type WrapperProps = Pick<PlayerLoadingSpinnerProps, 'duration' | 'size'>;
2
+ type WrapperProps = Pick<PlayerLoadingSpinnerProps, 'duration' | 'size'>;
3
3
  export declare const Wrapper: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, WrapperProps, never>;
4
4
  export {};
@@ -37,7 +37,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
37
37
  function verb(n) { return function (v) { return step([n, v]); }; }
38
38
  function step(op) {
39
39
  if (f) throw new TypeError("Generator is already executing.");
40
- while (_) try {
40
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
41
41
  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;
42
42
  if (y = 0, t) op = [op[0] & 2, t.value];
43
43
  switch (op[0]) {
@@ -1,4 +1,4 @@
1
- export declare type Positions = 'top-right' | 'bottom-right' | 'bottom-left' | 'top-left';
1
+ export type Positions = 'top-right' | 'bottom-right' | 'bottom-left' | 'top-left';
2
2
  interface PositionProps {
3
3
  position: Positions;
4
4
  }
@@ -14,7 +14,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
14
14
  function verb(n) { return function (v) { return step([n, v]); }; }
15
15
  function step(op) {
16
16
  if (f) throw new TypeError("Generator is already executing.");
17
- while (_) try {
17
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
18
18
  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;
19
19
  if (y = 0, t) op = [op[0] & 2, t.value];
20
20
  switch (op[0]) {
@@ -40,7 +40,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
40
40
  };
41
41
  Object.defineProperty(exports, "__esModule", { value: true });
42
42
  var react_1 = require("react");
43
- var useAnimationStart_1 = __importDefault(require("../../hooks/useAnimationStart"));
43
+ var usePlayerReady_1 = __importDefault(require("../../hooks/usePlayerReady"));
44
44
  var types_1 = require("../../types");
45
45
  var RotationDirections;
46
46
  (function (RotationDirections) {
@@ -48,7 +48,7 @@ var RotationDirections;
48
48
  RotationDirections["COUNTER_CLOCKWISE"] = "counter-clockwise";
49
49
  })(RotationDirections || (RotationDirections = {}));
50
50
  var TurntableAnimation = function (props) {
51
- var readyToAnimate = (0, useAnimationStart_1.default)();
51
+ var readyToAnimate = (0, usePlayerReady_1.default)();
52
52
  var initialRotation = (0, react_1.useRef)(null);
53
53
  var animationInProgress = (0, react_1.useRef)(false);
54
54
  var rotationNodeId = (0, react_1.useRef)(undefined);
@@ -37,7 +37,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
37
37
  function verb(n) { return function (v) { return step([n, v]); }; }
38
38
  function step(op) {
39
39
  if (f) throw new TypeError("Generator is already executing.");
40
- while (_) try {
40
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
41
41
  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;
42
42
  if (y = 0, t) op = [op[0] & 2, t.value];
43
43
  switch (op[0]) {
@@ -37,7 +37,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
37
37
  function verb(n) { return function (v) { return step([n, v]); }; }
38
38
  function step(op) {
39
39
  if (f) throw new TypeError("Generator is already executing.");
40
- while (_) try {
40
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
41
41
  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;
42
42
  if (y = 0, t) op = [op[0] & 2, t.value];
43
43
  switch (op[0]) {
@@ -37,7 +37,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
37
37
  function verb(n) { return function (v) { return step([n, v]); }; }
38
38
  function step(op) {
39
39
  if (f) throw new TypeError("Generator is already executing.");
40
- while (_) try {
40
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
41
41
  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;
42
42
  if (y = 0, t) op = [op[0] & 2, t.value];
43
43
  switch (op[0]) {
@@ -17,7 +17,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
17
17
  exports.hydrateAttributeForComponent = void 0;
18
18
  var react_1 = __importDefault(require("react"));
19
19
  var useAttribute_1 = __importDefault(require("../../hooks/useAttribute"));
20
- var usePlayerLoadingStatus_1 = __importDefault(require("../../hooks/usePlayerLoadingStatus"));
20
+ var useConfigurationChangeStatus_1 = __importDefault(require("../../hooks/useConfigurationChangeStatus"));
21
21
  var utils_1 = require("../../utils");
22
22
  var constants_1 = require("../../constants");
23
23
  var hydrateAttributeForComponent = function (attribute, config) {
@@ -80,7 +80,7 @@ exports.hydrateAttributeForComponent = hydrateAttributeForComponent;
80
80
  function formComponentContainer(FormComponent) {
81
81
  return function (props) {
82
82
  var attribute = props.attribute, metadataKeyThumbnail = props.metadataKeyThumbnail, metadataKeyDescription = props.metadataKeyDescription, metadataKeyPrice = props.metadataKeyPrice, hideAttributeTitle = props.hideAttributeTitle, sort = props.sort;
83
- var isLoading = (0, usePlayerLoadingStatus_1.default)();
83
+ var isConfigurationChanging = (0, useConfigurationChangeStatus_1.default)();
84
84
  var _a = (0, useAttribute_1.default)(attribute), attributeData = _a[0], setAttribute = _a[1];
85
85
  if (!attribute)
86
86
  return react_1.default.createElement(FormComponent, __assign({}, props));
@@ -104,7 +104,7 @@ function formComponentContainer(FormComponent) {
104
104
  var preppedProps = __assign({}, props);
105
105
  if (!hideAttributeTitle && !preppedProps.title)
106
106
  preppedProps.title = attributeData.label;
107
- return (react_1.default.createElement(FormComponent, __assign({}, preppedProps, { value: selected, onClick: handleSetAttribute, onChange: handleSetAttribute, options: options, isPlayerLoading: isLoading })));
107
+ return (react_1.default.createElement(FormComponent, __assign({}, preppedProps, { value: selected, onClick: handleSetAttribute, onChange: handleSetAttribute, options: options, isPlayerLoading: isConfigurationChanging })));
108
108
  };
109
109
  }
110
110
  exports.default = formComponentContainer;
@@ -14,7 +14,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
14
14
  function verb(n) { return function (v) { return step([n, v]); }; }
15
15
  function step(op) {
16
16
  if (f) throw new TypeError("Generator is already executing.");
17
- while (_) try {
17
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
18
18
  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;
19
19
  if (y = 0, t) op = [op[0] & 2, t.value];
20
20
  switch (op[0]) {
@@ -1,10 +1,10 @@
1
1
  import { IHydratedAttribute, IConfigurationColor } from '../../types';
2
- export declare type RawAttributeValue = string | number | boolean | IConfigurationColor | File | undefined;
3
- declare type UseAttributeError = [undefined, undefined];
4
- declare type UseAttributeSuccess = [
2
+ export type RawAttributeValue = string | number | boolean | IConfigurationColor | File | undefined;
3
+ type UseAttributeError = [undefined, undefined];
4
+ type UseAttributeSuccess = [
5
5
  IHydratedAttribute,
6
6
  (val: RawAttributeValue) => Promise<void>
7
7
  ];
8
- declare type UseAttributeHook = UseAttributeError | UseAttributeSuccess;
8
+ type UseAttributeHook = UseAttributeError | UseAttributeSuccess;
9
9
  declare const useAttribute: (attributeName?: string) => UseAttributeHook;
10
10
  export default useAttribute;
@@ -14,7 +14,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
14
14
  function verb(n) { return function (v) { return step([n, v]); }; }
15
15
  function step(op) {
16
16
  if (f) throw new TypeError("Generator is already executing.");
17
- while (_) try {
17
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
18
18
  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;
19
19
  if (y = 0, t) op = [op[0] & 2, t.value];
20
20
  switch (op[0]) {
@@ -0,0 +1,2 @@
1
+ declare const useConfigurationChangeStatus: () => boolean;
2
+ export default useConfigurationChangeStatus;
@@ -2,7 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  var store_1 = require("../../store");
4
4
  var treble_1 = require("../../store/treble");
5
- var usePlayerLoadingStatus = function () {
5
+ var useConfigurationChangeStatus = function () {
6
6
  return (0, store_1.useThreekitSelector)(treble_1.isPlayerLoading);
7
7
  };
8
- exports.default = usePlayerLoadingStatus;
8
+ exports.default = useConfigurationChangeStatus;
@@ -14,7 +14,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
14
14
  function verb(n) { return function (v) { return step([n, v]); }; }
15
15
  function step(op) {
16
16
  if (f) throw new TypeError("Generator is already executing.");
17
- while (_) try {
17
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
18
18
  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;
19
19
  if (y = 0, t) op = [op[0] & 2, t.value];
20
20
  switch (op[0]) {
@@ -1,9 +1,9 @@
1
1
  import { ISetConfiguration, IHydratedAttribute } from '../../types';
2
- declare type UseConfiguratorError = [undefined, undefined];
3
- declare type UseConfiguratorSuccess = [
2
+ type UseConfiguratorError = [undefined, undefined];
3
+ type UseConfiguratorSuccess = [
4
4
  Record<string, IHydratedAttribute>,
5
5
  (configuration: ISetConfiguration) => void
6
6
  ];
7
- declare type UseConfiguratorHook = UseConfiguratorError | UseConfiguratorSuccess;
7
+ type UseConfiguratorHook = UseConfiguratorError | UseConfiguratorSuccess;
8
8
  declare const useConfigurator: () => UseConfiguratorHook;
9
9
  export default useConfigurator;
@@ -1,3 +1,3 @@
1
- declare type UseDevToolsHook = [boolean, (val: boolean) => void];
1
+ type UseDevToolsHook = [boolean, (val: boolean) => void];
2
2
  export declare const useDevTools: () => UseDevToolsHook;
3
3
  export default useDevTools;
@@ -1,6 +1,6 @@
1
1
  import { IHydratedAttribute, IMetadata, ISetConfiguration } from '../../types';
2
- declare type UseNestedConfiguratorError = [undefined, undefined, undefined, undefined];
3
- declare type UseNestedConfiguratorSuccess = [
2
+ type UseNestedConfiguratorError = [undefined, undefined, undefined, undefined];
3
+ type UseNestedConfiguratorSuccess = [
4
4
  Record<string, IHydratedAttribute>,
5
5
  (val: ISetConfiguration) => Promise<void>,
6
6
  IMetadata,
@@ -14,7 +14,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
14
14
  function verb(n) { return function (v) { return step([n, v]); }; }
15
15
  function step(op) {
16
16
  if (f) throw new TypeError("Generator is already executing.");
17
- while (_) try {
17
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
18
18
  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;
19
19
  if (y = 0, t) op = [op[0] & 2, t.value];
20
20
  switch (op[0]) {
@@ -57,8 +57,7 @@ var useNestedConfigurator = function (address) {
57
57
  return;
58
58
  if (playerLoading)
59
59
  return;
60
- configurator.current =
61
- window.threekit.treble.getNestedConfigurator(address);
60
+ configurator.current = window.threekit.configurator.getNestedConfigurator([address].flat());
62
61
  if (!configurator.current)
63
62
  return;
64
63
  var updatedAttrs = configurator.current.getDisplayAttributes();
@@ -1,3 +1,3 @@
1
- declare type UsePlayer = [undefined] | [(node: null | HTMLDivElement) => void];
1
+ type UsePlayer = [undefined] | [(node: null | HTMLDivElement) => void];
2
2
  declare const usePlayer: () => UsePlayer;
3
3
  export default usePlayer;
@@ -1,3 +1,3 @@
1
- declare type UsePlayerPortal = [undefined, undefined] | [(toEl: string) => void, () => void];
1
+ type UsePlayerPortal = [undefined, undefined] | [(toEl: string) => void, () => void];
2
2
  declare const usePlayerPortal: () => UsePlayerPortal;
3
3
  export default usePlayerPortal;
@@ -0,0 +1,2 @@
1
+ declare const usePlayerReady: () => boolean;
2
+ export default usePlayerReady;
@@ -2,7 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  var store_1 = require("../../store");
4
4
  var treble_1 = require("../../store/treble");
5
- var useAnimationStart = function () {
5
+ var usePlayerReady = function () {
6
6
  return (0, store_1.useThreekitSelector)(treble_1.isFirstRenderComplete);
7
7
  };
8
- exports.default = useAnimationStart;
8
+ exports.default = usePlayerReady;
@@ -14,7 +14,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
14
14
  function verb(n) { return function (v) { return step([n, v]); }; }
15
15
  function step(op) {
16
16
  if (f) throw new TypeError("Generator is already executing.");
17
- while (_) try {
17
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
18
18
  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;
19
19
  if (y = 0, t) op = [op[0] & 2, t.value];
20
20
  switch (op[0]) {
@@ -1,3 +1,3 @@
1
- declare type UseShareHook = undefined | (() => Promise<void>);
1
+ type UseShareHook = undefined | (() => Promise<void>);
2
2
  declare const useResetProduct: () => UseShareHook;
3
3
  export default useResetProduct;
@@ -14,7 +14,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
14
14
  function verb(n) { return function (v) { return step([n, v]); }; }
15
15
  function step(op) {
16
16
  if (f) throw new TypeError("Generator is already executing.");
17
- while (_) try {
17
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
18
18
  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;
19
19
  if (y = 0, t) op = [op[0] & 2, t.value];
20
20
  switch (op[0]) {
@@ -1,3 +1,3 @@
1
- declare type UseShareHook = undefined | ((msg: string | undefined) => Promise<undefined | string>);
1
+ type UseShareHook = undefined | ((msg: string | undefined) => Promise<undefined | string>);
2
2
  declare const useShare: () => UseShareHook;
3
3
  export default useShare;
@@ -14,7 +14,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
14
14
  function verb(n) { return function (v) { return step([n, v]); }; }
15
15
  function step(op) {
16
16
  if (f) throw new TypeError("Generator is already executing.");
17
- while (_) try {
17
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
18
18
  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;
19
19
  if (y = 0, t) op = [op[0] & 2, t.value];
20
20
  switch (op[0]) {
@@ -25,7 +25,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
25
25
  function verb(n) { return function (v) { return step([n, v]); }; }
26
26
  function step(op) {
27
27
  if (f) throw new TypeError("Generator is already executing.");
28
- while (_) try {
28
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
29
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
30
  if (y = 0, t) op = [op[0] & 2, t.value];
31
31
  switch (op[0]) {
@@ -0,0 +1,11 @@
1
+ /// <reference types="react" />
2
+ import type { ICoordinate2D } from './types';
3
+ interface ISpacesLayout {
4
+ loops?: Array<ICoordinate2D[]>;
5
+ size?: number;
6
+ color?: string;
7
+ padding?: number;
8
+ strokeWidth?: number;
9
+ }
10
+ export default function SpacesLayout(props: ISpacesLayout): JSX.Element;
11
+ export {};
@@ -0,0 +1,74 @@
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 __importDefault = (this && this.__importDefault) || function (mod) {
14
+ return (mod && mod.__esModule) ? mod : { "default": mod };
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ var react_1 = __importDefault(require("react"));
18
+ function SpacesLayout(props) {
19
+ var loops = props.loops;
20
+ var size = props.size || 20;
21
+ var padding = props.padding || 2;
22
+ var strokeWidth = props.strokeWidth || 2;
23
+ if (!(loops === null || loops === void 0 ? void 0 : loops.length))
24
+ return react_1.default.createElement(react_1.default.Fragment, null);
25
+ var _a = loops.reduce(function (output, loop, i) {
26
+ loop.forEach(function (_a, j) {
27
+ var x = _a[0], y = _a[1];
28
+ if (!i && !j) {
29
+ output = {
30
+ xMin: x,
31
+ yMin: y,
32
+ xMax: x,
33
+ yMax: y,
34
+ };
35
+ }
36
+ else {
37
+ if (x < output.xMin)
38
+ output.xMin = x;
39
+ else if (x > output.xMax)
40
+ output.xMax = x;
41
+ if (y < output.yMin)
42
+ output.yMin = y;
43
+ else if (y > output.yMax)
44
+ output.yMax = y;
45
+ }
46
+ });
47
+ return output;
48
+ }, {
49
+ xMin: 0,
50
+ yMin: 0,
51
+ xMax: 0,
52
+ yMax: 0,
53
+ }), xMin = _a.xMin, yMin = _a.yMin, xMax = _a.xMax, yMax = _a.yMax;
54
+ var xSpan = xMax - xMin;
55
+ var ySpan = yMax - yMin;
56
+ var xCenter = xMin + xSpan / 2;
57
+ var yCenter = yMin + ySpan / 2;
58
+ var scaleFactor = (size - 2 * padding) / Math.max(xSpan, ySpan);
59
+ var translate = [
60
+ xCenter * scaleFactor - size / 2,
61
+ yCenter * scaleFactor - size / 2,
62
+ ];
63
+ return (react_1.default.createElement("svg", __assign({ width: size, height: size, fill: "none", xmlns: "http://www.w3.org/2000/svg" }, props), loops.map(function (loop, i) {
64
+ var path = loop
65
+ .map(function (point, i) {
66
+ var x = point[0] * scaleFactor - translate[0];
67
+ var y = point[1] * scaleFactor - translate[1];
68
+ return (!i ? 'M ' : 'L ') + x + ' ' + y;
69
+ })
70
+ .join(' ') + ' Z';
71
+ return (react_1.default.createElement("path", { key: "path-".concat(i), d: path, stroke: props.color, strokeWidth: strokeWidth }));
72
+ })));
73
+ }
74
+ exports.default = SpacesLayout;