@threekit-tools/treble 0.0.92 → 0.0.94
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.js +4 -3
- package/dist/Treble/snapshots.d.ts +2 -2
- package/dist/Treble/snapshots.js +1 -1
- package/dist/Treble/wishlist.d.ts +1 -1
- package/dist/Treble/wishlist.js +1 -1
- package/dist/api/assets.d.ts +1 -0
- package/dist/api/{products.js → assets.js} +12 -33
- package/dist/api/catalog.js +1 -1
- package/dist/api/configurations.d.ts +1 -0
- package/dist/api/configurations.js +10 -3
- package/dist/api/datatables.js +1 -1
- package/dist/api/index.d.ts +2 -2
- package/dist/api/index.js +2 -2
- 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 +6 -3
- package/dist/components/ThreekitProvider/index.js +27 -2
- 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/TrebleApp/index.js +5 -0
- 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 +3 -3
- package/dist/hooks/useConfigurationLoader/index.js +1 -1
- package/dist/hooks/useConfigurator/index.d.ts +3 -3
- package/dist/hooks/useConfigurator/index.js +3 -5
- 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 -3
- 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/useRoomBuilder/RoomBuilderState.js +1 -1
- package/dist/hooks/useRoomBuilder/constants.js +2 -2
- package/dist/hooks/useRoomBuilder/themes.js +1 -1
- package/dist/hooks/useRoomBuilder/types.d.ts +7 -7
- package/dist/hooks/useRoomBuilder/types.js +5 -5
- package/dist/hooks/useRoomBuilder/validators.d.ts +1 -1
- package/dist/hooks/useShare/index.d.ts +1 -1
- package/dist/hooks/useShare/index.js +4 -2
- package/dist/hooks/useSingleAnimation/index.js +1 -1
- package/dist/hooks/useSnapshot/index.d.ts +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 +2 -0
- package/dist/http/assets.js +16 -0
- package/dist/http/index.d.ts +2 -2
- package/dist/http/index.js +2 -2
- package/dist/http/orders.d.ts +1 -1
- package/dist/icons/Spinner.d.ts +2 -2
- package/dist/store/attributes.d.ts +4 -4
- package/dist/store/attributes.js +2 -4
- package/dist/store/index.d.ts +6 -6
- 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 +1 -1
- package/dist/store/translations.d.ts +10 -8
- package/dist/store/translations.js +39 -19
- package/dist/store/treble.d.ts +1 -1
- package/dist/store/treble.js +1 -1
- package/dist/store/wishlist.d.ts +2 -2
- package/dist/store/wishlist.js +1 -1
- package/dist/types.d.ts +19 -17
- package/dist/types.js +9 -9
- package/dist/utils.d.ts +2 -6
- package/dist/utils.js +12 -13
- package/package.json +1 -2
- package/dist/Treble/snapshot.d.ts +0 -22
- package/dist/Treble/snapshot.js +0 -247
- package/dist/api/products.d.ts +0 -4
- package/dist/hooks/useSpaces/SpacesLayout.d.ts +0 -11
- package/dist/hooks/useSpaces/SpacesLayout.js +0 -74
- package/dist/hooks/useSpaces/SpacesState.d.ts +0 -164
- package/dist/hooks/useSpaces/SpacesState.js +0 -1751
- package/dist/hooks/useSpaces/constants.d.ts +0 -64
- package/dist/hooks/useSpaces/constants.js +0 -109
- package/dist/hooks/useSpaces/dataHandlers.d.ts +0 -20
- package/dist/hooks/useSpaces/dataHandlers.js +0 -254
- package/dist/hooks/useSpaces/draw/clearCanvas.d.ts +0 -2
- package/dist/hooks/useSpaces/draw/clearCanvas.js +0 -9
- package/dist/hooks/useSpaces/draw/drawBackground.d.ts +0 -2
- package/dist/hooks/useSpaces/draw/drawBackground.js +0 -12
- package/dist/hooks/useSpaces/draw/drawDimensions.d.ts +0 -3
- package/dist/hooks/useSpaces/draw/drawDimensions.js +0 -53
- package/dist/hooks/useSpaces/draw/drawDoors.d.ts +0 -9
- package/dist/hooks/useSpaces/draw/drawDoors.js +0 -99
- package/dist/hooks/useSpaces/draw/drawFloor.d.ts +0 -3
- package/dist/hooks/useSpaces/draw/drawFloor.js +0 -36
- package/dist/hooks/useSpaces/draw/drawGrid.d.ts +0 -3
- package/dist/hooks/useSpaces/draw/drawGrid.js +0 -33
- package/dist/hooks/useSpaces/draw/drawGuides.d.ts +0 -3
- package/dist/hooks/useSpaces/draw/drawGuides.js +0 -23
- package/dist/hooks/useSpaces/draw/drawOpenings.d.ts +0 -9
- package/dist/hooks/useSpaces/draw/drawOpenings.js +0 -72
- package/dist/hooks/useSpaces/draw/drawVertices.d.ts +0 -8
- package/dist/hooks/useSpaces/draw/drawVertices.js +0 -61
- package/dist/hooks/useSpaces/draw/drawWalls.d.ts +0 -10
- package/dist/hooks/useSpaces/draw/drawWalls.js +0 -88
- package/dist/hooks/useSpaces/draw/drawWindows.d.ts +0 -9
- package/dist/hooks/useSpaces/draw/drawWindows.js +0 -82
- package/dist/hooks/useSpaces/draw/index.d.ts +0 -11
- package/dist/hooks/useSpaces/draw/index.js +0 -129
- package/dist/hooks/useSpaces/geometry/addThicknessToLine.d.ts +0 -3
- package/dist/hooks/useSpaces/geometry/addThicknessToLine.js +0 -13
- package/dist/hooks/useSpaces/geometry/areLinesEqual.d.ts +0 -3
- package/dist/hooks/useSpaces/geometry/areLinesEqual.js +0 -17
- package/dist/hooks/useSpaces/geometry/arePointsEqual.d.ts +0 -3
- package/dist/hooks/useSpaces/geometry/arePointsEqual.js +0 -8
- package/dist/hooks/useSpaces/geometry/arePointsWithinProximity.d.ts +0 -3
- package/dist/hooks/useSpaces/geometry/arePointsWithinProximity.js +0 -11
- package/dist/hooks/useSpaces/geometry/closestPointOnLine.d.ts +0 -3
- package/dist/hooks/useSpaces/geometry/closestPointOnLine.js +0 -13
- package/dist/hooks/useSpaces/geometry/doLinesOverlap.d.ts +0 -2
- package/dist/hooks/useSpaces/geometry/doLinesOverlap.js +0 -16
- package/dist/hooks/useSpaces/geometry/euclideanMod.d.ts +0 -2
- package/dist/hooks/useSpaces/geometry/euclideanMod.js +0 -6
- package/dist/hooks/useSpaces/geometry/findLoops.d.ts +0 -6
- package/dist/hooks/useSpaces/geometry/findLoops.js +0 -117
- package/dist/hooks/useSpaces/geometry/getAllLineIntersections.d.ts +0 -6
- package/dist/hooks/useSpaces/geometry/getAllLineIntersections.js +0 -23
- package/dist/hooks/useSpaces/geometry/getAngleOfLineSegment.d.ts +0 -3
- package/dist/hooks/useSpaces/geometry/getAngleOfLineSegment.js +0 -7
- package/dist/hooks/useSpaces/geometry/getClosestPointOnLineSegment.d.ts +0 -3
- package/dist/hooks/useSpaces/geometry/getClosestPointOnLineSegment.js +0 -17
- package/dist/hooks/useSpaces/geometry/getDistanceToLine.d.ts +0 -3
- package/dist/hooks/useSpaces/geometry/getDistanceToLine.js +0 -10
- package/dist/hooks/useSpaces/geometry/getLengthOfLineSegment.d.ts +0 -3
- package/dist/hooks/useSpaces/geometry/getLengthOfLineSegment.js +0 -7
- package/dist/hooks/useSpaces/geometry/getLineAtOffsetOnLineSegment.d.ts +0 -3
- package/dist/hooks/useSpaces/geometry/getLineAtOffsetOnLineSegment.js +0 -17
- package/dist/hooks/useSpaces/geometry/getLineOtherPoint.d.ts +0 -3
- package/dist/hooks/useSpaces/geometry/getLineOtherPoint.js +0 -11
- package/dist/hooks/useSpaces/geometry/getLineSegmentsIntersection.d.ts +0 -3
- package/dist/hooks/useSpaces/geometry/getLineSegmentsIntersection.js +0 -43
- package/dist/hooks/useSpaces/geometry/getMidpointOfLineSegment.d.ts +0 -3
- package/dist/hooks/useSpaces/geometry/getMidpointOfLineSegment.js +0 -9
- package/dist/hooks/useSpaces/geometry/getParallelLineSegmentAtDistance.d.ts +0 -3
- package/dist/hooks/useSpaces/geometry/getParallelLineSegmentAtDistance.js +0 -20
- package/dist/hooks/useSpaces/geometry/getPointAtOffsetOnLineSegment.d.ts +0 -3
- package/dist/hooks/useSpaces/geometry/getPointAtOffsetOnLineSegment.js +0 -11
- package/dist/hooks/useSpaces/geometry/getPolygonArea.d.ts +0 -3
- package/dist/hooks/useSpaces/geometry/getPolygonArea.js +0 -15
- package/dist/hooks/useSpaces/geometry/getQuadrilateralArea.d.ts +0 -3
- package/dist/hooks/useSpaces/geometry/getQuadrilateralArea.js +0 -16
- package/dist/hooks/useSpaces/geometry/getTangetIntersectionAndOffset.d.ts +0 -6
- package/dist/hooks/useSpaces/geometry/getTangetIntersectionAndOffset.js +0 -17
- package/dist/hooks/useSpaces/geometry/getTriangleArea.d.ts +0 -3
- package/dist/hooks/useSpaces/geometry/getTriangleArea.js +0 -9
- package/dist/hooks/useSpaces/geometry/getUnitVectorOfLineSegment.d.ts +0 -3
- package/dist/hooks/useSpaces/geometry/getUnitVectorOfLineSegment.js +0 -12
- package/dist/hooks/useSpaces/geometry/index.d.ts +0 -30
- package/dist/hooks/useSpaces/geometry/index.js +0 -64
- package/dist/hooks/useSpaces/geometry/isPointInPolygon.d.ts +0 -3
- package/dist/hooks/useSpaces/geometry/isPointInPolygon.js +0 -21
- package/dist/hooks/useSpaces/geometry/isPointInQuadrilateral.d.ts +0 -3
- package/dist/hooks/useSpaces/geometry/isPointInQuadrilateral.js +0 -25
- package/dist/hooks/useSpaces/geometry/orderCoordinatesOnLineSegment.d.ts +0 -3
- package/dist/hooks/useSpaces/geometry/orderCoordinatesOnLineSegment.js +0 -11
- package/dist/hooks/useSpaces/geometry/splitLineAtOffset.d.ts +0 -3
- package/dist/hooks/useSpaces/geometry/splitLineAtOffset.js +0 -12
- package/dist/hooks/useSpaces/geometry/splitLineAtPoint.d.ts +0 -3
- package/dist/hooks/useSpaces/geometry/splitLineAtPoint.js +0 -9
- package/dist/hooks/useSpaces/geometry/splitLineAtPoints.d.ts +0 -3
- package/dist/hooks/useSpaces/geometry/splitLineAtPoints.js +0 -28
- package/dist/hooks/useSpaces/index.d.ts +0 -82
- package/dist/hooks/useSpaces/index.js +0 -482
- package/dist/hooks/useSpaces/themes/blueprint.d.ts +0 -3
- package/dist/hooks/useSpaces/themes/blueprint.js +0 -96
- package/dist/hooks/useSpaces/themes/default.d.ts +0 -3
- package/dist/hooks/useSpaces/themes/default.js +0 -96
- package/dist/hooks/useSpaces/themes/index.d.ts +0 -11
- package/dist/hooks/useSpaces/themes/index.js +0 -21
- package/dist/hooks/useSpaces/themes/light.d.ts +0 -3
- package/dist/hooks/useSpaces/themes/light.js +0 -96
- package/dist/hooks/useSpaces/types.d.ts +0 -339
- package/dist/hooks/useSpaces/types.js +0 -54
- package/dist/hooks/useSpaces/validators/areWallsDuplicated.d.ts +0 -3
- package/dist/hooks/useSpaces/validators/areWallsDuplicated.js +0 -61
- package/dist/hooks/useSpaces/validators/areWallsIntersecting.d.ts +0 -3
- package/dist/hooks/useSpaces/validators/areWallsIntersecting.js +0 -42
- package/dist/hooks/useSpaces/validators/areWallsOrphaningFeatures.d.ts +0 -3
- package/dist/hooks/useSpaces/validators/areWallsOrphaningFeatures.js +0 -52
- package/dist/hooks/useSpaces/validators/areWallsTooShort.d.ts +0 -3
- package/dist/hooks/useSpaces/validators/areWallsTooShort.js +0 -37
- package/dist/hooks/useSpaces/validators/index.d.ts +0 -15
- package/dist/hooks/useSpaces/validators/index.js +0 -40
- package/dist/hooks/useSpaces/validators/isFeatureCollidingWithExistingFeature.d.ts +0 -3
- package/dist/hooks/useSpaces/validators/isFeatureCollidingWithExistingFeature.js +0 -31
- package/dist/hooks/useSpaces/validators/isFeatureOutsideWallBounds.d.ts +0 -3
- package/dist/hooks/useSpaces/validators/isFeatureOutsideWallBounds.js +0 -19
- package/dist/hooks/useSpaces/validators/isLineTooShort.d.ts +0 -3
- package/dist/hooks/useSpaces/validators/isLineTooShort.js +0 -26
- package/dist/hooks/useSpaces/validators/isVertexLandingOnFeature.d.ts +0 -4
- package/dist/hooks/useSpaces/validators/isVertexLandingOnFeature.js +0 -19
- package/dist/hooks/useSpaces/validators/isWallEndingOnFeature.d.ts +0 -3
- package/dist/hooks/useSpaces/validators/isWallEndingOnFeature.js +0 -19
- package/dist/hooks/useSpaces/validators/isWallIntersectingFeature.d.ts +0 -3
- package/dist/hooks/useSpaces/validators/isWallIntersectingFeature.js +0 -41
- package/dist/hooks/useSpaces/validators/isWallOverlappingExisitingWalls.d.ts +0 -3
- package/dist/hooks/useSpaces/validators/isWallOverlappingExisitingWalls.js +0 -54
- package/dist/hooks/useSpaces/validators/isWallTooShort.d.ts +0 -3
- package/dist/hooks/useSpaces/validators/isWallTooShort.js +0 -10
- package/dist/hooks/useSpaces/validators/messaging.d.ts +0 -8
- package/dist/hooks/useSpaces/validators/messaging.js +0 -18
- package/dist/http/products.d.ts +0 -1
- package/dist/http/products.js +0 -12
- package/dist/icons/AngleSnapping.d.ts +0 -3
- package/dist/icons/AngleSnapping.js +0 -28
- package/dist/icons/Center.d.ts +0 -3
- package/dist/icons/Center.js +0 -24
- package/dist/icons/GridSnapping.d.ts +0 -3
- package/dist/icons/GridSnapping.js +0 -28
- package/dist/icons/LayoutAlt.d.ts +0 -3
- package/dist/icons/LayoutAlt.js +0 -21
- package/dist/icons/Magnet.d.ts +0 -3
- package/dist/icons/Magnet.js +0 -27
- package/dist/icons/Player3D.d.ts +0 -3
- package/dist/icons/Player3D.js +0 -21
- package/dist/icons/Ruler copy.d.ts +0 -3
- package/dist/icons/Ruler copy.js +0 -22
- package/dist/icons/RulerBlank.d.ts +0 -3
- package/dist/icons/RulerBlank.js +0 -25
- package/dist/icons/RulerDetailed copy.d.ts +0 -3
- package/dist/icons/RulerDetailed copy.js +0 -27
- package/dist/icons/RulerDetailed.d.ts +0 -3
- package/dist/icons/RulerDetailed.js +0 -27
- package/dist/icons/Save.d.ts +0 -3
- package/dist/icons/Save.js +0 -21
- package/dist/icons/UnitCm.d.ts +0 -3
- package/dist/icons/UnitCm.js +0 -22
- package/dist/icons/UnitFeet.d.ts +0 -3
- package/dist/icons/UnitFeet.js +0 -22
- package/dist/icons/UnitInch.d.ts +0 -3
- package/dist/icons/UnitInch.js +0 -22
- package/dist/icons/UnitMeter.d.ts +0 -3
- package/dist/icons/UnitMeter.js +0 -21
- package/dist/store/spaces.d.ts +0 -47
- package/dist/store/spaces.js +0 -197
|
@@ -1,482 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __assign = (this && this.__assign) || function () {
|
|
3
|
-
__assign = Object.assign || function(t) {
|
|
4
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
-
s = arguments[i];
|
|
6
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
-
t[p] = s[p];
|
|
8
|
-
}
|
|
9
|
-
return t;
|
|
10
|
-
};
|
|
11
|
-
return __assign.apply(this, arguments);
|
|
12
|
-
};
|
|
13
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
14
|
-
if (k2 === undefined) k2 = k;
|
|
15
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
16
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
17
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
18
|
-
}
|
|
19
|
-
Object.defineProperty(o, k2, desc);
|
|
20
|
-
}) : (function(o, m, k, k2) {
|
|
21
|
-
if (k2 === undefined) k2 = k;
|
|
22
|
-
o[k2] = m[k];
|
|
23
|
-
}));
|
|
24
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
25
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
26
|
-
}) : function(o, v) {
|
|
27
|
-
o["default"] = v;
|
|
28
|
-
});
|
|
29
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
30
|
-
if (mod && mod.__esModule) return mod;
|
|
31
|
-
var result = {};
|
|
32
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
33
|
-
__setModuleDefault(result, mod);
|
|
34
|
-
return result;
|
|
35
|
-
};
|
|
36
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
37
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
38
|
-
};
|
|
39
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
40
|
-
var react_1 = require("react");
|
|
41
|
-
var types_1 = require("./types");
|
|
42
|
-
var types_2 = require("./types");
|
|
43
|
-
var useConfigurator_1 = __importDefault(require("../useConfigurator"));
|
|
44
|
-
var SpacesState_1 = __importDefault(require("./SpacesState"));
|
|
45
|
-
var constants_1 = require("./constants");
|
|
46
|
-
var themes_1 = __importStar(require("./themes"));
|
|
47
|
-
var SpacesLayout_1 = __importDefault(require("./SpacesLayout"));
|
|
48
|
-
var store_1 = require("../../store");
|
|
49
|
-
var spaces_1 = require("../../store/spaces");
|
|
50
|
-
var useThreekitInitStatus_1 = __importDefault(require("../useThreekitInitStatus"));
|
|
51
|
-
var useSpaces = function (props) {
|
|
52
|
-
var _a;
|
|
53
|
-
var attributesState = (0, useConfigurator_1.default)()[0];
|
|
54
|
-
var hasLoaded = (0, useThreekitInitStatus_1.default)();
|
|
55
|
-
var dispatch = (0, store_1.useThreekitDispatch)();
|
|
56
|
-
var layouts = (0, store_1.useThreekitSelector)(spaces_1.getLayouts);
|
|
57
|
-
var zoom = (0, store_1.useThreekitSelector)(spaces_1.getZoom);
|
|
58
|
-
var unit = (0, store_1.useThreekitSelector)(spaces_1.getUnit);
|
|
59
|
-
var translation = (0, store_1.useThreekitSelector)(spaces_1.getTranslation);
|
|
60
|
-
var modeValue = (0, store_1.useThreekitSelector)(spaces_1.getMode);
|
|
61
|
-
var showDimensions = (0, store_1.useThreekitSelector)(spaces_1.getShowDimensions);
|
|
62
|
-
var angleSnappingEnabled = (0, store_1.useThreekitSelector)(spaces_1.getAngleSnappingEnabled);
|
|
63
|
-
var guideSnappingEnabled = (0, store_1.useThreekitSelector)(spaces_1.getGuideSnappingEnabled);
|
|
64
|
-
var gridSnappingEnabled = (0, store_1.useThreekitSelector)(spaces_1.getGridSnappingEnabled);
|
|
65
|
-
var _b = (0, react_1.useState)(null), selectedElement = _b[0], setSelectedElement = _b[1];
|
|
66
|
-
var canvasRef = (0, react_1.useRef)(null);
|
|
67
|
-
var selectElementPending = (0, react_1.useRef)(null);
|
|
68
|
-
var translationAnchorRef = (0, react_1.useRef)(null);
|
|
69
|
-
var preppedConfig = Object.assign({
|
|
70
|
-
scale: constants_1.SCALE,
|
|
71
|
-
unit: types_2.IUnits.FEET,
|
|
72
|
-
snapProximity: constants_1.SNAP_PROXIMITY,
|
|
73
|
-
zoomDefault: zoom || constants_1.ZOOM_DEFAULT,
|
|
74
|
-
translateDefault: translation || constants_1.TRANSLATE_DEFAULT,
|
|
75
|
-
disableGuides: false,
|
|
76
|
-
styles: ((_a = props.config) === null || _a === void 0 ? void 0 : _a.theme) && themes_1.default[props.config.theme]
|
|
77
|
-
? themes_1.default[props.config.theme]
|
|
78
|
-
: themes_1.default[themes_1.IThemes.DEFAULT],
|
|
79
|
-
}, props.config);
|
|
80
|
-
var attributeNames = Object.assign(constants_1.ATTRIBUTE_NAME_DEFAULTS, props.attributes);
|
|
81
|
-
var spacesRef = (0, react_1.useRef)(new SpacesState_1.default(__assign(__assign({}, props), { config: preppedConfig, attributes: attributeNames })));
|
|
82
|
-
var drawSpaces = function () { return spacesRef.current.drawSpaces(canvasRef.current); };
|
|
83
|
-
(0, react_1.useEffect)(function () {
|
|
84
|
-
var attributesDelinked = JSON.parse(JSON.stringify(attributesState));
|
|
85
|
-
spacesRef.current.setAttributesToState(attributesDelinked);
|
|
86
|
-
drawSpaces();
|
|
87
|
-
}, [attributesState]);
|
|
88
|
-
(0, react_1.useEffect)(function () {
|
|
89
|
-
var _a;
|
|
90
|
-
var guidesEnabled = !(((_a = props.config) === null || _a === void 0 ? void 0 : _a.disableGuides) || false);
|
|
91
|
-
dispatch((0, spaces_1.setGuideSnappingEnabled)(guidesEnabled));
|
|
92
|
-
spacesRef.current.guideSnappingEnabled = guidesEnabled;
|
|
93
|
-
}, []);
|
|
94
|
-
(0, react_1.useEffect)(function () {
|
|
95
|
-
var _a;
|
|
96
|
-
if (zoom &&
|
|
97
|
-
((_a = props.config) === null || _a === void 0 ? void 0 : _a.zoomDefault) &&
|
|
98
|
-
props.config.zoomDefault >= spacesRef.current.zoomMin &&
|
|
99
|
-
spacesRef.current.zoomMax >= props.config.zoomDefault)
|
|
100
|
-
updateZoom(props.config.zoomDefault);
|
|
101
|
-
updateUnit(preppedConfig.unit);
|
|
102
|
-
}, []);
|
|
103
|
-
(0, react_1.useEffect)(function () {
|
|
104
|
-
var _a, _b;
|
|
105
|
-
if (canvasRef === null || canvasRef === void 0 ? void 0 : canvasRef.current) {
|
|
106
|
-
spacesRef.current.canvasDimensions = [
|
|
107
|
-
canvasRef.current.width,
|
|
108
|
-
canvasRef.current.height,
|
|
109
|
-
];
|
|
110
|
-
canvasRef.current.addEventListener('mousedown', handleDrawWallStart);
|
|
111
|
-
canvasRef.current.addEventListener('mousemove', handleDrawWallMouseMove);
|
|
112
|
-
document.addEventListener('mouseup', handleDrawWallFinish);
|
|
113
|
-
canvasRef.current.addEventListener('mousemove', handleHover);
|
|
114
|
-
canvasRef.current.addEventListener('mousedown', handleSelectElement);
|
|
115
|
-
canvasRef.current.addEventListener('mousemove', handleMoveSelectedElement);
|
|
116
|
-
if (!((_a = props.config) === null || _a === void 0 ? void 0 : _a.translateDisabled))
|
|
117
|
-
canvasRef.current.addEventListener('mousemove', handleMoveCanvas);
|
|
118
|
-
document.addEventListener('mouseup', handleSetSelectedElement);
|
|
119
|
-
if (!((_b = props.config) === null || _b === void 0 ? void 0 : _b.zoomDisabled))
|
|
120
|
-
canvasRef.current.addEventListener('wheel', handleScrollToZoom);
|
|
121
|
-
}
|
|
122
|
-
return function () {
|
|
123
|
-
var _a, _b;
|
|
124
|
-
if (canvasRef === null || canvasRef === void 0 ? void 0 : canvasRef.current) {
|
|
125
|
-
canvasRef.current.removeEventListener('mousedown', handleDrawWallStart);
|
|
126
|
-
canvasRef.current.removeEventListener('mousemove', handleDrawWallMouseMove);
|
|
127
|
-
document.removeEventListener('mouseup', handleDrawWallFinish);
|
|
128
|
-
canvasRef.current.removeEventListener('mousemove', handleHover);
|
|
129
|
-
canvasRef.current.removeEventListener('mousedown', handleSelectElement);
|
|
130
|
-
canvasRef.current.removeEventListener('mousemove', handleMoveSelectedElement);
|
|
131
|
-
if (!((_a = props.config) === null || _a === void 0 ? void 0 : _a.translateDisabled))
|
|
132
|
-
canvasRef.current.removeEventListener('mousemove', handleMoveCanvas);
|
|
133
|
-
document.removeEventListener('mouseup', handleSetSelectedElement);
|
|
134
|
-
if (!((_b = props.config) === null || _b === void 0 ? void 0 : _b.zoomDisabled))
|
|
135
|
-
canvasRef.current.removeEventListener('wheel', handleScrollToZoom);
|
|
136
|
-
}
|
|
137
|
-
};
|
|
138
|
-
});
|
|
139
|
-
(0, react_1.useEffect)(function () {
|
|
140
|
-
spacesRef.current.showDimensions = showDimensions;
|
|
141
|
-
spacesRef.current.angleSnappingEnabled = angleSnappingEnabled;
|
|
142
|
-
spacesRef.current.guideSnappingEnabled = guideSnappingEnabled;
|
|
143
|
-
spacesRef.current.gridSnappingEnabled = gridSnappingEnabled;
|
|
144
|
-
spacesRef.current.selectedElement = selectedElement
|
|
145
|
-
? {
|
|
146
|
-
type: selectedElement.path[0],
|
|
147
|
-
index: selectedElement.path[1],
|
|
148
|
-
}
|
|
149
|
-
: null;
|
|
150
|
-
drawSpaces();
|
|
151
|
-
}, [
|
|
152
|
-
selectedElement,
|
|
153
|
-
showDimensions,
|
|
154
|
-
angleSnappingEnabled,
|
|
155
|
-
guideSnappingEnabled,
|
|
156
|
-
gridSnappingEnabled,
|
|
157
|
-
]);
|
|
158
|
-
(0, react_1.useEffect)(function () {
|
|
159
|
-
if (!hasLoaded)
|
|
160
|
-
return;
|
|
161
|
-
var layoutIds = props.layouts || [];
|
|
162
|
-
dispatch((0, spaces_1.hydrateLayouts)(layoutIds, {
|
|
163
|
-
walls: attributeNames[types_2.IElements.WALL],
|
|
164
|
-
startX: attributeNames.wallStartX,
|
|
165
|
-
startZ: attributeNames.wallStartZ,
|
|
166
|
-
endX: attributeNames.wallEndX,
|
|
167
|
-
endZ: attributeNames.wallEndZ,
|
|
168
|
-
}));
|
|
169
|
-
}, [hasLoaded, JSON.stringify(props.layouts)]);
|
|
170
|
-
var updateZoom = function (value) {
|
|
171
|
-
spacesRef.current.zoom = value;
|
|
172
|
-
if (!spacesRef.current.zoom)
|
|
173
|
-
return;
|
|
174
|
-
dispatch((0, spaces_1.setZoom)(spacesRef.current.zoom));
|
|
175
|
-
};
|
|
176
|
-
var updateUnit = function (unit) {
|
|
177
|
-
if (!spacesRef.current)
|
|
178
|
-
return;
|
|
179
|
-
spacesRef.current.unit = unit;
|
|
180
|
-
if (!spacesRef.current.unit)
|
|
181
|
-
return;
|
|
182
|
-
dispatch((0, spaces_1.setUnit)(spacesRef.current.unit));
|
|
183
|
-
spacesRef.current.drawSpaces(canvasRef.current);
|
|
184
|
-
};
|
|
185
|
-
var handleRecenter = function (zoomToFit) {
|
|
186
|
-
spacesRef.current.centerSpace(canvasRef.current, zoomToFit);
|
|
187
|
-
dispatch((0, spaces_1.setZoom)(spacesRef.current.zoom));
|
|
188
|
-
};
|
|
189
|
-
var handleSelectModeHover = function (canvas, cursorPoint) {
|
|
190
|
-
if (spacesRef.current.activeElement !== null)
|
|
191
|
-
return;
|
|
192
|
-
if (translationAnchorRef.current)
|
|
193
|
-
return;
|
|
194
|
-
spacesRef.current.highlightElementIfInProximity(canvas, cursorPoint);
|
|
195
|
-
};
|
|
196
|
-
var handleSelectElement = function (e) {
|
|
197
|
-
var _a;
|
|
198
|
-
if (!canvasRef.current)
|
|
199
|
-
return;
|
|
200
|
-
if (modeValue !== types_2.IModes.SELECT)
|
|
201
|
-
return;
|
|
202
|
-
var cursorPoint = [e.offsetX, e.offsetY];
|
|
203
|
-
spacesRef.current.selectElementIfInProximity(canvasRef.current, cursorPoint);
|
|
204
|
-
var element = spacesRef.current.getElementUiAtPoint(cursorPoint);
|
|
205
|
-
if (!element) {
|
|
206
|
-
if (selectedElement !== null)
|
|
207
|
-
setSelectedElement(null);
|
|
208
|
-
if (!((_a = props.config) === null || _a === void 0 ? void 0 : _a.translateDisabled) && !spacesRef.current.activeElement)
|
|
209
|
-
translationAnchorRef.current = cursorPoint;
|
|
210
|
-
return;
|
|
211
|
-
}
|
|
212
|
-
if (spacesRef.current.activeElement ||
|
|
213
|
-
(selectedElement &&
|
|
214
|
-
JSON.stringify(element.path) !== JSON.stringify(selectedElement.path)))
|
|
215
|
-
setSelectedElement(null);
|
|
216
|
-
selectElementPending.current = element;
|
|
217
|
-
};
|
|
218
|
-
var handleMoveSelectedElement = function (e) {
|
|
219
|
-
if (modeValue !== types_2.IModes.SELECT)
|
|
220
|
-
return;
|
|
221
|
-
if (!canvasRef.current)
|
|
222
|
-
return;
|
|
223
|
-
var point = [e.offsetX, e.offsetY];
|
|
224
|
-
spacesRef.current.moveActiveElement(canvasRef.current, point);
|
|
225
|
-
selectElementPending.current = null;
|
|
226
|
-
};
|
|
227
|
-
var handleMoveCanvas = function (e) {
|
|
228
|
-
if (modeValue !== types_2.IModes.SELECT)
|
|
229
|
-
return;
|
|
230
|
-
if (!canvasRef.current)
|
|
231
|
-
return;
|
|
232
|
-
if (spacesRef.current.selectedElement || !translationAnchorRef.current)
|
|
233
|
-
return;
|
|
234
|
-
var delta = [
|
|
235
|
-
e.offsetX - translationAnchorRef.current[0],
|
|
236
|
-
e.offsetY - translationAnchorRef.current[1],
|
|
237
|
-
];
|
|
238
|
-
handleChangeTranslate(delta);
|
|
239
|
-
translationAnchorRef.current = [e.offsetX, e.offsetY];
|
|
240
|
-
};
|
|
241
|
-
var handleSetSelectedElement = function (e) {
|
|
242
|
-
var _a;
|
|
243
|
-
if (modeValue !== types_2.IModes.SELECT)
|
|
244
|
-
return;
|
|
245
|
-
if (!canvasRef.current)
|
|
246
|
-
return;
|
|
247
|
-
if (!((_a = canvasRef.current) === null || _a === void 0 ? void 0 : _a.contains(e.target))) {
|
|
248
|
-
spacesRef.current.cancelMoveActiveElement(canvasRef.current);
|
|
249
|
-
return;
|
|
250
|
-
}
|
|
251
|
-
spacesRef.current.finishMoveActiveElement(canvasRef.current);
|
|
252
|
-
if (selectElementPending.current) {
|
|
253
|
-
setSelectedElement(selectElementPending.current);
|
|
254
|
-
selectElementPending.current = null;
|
|
255
|
-
return;
|
|
256
|
-
}
|
|
257
|
-
if (translationAnchorRef.current)
|
|
258
|
-
translationAnchorRef.current = null;
|
|
259
|
-
};
|
|
260
|
-
var handleDrawModeHover = function (canvas, cursorPoint) {
|
|
261
|
-
if (spacesRef.current.isDrawWallActive)
|
|
262
|
-
return;
|
|
263
|
-
spacesRef.current.showGuideAtPoint(canvas, cursorPoint);
|
|
264
|
-
};
|
|
265
|
-
var handleDrawWallStart = function (e) {
|
|
266
|
-
if (modeValue !== types_2.IModes.DRAW)
|
|
267
|
-
return;
|
|
268
|
-
var cursorPoint = [e.offsetX, e.offsetY];
|
|
269
|
-
spacesRef.current.startDrawNewWall(cursorPoint);
|
|
270
|
-
};
|
|
271
|
-
var handleDrawWallMouseMove = function (e) {
|
|
272
|
-
if (modeValue !== types_2.IModes.DRAW)
|
|
273
|
-
return;
|
|
274
|
-
if (!canvasRef.current)
|
|
275
|
-
return;
|
|
276
|
-
var cursorPoint = [e.offsetX, e.offsetY];
|
|
277
|
-
if (spacesRef.current.isDrawWallActive)
|
|
278
|
-
spacesRef.current.drawNewWall(canvasRef.current, cursorPoint);
|
|
279
|
-
};
|
|
280
|
-
var handleDrawWallFinish = function (e) {
|
|
281
|
-
var _a;
|
|
282
|
-
if (modeValue !== types_2.IModes.DRAW)
|
|
283
|
-
return;
|
|
284
|
-
if (!canvasRef.current)
|
|
285
|
-
return;
|
|
286
|
-
if (!((_a = canvasRef.current) === null || _a === void 0 ? void 0 : _a.contains(e.target))) {
|
|
287
|
-
spacesRef.current.cancelDrawNewWall(canvasRef.current);
|
|
288
|
-
return;
|
|
289
|
-
}
|
|
290
|
-
spacesRef.current.finishDrawNewWall(canvasRef.current);
|
|
291
|
-
};
|
|
292
|
-
var handleScrollToZoom = function (e) {
|
|
293
|
-
var _a;
|
|
294
|
-
if (!canvasRef.current)
|
|
295
|
-
return;
|
|
296
|
-
var zoomSensitivity = ((_a = props.config) === null || _a === void 0 ? void 0 : _a.zoomSensitivity) || constants_1.ZOOM_SENSITIVITY;
|
|
297
|
-
updateZoom(-1 * e.deltaY * zoomSensitivity);
|
|
298
|
-
e.preventDefault();
|
|
299
|
-
};
|
|
300
|
-
var handleHover = function (e) {
|
|
301
|
-
if (!canvasRef.current)
|
|
302
|
-
return;
|
|
303
|
-
var cursorPoint = [e.offsetX, e.offsetY];
|
|
304
|
-
if (modeValue === types_2.IModes.DRAW)
|
|
305
|
-
handleDrawModeHover(canvasRef.current, cursorPoint);
|
|
306
|
-
else if (modeValue === types_2.IModes.SELECT)
|
|
307
|
-
handleSelectModeHover(canvasRef.current, cursorPoint);
|
|
308
|
-
};
|
|
309
|
-
var prepFeatureAttributeForOutput = function (type, attribute) {
|
|
310
|
-
if (!attribute)
|
|
311
|
-
return undefined;
|
|
312
|
-
var values = attribute.values.map(function (val) { return (__assign(__assign({}, val), { add: function (addToWallIndex, feature) {
|
|
313
|
-
return spacesRef.current.addFeature(type, addToWallIndex, __assign({ assetId: val.assetId }, (feature || {})));
|
|
314
|
-
} })); });
|
|
315
|
-
var value = attribute.value.map(function (val, i) { return (__assign(__assign({}, val), { delete: function () { return spacesRef.current.deleteFeature(type, i); } })); });
|
|
316
|
-
return __assign(__assign({}, attribute), { values: values, value: value });
|
|
317
|
-
};
|
|
318
|
-
var prepWallAttributeForOutput = function (attribute) {
|
|
319
|
-
if (!attribute)
|
|
320
|
-
return undefined;
|
|
321
|
-
var values = attribute.values.map(function (val) { return (__assign({}, val)); });
|
|
322
|
-
var value = attribute.value.map(function (val, i) { return (__assign(__assign({}, val), { delete: function () { var _a; return (_a = spacesRef.current) === null || _a === void 0 ? void 0 : _a.deleteWall(i); }, splitWall: function (offset) { var _a; return (_a = spacesRef.current) === null || _a === void 0 ? void 0 : _a.splitWallAtOffset(i, offset); } })); });
|
|
323
|
-
return __assign(__assign({}, attribute), { values: values, value: value });
|
|
324
|
-
};
|
|
325
|
-
var getElementFromAttributeName = function (attributeName) {
|
|
326
|
-
var elementAttr = Object.entries(attributeNames).find(function (_a) {
|
|
327
|
-
var _ = _a[0], attrName = _a[1];
|
|
328
|
-
return attrName === attributeName;
|
|
329
|
-
});
|
|
330
|
-
if (!elementAttr)
|
|
331
|
-
return;
|
|
332
|
-
return elementAttr[0];
|
|
333
|
-
};
|
|
334
|
-
var handleSetMode = function (mode) {
|
|
335
|
-
if (mode === modeValue)
|
|
336
|
-
return;
|
|
337
|
-
drawSpaces();
|
|
338
|
-
dispatch((0, spaces_1.setMode)(mode));
|
|
339
|
-
setSelectedElement(null);
|
|
340
|
-
};
|
|
341
|
-
var handleReset = function () {
|
|
342
|
-
var _a;
|
|
343
|
-
(_a = spacesRef.current) === null || _a === void 0 ? void 0 : _a.deleteAll();
|
|
344
|
-
setSelectedElement(null);
|
|
345
|
-
};
|
|
346
|
-
var handleDeleteElement = function (type, index) {
|
|
347
|
-
var _a;
|
|
348
|
-
var elementType = type;
|
|
349
|
-
if (Object.values(attributeNames).includes(type)) {
|
|
350
|
-
var updatedType = getElementFromAttributeName(type);
|
|
351
|
-
if (!updatedType)
|
|
352
|
-
return;
|
|
353
|
-
elementType = updatedType;
|
|
354
|
-
}
|
|
355
|
-
(_a = spacesRef.current) === null || _a === void 0 ? void 0 : _a.deleteElement(elementType, index);
|
|
356
|
-
setSelectedElement(null);
|
|
357
|
-
};
|
|
358
|
-
var handleSetShowDimensions = function (val) {
|
|
359
|
-
dispatch((0, spaces_1.setShowDimensions)(val));
|
|
360
|
-
};
|
|
361
|
-
var handleToggleAngleSnapping = function (val) {
|
|
362
|
-
if (val === undefined)
|
|
363
|
-
dispatch((0, spaces_1.setAngleSnappingEnabled)(!angleSnappingEnabled));
|
|
364
|
-
else
|
|
365
|
-
dispatch((0, spaces_1.setAngleSnappingEnabled)(val));
|
|
366
|
-
setSelectedElement(null);
|
|
367
|
-
};
|
|
368
|
-
var handleToggleGuideSnapping = function (val) {
|
|
369
|
-
if (val === undefined)
|
|
370
|
-
dispatch((0, spaces_1.setGuideSnappingEnabled)(!guideSnappingEnabled));
|
|
371
|
-
else
|
|
372
|
-
dispatch((0, spaces_1.setGuideSnappingEnabled)(val));
|
|
373
|
-
setSelectedElement(null);
|
|
374
|
-
};
|
|
375
|
-
var handleToggleGridSnapping = function (val) {
|
|
376
|
-
if (val === undefined)
|
|
377
|
-
dispatch((0, spaces_1.setGridSnappingEnabled)(!gridSnappingEnabled));
|
|
378
|
-
else
|
|
379
|
-
dispatch((0, spaces_1.setGridSnappingEnabled)(val));
|
|
380
|
-
setSelectedElement(null);
|
|
381
|
-
};
|
|
382
|
-
var handleChangeTranslate = function (delta) {
|
|
383
|
-
spacesRef.current.translate = [
|
|
384
|
-
spacesRef.current.translate[0] + delta[0],
|
|
385
|
-
spacesRef.current.translate[1] + delta[1],
|
|
386
|
-
];
|
|
387
|
-
dispatch((0, spaces_1.setTranslation)(spacesRef.current.translate));
|
|
388
|
-
drawSpaces();
|
|
389
|
-
};
|
|
390
|
-
return {
|
|
391
|
-
draw: drawSpaces,
|
|
392
|
-
canvasRef: canvasRef,
|
|
393
|
-
selectedElement: selectedElement === null
|
|
394
|
-
? selectedElement
|
|
395
|
-
: __assign(__assign({}, selectedElement), { path: [
|
|
396
|
-
attributeNames[selectedElement.path[0]],
|
|
397
|
-
selectedElement.path[1],
|
|
398
|
-
], type: selectedElement.path[0], deleteElement: function () { return handleDeleteElement.apply(void 0, selectedElement.path); }, splitWall: selectedElement.path[0] !== types_2.IElements.WALL
|
|
399
|
-
? undefined
|
|
400
|
-
: function (offset) {
|
|
401
|
-
return spacesRef.current.splitWallAtOffset(selectedElement.path[1], offset);
|
|
402
|
-
}, addFeature: selectedElement.path[0] !== types_2.IElements.WALL
|
|
403
|
-
? undefined
|
|
404
|
-
: function (type, feature) {
|
|
405
|
-
return spacesRef.current.addFeature(type, selectedElement.path[1], feature);
|
|
406
|
-
} }),
|
|
407
|
-
mode: {
|
|
408
|
-
value: modeValue,
|
|
409
|
-
options: [types_2.IModes.SELECT, types_2.IModes.DRAW].map(function (el) { return ({
|
|
410
|
-
value: el,
|
|
411
|
-
label: el,
|
|
412
|
-
selected: modeValue === el,
|
|
413
|
-
handleSelect: function () { return handleSetMode(el); },
|
|
414
|
-
}); }),
|
|
415
|
-
handleChange: handleSetMode,
|
|
416
|
-
},
|
|
417
|
-
dimensions: {
|
|
418
|
-
value: showDimensions,
|
|
419
|
-
options: [
|
|
420
|
-
types_1.IDimensionOptions.NONE,
|
|
421
|
-
types_1.IDimensionOptions.DEFAULT,
|
|
422
|
-
types_1.IDimensionOptions.DETAILED,
|
|
423
|
-
].map(function (el) { return ({
|
|
424
|
-
value: el,
|
|
425
|
-
label: el,
|
|
426
|
-
selected: showDimensions === el,
|
|
427
|
-
handleSelect: function () { return handleSetShowDimensions(el); },
|
|
428
|
-
}); }),
|
|
429
|
-
handleChange: handleSetShowDimensions,
|
|
430
|
-
},
|
|
431
|
-
angleSnapping: {
|
|
432
|
-
enabled: angleSnappingEnabled,
|
|
433
|
-
handleToggle: handleToggleAngleSnapping,
|
|
434
|
-
},
|
|
435
|
-
guideSnapping: {
|
|
436
|
-
enabled: guideSnappingEnabled,
|
|
437
|
-
handleToggle: handleToggleGuideSnapping,
|
|
438
|
-
},
|
|
439
|
-
gridSnapping: {
|
|
440
|
-
enabled: gridSnappingEnabled,
|
|
441
|
-
handleToggle: handleToggleGridSnapping,
|
|
442
|
-
},
|
|
443
|
-
zoom: {
|
|
444
|
-
min: spacesRef.current.zoomMin,
|
|
445
|
-
max: spacesRef.current.zoomMax,
|
|
446
|
-
value: zoom || constants_1.ZOOM_DEFAULT,
|
|
447
|
-
handleChange: updateZoom,
|
|
448
|
-
},
|
|
449
|
-
unit: {
|
|
450
|
-
value: unit,
|
|
451
|
-
options: [types_2.IUnits.FEET, types_2.IUnits.METER, types_2.IUnits.INCH, types_2.IUnits.CM].map(function (el) { return ({
|
|
452
|
-
value: el,
|
|
453
|
-
label: el,
|
|
454
|
-
selected: unit === el,
|
|
455
|
-
handleSelect: function () { return updateUnit(el); },
|
|
456
|
-
}); }),
|
|
457
|
-
handleChange: updateUnit,
|
|
458
|
-
},
|
|
459
|
-
translate: {
|
|
460
|
-
handleChange: handleChangeTranslate,
|
|
461
|
-
},
|
|
462
|
-
reset: handleReset,
|
|
463
|
-
recenter: handleRecenter,
|
|
464
|
-
deleteElement: handleDeleteElement,
|
|
465
|
-
layouts: layouts.map(function (layout) { return ({
|
|
466
|
-
label: layout.label,
|
|
467
|
-
loops: layout.loop,
|
|
468
|
-
handleSelect: function () {
|
|
469
|
-
return window.threekit.configurator.setFullConfiguration(layout.configuration);
|
|
470
|
-
},
|
|
471
|
-
}); }),
|
|
472
|
-
walls: prepWallAttributeForOutput(attributesState === null || attributesState === void 0 ? void 0 : attributesState[attributeNames[types_2.IElements.WALL]]),
|
|
473
|
-
windows: prepFeatureAttributeForOutput(types_2.IElements.WINDOW, attributesState === null || attributesState === void 0 ? void 0 : attributesState[attributeNames[types_2.IElements.WINDOW]]),
|
|
474
|
-
doors: prepFeatureAttributeForOutput(types_2.IElements.DOOR, attributesState === null || attributesState === void 0 ? void 0 : attributesState[attributeNames[types_2.IElements.DOOR]]),
|
|
475
|
-
openings: prepFeatureAttributeForOutput(types_2.IElements.OPENING, attributesState === null || attributesState === void 0 ? void 0 : attributesState[attributeNames[types_2.IElements.OPENING]]),
|
|
476
|
-
};
|
|
477
|
-
};
|
|
478
|
-
useSpaces.themes = themes_1.IThemes;
|
|
479
|
-
useSpaces.units = types_2.IUnits;
|
|
480
|
-
useSpaces.modes = types_2.IModes;
|
|
481
|
-
useSpaces.LayoutIcon = SpacesLayout_1.default;
|
|
482
|
-
exports.default = useSpaces;
|
|
@@ -1,96 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
var WALL_THICKNESS = 22;
|
|
4
|
-
var VERTEX_RADIUS = (WALL_THICKNESS - 8) / 2;
|
|
5
|
-
var FEATURE_THICKNESS = WALL_THICKNESS + 6;
|
|
6
|
-
var HIGHLIGHT_COLOR = '#36738E';
|
|
7
|
-
var ACTIVE_COLOR = 'green';
|
|
8
|
-
var ERROR_COLOR = 'red';
|
|
9
|
-
var theme = {
|
|
10
|
-
grid: {
|
|
11
|
-
lineThickness: 2,
|
|
12
|
-
lineColor: '#fff',
|
|
13
|
-
showSubdivisions: true,
|
|
14
|
-
subdivisionLineThickness: 1,
|
|
15
|
-
subdivisionLineColor: '#fff',
|
|
16
|
-
subdivisionThreshold: 20,
|
|
17
|
-
backgroundColor: '#37588B',
|
|
18
|
-
},
|
|
19
|
-
guides: {
|
|
20
|
-
color: 'red',
|
|
21
|
-
thickness: 1,
|
|
22
|
-
},
|
|
23
|
-
floor: {
|
|
24
|
-
color: '#eee',
|
|
25
|
-
textColor: '#666',
|
|
26
|
-
},
|
|
27
|
-
dimensions: {
|
|
28
|
-
padding: WALL_THICKNESS / 2 + 12,
|
|
29
|
-
lineThickness: 1,
|
|
30
|
-
lineColor: '#fff',
|
|
31
|
-
fontSize: 14,
|
|
32
|
-
font: 'Helvetica',
|
|
33
|
-
textColor: '#444',
|
|
34
|
-
textBackgroundColor: '#fff',
|
|
35
|
-
},
|
|
36
|
-
wall: {
|
|
37
|
-
fill: '#848484',
|
|
38
|
-
stroke: '#fff',
|
|
39
|
-
strokeWidth: 1,
|
|
40
|
-
thickness: WALL_THICKNESS,
|
|
41
|
-
highlight: {
|
|
42
|
-
fill: HIGHLIGHT_COLOR,
|
|
43
|
-
stroke: HIGHLIGHT_COLOR,
|
|
44
|
-
},
|
|
45
|
-
active: {
|
|
46
|
-
fill: ACTIVE_COLOR,
|
|
47
|
-
stroke: ACTIVE_COLOR,
|
|
48
|
-
},
|
|
49
|
-
error: {
|
|
50
|
-
fill: ERROR_COLOR,
|
|
51
|
-
stroke: ERROR_COLOR,
|
|
52
|
-
},
|
|
53
|
-
},
|
|
54
|
-
vertex: {
|
|
55
|
-
innerFill: '#fff',
|
|
56
|
-
outerFill: '#fff',
|
|
57
|
-
stroke: '#36738E',
|
|
58
|
-
strokeWidth: 0,
|
|
59
|
-
outerRadius: VERTEX_RADIUS,
|
|
60
|
-
innerRadius: VERTEX_RADIUS / 2,
|
|
61
|
-
highlight: {
|
|
62
|
-
innerFill: HIGHLIGHT_COLOR,
|
|
63
|
-
outerFill: HIGHLIGHT_COLOR,
|
|
64
|
-
stroke: HIGHLIGHT_COLOR,
|
|
65
|
-
},
|
|
66
|
-
active: {
|
|
67
|
-
innerFill: ACTIVE_COLOR,
|
|
68
|
-
outerFill: ACTIVE_COLOR,
|
|
69
|
-
stroke: ACTIVE_COLOR,
|
|
70
|
-
},
|
|
71
|
-
error: {
|
|
72
|
-
innerFill: ERROR_COLOR,
|
|
73
|
-
outerFill: ERROR_COLOR,
|
|
74
|
-
stroke: ERROR_COLOR,
|
|
75
|
-
},
|
|
76
|
-
},
|
|
77
|
-
feature: {
|
|
78
|
-
fill: '#888',
|
|
79
|
-
stroke: '#888',
|
|
80
|
-
strokeWidth: 0,
|
|
81
|
-
thickness: FEATURE_THICKNESS,
|
|
82
|
-
highlight: {
|
|
83
|
-
fill: HIGHLIGHT_COLOR,
|
|
84
|
-
stroke: HIGHLIGHT_COLOR,
|
|
85
|
-
},
|
|
86
|
-
active: {
|
|
87
|
-
fill: ACTIVE_COLOR,
|
|
88
|
-
stroke: ACTIVE_COLOR,
|
|
89
|
-
},
|
|
90
|
-
error: {
|
|
91
|
-
fill: ERROR_COLOR,
|
|
92
|
-
stroke: ERROR_COLOR,
|
|
93
|
-
},
|
|
94
|
-
},
|
|
95
|
-
};
|
|
96
|
-
exports.default = theme;
|
|
@@ -1,96 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
var HIGHLIGHT_COLOR = '#36738E';
|
|
4
|
-
var ACTIVE_COLOR = 'green';
|
|
5
|
-
var ERROR_COLOR = 'red';
|
|
6
|
-
var WALL_THICKNESS = 18;
|
|
7
|
-
var VERTEX_RADIUS = (WALL_THICKNESS - 6) / 2;
|
|
8
|
-
var FEATURE_THICKNESS = WALL_THICKNESS + 6;
|
|
9
|
-
var theme = {
|
|
10
|
-
grid: {
|
|
11
|
-
lineThickness: 2,
|
|
12
|
-
lineColor: '#ddd',
|
|
13
|
-
showSubdivisions: true,
|
|
14
|
-
subdivisionLineThickness: 1,
|
|
15
|
-
subdivisionLineColor: '#ddd',
|
|
16
|
-
subdivisionThreshold: 20,
|
|
17
|
-
backgroundColor: '#fff',
|
|
18
|
-
},
|
|
19
|
-
guides: {
|
|
20
|
-
color: '#00F8FB',
|
|
21
|
-
thickness: 1,
|
|
22
|
-
},
|
|
23
|
-
floor: {
|
|
24
|
-
color: '#eee',
|
|
25
|
-
textColor: '#666',
|
|
26
|
-
},
|
|
27
|
-
dimensions: {
|
|
28
|
-
padding: WALL_THICKNESS / 2 + 12,
|
|
29
|
-
lineThickness: 1,
|
|
30
|
-
lineColor: '#444',
|
|
31
|
-
fontSize: 14,
|
|
32
|
-
font: 'Helvetica',
|
|
33
|
-
textColor: '#444',
|
|
34
|
-
textBackgroundColor: 'white',
|
|
35
|
-
},
|
|
36
|
-
wall: {
|
|
37
|
-
fill: '#d9d9d9',
|
|
38
|
-
stroke: '#d9d9d9',
|
|
39
|
-
strokeWidth: 0,
|
|
40
|
-
thickness: WALL_THICKNESS,
|
|
41
|
-
highlight: {
|
|
42
|
-
fill: HIGHLIGHT_COLOR,
|
|
43
|
-
stroke: HIGHLIGHT_COLOR,
|
|
44
|
-
},
|
|
45
|
-
active: {
|
|
46
|
-
fill: ACTIVE_COLOR,
|
|
47
|
-
stroke: ACTIVE_COLOR,
|
|
48
|
-
},
|
|
49
|
-
error: {
|
|
50
|
-
fill: ERROR_COLOR,
|
|
51
|
-
stroke: ERROR_COLOR,
|
|
52
|
-
},
|
|
53
|
-
},
|
|
54
|
-
vertex: {
|
|
55
|
-
innerFill: '#36738E',
|
|
56
|
-
outerFill: 'white',
|
|
57
|
-
stroke: '#36738E',
|
|
58
|
-
strokeWidth: 2,
|
|
59
|
-
outerRadius: VERTEX_RADIUS,
|
|
60
|
-
innerRadius: VERTEX_RADIUS / 2,
|
|
61
|
-
highlight: {
|
|
62
|
-
innerFill: HIGHLIGHT_COLOR,
|
|
63
|
-
outerFill: HIGHLIGHT_COLOR,
|
|
64
|
-
stroke: HIGHLIGHT_COLOR,
|
|
65
|
-
},
|
|
66
|
-
active: {
|
|
67
|
-
innerFill: ACTIVE_COLOR,
|
|
68
|
-
outerFill: ACTIVE_COLOR,
|
|
69
|
-
stroke: ACTIVE_COLOR,
|
|
70
|
-
},
|
|
71
|
-
error: {
|
|
72
|
-
innerFill: ERROR_COLOR,
|
|
73
|
-
outerFill: ERROR_COLOR,
|
|
74
|
-
stroke: ERROR_COLOR,
|
|
75
|
-
},
|
|
76
|
-
},
|
|
77
|
-
feature: {
|
|
78
|
-
fill: '#888',
|
|
79
|
-
stroke: '#888',
|
|
80
|
-
strokeWidth: 0,
|
|
81
|
-
thickness: FEATURE_THICKNESS,
|
|
82
|
-
highlight: {
|
|
83
|
-
fill: HIGHLIGHT_COLOR,
|
|
84
|
-
stroke: HIGHLIGHT_COLOR,
|
|
85
|
-
},
|
|
86
|
-
active: {
|
|
87
|
-
fill: ACTIVE_COLOR,
|
|
88
|
-
stroke: ACTIVE_COLOR,
|
|
89
|
-
},
|
|
90
|
-
error: {
|
|
91
|
-
fill: ERROR_COLOR,
|
|
92
|
-
stroke: ERROR_COLOR,
|
|
93
|
-
},
|
|
94
|
-
},
|
|
95
|
-
};
|
|
96
|
-
exports.default = theme;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
export declare enum IThemes {
|
|
2
|
-
DEFAULT = "default",
|
|
3
|
-
BLUEPRINT = "blueprint",
|
|
4
|
-
LIGHT = "light"
|
|
5
|
-
}
|
|
6
|
-
declare const _default: {
|
|
7
|
-
default: import("../types").ISpacesStyles;
|
|
8
|
-
blueprint: import("../types").ISpacesStyles;
|
|
9
|
-
light: import("../types").ISpacesStyles;
|
|
10
|
-
};
|
|
11
|
-
export default _default;
|