@threekit-tools/treble 0.0.92 → 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 (282) hide show
  1. package/dist/Treble/Treble.d.ts +1 -1
  2. package/dist/Treble/Treble.js +4 -3
  3. package/dist/Treble/snapshots.d.ts +2 -2
  4. package/dist/Treble/snapshots.js +1 -1
  5. package/dist/Treble/wishlist.d.ts +1 -1
  6. package/dist/Treble/wishlist.js +1 -1
  7. package/dist/api/assets.d.ts +1 -0
  8. package/dist/api/{products.js → assets.js} +12 -33
  9. package/dist/api/catalog.js +1 -1
  10. package/dist/api/configurations.d.ts +1 -0
  11. package/dist/api/configurations.js +10 -3
  12. package/dist/api/datatables.js +1 -1
  13. package/dist/api/index.d.ts +2 -2
  14. package/dist/api/index.js +2 -2
  15. package/dist/api/orders.js +1 -1
  16. package/dist/api/price.js +1 -1
  17. package/dist/components/AttributeTitle/index.d.ts +2 -2
  18. package/dist/components/AttributeValue/index.d.ts +2 -2
  19. package/dist/components/BreatheAnimation/index.js +1 -1
  20. package/dist/components/Button/index.d.ts +3 -3
  21. package/dist/components/Cards/index.d.ts +3 -3
  22. package/dist/components/DevTools/index.d.ts +2 -2
  23. package/dist/components/DraggableHint/draggableIndicator.styles.d.ts +1 -1
  24. package/dist/components/DraggableHint/index.d.ts +2 -2
  25. package/dist/components/Dropdown/index.d.ts +3 -3
  26. package/dist/components/FlatForm/index.d.ts +2 -2
  27. package/dist/components/FormComponentDescription/index.d.ts +1 -1
  28. package/dist/components/FormComponentTitle/index.d.ts +1 -1
  29. package/dist/components/Player/index.d.ts +9 -9
  30. package/dist/components/PlayerLoadingCircular/index.d.ts +2 -2
  31. package/dist/components/PlayerLoadingSpinner/index.d.ts +2 -2
  32. package/dist/components/PlayerLoadingSpinner/playerLoadingSpinner.styles.d.ts +1 -1
  33. package/dist/components/ProductDescription/index.d.ts +3 -3
  34. package/dist/components/ProductName/index.d.ts +3 -3
  35. package/dist/components/Share/index.d.ts +2 -2
  36. package/dist/components/Share/index.js +1 -1
  37. package/dist/components/Share/share.styles.d.ts +1 -1
  38. package/dist/components/Snapshots/index.d.ts +2 -2
  39. package/dist/components/Strips/index.d.ts +3 -3
  40. package/dist/components/Swatch/index.d.ts +3 -3
  41. package/dist/components/Switch/index.d.ts +3 -3
  42. package/dist/components/TextInput/index.d.ts +3 -3
  43. package/dist/components/ThreekitProvider/index.d.ts +6 -3
  44. package/dist/components/ThreekitProvider/index.js +27 -2
  45. package/dist/components/Tiles/index.d.ts +3 -3
  46. package/dist/components/TilesGroup/index.d.ts +3 -3
  47. package/dist/components/TotalPrice/index.d.ts +3 -3
  48. package/dist/components/TrebleApp/index.d.ts +3 -3
  49. package/dist/components/TurntableAnimation/index.js +1 -1
  50. package/dist/components/Upload/index.d.ts +3 -3
  51. package/dist/components/Upload/index.js +1 -1
  52. package/dist/components/UploadArea/index.d.ts +3 -3
  53. package/dist/components/UploadArea/index.js +1 -1
  54. package/dist/components/Wishlist/WishlistItem.d.ts +2 -2
  55. package/dist/components/Wishlist/index.d.ts +4 -4
  56. package/dist/components/Wishlist/index.js +1 -1
  57. package/dist/components/Zoom/index.d.ts +6 -6
  58. package/dist/components/containers/formInputContainer.d.ts +2 -2
  59. package/dist/components/formComponents.d.ts +6 -6
  60. package/dist/components/message/index.d.ts +1 -1
  61. package/dist/constants.d.ts +6 -6
  62. package/dist/hooks/useAttribute/index.d.ts +4 -4
  63. package/dist/hooks/useAttribute/index.js +3 -3
  64. package/dist/hooks/useConfigurationLoader/index.js +1 -1
  65. package/dist/hooks/useConfigurator/index.d.ts +3 -3
  66. package/dist/hooks/useConfigurator/index.js +3 -5
  67. package/dist/hooks/useDevTools/index.d.ts +1 -1
  68. package/dist/hooks/useNestedConfigurator/index.d.ts +2 -2
  69. package/dist/hooks/useNestedConfigurator/index.js +3 -3
  70. package/dist/hooks/usePlayer/index.d.ts +1 -1
  71. package/dist/hooks/usePlayerPortal/index.d.ts +1 -1
  72. package/dist/hooks/useProductCache/index.js +1 -1
  73. package/dist/hooks/useResetProduct/index.d.ts +1 -1
  74. package/dist/hooks/useResetProduct/index.js +1 -1
  75. package/dist/hooks/useRoomBuilder/RoomBuilderState.js +1 -1
  76. package/dist/hooks/useRoomBuilder/constants.js +2 -2
  77. package/dist/hooks/useRoomBuilder/themes.js +1 -1
  78. package/dist/hooks/useRoomBuilder/types.d.ts +7 -7
  79. package/dist/hooks/useRoomBuilder/types.js +5 -5
  80. package/dist/hooks/useRoomBuilder/validators.d.ts +1 -1
  81. package/dist/hooks/useShare/index.d.ts +1 -1
  82. package/dist/hooks/useShare/index.js +4 -2
  83. package/dist/hooks/useSingleAnimation/index.js +1 -1
  84. package/dist/hooks/useSnapshot/index.d.ts +1 -1
  85. package/dist/hooks/useWishlist/index.d.ts +1 -1
  86. package/dist/hooks/useZoom/index.d.ts +1 -1
  87. package/dist/http/assets.d.ts +2 -0
  88. package/dist/http/assets.js +16 -0
  89. package/dist/http/index.d.ts +2 -2
  90. package/dist/http/index.js +2 -2
  91. package/dist/http/orders.d.ts +1 -1
  92. package/dist/icons/Spinner.d.ts +2 -2
  93. package/dist/icons/types.d.ts +1 -1
  94. package/dist/store/attributes.d.ts +4 -4
  95. package/dist/store/attributes.js +2 -4
  96. package/dist/store/index.d.ts +6 -6
  97. package/dist/store/price.d.ts +1 -1
  98. package/dist/store/price.js +1 -1
  99. package/dist/store/product.d.ts +2 -2
  100. package/dist/store/product.js +1 -1
  101. package/dist/store/translations.d.ts +10 -8
  102. package/dist/store/translations.js +39 -19
  103. package/dist/store/treble.d.ts +1 -1
  104. package/dist/store/treble.js +1 -1
  105. package/dist/store/wishlist.d.ts +2 -2
  106. package/dist/store/wishlist.js +1 -1
  107. package/dist/types.d.ts +18 -17
  108. package/dist/types.js +9 -9
  109. package/dist/utils.d.ts +2 -6
  110. package/dist/utils.js +5 -12
  111. package/package.json +1 -2
  112. package/dist/Treble/snapshot.d.ts +0 -22
  113. package/dist/Treble/snapshot.js +0 -247
  114. package/dist/api/products.d.ts +0 -4
  115. package/dist/hooks/useSpaces/SpacesLayout.d.ts +0 -11
  116. package/dist/hooks/useSpaces/SpacesLayout.js +0 -74
  117. package/dist/hooks/useSpaces/SpacesState.d.ts +0 -164
  118. package/dist/hooks/useSpaces/SpacesState.js +0 -1751
  119. package/dist/hooks/useSpaces/constants.d.ts +0 -64
  120. package/dist/hooks/useSpaces/constants.js +0 -109
  121. package/dist/hooks/useSpaces/dataHandlers.d.ts +0 -20
  122. package/dist/hooks/useSpaces/dataHandlers.js +0 -254
  123. package/dist/hooks/useSpaces/draw/clearCanvas.d.ts +0 -2
  124. package/dist/hooks/useSpaces/draw/clearCanvas.js +0 -9
  125. package/dist/hooks/useSpaces/draw/drawBackground.d.ts +0 -2
  126. package/dist/hooks/useSpaces/draw/drawBackground.js +0 -12
  127. package/dist/hooks/useSpaces/draw/drawDimensions.d.ts +0 -3
  128. package/dist/hooks/useSpaces/draw/drawDimensions.js +0 -53
  129. package/dist/hooks/useSpaces/draw/drawDoors.d.ts +0 -9
  130. package/dist/hooks/useSpaces/draw/drawDoors.js +0 -99
  131. package/dist/hooks/useSpaces/draw/drawFloor.d.ts +0 -3
  132. package/dist/hooks/useSpaces/draw/drawFloor.js +0 -36
  133. package/dist/hooks/useSpaces/draw/drawGrid.d.ts +0 -3
  134. package/dist/hooks/useSpaces/draw/drawGrid.js +0 -33
  135. package/dist/hooks/useSpaces/draw/drawGuides.d.ts +0 -3
  136. package/dist/hooks/useSpaces/draw/drawGuides.js +0 -23
  137. package/dist/hooks/useSpaces/draw/drawOpenings.d.ts +0 -9
  138. package/dist/hooks/useSpaces/draw/drawOpenings.js +0 -72
  139. package/dist/hooks/useSpaces/draw/drawVertices.d.ts +0 -8
  140. package/dist/hooks/useSpaces/draw/drawVertices.js +0 -61
  141. package/dist/hooks/useSpaces/draw/drawWalls.d.ts +0 -10
  142. package/dist/hooks/useSpaces/draw/drawWalls.js +0 -88
  143. package/dist/hooks/useSpaces/draw/drawWindows.d.ts +0 -9
  144. package/dist/hooks/useSpaces/draw/drawWindows.js +0 -82
  145. package/dist/hooks/useSpaces/draw/index.d.ts +0 -11
  146. package/dist/hooks/useSpaces/draw/index.js +0 -129
  147. package/dist/hooks/useSpaces/geometry/addThicknessToLine.d.ts +0 -3
  148. package/dist/hooks/useSpaces/geometry/addThicknessToLine.js +0 -13
  149. package/dist/hooks/useSpaces/geometry/areLinesEqual.d.ts +0 -3
  150. package/dist/hooks/useSpaces/geometry/areLinesEqual.js +0 -17
  151. package/dist/hooks/useSpaces/geometry/arePointsEqual.d.ts +0 -3
  152. package/dist/hooks/useSpaces/geometry/arePointsEqual.js +0 -8
  153. package/dist/hooks/useSpaces/geometry/arePointsWithinProximity.d.ts +0 -3
  154. package/dist/hooks/useSpaces/geometry/arePointsWithinProximity.js +0 -11
  155. package/dist/hooks/useSpaces/geometry/closestPointOnLine.d.ts +0 -3
  156. package/dist/hooks/useSpaces/geometry/closestPointOnLine.js +0 -13
  157. package/dist/hooks/useSpaces/geometry/doLinesOverlap.d.ts +0 -2
  158. package/dist/hooks/useSpaces/geometry/doLinesOverlap.js +0 -16
  159. package/dist/hooks/useSpaces/geometry/euclideanMod.d.ts +0 -2
  160. package/dist/hooks/useSpaces/geometry/euclideanMod.js +0 -6
  161. package/dist/hooks/useSpaces/geometry/findLoops.d.ts +0 -6
  162. package/dist/hooks/useSpaces/geometry/findLoops.js +0 -117
  163. package/dist/hooks/useSpaces/geometry/getAllLineIntersections.d.ts +0 -6
  164. package/dist/hooks/useSpaces/geometry/getAllLineIntersections.js +0 -23
  165. package/dist/hooks/useSpaces/geometry/getAngleOfLineSegment.d.ts +0 -3
  166. package/dist/hooks/useSpaces/geometry/getAngleOfLineSegment.js +0 -7
  167. package/dist/hooks/useSpaces/geometry/getClosestPointOnLineSegment.d.ts +0 -3
  168. package/dist/hooks/useSpaces/geometry/getClosestPointOnLineSegment.js +0 -17
  169. package/dist/hooks/useSpaces/geometry/getDistanceToLine.d.ts +0 -3
  170. package/dist/hooks/useSpaces/geometry/getDistanceToLine.js +0 -10
  171. package/dist/hooks/useSpaces/geometry/getLengthOfLineSegment.d.ts +0 -3
  172. package/dist/hooks/useSpaces/geometry/getLengthOfLineSegment.js +0 -7
  173. package/dist/hooks/useSpaces/geometry/getLineAtOffsetOnLineSegment.d.ts +0 -3
  174. package/dist/hooks/useSpaces/geometry/getLineAtOffsetOnLineSegment.js +0 -17
  175. package/dist/hooks/useSpaces/geometry/getLineOtherPoint.d.ts +0 -3
  176. package/dist/hooks/useSpaces/geometry/getLineOtherPoint.js +0 -11
  177. package/dist/hooks/useSpaces/geometry/getLineSegmentsIntersection.d.ts +0 -3
  178. package/dist/hooks/useSpaces/geometry/getLineSegmentsIntersection.js +0 -43
  179. package/dist/hooks/useSpaces/geometry/getMidpointOfLineSegment.d.ts +0 -3
  180. package/dist/hooks/useSpaces/geometry/getMidpointOfLineSegment.js +0 -9
  181. package/dist/hooks/useSpaces/geometry/getParallelLineSegmentAtDistance.d.ts +0 -3
  182. package/dist/hooks/useSpaces/geometry/getParallelLineSegmentAtDistance.js +0 -20
  183. package/dist/hooks/useSpaces/geometry/getPointAtOffsetOnLineSegment.d.ts +0 -3
  184. package/dist/hooks/useSpaces/geometry/getPointAtOffsetOnLineSegment.js +0 -11
  185. package/dist/hooks/useSpaces/geometry/getPolygonArea.d.ts +0 -3
  186. package/dist/hooks/useSpaces/geometry/getPolygonArea.js +0 -15
  187. package/dist/hooks/useSpaces/geometry/getQuadrilateralArea.d.ts +0 -3
  188. package/dist/hooks/useSpaces/geometry/getQuadrilateralArea.js +0 -16
  189. package/dist/hooks/useSpaces/geometry/getTangetIntersectionAndOffset.d.ts +0 -6
  190. package/dist/hooks/useSpaces/geometry/getTangetIntersectionAndOffset.js +0 -17
  191. package/dist/hooks/useSpaces/geometry/getTriangleArea.d.ts +0 -3
  192. package/dist/hooks/useSpaces/geometry/getTriangleArea.js +0 -9
  193. package/dist/hooks/useSpaces/geometry/getUnitVectorOfLineSegment.d.ts +0 -3
  194. package/dist/hooks/useSpaces/geometry/getUnitVectorOfLineSegment.js +0 -12
  195. package/dist/hooks/useSpaces/geometry/index.d.ts +0 -30
  196. package/dist/hooks/useSpaces/geometry/index.js +0 -64
  197. package/dist/hooks/useSpaces/geometry/isPointInPolygon.d.ts +0 -3
  198. package/dist/hooks/useSpaces/geometry/isPointInPolygon.js +0 -21
  199. package/dist/hooks/useSpaces/geometry/isPointInQuadrilateral.d.ts +0 -3
  200. package/dist/hooks/useSpaces/geometry/isPointInQuadrilateral.js +0 -25
  201. package/dist/hooks/useSpaces/geometry/orderCoordinatesOnLineSegment.d.ts +0 -3
  202. package/dist/hooks/useSpaces/geometry/orderCoordinatesOnLineSegment.js +0 -11
  203. package/dist/hooks/useSpaces/geometry/splitLineAtOffset.d.ts +0 -3
  204. package/dist/hooks/useSpaces/geometry/splitLineAtOffset.js +0 -12
  205. package/dist/hooks/useSpaces/geometry/splitLineAtPoint.d.ts +0 -3
  206. package/dist/hooks/useSpaces/geometry/splitLineAtPoint.js +0 -9
  207. package/dist/hooks/useSpaces/geometry/splitLineAtPoints.d.ts +0 -3
  208. package/dist/hooks/useSpaces/geometry/splitLineAtPoints.js +0 -28
  209. package/dist/hooks/useSpaces/index.d.ts +0 -82
  210. package/dist/hooks/useSpaces/index.js +0 -482
  211. package/dist/hooks/useSpaces/themes/blueprint.d.ts +0 -3
  212. package/dist/hooks/useSpaces/themes/blueprint.js +0 -96
  213. package/dist/hooks/useSpaces/themes/default.d.ts +0 -3
  214. package/dist/hooks/useSpaces/themes/default.js +0 -96
  215. package/dist/hooks/useSpaces/themes/index.d.ts +0 -11
  216. package/dist/hooks/useSpaces/themes/index.js +0 -21
  217. package/dist/hooks/useSpaces/themes/light.d.ts +0 -3
  218. package/dist/hooks/useSpaces/themes/light.js +0 -96
  219. package/dist/hooks/useSpaces/types.d.ts +0 -339
  220. package/dist/hooks/useSpaces/types.js +0 -54
  221. package/dist/hooks/useSpaces/validators/areWallsDuplicated.d.ts +0 -3
  222. package/dist/hooks/useSpaces/validators/areWallsDuplicated.js +0 -61
  223. package/dist/hooks/useSpaces/validators/areWallsIntersecting.d.ts +0 -3
  224. package/dist/hooks/useSpaces/validators/areWallsIntersecting.js +0 -42
  225. package/dist/hooks/useSpaces/validators/areWallsOrphaningFeatures.d.ts +0 -3
  226. package/dist/hooks/useSpaces/validators/areWallsOrphaningFeatures.js +0 -52
  227. package/dist/hooks/useSpaces/validators/areWallsTooShort.d.ts +0 -3
  228. package/dist/hooks/useSpaces/validators/areWallsTooShort.js +0 -37
  229. package/dist/hooks/useSpaces/validators/index.d.ts +0 -15
  230. package/dist/hooks/useSpaces/validators/index.js +0 -40
  231. package/dist/hooks/useSpaces/validators/isFeatureCollidingWithExistingFeature.d.ts +0 -3
  232. package/dist/hooks/useSpaces/validators/isFeatureCollidingWithExistingFeature.js +0 -31
  233. package/dist/hooks/useSpaces/validators/isFeatureOutsideWallBounds.d.ts +0 -3
  234. package/dist/hooks/useSpaces/validators/isFeatureOutsideWallBounds.js +0 -19
  235. package/dist/hooks/useSpaces/validators/isLineTooShort.d.ts +0 -3
  236. package/dist/hooks/useSpaces/validators/isLineTooShort.js +0 -26
  237. package/dist/hooks/useSpaces/validators/isVertexLandingOnFeature.d.ts +0 -4
  238. package/dist/hooks/useSpaces/validators/isVertexLandingOnFeature.js +0 -19
  239. package/dist/hooks/useSpaces/validators/isWallEndingOnFeature.d.ts +0 -3
  240. package/dist/hooks/useSpaces/validators/isWallEndingOnFeature.js +0 -19
  241. package/dist/hooks/useSpaces/validators/isWallIntersectingFeature.d.ts +0 -3
  242. package/dist/hooks/useSpaces/validators/isWallIntersectingFeature.js +0 -41
  243. package/dist/hooks/useSpaces/validators/isWallOverlappingExisitingWalls.d.ts +0 -3
  244. package/dist/hooks/useSpaces/validators/isWallOverlappingExisitingWalls.js +0 -54
  245. package/dist/hooks/useSpaces/validators/isWallTooShort.d.ts +0 -3
  246. package/dist/hooks/useSpaces/validators/isWallTooShort.js +0 -10
  247. package/dist/hooks/useSpaces/validators/messaging.d.ts +0 -8
  248. package/dist/hooks/useSpaces/validators/messaging.js +0 -18
  249. package/dist/http/products.d.ts +0 -1
  250. package/dist/http/products.js +0 -12
  251. package/dist/icons/AngleSnapping.d.ts +0 -3
  252. package/dist/icons/AngleSnapping.js +0 -28
  253. package/dist/icons/Center.d.ts +0 -3
  254. package/dist/icons/Center.js +0 -24
  255. package/dist/icons/GridSnapping.d.ts +0 -3
  256. package/dist/icons/GridSnapping.js +0 -28
  257. package/dist/icons/LayoutAlt.d.ts +0 -3
  258. package/dist/icons/LayoutAlt.js +0 -21
  259. package/dist/icons/Magnet.d.ts +0 -3
  260. package/dist/icons/Magnet.js +0 -27
  261. package/dist/icons/Player3D.d.ts +0 -3
  262. package/dist/icons/Player3D.js +0 -21
  263. package/dist/icons/Ruler copy.d.ts +0 -3
  264. package/dist/icons/Ruler copy.js +0 -22
  265. package/dist/icons/RulerBlank.d.ts +0 -3
  266. package/dist/icons/RulerBlank.js +0 -25
  267. package/dist/icons/RulerDetailed copy.d.ts +0 -3
  268. package/dist/icons/RulerDetailed copy.js +0 -27
  269. package/dist/icons/RulerDetailed.d.ts +0 -3
  270. package/dist/icons/RulerDetailed.js +0 -27
  271. package/dist/icons/Save.d.ts +0 -3
  272. package/dist/icons/Save.js +0 -21
  273. package/dist/icons/UnitCm.d.ts +0 -3
  274. package/dist/icons/UnitCm.js +0 -22
  275. package/dist/icons/UnitFeet.d.ts +0 -3
  276. package/dist/icons/UnitFeet.js +0 -22
  277. package/dist/icons/UnitInch.d.ts +0 -3
  278. package/dist/icons/UnitInch.js +0 -22
  279. package/dist/icons/UnitMeter.d.ts +0 -3
  280. package/dist/icons/UnitMeter.js +0 -21
  281. package/dist/store/spaces.d.ts +0 -47
  282. package/dist/store/spaces.js +0 -197
@@ -1,10 +1,10 @@
1
- export declare type ICoordinate2D = [x: number, y: number];
2
- export declare type ICoordinate3D = [x: number, y: number, z: number];
3
- export declare type ICoordinatesLine = [
1
+ export type ICoordinate2D = [x: number, y: number];
2
+ export type ICoordinate3D = [x: number, y: number, z: number];
3
+ export type ICoordinatesLine = [
4
4
  startPoint: ICoordinate2D,
5
5
  endPoint: ICoordinate2D
6
6
  ];
7
- export declare type ICoordinatesQuadrilateral = [
7
+ export type ICoordinatesQuadrilateral = [
8
8
  point1: ICoordinate2D,
9
9
  point2: ICoordinate2D,
10
10
  point3: ICoordinate2D,
@@ -18,8 +18,8 @@ export declare enum IElements {
18
18
  DOOR = "doors",
19
19
  OPENING = "openings"
20
20
  }
21
- export declare type IFeatureName = IElements.WINDOW | IElements.DOOR | IElements.OPENING;
22
- export declare type IElementName = IElements.WALL | IElements.VERTEX | IFeatureName;
21
+ export type IFeatureName = IElements.WINDOW | IElements.DOOR | IElements.OPENING;
22
+ export type IElementName = IElements.WALL | IElements.VERTEX | IFeatureName;
23
23
  export interface IWall {
24
24
  assetId: string;
25
25
  line: ICoordinatesLine;
@@ -179,7 +179,7 @@ export interface ISnapPointFeature extends ISnapPointShared<IFeatureName> {
179
179
  }
180
180
  export interface ISnapPointAngle extends Omit<ISnapPointShared<'Angle'>, 'index'> {
181
181
  }
182
- export declare type ISnapPoint = ISnapPointVertex | ISnapPointWall | ISnapPointFeature | ISnapPointAngle;
182
+ export type ISnapPoint = ISnapPointVertex | ISnapPointWall | ISnapPointFeature | ISnapPointAngle;
183
183
  export interface IActiveElement extends IElementAddress {
184
184
  snapPoint?: ISnapPoint;
185
185
  }
@@ -9,28 +9,28 @@ var IElements;
9
9
  IElements["WINDOW"] = "windows";
10
10
  IElements["DOOR"] = "doors";
11
11
  IElements["OPENING"] = "openings";
12
- })(IElements = exports.IElements || (exports.IElements = {}));
12
+ })(IElements || (exports.IElements = IElements = {}));
13
13
  var IElementStyleModes;
14
14
  (function (IElementStyleModes) {
15
15
  IElementStyleModes["HIGHLIGHT"] = "highlight";
16
16
  IElementStyleModes["ACTIVE"] = "active";
17
17
  IElementStyleModes["ERROR"] = "error";
18
- })(IElementStyleModes = exports.IElementStyleModes || (exports.IElementStyleModes = {}));
18
+ })(IElementStyleModes || (exports.IElementStyleModes = IElementStyleModes = {}));
19
19
  var IErrorTypes;
20
20
  (function (IErrorTypes) {
21
21
  IErrorTypes["HARD"] = "hard";
22
22
  IErrorTypes["SOFT"] = "soft";
23
23
  IErrorTypes["WARN"] = "warning";
24
- })(IErrorTypes = exports.IErrorTypes || (exports.IErrorTypes = {}));
24
+ })(IErrorTypes || (exports.IErrorTypes = IErrorTypes = {}));
25
25
  var IModes;
26
26
  (function (IModes) {
27
27
  IModes["SELECT"] = "select";
28
28
  IModes["DRAW"] = "draw";
29
- })(IModes = exports.IModes || (exports.IModes = {}));
29
+ })(IModes || (exports.IModes = IModes = {}));
30
30
  var IUnits;
31
31
  (function (IUnits) {
32
32
  IUnits["FEET"] = "feet";
33
33
  IUnits["METER"] = "meter";
34
34
  IUnits["INCH"] = "inch";
35
35
  IUnits["CM"] = "cm";
36
- })(IUnits = exports.IUnits || (exports.IUnits = {}));
36
+ })(IUnits || (exports.IUnits = IUnits = {}));
@@ -20,7 +20,7 @@ export interface IMoveVertexValidatorInput {
20
20
  vertex: IVertex;
21
21
  features: IFeatures;
22
22
  }
23
- declare type IValidatorFunction<T> = (input: T) => false | IErrorElement;
23
+ type IValidatorFunction<T> = (input: T) => false | IErrorElement;
24
24
  export declare function isWallTooShort(input: IAddWallValidatorInput): false | IErrorElement;
25
25
  export declare function isWallIntersectingFeature(input: IAddWallValidatorInput): false | IErrorElement;
26
26
  export declare function isWallOverlappingExisitingWalls(input: IAddWallValidatorInput): false | IErrorElement;
@@ -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]) {
@@ -53,7 +53,9 @@ var useShare = function () {
53
53
  var configuration;
54
54
  return __generator(this, function (_a) {
55
55
  switch (_a.label) {
56
- case 0: return [4, window.threekit.treble.saveConfiguration()];
56
+ case 0: return [4, window.threekit.treble.saveConfiguration({
57
+ creator: 'threekit share button',
58
+ })];
57
59
  case 1:
58
60
  configuration = _a.sent();
59
61
  if (!configuration)
@@ -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]) {
@@ -1,3 +1,3 @@
1
1
  import { ISnapshotsCameras, ITakeSnapshotsConfig } from '../../Treble';
2
- declare const useSnapshot: (cameras: ISnapshotsCameras, config: ITakeSnapshotsConfig) => (() => Promise<void | string[] | Blob[] | File[] | null>) | undefined;
2
+ declare const useSnapshot: (cameras: ISnapshotsCameras, config: ITakeSnapshotsConfig) => (() => Promise<void | string[] | File[] | Blob[] | null>) | undefined;
3
3
  export default useSnapshot;
@@ -5,7 +5,7 @@ interface HydratedWishlistItem extends IConfigurationResponse {
5
5
  handleRemove: () => void;
6
6
  handleShare: () => void;
7
7
  }
8
- declare type UseWishlistHook = [
8
+ type UseWishlistHook = [
9
9
  Array<HydratedWishlistItem>,
10
10
  (config?: Omit<ISaveConfiguration, 'configuration'>) => void,
11
11
  () => void
@@ -1,3 +1,3 @@
1
- declare type UseZoom = [(step: number) => void, (step: number) => void];
1
+ type UseZoom = [(step: number) => void, (step: number) => void];
2
2
  declare const useZoom: () => UseZoom;
3
3
  export default useZoom;
@@ -0,0 +1,2 @@
1
+ export type ITranslationsMap = Record<string, string>;
2
+ export declare const getTranslationsForLocale: (locale: string) => Promise<import("axios").AxiosResponse<ITranslationsMap>>;
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.getTranslationsForLocale = void 0;
7
+ var request_1 = __importDefault(require("./request"));
8
+ var ASSETS_API_ROUTE = "/api/assets";
9
+ var getTranslationsForLocale = function (locale) {
10
+ return request_1.default.get({
11
+ url: "".concat(ASSETS_API_ROUTE, "/translations"),
12
+ params: { locale: locale },
13
+ includeOrgId: true,
14
+ });
15
+ };
16
+ exports.getTranslationsForLocale = getTranslationsForLocale;
@@ -1,13 +1,13 @@
1
+ import * as assets from './assets';
1
2
  import * as orders from './orders';
2
- import * as products from './products';
3
3
  import * as configurations from './configurations';
4
4
  import * as pricebook from './pricebook';
5
5
  import * as catalog from './catalog';
6
6
  import * as datatables from './datatables';
7
7
  import * as server from './server';
8
8
  declare const _default: {
9
+ assets: typeof assets;
9
10
  orders: typeof orders;
10
- products: typeof products;
11
11
  configurations: typeof configurations;
12
12
  pricebook: typeof pricebook;
13
13
  catalog: typeof catalog;
@@ -23,16 +23,16 @@ var __importStar = (this && this.__importStar) || function (mod) {
23
23
  return result;
24
24
  };
25
25
  Object.defineProperty(exports, "__esModule", { value: true });
26
+ var assets = __importStar(require("./assets"));
26
27
  var orders = __importStar(require("./orders"));
27
- var products = __importStar(require("./products"));
28
28
  var configurations = __importStar(require("./configurations"));
29
29
  var pricebook = __importStar(require("./pricebook"));
30
30
  var catalog = __importStar(require("./catalog"));
31
31
  var datatables = __importStar(require("./datatables"));
32
32
  var server = __importStar(require("./server"));
33
33
  exports.default = {
34
+ assets: assets,
34
35
  orders: orders,
35
- products: products,
36
36
  configurations: configurations,
37
37
  pricebook: pricebook,
38
38
  catalog: catalog,
@@ -1,5 +1,5 @@
1
1
  import { IMultiPageResponse } from './request';
2
- export declare type STATUSES = 'List';
2
+ export type STATUSES = 'List';
3
3
  export interface ICartItem {
4
4
  count: number;
5
5
  metadata?: null | Record<string, string>;
@@ -1,9 +1,9 @@
1
- /// <reference types="react" />
1
+ import React from 'react';
2
2
  interface ISpinnerProps {
3
3
  size?: string;
4
4
  thickness?: string;
5
5
  }
6
- declare function Spinner(props: ISpinnerProps): JSX.Element;
6
+ declare function Spinner(props: ISpinnerProps): React.JSX.Element;
7
7
  declare namespace Spinner {
8
8
  var iconName: string;
9
9
  }
@@ -1,4 +1,4 @@
1
- import React from 'react';
1
+ import React from "react";
2
2
  export interface IIconProps {
3
3
  color?: string;
4
4
  }
@@ -1,9 +1,9 @@
1
1
  import { RootState, ThreekitDispatch } from './index';
2
2
  import { ISetConfiguration, IThreekitDisplayAttribute } from '../types';
3
- import { ITranslationMap } from '../api/products';
4
- export declare type AttributesState = Record<string, IThreekitDisplayAttribute>;
3
+ import { ITranslationsMap } from '../http/assets';
4
+ export type AttributesState = Record<string, IThreekitDisplayAttribute>;
5
5
  export declare const setAttributes: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[attributes: IThreekitDisplayAttribute[]], Record<string, IThreekitDisplayAttribute>, "treble/attributes/set-attributes", never, never>;
6
- declare const reducer: import("redux").Reducer<AttributesState, import("redux").AnyAction>;
6
+ declare const reducer: import("redux").Reducer<AttributesState>;
7
7
  export declare const getAttributes: (state: RootState) => AttributesState;
8
8
  export declare const getHydrationData: ((state: {
9
9
  treble: import("./treble").TrebleState;
@@ -12,7 +12,7 @@ export declare const getHydrationData: ((state: {
12
12
  translations: import("./translations").TranslationsState;
13
13
  wishlist: import("../Treble").WishlistArray;
14
14
  price: import("./price").PriceState;
15
- }) => [Record<string, IThreekitDisplayAttribute>, ITranslationMap | undefined, string | undefined]) & import("reselect").OutputSelectorFields<(args_0: AttributesState, args_1: string | undefined) => [Record<string, IThreekitDisplayAttribute>, ITranslationMap | undefined, string | undefined], {
15
+ }) => readonly [Record<string, IThreekitDisplayAttribute>, ITranslationsMap]) & import("reselect").OutputSelectorFields<(args_0: AttributesState, args_1: ITranslationsMap) => readonly [Record<string, IThreekitDisplayAttribute>, ITranslationsMap], {
16
16
  clearCache: () => void;
17
17
  }> & {
18
18
  clearCache: () => void;
@@ -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]) {
@@ -67,9 +67,7 @@ var reducer = (0, toolkit_1.createSlice)({
67
67
  }).reducer;
68
68
  var getAttributes = function (state) { return state.attributes; };
69
69
  exports.getAttributes = getAttributes;
70
- exports.getHydrationData = (0, toolkit_1.createSelector)(exports.getAttributes, translations_1.getLanguage, function (attributes, language) {
71
- return [attributes, translations_1.TRANSLATIONS, language];
72
- });
70
+ exports.getHydrationData = (0, toolkit_1.createSelector)(exports.getAttributes, translations_1.getTranslations, function (attributes, translations) { return [attributes, translations]; });
73
71
  var setConfiguration = function (config) { return function (dispatch) { return __awaiter(void 0, void 0, void 0, function () {
74
72
  return __generator(this, function (_a) {
75
73
  switch (_a.label) {
@@ -14,14 +14,14 @@ declare const store: import("@reduxjs/toolkit/dist/configureStore").ToolkitStore
14
14
  translations: import("./translations").TranslationsState;
15
15
  wishlist: import("../Treble").WishlistArray;
16
16
  price: import("./price").PriceState;
17
- }, import("redux").AnyAction, undefined>]> | import("@reduxjs/toolkit").MiddlewareArray<[import("@reduxjs/toolkit").ThunkMiddleware<{
17
+ }, import("redux").AnyAction>]> | import("@reduxjs/toolkit").MiddlewareArray<[import("@reduxjs/toolkit").ThunkMiddleware<{
18
18
  treble: import("./treble").TrebleState;
19
19
  product: import("./product").ProductState;
20
20
  attributes: import("./attributes").AttributesState;
21
21
  translations: import("./translations").TranslationsState;
22
22
  wishlist: import("../Treble").WishlistArray;
23
23
  price: import("./price").PriceState;
24
- }, import("redux").AnyAction, undefined>, import("redux").Middleware<{}, any, import("redux").Dispatch<import("redux").AnyAction>>]>>;
24
+ }, import("redux").AnyAction>, import("redux").Middleware<{}, any, import("redux").Dispatch<import("redux").AnyAction>>]>>;
25
25
  export declare const createStore: (reducer?: Record<string, Reducer>) => import("@reduxjs/toolkit/dist/configureStore").ToolkitStore<{
26
26
  treble: import("./treble").TrebleState;
27
27
  product: import("./product").ProductState;
@@ -36,16 +36,16 @@ export declare const createStore: (reducer?: Record<string, Reducer>) => import(
36
36
  translations: import("./translations").TranslationsState;
37
37
  wishlist: import("../Treble").WishlistArray;
38
38
  price: import("./price").PriceState;
39
- }, import("redux").AnyAction, undefined>]> | import("@reduxjs/toolkit").MiddlewareArray<[import("@reduxjs/toolkit").ThunkMiddleware<{
39
+ }, import("redux").AnyAction>]> | import("@reduxjs/toolkit").MiddlewareArray<[import("@reduxjs/toolkit").ThunkMiddleware<{
40
40
  treble: import("./treble").TrebleState;
41
41
  product: import("./product").ProductState;
42
42
  attributes: import("./attributes").AttributesState;
43
43
  translations: import("./translations").TranslationsState;
44
44
  wishlist: import("../Treble").WishlistArray;
45
45
  price: import("./price").PriceState;
46
- }, import("redux").AnyAction, undefined>, import("redux").Middleware<{}, any, import("redux").Dispatch<import("redux").AnyAction>>]>>;
47
- export declare type RootState = ReturnType<typeof store.getState>;
48
- export declare type ThreekitDispatch = typeof store.dispatch;
46
+ }, import("redux").AnyAction>, import("redux").Middleware<{}, any, import("redux").Dispatch<import("redux").AnyAction>>]>>;
47
+ export type RootState = ReturnType<typeof store.getState>;
48
+ export type ThreekitDispatch = typeof store.dispatch;
49
49
  export declare const useThreekitDispatch: () => import("@reduxjs/toolkit").ThunkDispatch<{
50
50
  treble: import("./treble").TrebleState;
51
51
  product: import("./product").ProductState;
@@ -15,7 +15,7 @@ export interface PriceState {
15
15
  export declare const setPriceConfig: import("@reduxjs/toolkit").ActionCreatorWithPayload<IPriceConfig, string>;
16
16
  export declare const setPrice: import("@reduxjs/toolkit").ActionCreatorWithPayload<number, string>;
17
17
  export declare const initPrice: () => (dispatch: ThreekitDispatch) => Promise<void>;
18
- declare const reducer: import("redux").Reducer<PriceState, import("redux").AnyAction>;
18
+ declare const reducer: import("redux").Reducer<PriceState>;
19
19
  export declare const getPrice: (state: RootState) => undefined | IPrice;
20
20
  export declare const getPriceConfig: (state: RootState) => undefined | IPriceConfig;
21
21
  export declare const updatePrice: () => (dispatch: ThreekitDispatch, getState: () => RootState) => void;
@@ -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]) {
@@ -16,7 +16,7 @@ export interface LoadProductConfig {
16
16
  export interface CachedProductState extends Pick<CachedProduct, 'id' | 'name' | 'label' | 'thumbnail'> {
17
17
  data: string;
18
18
  }
19
- declare type IEnvConfig = Record<string, Partial<IProduct>>;
19
+ type IEnvConfig = Record<string, Partial<IProduct>>;
20
20
  export interface IHydratedProducts extends Record<string, IEnvConfig> {
21
21
  }
22
22
  export interface ProductState {
@@ -36,7 +36,7 @@ export declare const removeFromCache: import("@reduxjs/toolkit").ActionCreatorWi
36
36
  export declare const setActiveCacheIdx: import("@reduxjs/toolkit").ActionCreatorWithPayload<number, string>;
37
37
  export declare const incrementActiveCacheIdx: import("@reduxjs/toolkit").ActionCreatorWithOptionalPayload<undefined, string>;
38
38
  export declare const decrementActiveCacheIdx: import("@reduxjs/toolkit").ActionCreatorWithOptionalPayload<undefined, string>;
39
- declare const reducer: import("redux").Reducer<ProductState, import("redux").AnyAction>;
39
+ declare const reducer: import("redux").Reducer<ProductState>;
40
40
  export declare const getProductId: (state: RootState) => undefined | string;
41
41
  export declare const getName: (state: RootState) => undefined | string;
42
42
  export declare const getMetadata: (state: RootState) => undefined | IMetadata;
@@ -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]) {
@@ -1,12 +1,14 @@
1
1
  import { RootState, ThreekitDispatch } from './index';
2
- import { ITranslationMap } from '../api/products';
2
+ import { ITranslationsMap } from '../http/assets';
3
3
  export interface TranslationsState {
4
- language: string | undefined;
4
+ locale: string | undefined;
5
+ translationsMap: ITranslationsMap;
5
6
  }
6
- export declare let TRANSLATIONS: undefined | ITranslationMap;
7
- export declare const setLanguage: import("@reduxjs/toolkit").ActionCreatorWithPayload<string, string>;
8
- export declare const initTranslations: (language?: string) => (dispatch: ThreekitDispatch) => Promise<void>;
9
- declare const reducer: import("redux").Reducer<TranslationsState, import("redux").AnyAction>;
10
- export declare const getLanguage: (state: RootState) => undefined | string;
11
- export declare const getLanguageOptions: (state: RootState) => Array<string>;
7
+ export declare const setLocale: import("@reduxjs/toolkit").ActionCreatorWithOptionalPayload<string | undefined, string>;
8
+ export declare const setTranslationsMap: import("@reduxjs/toolkit").ActionCreatorWithPayload<ITranslationsMap, string>;
9
+ export declare const initTranslations: (locale?: string) => (dispatch: ThreekitDispatch) => Promise<void>;
10
+ declare const reducer: import("redux").Reducer<TranslationsState>;
11
+ export declare const getLocale: (state: RootState) => undefined | string;
12
+ export declare const getTranslations: (state: RootState) => ITranslationsMap;
13
+ export declare const setTranslationForLocale: (locale: string | null) => (dispatch: ThreekitDispatch, getState: () => RootState) => void;
12
14
  export default reducer;
@@ -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]) {
@@ -39,44 +39,64 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
39
39
  return (mod && mod.__esModule) ? mod : { "default": mod };
40
40
  };
41
41
  Object.defineProperty(exports, "__esModule", { value: true });
42
- exports.getLanguageOptions = exports.getLanguage = exports.initTranslations = exports.setLanguage = exports.TRANSLATIONS = void 0;
42
+ exports.setTranslationForLocale = exports.getTranslations = exports.getLocale = exports.initTranslations = exports.setTranslationsMap = exports.setLocale = void 0;
43
43
  var toolkit_1 = require("@reduxjs/toolkit");
44
44
  var api_1 = __importDefault(require("../api"));
45
- exports.setLanguage = (0, toolkit_1.createAction)('treble/translations/set-language');
46
- var initTranslations = function (language) { return function (dispatch) { return __awaiter(void 0, void 0, void 0, function () {
45
+ exports.setLocale = (0, toolkit_1.createAction)('treble/translations/set-locale');
46
+ exports.setTranslationsMap = (0, toolkit_1.createAction)('treble/translations/set-translations-map');
47
+ var initTranslations = function (locale) { return function (dispatch) { return __awaiter(void 0, void 0, void 0, function () {
48
+ var translations;
47
49
  return __generator(this, function (_a) {
48
50
  switch (_a.label) {
49
- case 0: return [4, api_1.default.products.fetchTranslations()];
51
+ case 0:
52
+ if (!locale)
53
+ return [2];
54
+ return [4, api_1.default.assets.fetchTranslations(locale)];
50
55
  case 1:
51
- exports.TRANSLATIONS = _a.sent();
52
- if (language)
53
- dispatch((0, exports.setLanguage)(language));
56
+ translations = _a.sent();
57
+ dispatch((0, exports.setLocale)(locale));
58
+ dispatch((0, exports.setTranslationsMap)(translations));
54
59
  return [2];
55
60
  }
56
61
  });
57
62
  }); }; };
58
63
  exports.initTranslations = initTranslations;
59
64
  var initialState = {
60
- language: undefined,
65
+ locale: undefined,
66
+ translationsMap: {},
61
67
  };
62
68
  var reducer = (0, toolkit_1.createSlice)({
63
69
  name: 'translations',
64
70
  initialState: initialState,
65
71
  extraReducers: function (builder) {
66
- builder.addCase(exports.setLanguage, function (state, action) {
67
- state.language = action.payload;
72
+ builder
73
+ .addCase(exports.setLocale, function (state, action) {
74
+ state.locale = action.payload;
75
+ })
76
+ .addCase(exports.setTranslationsMap, function (state, action) {
77
+ state.translationsMap = action.payload;
68
78
  });
69
79
  },
70
80
  reducers: {},
71
81
  }).reducer;
72
- var getLanguage = function (state) {
73
- return state.translations.language;
82
+ var getLocale = function (state) {
83
+ return state.translations.locale;
74
84
  };
75
- exports.getLanguage = getLanguage;
76
- var getLanguageOptions = function (state) {
77
- if (!state.treble.isThreekitInitialized || !exports.TRANSLATIONS)
78
- return [];
79
- return Object.keys(Object.values(exports.TRANSLATIONS)[0]);
85
+ exports.getLocale = getLocale;
86
+ var getTranslations = function (state) {
87
+ return state.translations.translationsMap;
80
88
  };
81
- exports.getLanguageOptions = getLanguageOptions;
89
+ exports.getTranslations = getTranslations;
90
+ var setTranslationForLocale = function (locale) {
91
+ return function (dispatch, getState) {
92
+ if (!locale) {
93
+ dispatch((0, exports.setLocale)(undefined));
94
+ dispatch((0, exports.setTranslationsMap)({}));
95
+ }
96
+ if (locale === getState().translations.locale)
97
+ return;
98
+ dispatch((0, exports.initTranslations)(locale !== null && locale !== void 0 ? locale : undefined));
99
+ };
100
+ };
101
+ exports.setTranslationForLocale = setTranslationForLocale;
82
102
  exports.default = reducer;
@@ -56,7 +56,7 @@ export declare const setPlayerElement: import("@reduxjs/toolkit").ActionCreatorW
56
56
  export declare const reloadTreble: import("@reduxjs/toolkit").ActionCreatorWithPayload<Partial<TrebleState>, string>;
57
57
  export declare const updateLoadingProgress: import("@reduxjs/toolkit").ActionCreatorWithPayload<number, string>;
58
58
  export declare const setPlayerInteraction: import("@reduxjs/toolkit").ActionCreatorWithPayload<boolean, string>;
59
- declare const reducer: import("redux").Reducer<TrebleState, import("redux").AnyAction>;
59
+ declare const reducer: import("redux").Reducer<TrebleState>;
60
60
  export declare const getThreekitEnv: (state: RootState) => string;
61
61
  export declare const isThreekitInitialized: (state: RootState) => boolean;
62
62
  export declare const isFirstRenderComplete: (state: RootState) => boolean;
@@ -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]) {
@@ -1,7 +1,7 @@
1
1
  import { RootState, ThreekitDispatch } from './index';
2
2
  import { WishlistArray } from '../Treble';
3
3
  import { ISaveConfiguration } from '../api/configurations';
4
- export declare type WishlistState = WishlistArray;
4
+ export type WishlistState = WishlistArray;
5
5
  export declare const refreshWishlist: import("@reduxjs/toolkit").AsyncThunk<import("../http/configurations").IConfigurationResponse[], void, {
6
6
  state?: unknown;
7
7
  dispatch?: import("redux").Dispatch<import("redux").AnyAction> | undefined;
@@ -24,7 +24,7 @@ export declare const addToWishlist: import("@reduxjs/toolkit").AsyncThunk<import
24
24
  }>;
25
25
  export declare const clearWishlist: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[], import("../http/configurations").IConfigurationResponse[], "treble/wishlist/clear", never, never>;
26
26
  export declare const removeFromWishlist: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[idx: number], import("../http/configurations").IConfigurationResponse[], "treble/wishlist/remove-item", never, never>;
27
- declare const reducer: import("redux").Reducer<WishlistArray, import("redux").AnyAction>;
27
+ declare const reducer: import("redux").Reducer<WishlistArray>;
28
28
  export declare const getWishlist: (state: RootState) => WishlistArray;
29
29
  export declare const resumeFromWishlist: (idx: number) => (_: ThreekitDispatch, getState: () => RootState) => void;
30
30
  export default reducer;
@@ -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/types.d.ts CHANGED
@@ -46,7 +46,7 @@ export declare enum SNAPSHOT_OUTPUTS {
46
46
  BLOB = "blob",
47
47
  FILE = "file"
48
48
  }
49
- export declare type IMetadata = Record<string, string | number | null>;
49
+ export type IMetadata = Record<string, string | number | null>;
50
50
  export interface ISceneQueryShared {
51
51
  all?: boolean;
52
52
  id?: string;
@@ -79,7 +79,7 @@ export interface ISceneQueryTransform extends ISceneQueryShared {
79
79
  plug: PLUG_TYPES.TRANSFORM;
80
80
  property: TRANSFORM_PROPERTY_TYPES;
81
81
  }
82
- export declare type ISceneQuery = ISceneQueryNode | ISceneQueryTransform | string;
82
+ export type ISceneQuery = ISceneQueryNode | ISceneQueryTransform | string;
83
83
  export interface ISceneResult {
84
84
  id: string;
85
85
  name: string;
@@ -97,9 +97,9 @@ export interface IConfigurationColor {
97
97
  g: number;
98
98
  b: number;
99
99
  }
100
- export declare type IConfigurationAttribute = IConfigurationAsset | IConfigurationArray | IConfigurationColor | string | number | boolean | undefined;
101
- export declare type IConfiguration = Record<string, IConfigurationAttribute>;
102
- export declare type ISetConfiguration = Record<string, IConfigurationAttribute>;
100
+ export type IConfigurationAttribute = IConfigurationAsset | IConfigurationArray | IConfigurationColor | string | number | boolean | undefined;
101
+ export type IConfiguration = Record<string, IConfigurationAttribute>;
102
+ export type ISetConfiguration = Record<string, IConfigurationAttribute>;
103
103
  interface IDisplayAttributeConfig {
104
104
  includeHidden?: boolean;
105
105
  }
@@ -135,9 +135,9 @@ export interface IAttributeAssetBase<V> extends IAttributeBase<ATTRIBUTE_TYPES.A
135
135
  disabledValues?: Array<string>;
136
136
  values: Array<V>;
137
137
  }
138
- export declare type IDisplayAttributeAsset = IAttributeAssetBase<IDisplayAttributeAssetValue>;
139
- export declare type IHydratedAttributeAsset = IAttributeAssetBase<IHydratedAttributeAssetValue>;
140
- export declare type IAttributeAsset = IAttributeAssetBase<IConfigurationAssetValue>;
138
+ export type IDisplayAttributeAsset = IAttributeAssetBase<IDisplayAttributeAssetValue>;
139
+ export type IHydratedAttributeAsset = IAttributeAssetBase<IHydratedAttributeAssetValue>;
140
+ export type IAttributeAsset = IAttributeAssetBase<IConfigurationAssetValue>;
141
141
  export interface IConfigurationArrayValue {
142
142
  assetId: string;
143
143
  name: string;
@@ -167,9 +167,9 @@ export interface IAttributeArrayBase<V> extends IAttributeBase<ATTRIBUTE_TYPES.A
167
167
  assetType: ASSET_TYPES;
168
168
  };
169
169
  }
170
- export declare type IDisplayAttributeArray = IAttributeArrayBase<IDisplayAttributeArrayValue>;
171
- export declare type IHydratedAttributeArray = IAttributeArrayBase<IHydratedAttributeArrayValue>;
172
- export declare type IAttributeArray = IAttributeArrayBase<Pick<IConfigurationArrayValue, 'assetId'>>;
170
+ export type IDisplayAttributeArray = IAttributeArrayBase<IDisplayAttributeArrayValue>;
171
+ export type IHydratedAttributeArray = IAttributeArrayBase<IHydratedAttributeArrayValue>;
172
+ export type IAttributeArray = IAttributeArrayBase<Pick<IConfigurationArrayValue, 'assetId'>>;
173
173
  export interface IDisplayAttributeStringValue {
174
174
  label: string;
175
175
  value: string;
@@ -185,9 +185,9 @@ export interface IAttributeStringBase<V> extends IAttributeBase<ATTRIBUTE_TYPES.
185
185
  disabledValues?: Array<string>;
186
186
  values: Array<V>;
187
187
  }
188
- export declare type IDisplayAttributeString = IAttributeStringBase<IDisplayAttributeStringValue>;
189
- export declare type IHydratedAttributeString = IAttributeStringBase<IHydratedAttributeStringValue>;
190
- export declare type IAttributeString = IAttributeStringBase<string>;
188
+ export type IDisplayAttributeString = IAttributeStringBase<IDisplayAttributeStringValue>;
189
+ export type IHydratedAttributeString = IAttributeStringBase<IHydratedAttributeStringValue>;
190
+ export type IAttributeString = IAttributeStringBase<string>;
191
191
  export interface IAttributeColor extends IAttributeBase<ATTRIBUTE_TYPES.COLOR, IConfigurationColor> {
192
192
  defaultValue: IConfigurationColor;
193
193
  }
@@ -201,9 +201,9 @@ export interface IAttributeNumber extends IAttributeBase<ATTRIBUTE_TYPES.NUMBER,
201
201
  export interface IAttributeBoolean extends IAttributeBase<ATTRIBUTE_TYPES.BOOLEAN, boolean> {
202
202
  defaultValue: boolean;
203
203
  }
204
- export declare type IThreekitAttribute = IAttributeAsset | IAttributeArray | IAttributeColor | IAttributeString | IAttributeNumber | IAttributeBoolean;
205
- export declare type IThreekitDisplayAttribute = IDisplayAttributeAsset | IDisplayAttributeArray | IDisplayAttributeString | IAttributeColor | IAttributeNumber | IAttributeBoolean;
206
- export declare type IHydratedAttribute = IHydratedAttributeAsset | IHydratedAttributeArray | IHydratedAttributeString | IAttributeColor | IAttributeNumber | IAttributeBoolean;
204
+ export type IThreekitAttribute = IAttributeAsset | IAttributeArray | IAttributeColor | IAttributeString | IAttributeNumber | IAttributeBoolean;
205
+ export type IThreekitDisplayAttribute = IDisplayAttributeAsset | IDisplayAttributeArray | IDisplayAttributeString | IAttributeColor | IAttributeNumber | IAttributeBoolean;
206
+ export type IHydratedAttribute = IHydratedAttributeAsset | IHydratedAttributeArray | IHydratedAttributeString | IAttributeColor | IAttributeNumber | IAttributeBoolean;
207
207
  export interface ICoordinates {
208
208
  x: number;
209
209
  y: number;
@@ -327,6 +327,7 @@ export interface IThreekitPlayer {
327
327
  unload: () => Promise<string>;
328
328
  uploadImage: (image: File) => Promise<string>;
329
329
  cacheParameters: ICacheParameters;
330
+ sessionId: string;
330
331
  }
331
332
  export interface IThreekitPrivateConfigurator extends IThreekitConfigurator {
332
333
  name: string;