@threekit-tools/treble 0.0.94 → 0.0.95-next-01
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Treble/Treble.d.ts +2 -2
- package/dist/Treble/Treble.js +3 -3
- package/dist/Treble/index.d.ts +1 -1
- package/dist/Treble/index.js +1 -1
- package/dist/Treble/{snapshots.d.ts → snapshot.d.ts} +1 -1
- package/dist/Treble/{snapshots.js → snapshot.js} +1 -1
- package/dist/Treble/wishlist.d.ts +1 -1
- package/dist/Treble/wishlist.js +1 -1
- package/dist/api/assets.js +1 -1
- package/dist/api/catalog.js +1 -1
- package/dist/api/configurations.js +1 -1
- package/dist/api/datatables.js +1 -1
- package/dist/api/orders.js +1 -1
- package/dist/api/price.js +1 -1
- package/dist/components/AttributeTitle/index.d.ts +2 -2
- package/dist/components/AttributeValue/index.d.ts +2 -2
- package/dist/components/BreatheAnimation/index.js +1 -1
- package/dist/components/Button/index.d.ts +3 -3
- package/dist/components/Cards/index.d.ts +3 -3
- package/dist/components/DevTools/index.d.ts +2 -2
- package/dist/components/DraggableHint/draggableIndicator.styles.d.ts +1 -1
- package/dist/components/DraggableHint/index.d.ts +2 -2
- package/dist/components/Dropdown/index.d.ts +3 -3
- package/dist/components/FlatForm/index.d.ts +2 -2
- package/dist/components/FormComponentDescription/index.d.ts +1 -1
- package/dist/components/FormComponentTitle/index.d.ts +1 -1
- package/dist/components/Player/index.d.ts +9 -9
- package/dist/components/PlayerLoadingCircular/index.d.ts +2 -2
- package/dist/components/PlayerLoadingSpinner/index.d.ts +2 -2
- package/dist/components/PlayerLoadingSpinner/playerLoadingSpinner.styles.d.ts +1 -1
- package/dist/components/ProductDescription/index.d.ts +3 -3
- package/dist/components/ProductName/index.d.ts +3 -3
- package/dist/components/Share/index.d.ts +2 -2
- package/dist/components/Share/index.js +1 -1
- package/dist/components/Share/share.styles.d.ts +1 -1
- package/dist/components/Snapshots/index.d.ts +2 -2
- package/dist/components/Strips/index.d.ts +3 -3
- package/dist/components/Swatch/index.d.ts +3 -3
- package/dist/components/Switch/index.d.ts +3 -3
- package/dist/components/TextInput/index.d.ts +3 -3
- package/dist/components/ThreekitProvider/index.d.ts +1 -1
- package/dist/components/Tiles/index.d.ts +3 -3
- package/dist/components/TilesGroup/index.d.ts +3 -3
- package/dist/components/TotalPrice/index.d.ts +3 -3
- package/dist/components/TrebleApp/index.d.ts +3 -3
- package/dist/components/TurntableAnimation/index.js +1 -1
- package/dist/components/Upload/index.d.ts +3 -3
- package/dist/components/Upload/index.js +1 -1
- package/dist/components/UploadArea/index.d.ts +3 -3
- package/dist/components/UploadArea/index.js +1 -1
- package/dist/components/Wishlist/WishlistItem.d.ts +2 -2
- package/dist/components/Wishlist/index.d.ts +4 -4
- package/dist/components/Wishlist/index.js +1 -1
- package/dist/components/Zoom/index.d.ts +6 -6
- package/dist/components/containers/formInputContainer.d.ts +2 -2
- package/dist/components/formComponents.d.ts +6 -6
- package/dist/components/message/index.d.ts +1 -1
- package/dist/constants.d.ts +6 -6
- package/dist/hooks/useAttribute/index.d.ts +4 -4
- package/dist/hooks/useAttribute/index.js +1 -1
- package/dist/hooks/useConfigurationLoader/index.js +1 -1
- package/dist/hooks/useConfigurator/index.d.ts +3 -3
- package/dist/hooks/useDevTools/index.d.ts +1 -1
- package/dist/hooks/useNestedConfigurator/index.d.ts +2 -2
- package/dist/hooks/useNestedConfigurator/index.js +3 -4
- package/dist/hooks/usePlayer/index.d.ts +1 -1
- package/dist/hooks/usePlayerPortal/index.d.ts +1 -1
- package/dist/hooks/useProductCache/index.js +1 -1
- package/dist/hooks/useResetProduct/index.d.ts +1 -1
- package/dist/hooks/useResetProduct/index.js +1 -1
- package/dist/hooks/useShare/index.d.ts +1 -1
- package/dist/hooks/useShare/index.js +1 -1
- package/dist/hooks/useSingleAnimation/index.js +1 -1
- package/dist/hooks/useSpaces/SpacesLayout.d.ts +11 -0
- package/dist/hooks/useSpaces/SpacesLayout.js +74 -0
- package/dist/hooks/useSpaces/SpacesState.d.ts +177 -0
- package/dist/hooks/useSpaces/SpacesState.js +1816 -0
- package/dist/hooks/useSpaces/constants.d.ts +79 -0
- package/dist/hooks/useSpaces/constants.js +130 -0
- package/dist/hooks/useSpaces/dataHandlers.d.ts +38 -0
- package/dist/hooks/useSpaces/dataHandlers.js +411 -0
- package/dist/hooks/useSpaces/draw/clearCanvas.d.ts +2 -0
- package/dist/hooks/useSpaces/draw/clearCanvas.js +9 -0
- package/dist/hooks/useSpaces/draw/drawBackground.d.ts +2 -0
- package/dist/hooks/useSpaces/draw/drawBackground.js +12 -0
- package/dist/hooks/useSpaces/draw/drawDimensions.d.ts +3 -0
- package/dist/hooks/useSpaces/draw/drawDimensions.js +53 -0
- package/dist/hooks/useSpaces/draw/drawDoors.d.ts +9 -0
- package/dist/hooks/useSpaces/draw/drawDoors.js +99 -0
- package/dist/hooks/useSpaces/draw/drawFloor.d.ts +3 -0
- package/dist/hooks/useSpaces/draw/drawFloor.js +36 -0
- package/dist/hooks/useSpaces/draw/drawGrid.d.ts +3 -0
- package/dist/hooks/useSpaces/draw/drawGrid.js +36 -0
- package/dist/hooks/useSpaces/draw/drawGuides.d.ts +3 -0
- package/dist/hooks/useSpaces/draw/drawGuides.js +23 -0
- package/dist/hooks/useSpaces/draw/drawOpenings.d.ts +9 -0
- package/dist/hooks/useSpaces/draw/drawOpenings.js +72 -0
- package/dist/hooks/useSpaces/draw/drawVertices.d.ts +8 -0
- package/dist/hooks/useSpaces/draw/drawVertices.js +61 -0
- package/dist/hooks/useSpaces/draw/drawWalls.d.ts +11 -0
- package/dist/hooks/useSpaces/draw/drawWalls.js +90 -0
- package/dist/hooks/useSpaces/draw/drawWindows.d.ts +9 -0
- package/dist/hooks/useSpaces/draw/drawWindows.js +82 -0
- package/dist/hooks/useSpaces/draw/index.d.ts +11 -0
- package/dist/hooks/useSpaces/draw/index.js +129 -0
- package/dist/hooks/useSpaces/geometry/addThicknessToLine.d.ts +3 -0
- package/dist/hooks/useSpaces/geometry/addThicknessToLine.js +13 -0
- package/dist/hooks/useSpaces/geometry/areLinesEqual.d.ts +3 -0
- package/dist/hooks/useSpaces/geometry/areLinesEqual.js +17 -0
- package/dist/hooks/useSpaces/geometry/arePointsEqual.d.ts +3 -0
- package/dist/hooks/useSpaces/geometry/arePointsEqual.js +8 -0
- package/dist/hooks/useSpaces/geometry/arePointsWithinProximity.d.ts +3 -0
- package/dist/hooks/useSpaces/geometry/arePointsWithinProximity.js +11 -0
- package/dist/hooks/useSpaces/geometry/closestPointOnLine.d.ts +3 -0
- package/dist/hooks/useSpaces/geometry/closestPointOnLine.js +13 -0
- package/dist/hooks/useSpaces/geometry/doLinesOverlap.d.ts +2 -0
- package/dist/hooks/useSpaces/geometry/doLinesOverlap.js +16 -0
- package/dist/hooks/useSpaces/geometry/euclideanMod.d.ts +2 -0
- package/dist/hooks/useSpaces/geometry/euclideanMod.js +6 -0
- package/dist/hooks/useSpaces/geometry/findLoops.d.ts +6 -0
- package/dist/hooks/{useRoomBuilder → useSpaces/geometry}/findLoops.js +31 -13
- package/dist/hooks/useSpaces/geometry/getAllLineIntersections.d.ts +6 -0
- package/dist/hooks/useSpaces/geometry/getAllLineIntersections.js +23 -0
- package/dist/hooks/useSpaces/geometry/getAngleOfLineSegment.d.ts +3 -0
- package/dist/hooks/useSpaces/geometry/getAngleOfLineSegment.js +7 -0
- package/dist/hooks/useSpaces/geometry/getClosestPointOnLineSegment.d.ts +3 -0
- package/dist/hooks/useSpaces/geometry/getClosestPointOnLineSegment.js +17 -0
- package/dist/hooks/useSpaces/geometry/getDistanceToLine.d.ts +3 -0
- package/dist/hooks/useSpaces/geometry/getDistanceToLine.js +10 -0
- package/dist/hooks/useSpaces/geometry/getLengthOfLineSegment.d.ts +3 -0
- package/dist/hooks/useSpaces/geometry/getLengthOfLineSegment.js +7 -0
- package/dist/hooks/useSpaces/geometry/getLineAtOffsetOnLineSegment.d.ts +3 -0
- package/dist/hooks/useSpaces/geometry/getLineAtOffsetOnLineSegment.js +17 -0
- package/dist/hooks/useSpaces/geometry/getLineOtherPoint.d.ts +3 -0
- package/dist/hooks/useSpaces/geometry/getLineOtherPoint.js +11 -0
- package/dist/hooks/useSpaces/geometry/getLineSegmentsIntersection.d.ts +3 -0
- package/dist/hooks/useSpaces/geometry/getLineSegmentsIntersection.js +43 -0
- package/dist/hooks/useSpaces/geometry/getMidpointOfLineSegment.d.ts +3 -0
- package/dist/hooks/useSpaces/geometry/getMidpointOfLineSegment.js +9 -0
- package/dist/hooks/useSpaces/geometry/getParallelLineSegmentAtDistance.d.ts +3 -0
- package/dist/hooks/useSpaces/geometry/getParallelLineSegmentAtDistance.js +20 -0
- package/dist/hooks/useSpaces/geometry/getPointAtOffsetOnLineSegment.d.ts +3 -0
- package/dist/hooks/useSpaces/geometry/getPointAtOffsetOnLineSegment.js +11 -0
- package/dist/hooks/useSpaces/geometry/getPolygonArea.d.ts +3 -0
- package/dist/hooks/useSpaces/geometry/getPolygonArea.js +15 -0
- package/dist/hooks/useSpaces/geometry/getQuadrilateralArea.d.ts +3 -0
- package/dist/hooks/useSpaces/geometry/getQuadrilateralArea.js +16 -0
- package/dist/hooks/useSpaces/geometry/getTangetIntersectionAndOffset.d.ts +6 -0
- package/dist/hooks/useSpaces/geometry/getTangetIntersectionAndOffset.js +17 -0
- package/dist/hooks/useSpaces/geometry/getTriangleArea.d.ts +3 -0
- package/dist/hooks/useSpaces/geometry/getTriangleArea.js +9 -0
- package/dist/hooks/useSpaces/geometry/getUnitVectorOfLineSegment.d.ts +3 -0
- package/dist/hooks/useSpaces/geometry/getUnitVectorOfLineSegment.js +12 -0
- package/dist/hooks/useSpaces/geometry/index.d.ts +30 -0
- package/dist/hooks/useSpaces/geometry/index.js +64 -0
- package/dist/hooks/useSpaces/geometry/isPointInPolygon.d.ts +3 -0
- package/dist/hooks/useSpaces/geometry/isPointInPolygon.js +21 -0
- package/dist/hooks/useSpaces/geometry/isPointInQuadrilateral.d.ts +3 -0
- package/dist/hooks/useSpaces/geometry/isPointInQuadrilateral.js +25 -0
- package/dist/hooks/useSpaces/geometry/orderCoordinatesOnLineSegment.d.ts +3 -0
- package/dist/hooks/useSpaces/geometry/orderCoordinatesOnLineSegment.js +11 -0
- package/dist/hooks/useSpaces/geometry/splitLineAtOffset.d.ts +3 -0
- package/dist/hooks/useSpaces/geometry/splitLineAtOffset.js +12 -0
- package/dist/hooks/useSpaces/geometry/splitLineAtPoint.d.ts +3 -0
- package/dist/hooks/useSpaces/geometry/splitLineAtPoint.js +9 -0
- package/dist/hooks/useSpaces/geometry/splitLineAtPoints.d.ts +3 -0
- package/dist/hooks/useSpaces/geometry/splitLineAtPoints.js +28 -0
- package/dist/hooks/useSpaces/index.d.ts +95 -0
- package/dist/hooks/useSpaces/index.js +625 -0
- package/dist/hooks/useSpaces/themes/blueprint.d.ts +3 -0
- package/dist/hooks/useSpaces/themes/blueprint.js +96 -0
- package/dist/hooks/useSpaces/themes/default.d.ts +3 -0
- package/dist/hooks/useSpaces/themes/default.js +96 -0
- package/dist/hooks/{useRoomBuilder/themes.d.ts → useSpaces/themes/index.d.ts} +3 -4
- package/dist/hooks/useSpaces/themes/index.js +21 -0
- package/dist/hooks/useSpaces/themes/light.d.ts +3 -0
- package/dist/hooks/useSpaces/themes/light.js +96 -0
- package/dist/hooks/useSpaces/types.d.ts +378 -0
- package/dist/hooks/useSpaces/types.js +54 -0
- package/dist/hooks/useSpaces/validators/areWallsDuplicated.d.ts +3 -0
- package/dist/hooks/useSpaces/validators/areWallsDuplicated.js +61 -0
- package/dist/hooks/useSpaces/validators/areWallsIntersecting.d.ts +3 -0
- package/dist/hooks/useSpaces/validators/areWallsIntersecting.js +42 -0
- package/dist/hooks/useSpaces/validators/areWallsOrphaningFeatures.d.ts +3 -0
- package/dist/hooks/useSpaces/validators/areWallsOrphaningFeatures.js +52 -0
- package/dist/hooks/useSpaces/validators/areWallsTooShort.d.ts +3 -0
- package/dist/hooks/useSpaces/validators/areWallsTooShort.js +37 -0
- package/dist/hooks/useSpaces/validators/index.d.ts +15 -0
- package/dist/hooks/useSpaces/validators/index.js +40 -0
- package/dist/hooks/useSpaces/validators/isFeatureCollidingWithExistingFeature.d.ts +3 -0
- package/dist/hooks/useSpaces/validators/isFeatureCollidingWithExistingFeature.js +31 -0
- package/dist/hooks/useSpaces/validators/isFeatureOutsideWallBounds.d.ts +3 -0
- package/dist/hooks/useSpaces/validators/isFeatureOutsideWallBounds.js +19 -0
- package/dist/hooks/useSpaces/validators/isLineTooShort.d.ts +3 -0
- package/dist/hooks/useSpaces/validators/isLineTooShort.js +26 -0
- package/dist/hooks/useSpaces/validators/isVertexLandingOnFeature.d.ts +4 -0
- package/dist/hooks/useSpaces/validators/isVertexLandingOnFeature.js +19 -0
- package/dist/hooks/useSpaces/validators/isWallEndingOnFeature.d.ts +3 -0
- package/dist/hooks/useSpaces/validators/isWallEndingOnFeature.js +19 -0
- package/dist/hooks/useSpaces/validators/isWallIntersectingFeature.d.ts +3 -0
- package/dist/hooks/useSpaces/validators/isWallIntersectingFeature.js +41 -0
- package/dist/hooks/useSpaces/validators/isWallOverlappingExisitingWalls.d.ts +3 -0
- package/dist/hooks/useSpaces/validators/isWallOverlappingExisitingWalls.js +54 -0
- package/dist/hooks/useSpaces/validators/isWallTooShort.d.ts +3 -0
- package/dist/hooks/useSpaces/validators/isWallTooShort.js +10 -0
- package/dist/hooks/{useRoomBuilder → useSpaces/validators}/messaging.js +1 -1
- package/dist/hooks/useWishlist/index.d.ts +1 -1
- package/dist/hooks/useZoom/index.d.ts +1 -1
- package/dist/http/assets.d.ts +1 -1
- package/dist/http/orders.d.ts +1 -1
- package/dist/icons/AngleSnapping.d.ts +3 -0
- package/dist/icons/AngleSnapping.js +28 -0
- package/dist/icons/Boundary.d.ts +3 -0
- package/dist/icons/Boundary.js +21 -0
- package/dist/icons/Center.d.ts +3 -0
- package/dist/icons/Center.js +24 -0
- package/dist/icons/Draw.js +3 -3
- package/dist/icons/GridSnapping.d.ts +3 -0
- package/dist/icons/GridSnapping.js +28 -0
- package/dist/icons/LayoutAlt.d.ts +3 -0
- package/dist/icons/LayoutAlt.js +21 -0
- package/dist/icons/Magnet.d.ts +3 -0
- package/dist/icons/Magnet.js +27 -0
- package/dist/icons/Player3D.d.ts +3 -0
- package/dist/icons/Player3D.js +21 -0
- package/dist/icons/RulerBlank.d.ts +3 -0
- package/dist/icons/RulerBlank.js +25 -0
- package/dist/icons/RulerDetailed.d.ts +3 -0
- package/dist/icons/RulerDetailed.js +27 -0
- package/dist/icons/Save.d.ts +3 -0
- package/dist/icons/Save.js +21 -0
- package/dist/icons/Spinner.d.ts +2 -2
- package/dist/icons/UnitCm.d.ts +3 -0
- package/dist/icons/UnitCm.js +22 -0
- package/dist/icons/UnitFeet.d.ts +3 -0
- package/dist/icons/UnitFeet.js +22 -0
- package/dist/icons/UnitInch.d.ts +3 -0
- package/dist/icons/UnitInch.js +22 -0
- package/dist/icons/UnitMeter.d.ts +3 -0
- package/dist/icons/UnitMeter.js +21 -0
- package/dist/icons/Window.js +4 -4
- package/dist/icons/index.js +28 -0
- package/dist/index.d.ts +17 -2
- package/dist/index.js +35 -5
- package/dist/store/attributes.d.ts +4 -3
- package/dist/store/attributes.js +1 -1
- package/dist/store/index.d.ts +43 -12
- package/dist/store/index.js +3 -1
- package/dist/store/price.d.ts +1 -1
- package/dist/store/price.js +1 -1
- package/dist/store/product.d.ts +2 -2
- package/dist/store/product.js +5 -8
- package/dist/store/spaces.d.ts +74 -0
- package/dist/store/spaces.js +354 -0
- package/dist/store/translations.d.ts +1 -1
- package/dist/store/translations.js +1 -1
- package/dist/store/treble.d.ts +2 -2
- package/dist/store/treble.js +15 -22
- package/dist/store/wishlist.d.ts +4 -22
- package/dist/store/wishlist.js +1 -1
- package/dist/types.d.ts +20 -18
- package/dist/types.js +9 -9
- package/dist/utils.d.ts +2 -2
- package/dist/utils.js +3 -3
- package/package.json +1 -1
- package/dist/hooks/useRoomBuilder/RoomBuilderState.d.ts +0 -95
- package/dist/hooks/useRoomBuilder/RoomBuilderState.js +0 -1237
- package/dist/hooks/useRoomBuilder/constants.d.ts +0 -41
- package/dist/hooks/useRoomBuilder/constants.js +0 -48
- package/dist/hooks/useRoomBuilder/dataHandlers.d.ts +0 -18
- package/dist/hooks/useRoomBuilder/dataHandlers.js +0 -187
- package/dist/hooks/useRoomBuilder/draw.d.ts +0 -55
- package/dist/hooks/useRoomBuilder/draw.js +0 -573
- package/dist/hooks/useRoomBuilder/findLoops.d.ts +0 -5
- package/dist/hooks/useRoomBuilder/geometry.d.ts +0 -33
- package/dist/hooks/useRoomBuilder/geometry.js +0 -325
- package/dist/hooks/useRoomBuilder/index.d.ts +0 -40
- package/dist/hooks/useRoomBuilder/index.js +0 -303
- package/dist/hooks/useRoomBuilder/themes.js +0 -273
- package/dist/hooks/useRoomBuilder/types.d.ts +0 -238
- package/dist/hooks/useRoomBuilder/types.js +0 -36
- package/dist/hooks/useRoomBuilder/validators.d.ts +0 -36
- package/dist/hooks/useRoomBuilder/validators.js +0 -362
- /package/dist/hooks/{useRoomBuilder → useSpaces/validators}/messaging.d.ts +0 -0
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
|
|
1
|
+
/// <reference types="react" />
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
3
|
interface IPrice {
|
|
4
4
|
price?: string;
|
|
5
5
|
className?: string;
|
|
6
6
|
}
|
|
7
7
|
export declare const TotalPriceComponent: {
|
|
8
|
-
(props: IPrice):
|
|
8
|
+
(props: IPrice): JSX.Element;
|
|
9
9
|
propTypes: {
|
|
10
10
|
price: PropTypes.Requireable<string>;
|
|
11
11
|
className: PropTypes.Requireable<string>;
|
|
@@ -15,5 +15,5 @@ export declare const TotalPriceComponent: {
|
|
|
15
15
|
className: string;
|
|
16
16
|
};
|
|
17
17
|
};
|
|
18
|
-
export declare const TotalPrice: (props: IPrice) =>
|
|
18
|
+
export declare const TotalPrice: (props: IPrice) => JSX.Element | null;
|
|
19
19
|
export default TotalPrice;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
|
|
1
|
+
/// <reference types="react" />
|
|
2
2
|
import { ThreekitProviderProps } from '../ThreekitProvider';
|
|
3
3
|
interface TrebleAppProps extends Omit<ThreekitProviderProps, 'children'> {
|
|
4
4
|
productId?: string;
|
|
5
5
|
}
|
|
6
|
-
export declare const Products: () =>
|
|
7
|
-
export default function TrebleApp(props: TrebleAppProps):
|
|
6
|
+
export declare const Products: () => JSX.Element | null;
|
|
7
|
+
export default function TrebleApp(props: TrebleAppProps): JSX.Element | null;
|
|
8
8
|
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 (
|
|
17
|
+
while (_) 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,13 +1,13 @@
|
|
|
1
|
-
|
|
1
|
+
/// <reference types="react" />
|
|
2
2
|
import { ATTRIBUTE_TYPES } from '../../types';
|
|
3
3
|
import { IFormComponentProps, IOptionShared } from '../containers/formInputContainer';
|
|
4
4
|
export interface IUpload extends Pick<IFormComponentProps<IOptionShared>, 'title' | 'description' | 'className' | 'value'> {
|
|
5
5
|
onChange: (file: File | undefined) => Promise<void>;
|
|
6
6
|
}
|
|
7
7
|
export declare const Upload: {
|
|
8
|
-
(props: IUpload):
|
|
8
|
+
(props: IUpload): JSX.Element;
|
|
9
9
|
componentName: string;
|
|
10
10
|
compatibleAttributes: Set<ATTRIBUTE_TYPES>;
|
|
11
11
|
};
|
|
12
|
-
declare const _default: (props: IUpload) =>
|
|
12
|
+
declare const _default: (props: IUpload) => JSX.Element | null;
|
|
13
13
|
export default _default;
|
|
@@ -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 (
|
|
40
|
+
while (_) 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,13 +1,13 @@
|
|
|
1
|
-
|
|
1
|
+
/// <reference types="react" />
|
|
2
2
|
import { ATTRIBUTE_TYPES } from '../../types';
|
|
3
3
|
import { IFormComponentProps, IOptionShared } from '../containers/formInputContainer';
|
|
4
4
|
export interface IUpload extends Pick<IFormComponentProps<IOptionShared>, 'title' | 'description' | 'className' | 'value'> {
|
|
5
5
|
onChange: (file: File) => Promise<void>;
|
|
6
6
|
}
|
|
7
7
|
export declare const UploadArea: {
|
|
8
|
-
(props: IUpload):
|
|
8
|
+
(props: IUpload): JSX.Element;
|
|
9
9
|
componentName: string;
|
|
10
10
|
compatibleAttributes: Set<ATTRIBUTE_TYPES>;
|
|
11
11
|
};
|
|
12
|
-
declare const _default: (props: IUpload) =>
|
|
12
|
+
declare const _default: (props: IUpload) => JSX.Element | null;
|
|
13
13
|
export default _default;
|
|
@@ -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 (
|
|
40
|
+
while (_) 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
|
-
|
|
1
|
+
/// <reference types="react" />
|
|
2
2
|
import { IMetadata } from '../../types';
|
|
3
3
|
interface WishlistItemProps {
|
|
4
4
|
thumbnail?: string;
|
|
@@ -7,5 +7,5 @@ interface WishlistItemProps {
|
|
|
7
7
|
onShare: () => void;
|
|
8
8
|
onDelete: () => void;
|
|
9
9
|
}
|
|
10
|
-
export declare const WishlistItem: (props: WishlistItemProps) =>
|
|
10
|
+
export declare const WishlistItem: (props: WishlistItemProps) => JSX.Element;
|
|
11
11
|
export default WishlistItem;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
/// <reference types="react" />
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
3
|
import { BUTTON_SHAPES, BUTTON_TYPES } from '../Button';
|
|
4
4
|
interface WidgetButtonProps {
|
|
@@ -14,10 +14,10 @@ interface WishlistProps {
|
|
|
14
14
|
shape?: BUTTON_SHAPES;
|
|
15
15
|
className?: string;
|
|
16
16
|
}
|
|
17
|
-
export declare const AddWishlistButton: (props: WidgetButtonProps) =>
|
|
18
|
-
export declare const WishlistButton: (props: WidgetButtonProps) =>
|
|
17
|
+
export declare const AddWishlistButton: (props: WidgetButtonProps) => JSX.Element;
|
|
18
|
+
export declare const WishlistButton: (props: WidgetButtonProps) => JSX.Element;
|
|
19
19
|
export declare const Wishlist: {
|
|
20
|
-
(props: WishlistProps):
|
|
20
|
+
(props: WishlistProps): JSX.Element | null;
|
|
21
21
|
propTypes: {
|
|
22
22
|
className: PropTypes.Requireable<string>;
|
|
23
23
|
};
|
|
@@ -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 (
|
|
40
|
+
while (_) 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
|
-
|
|
1
|
+
/// <reference types="react" />
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
3
|
import { BUTTON_SHAPES, BUTTON_TYPES } from '../Button';
|
|
4
4
|
interface ZoomComponentProps {
|
|
@@ -10,10 +10,10 @@ interface ZoomComponentProps {
|
|
|
10
10
|
interface ZoomProps extends ZoomComponentProps {
|
|
11
11
|
orientation?: string;
|
|
12
12
|
}
|
|
13
|
-
export declare const ZoomOutComponent: (props: ZoomComponentProps) =>
|
|
14
|
-
export declare const ZoomInComponent: (props: ZoomComponentProps) =>
|
|
13
|
+
export declare const ZoomOutComponent: (props: ZoomComponentProps) => JSX.Element | null;
|
|
14
|
+
export declare const ZoomInComponent: (props: ZoomComponentProps) => JSX.Element | null;
|
|
15
15
|
export declare const Zoom: {
|
|
16
|
-
(props: ZoomProps):
|
|
16
|
+
(props: ZoomProps): JSX.Element;
|
|
17
17
|
propTypes: {
|
|
18
18
|
step: PropTypes.Requireable<number>;
|
|
19
19
|
orientation: PropTypes.Requireable<string>;
|
|
@@ -30,7 +30,7 @@ export declare const Zoom: {
|
|
|
30
30
|
};
|
|
31
31
|
componentName: string;
|
|
32
32
|
Icon: import("../../icons/types").IIcon;
|
|
33
|
-
ZoomOut: (props: ZoomComponentProps) =>
|
|
34
|
-
ZoomIn: (props: ZoomComponentProps) =>
|
|
33
|
+
ZoomOut: (props: ZoomComponentProps) => JSX.Element | null;
|
|
34
|
+
ZoomIn: (props: ZoomComponentProps) => JSX.Element | null;
|
|
35
35
|
};
|
|
36
36
|
export default Zoom;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { FunctionComponent } from 'react';
|
|
2
2
|
import { RawAttributeValue } from '../../hooks/useAttribute';
|
|
3
3
|
import { IHydratedAttribute, IHydratedAttributeAssetValue } from '../../types';
|
|
4
4
|
export interface IOptionShared {
|
|
@@ -50,5 +50,5 @@ export declare const hydrateAttributeForComponent: (attribute: IHydratedAttribut
|
|
|
50
50
|
value: string;
|
|
51
51
|
}[] | IHydratedAttributeAssetValue[] | undefined;
|
|
52
52
|
};
|
|
53
|
-
declare function formComponentContainer<P extends IFormContainerProps>(FormComponent: IFormComponent<Omit<P, 'options'>>): (props: P) =>
|
|
53
|
+
declare function formComponentContainer<P extends IFormContainerProps>(FormComponent: IFormComponent<Omit<P, 'options'>>): (props: P) => JSX.Element | null;
|
|
54
54
|
export default formComponentContainer;
|
|
@@ -4,21 +4,21 @@ export declare const FORM_COMPONENT_TYPES: {
|
|
|
4
4
|
};
|
|
5
5
|
export declare const formComponents: {
|
|
6
6
|
[x: string]: {
|
|
7
|
-
[x: string]: ((props: import("./Cards").ICards) =>
|
|
7
|
+
[x: string]: ((props: import("./Cards").ICards) => JSX.Element | null) | ((props: import("./TextInput").ITextInput) => JSX.Element | null) | ((props: import("./Tiles").ITiles) => JSX.Element | null);
|
|
8
8
|
} | {
|
|
9
|
-
[x: string]: (props: import("./Upload").IUpload) =>
|
|
9
|
+
[x: string]: (props: import("./Upload").IUpload) => JSX.Element | null;
|
|
10
10
|
};
|
|
11
11
|
Asset: {
|
|
12
|
-
[x: string]: ((props: import("./Cards").ICards) =>
|
|
12
|
+
[x: string]: ((props: import("./Cards").ICards) => JSX.Element | null) | ((props: import("./Tiles").ITiles) => JSX.Element | null);
|
|
13
13
|
};
|
|
14
14
|
String: {
|
|
15
|
-
[x: string]: ((props: import("./Cards").ICards) =>
|
|
15
|
+
[x: string]: ((props: import("./Cards").ICards) => JSX.Element | null) | ((props: import("./TextInput").ITextInput) => JSX.Element | null) | ((props: import("./Tiles").ITiles) => JSX.Element | null);
|
|
16
16
|
};
|
|
17
17
|
upload: {
|
|
18
|
-
[x: string]: (props: import("./Upload").IUpload) =>
|
|
18
|
+
[x: string]: (props: import("./Upload").IUpload) => JSX.Element | null;
|
|
19
19
|
};
|
|
20
20
|
Boolean: {
|
|
21
|
-
[x: string]: (props: import("./Switch").ISwitch) =>
|
|
21
|
+
[x: string]: (props: import("./Switch").ISwitch) => JSX.Element | null;
|
|
22
22
|
};
|
|
23
23
|
};
|
|
24
24
|
export default formComponents;
|
|
@@ -10,7 +10,7 @@ interface MessageComponentProps {
|
|
|
10
10
|
icon: string;
|
|
11
11
|
}
|
|
12
12
|
export declare const MessageComponent: {
|
|
13
|
-
(props: MessageComponentProps):
|
|
13
|
+
(props: MessageComponentProps): JSX.Element | null;
|
|
14
14
|
propTypes: {
|
|
15
15
|
content: PropTypes.Requireable<string>;
|
|
16
16
|
icon: PropTypes.Requireable<string>;
|
package/dist/constants.d.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
export declare const TREBLE_DEBUG: boolean;
|
|
2
2
|
export declare const DEFAULT_CLASS_NAME = "threekit-react";
|
|
3
3
|
export declare const CLASS_NAME_PREFIX = "tk";
|
|
4
|
-
export declare const INPUT_COMPONENT_CLASS_NAME
|
|
5
|
-
export declare const WIDGET_CLASS_NAME
|
|
6
|
-
export declare const LAYOUT_CLASS_NAME
|
|
7
|
-
export declare const TOOL_CLASS_NAME
|
|
8
|
-
export declare const DISPLAY_CLASS_NAME
|
|
9
|
-
export declare const FORM_CLASS_NAME
|
|
4
|
+
export declare const INPUT_COMPONENT_CLASS_NAME: string;
|
|
5
|
+
export declare const WIDGET_CLASS_NAME: string;
|
|
6
|
+
export declare const LAYOUT_CLASS_NAME: string;
|
|
7
|
+
export declare const TOOL_CLASS_NAME: string;
|
|
8
|
+
export declare const DISPLAY_CLASS_NAME: string;
|
|
9
|
+
export declare const FORM_CLASS_NAME: string;
|
|
10
10
|
export declare const IS_TREBLE_SCRIPTS: boolean;
|
|
11
11
|
export declare const TK_PRODUCT_ID_PARAM_KEY = "tkProduct";
|
|
12
12
|
export declare const TK_SAVED_CONFIG_PARAM_KEY = "tkConfigId";
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { IHydratedAttribute, IConfigurationColor } from '../../types';
|
|
2
|
-
export type RawAttributeValue = string | number | boolean | IConfigurationColor | File | undefined;
|
|
3
|
-
type UseAttributeError = [undefined, undefined];
|
|
4
|
-
type UseAttributeSuccess = [
|
|
2
|
+
export declare type RawAttributeValue = string | number | boolean | IConfigurationColor | File | undefined;
|
|
3
|
+
declare type UseAttributeError = [undefined, undefined];
|
|
4
|
+
declare type UseAttributeSuccess = [
|
|
5
5
|
IHydratedAttribute,
|
|
6
6
|
(val: RawAttributeValue) => Promise<void>
|
|
7
7
|
];
|
|
8
|
-
type UseAttributeHook = UseAttributeError | UseAttributeSuccess;
|
|
8
|
+
declare 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 (
|
|
17
|
+
while (_) 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 (
|
|
17
|
+
while (_) 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
|
-
type UseConfiguratorError = [undefined, undefined];
|
|
3
|
-
type UseConfiguratorSuccess = [
|
|
2
|
+
declare type UseConfiguratorError = [undefined, undefined];
|
|
3
|
+
declare type UseConfiguratorSuccess = [
|
|
4
4
|
Record<string, IHydratedAttribute>,
|
|
5
5
|
(configuration: ISetConfiguration) => void
|
|
6
6
|
];
|
|
7
|
-
type UseConfiguratorHook = UseConfiguratorError | UseConfiguratorSuccess;
|
|
7
|
+
declare type UseConfiguratorHook = UseConfiguratorError | UseConfiguratorSuccess;
|
|
8
8
|
declare const useConfigurator: () => UseConfiguratorHook;
|
|
9
9
|
export default useConfigurator;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { IHydratedAttribute, IMetadata, ISetConfiguration } from '../../types';
|
|
2
|
-
type UseNestedConfiguratorError = [undefined, undefined, undefined, undefined];
|
|
3
|
-
type UseNestedConfiguratorSuccess = [
|
|
2
|
+
declare type UseNestedConfiguratorError = [undefined, undefined, undefined, undefined];
|
|
3
|
+
declare 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 (
|
|
17
|
+
while (_) 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();
|
|
@@ -90,7 +89,7 @@ var useNestedConfigurator = function (address) {
|
|
|
90
89
|
var _a;
|
|
91
90
|
return Object.assign(output, (_a = {}, _a[attr.name] = attr, _a));
|
|
92
91
|
}, {});
|
|
93
|
-
var preppedAttributes = (0, utils_1.hydrateAttribute)([attributeObj, translations], handleSelect);
|
|
92
|
+
var preppedAttributes = (0, utils_1.hydrateAttribute)([attributeObj, translations], handleSelect, configurator.current.getResolvedConfiguration());
|
|
94
93
|
var price = priceConfig
|
|
95
94
|
? configurator.current.getPrice(priceConfig.id, priceConfig.currency)
|
|
96
95
|
: undefined;
|
|
@@ -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 (
|
|
17
|
+
while (_) 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 (
|
|
17
|
+
while (_) 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 (
|
|
17
|
+
while (_) 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 (
|
|
28
|
+
while (_) 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;
|