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

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.
@@ -1,29 +1,5 @@
1
- import { ICoordinate2D } from './types';
2
- export declare enum IRoomBuilderAttributes {
3
- WALLS = "_tkSpace_walls",
4
- WINDOWS = "_tkSpace_windows",
5
- DOORS = "_tkSpace_doors",
6
- OPENINGS = "_tkSpace_openings"
7
- }
8
- export declare enum IWallAttributes {
9
- START_X = "_tkSpace_startX",
10
- START_Y = "_tkSpace_startY",
11
- START_Z = "_tkSpace_startZ",
12
- END_X = "_tkSpace_endX",
13
- END_Y = "_tkSpace_endY",
14
- END_Z = "_tkSpace_endZ",
15
- CONNECTIONS = "_tkSpace_connections",
16
- WALL_HEIGHT = "_tkSpace_wallHeight",
17
- WALL_THICKNESS = "_tkSpace_wallThickness"
18
- }
19
- export declare enum IFeatureAttribute {
20
- POSITION_X = "_tkSpace_offsetX",
21
- POSITION_Y = "_tkSpace_offsetY",
22
- POSITION_Z = "_tkSpace_offsetZ",
23
- CONNECTED_TO = "_tkSpace_connectedTo",
24
- FEATURE_HEIGHT = "_tkSpace_featureHeight",
25
- FEATURE_LENGTH = "_tkSpace_featureWidth"
26
- }
1
+ import { ICoordinate2D, IRoomBuilderAttributes } from './types';
2
+ export declare const attributeNameDefaults: IRoomBuilderAttributes;
27
3
  export declare const SCALE = 0.02;
28
4
  export declare const SNAP_PROXIMITY = 16;
29
5
  export declare const ZOOM_MAX = 100;
@@ -1,36 +1,57 @@
1
1
  "use strict";
2
- var _a, _b, _c;
2
+ var _a, _b, _c, _d;
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
- exports.WALL_SNAP_DISTANCE = exports.UI_ANCHOR_DISTANCE = exports.FEATURE_LENGTH = exports.FEATURE_LABELS = exports.UNIT_FACTORS = exports.UNIT_LABELS = exports.WALL_PADDING_FOR_FEATURE = exports.MIN_WALL_LENGTH = exports.TRANSLATE_DEFAULT = exports.TRANSLATE_MIN = exports.TRANSLATE_MAX = exports.ZOOM_DEFAULT = exports.ZOOM_MIN = exports.ZOOM_MAX = exports.SNAP_PROXIMITY = exports.SCALE = exports.IFeatureAttribute = exports.IWallAttributes = exports.IRoomBuilderAttributes = void 0;
4
+ exports.WALL_SNAP_DISTANCE = exports.UI_ANCHOR_DISTANCE = exports.FEATURE_LENGTH = exports.FEATURE_LABELS = exports.UNIT_FACTORS = exports.UNIT_LABELS = exports.WALL_PADDING_FOR_FEATURE = exports.MIN_WALL_LENGTH = exports.TRANSLATE_DEFAULT = exports.TRANSLATE_MIN = exports.TRANSLATE_MAX = exports.ZOOM_DEFAULT = exports.ZOOM_MIN = exports.ZOOM_MAX = exports.SNAP_PROXIMITY = exports.SCALE = exports.attributeNameDefaults = void 0;
5
5
  var types_1 = require("./types");
6
- var IRoomBuilderAttributes;
7
- (function (IRoomBuilderAttributes) {
8
- IRoomBuilderAttributes["WALLS"] = "_tkSpace_walls";
9
- IRoomBuilderAttributes["WINDOWS"] = "_tkSpace_windows";
10
- IRoomBuilderAttributes["DOORS"] = "_tkSpace_doors";
11
- IRoomBuilderAttributes["OPENINGS"] = "_tkSpace_openings";
12
- })(IRoomBuilderAttributes = exports.IRoomBuilderAttributes || (exports.IRoomBuilderAttributes = {}));
13
- var IWallAttributes;
14
- (function (IWallAttributes) {
15
- IWallAttributes["START_X"] = "_tkSpace_startX";
16
- IWallAttributes["START_Y"] = "_tkSpace_startY";
17
- IWallAttributes["START_Z"] = "_tkSpace_startZ";
18
- IWallAttributes["END_X"] = "_tkSpace_endX";
19
- IWallAttributes["END_Y"] = "_tkSpace_endY";
20
- IWallAttributes["END_Z"] = "_tkSpace_endZ";
21
- IWallAttributes["CONNECTIONS"] = "_tkSpace_connections";
22
- IWallAttributes["WALL_HEIGHT"] = "_tkSpace_wallHeight";
23
- IWallAttributes["WALL_THICKNESS"] = "_tkSpace_wallThickness";
24
- })(IWallAttributes = exports.IWallAttributes || (exports.IWallAttributes = {}));
25
- var IFeatureAttribute;
26
- (function (IFeatureAttribute) {
27
- IFeatureAttribute["POSITION_X"] = "_tkSpace_offsetX";
28
- IFeatureAttribute["POSITION_Y"] = "_tkSpace_offsetY";
29
- IFeatureAttribute["POSITION_Z"] = "_tkSpace_offsetZ";
30
- IFeatureAttribute["CONNECTED_TO"] = "_tkSpace_connectedTo";
31
- IFeatureAttribute["FEATURE_HEIGHT"] = "_tkSpace_featureHeight";
32
- IFeatureAttribute["FEATURE_LENGTH"] = "_tkSpace_featureWidth";
33
- })(IFeatureAttribute = exports.IFeatureAttribute || (exports.IFeatureAttribute = {}));
6
+ var RoomBuilderAttributes;
7
+ (function (RoomBuilderAttributes) {
8
+ RoomBuilderAttributes["WALLS"] = "_tkSpace_walls";
9
+ RoomBuilderAttributes["WINDOWS"] = "_tkSpace_windows";
10
+ RoomBuilderAttributes["DOORS"] = "_tkSpace_doors";
11
+ RoomBuilderAttributes["OPENINGS"] = "_tkSpace_openings";
12
+ })(RoomBuilderAttributes || (RoomBuilderAttributes = {}));
13
+ var WallAttributes;
14
+ (function (WallAttributes) {
15
+ WallAttributes["START_X"] = "_tkSpace_startX";
16
+ WallAttributes["START_Y"] = "_tkSpace_startY";
17
+ WallAttributes["START_Z"] = "_tkSpace_startZ";
18
+ WallAttributes["END_X"] = "_tkSpace_endX";
19
+ WallAttributes["END_Y"] = "_tkSpace_endY";
20
+ WallAttributes["END_Z"] = "_tkSpace_endZ";
21
+ WallAttributes["CONNECTIONS"] = "_tkSpace_connections";
22
+ WallAttributes["WALL_HEIGHT"] = "_tkSpace_wallHeight";
23
+ WallAttributes["WALL_THICKNESS"] = "_tkSpace_wallThickness";
24
+ })(WallAttributes || (WallAttributes = {}));
25
+ var FeatureAttribute;
26
+ (function (FeatureAttribute) {
27
+ FeatureAttribute["POSITION_X"] = "_tkSpace_offsetX";
28
+ FeatureAttribute["POSITION_Y"] = "_tkSpace_offsetY";
29
+ FeatureAttribute["POSITION_Z"] = "_tkSpace_offsetZ";
30
+ FeatureAttribute["CONNECTED_TO"] = "_tkSpace_connectedTo";
31
+ FeatureAttribute["FEATURE_HEIGHT"] = "_tkSpace_featureHeight";
32
+ FeatureAttribute["FEATURE_LENGTH"] = "_tkSpace_featureWidth";
33
+ })(FeatureAttribute || (FeatureAttribute = {}));
34
+ exports.attributeNameDefaults = (_a = {},
35
+ _a[types_1.IElements.WALL] = RoomBuilderAttributes.WALLS,
36
+ _a[types_1.IElements.WINDOW] = RoomBuilderAttributes.WINDOWS,
37
+ _a[types_1.IElements.OPENING] = RoomBuilderAttributes.OPENINGS,
38
+ _a[types_1.IElements.DOOR] = RoomBuilderAttributes.DOORS,
39
+ _a.featurePositionX = FeatureAttribute.POSITION_X,
40
+ _a.featurePositionY = FeatureAttribute.POSITION_Y,
41
+ _a.featurePositionZ = FeatureAttribute.POSITION_Z,
42
+ _a.featureConnectedTo = FeatureAttribute.CONNECTED_TO,
43
+ _a.featureHeight = FeatureAttribute.FEATURE_HEIGHT,
44
+ _a.featureLength = FeatureAttribute.FEATURE_LENGTH,
45
+ _a.wallStartX = WallAttributes.START_X,
46
+ _a.wallStartY = WallAttributes.START_Y,
47
+ _a.wallStartZ = WallAttributes.START_Z,
48
+ _a.wallEndX = WallAttributes.END_X,
49
+ _a.wallEndY = WallAttributes.END_Y,
50
+ _a.wallEndZ = WallAttributes.END_Z,
51
+ _a.wallConnections = WallAttributes.CONNECTIONS,
52
+ _a.wallThickness = WallAttributes.WALL_THICKNESS,
53
+ _a.wallHeight = WallAttributes.WALL_HEIGHT,
54
+ _a);
34
55
  exports.SCALE = 0.02;
35
56
  exports.SNAP_PROXIMITY = 16;
36
57
  exports.ZOOM_MAX = 100;
@@ -41,23 +62,23 @@ exports.TRANSLATE_MIN = [400, 400];
41
62
  exports.TRANSLATE_DEFAULT = [-200, -200];
42
63
  exports.MIN_WALL_LENGTH = 50;
43
64
  exports.WALL_PADDING_FOR_FEATURE = 20;
44
- exports.UNIT_LABELS = (_a = {},
45
- _a[types_1.IUnits.FEET] = 'ft',
46
- _a[types_1.IUnits.METER] = 'm',
47
- _a[types_1.IUnits.INCH] = 'in',
48
- _a[types_1.IUnits.CM] = 'cm',
49
- _a);
50
- exports.UNIT_FACTORS = (_b = {},
51
- _b[types_1.IUnits.CM] = 100,
52
- _b[types_1.IUnits.METER] = 1,
53
- _b[types_1.IUnits.FEET] = 3.28084,
54
- _b[types_1.IUnits.INCH] = 39.37,
65
+ exports.UNIT_LABELS = (_b = {},
66
+ _b[types_1.IUnits.FEET] = 'ft',
67
+ _b[types_1.IUnits.METER] = 'm',
68
+ _b[types_1.IUnits.INCH] = 'in',
69
+ _b[types_1.IUnits.CM] = 'cm',
55
70
  _b);
56
- exports.FEATURE_LABELS = (_c = {},
57
- _c[types_1.IElements.WINDOW] = 'Window',
58
- _c[types_1.IElements.DOOR] = 'Door',
59
- _c[types_1.IElements.OPENING] = 'Opening',
71
+ exports.UNIT_FACTORS = (_c = {},
72
+ _c[types_1.IUnits.CM] = 100,
73
+ _c[types_1.IUnits.METER] = 1,
74
+ _c[types_1.IUnits.FEET] = 3.28084,
75
+ _c[types_1.IUnits.INCH] = 39.37,
60
76
  _c);
77
+ exports.FEATURE_LABELS = (_d = {},
78
+ _d[types_1.IElements.WINDOW] = 'Window',
79
+ _d[types_1.IElements.DOOR] = 'Door',
80
+ _d[types_1.IElements.OPENING] = 'Opening',
81
+ _d);
61
82
  exports.FEATURE_LENGTH = 120;
62
83
  exports.UI_ANCHOR_DISTANCE = -60;
63
84
  exports.WALL_SNAP_DISTANCE = 12;
@@ -26,15 +26,16 @@ function prepWallsAndVerticesIncoming(wallsAttribute, config) {
26
26
  var _a;
27
27
  var walls = [];
28
28
  var vertices = {};
29
+ var attributeName = config.attributes;
29
30
  ((wallsAttribute === null || wallsAttribute === void 0 ? void 0 : wallsAttribute.value) || []).forEach(function (_a, i) {
30
31
  var assetId = _a.assetId, configuration = _a.configuration;
31
32
  var point1 = [
32
- (configuration === null || configuration === void 0 ? void 0 : configuration[constants_1.IWallAttributes.START_X]) / config.config.scale,
33
- (configuration === null || configuration === void 0 ? void 0 : configuration[constants_1.IWallAttributes.START_Z]) / config.config.scale,
33
+ (configuration === null || configuration === void 0 ? void 0 : configuration[attributeName.wallStartX]) / config.config.scale,
34
+ (configuration === null || configuration === void 0 ? void 0 : configuration[attributeName.wallStartZ]) / config.config.scale,
34
35
  ];
35
36
  var point2 = [
36
- (configuration === null || configuration === void 0 ? void 0 : configuration[constants_1.IWallAttributes.END_X]) / config.config.scale,
37
- (configuration === null || configuration === void 0 ? void 0 : configuration[constants_1.IWallAttributes.END_Z]) / config.config.scale,
37
+ (configuration === null || configuration === void 0 ? void 0 : configuration[attributeName.wallEndX]) / config.config.scale,
38
+ (configuration === null || configuration === void 0 ? void 0 : configuration[attributeName.wallEndZ]) / config.config.scale,
38
39
  ];
39
40
  var point1Str = JSON.stringify(point1);
40
41
  var point2Str = JSON.stringify(point2);
@@ -51,8 +52,8 @@ function prepWallsAndVerticesIncoming(wallsAttribute, config) {
51
52
  assetId: assetId,
52
53
  line: [point1, point2],
53
54
  path: (0, geometry_1.addThicknessToLine)([point1, point2], config.config.styles.wall.thickness),
54
- height: configuration === null || configuration === void 0 ? void 0 : configuration[constants_1.IWallAttributes.WALL_HEIGHT],
55
- thickness: configuration === null || configuration === void 0 ? void 0 : configuration[constants_1.IWallAttributes.WALL_THICKNESS],
55
+ height: configuration === null || configuration === void 0 ? void 0 : configuration[attributeName.wallHeight],
56
+ thickness: configuration === null || configuration === void 0 ? void 0 : configuration[attributeName.wallThickness],
56
57
  connections: connections,
57
58
  });
58
59
  });
@@ -60,13 +61,14 @@ function prepWallsAndVerticesIncoming(wallsAttribute, config) {
60
61
  }
61
62
  function prepFeatureIncoming(walls, featureAttribute, config) {
62
63
  var _a;
64
+ var attributeName = config.attributes;
63
65
  var feature = [];
64
66
  (_a = featureAttribute === null || featureAttribute === void 0 ? void 0 : featureAttribute.value) === null || _a === void 0 ? void 0 : _a.forEach(function (_a) {
65
67
  var assetId = _a.assetId, configuration = _a.configuration;
66
- var offset = (configuration === null || configuration === void 0 ? void 0 : configuration[constants_1.IFeatureAttribute.POSITION_X]) / config.config.scale;
67
- var length = (configuration === null || configuration === void 0 ? void 0 : configuration[constants_1.IFeatureAttribute.FEATURE_LENGTH]) / config.config.scale ||
68
+ var offset = (configuration === null || configuration === void 0 ? void 0 : configuration[attributeName.featurePositionX]) / config.config.scale;
69
+ var length = (configuration === null || configuration === void 0 ? void 0 : configuration[attributeName.featureLength]) / config.config.scale ||
68
70
  constants_1.FEATURE_LENGTH;
69
- var connectedTo = (configuration === null || configuration === void 0 ? void 0 : configuration[constants_1.IFeatureAttribute.CONNECTED_TO]) || '';
71
+ var connectedTo = (configuration === null || configuration === void 0 ? void 0 : configuration[attributeName.featureConnectedTo]) || '';
70
72
  var wallIndex = prepConnectionIncoming(connectedTo)[1];
71
73
  var featureLine = (0, geometry_1.getLineAtOffsetOnLineSegment)(walls[wallIndex].line, offset, length);
72
74
  var path = (0, geometry_1.addThicknessToLine)(featureLine, config.config.styles.feature.thickness);
@@ -92,6 +94,7 @@ function prepAttributesIncoming(attributes, config) {
92
94
  }
93
95
  exports.prepAttributesIncoming = prepAttributesIncoming;
94
96
  function prepFeaturesOutgoing(features, config) {
97
+ var attributeName = config.attributes;
95
98
  return features.map(function (feature) {
96
99
  var _a, _b;
97
100
  var assetId = feature.assetId, offset = feature.offset, length = feature.length;
@@ -100,8 +103,8 @@ function prepFeaturesOutgoing(features, config) {
100
103
  feature.connectedTo[1],
101
104
  ]);
102
105
  var configuration = Object.entries((_a = {},
103
- _a[constants_1.IFeatureAttribute.FEATURE_LENGTH] = length,
104
- _a[constants_1.IFeatureAttribute.POSITION_X] = offset,
106
+ _a[attributeName.featureLength] = length,
107
+ _a[attributeName.featurePositionX] = offset,
105
108
  _a)).reduce(function (output, _a) {
106
109
  var _b;
107
110
  var key = _a[0], value = _a[1];
@@ -109,7 +112,7 @@ function prepFeaturesOutgoing(features, config) {
109
112
  _b[key] = value ? value * config.config.scale : value,
110
113
  _b));
111
114
  }, (_b = {},
112
- _b[constants_1.IFeatureAttribute.CONNECTED_TO] = connectedTo,
115
+ _b[attributeName.featureConnectedTo] = connectedTo,
113
116
  _b));
114
117
  return {
115
118
  assetId: assetId,
@@ -118,6 +121,7 @@ function prepFeaturesOutgoing(features, config) {
118
121
  });
119
122
  }
120
123
  function prepWallsOutgoing(walls, config) {
124
+ var attributeName = config.attributes;
121
125
  return walls.map(function (wall) {
122
126
  var _a, _b;
123
127
  var line = wall.line, height = wall.height, thickness = wall.thickness;
@@ -129,12 +133,12 @@ function prepWallsOutgoing(walls, config) {
129
133
  });
130
134
  var _c = line.flat(), x1 = _c[0], y1 = _c[1], x2 = _c[2], y2 = _c[3];
131
135
  var configuration = Object.entries((_a = {},
132
- _a[constants_1.IWallAttributes.START_X] = x1,
133
- _a[constants_1.IWallAttributes.START_Z] = y1,
134
- _a[constants_1.IWallAttributes.END_X] = x2,
135
- _a[constants_1.IWallAttributes.END_Z] = y2,
136
- _a[constants_1.IWallAttributes.WALL_HEIGHT] = height,
137
- _a[constants_1.IWallAttributes.WALL_THICKNESS] = thickness,
136
+ _a[attributeName.wallStartX] = x1,
137
+ _a[attributeName.wallStartZ] = y1,
138
+ _a[attributeName.wallEndX] = x2,
139
+ _a[attributeName.wallEndZ] = y2,
140
+ _a[attributeName.wallHeight] = height,
141
+ _a[attributeName.wallThickness] = thickness,
138
142
  _a)).reduce(function (output, _a) {
139
143
  var _b;
140
144
  var key = _a[0], value = _a[1];
@@ -142,7 +146,7 @@ function prepWallsOutgoing(walls, config) {
142
146
  _b[key] = value ? value * config.config.scale : value,
143
147
  _b));
144
148
  }, (_b = {},
145
- _b[constants_1.IWallAttributes.CONNECTIONS] = JSON.stringify(connections),
149
+ _b[attributeName.wallConnections] = JSON.stringify(connections),
146
150
  _b));
147
151
  return {
148
152
  assetId: wall.assetId,
@@ -49,7 +49,6 @@ var roomBuilder_1 = require("../../store/roomBuilder");
49
49
  var useThreekitInitStatus_1 = __importDefault(require("../useThreekitInitStatus"));
50
50
  var useRoomBuilder = function (props) {
51
51
  var _a;
52
- var _b;
53
52
  var attributesState = (0, useConfigurator_1.default)()[0];
54
53
  var hasLoaded = (0, useThreekitInitStatus_1.default)();
55
54
  var dispatch = (0, store_1.useThreekitDispatch)();
@@ -59,8 +58,8 @@ var useRoomBuilder = function (props) {
59
58
  var modeValue = (0, store_1.useThreekitSelector)(roomBuilder_1.getMode);
60
59
  var showDimensions = (0, store_1.useThreekitSelector)(roomBuilder_1.getShowDimensions);
61
60
  var angleSnappingEnabled = (0, store_1.useThreekitSelector)(roomBuilder_1.getAngleSnappingEnabled);
62
- var _c = (0, react_1.useState)(null), selectedElement = _c[0], setSelectedElement = _c[1];
63
- var _d = (0, react_1.useState)(null), selectedWallAsset = _d[0], setSelectedWallAsset = _d[1];
61
+ var _b = (0, react_1.useState)(null), selectedElement = _b[0], setSelectedElement = _b[1];
62
+ var _c = (0, react_1.useState)(null), selectedWallAsset = _c[0], setSelectedWallAsset = _c[1];
64
63
  var canvasRef = (0, react_1.useRef)(null);
65
64
  var selectElementPending = (0, react_1.useRef)(null);
66
65
  var translationAnchorRef = (0, react_1.useRef)(null);
@@ -70,16 +69,11 @@ var useRoomBuilder = function (props) {
70
69
  snapProximity: constants_1.SNAP_PROXIMITY,
71
70
  zoomDefault: zoom || constants_1.ZOOM_DEFAULT,
72
71
  translateDefault: translation || constants_1.TRANSLATE_DEFAULT,
73
- styles: ((_b = props.config) === null || _b === void 0 ? void 0 : _b.theme) && themes_1.default[props.config.theme]
72
+ styles: ((_a = props.config) === null || _a === void 0 ? void 0 : _a.theme) && themes_1.default[props.config.theme]
74
73
  ? themes_1.default[props.config.theme]
75
74
  : themes_1.default[themes_1.IThemes.DEFAULT],
76
75
  }, props.config);
77
- var attributeNames = Object.assign((_a = {},
78
- _a[types_1.IElements.WALL] = constants_1.IRoomBuilderAttributes.WALLS,
79
- _a[types_1.IElements.WINDOW] = constants_1.IRoomBuilderAttributes.WINDOWS,
80
- _a[types_1.IElements.OPENING] = constants_1.IRoomBuilderAttributes.OPENINGS,
81
- _a[types_1.IElements.DOOR] = constants_1.IRoomBuilderAttributes.DOORS,
82
- _a), props.attributes);
76
+ var attributeNames = Object.assign(constants_1.attributeNameDefaults, props.attributes);
83
77
  var roomBuilderRef = (0, react_1.useRef)(new RoomBuilderState_1.default(__assign(__assign({}, props), { config: preppedConfig, attributes: attributeNames })));
84
78
  var drawRoom = function () { return roomBuilderRef.current.drawRoom(canvasRef.current); };
85
79
  (0, react_1.useEffect)(function () {
@@ -151,10 +145,10 @@ var useRoomBuilder = function (props) {
151
145
  var layoutIds = props.layouts || [];
152
146
  dispatch((0, roomBuilder_1.hydrateLayouts)(layoutIds, {
153
147
  walls: attributeNames[types_1.IElements.WALL],
154
- startX: constants_1.IWallAttributes.START_X,
155
- startZ: constants_1.IWallAttributes.START_Z,
156
- endX: constants_1.IWallAttributes.END_X,
157
- endZ: constants_1.IWallAttributes.END_Z,
148
+ startX: attributeNames.wallStartX,
149
+ startZ: attributeNames.wallStartZ,
150
+ endX: attributeNames.wallEndX,
151
+ endZ: attributeNames.wallStartZ,
158
152
  }));
159
153
  }, [hasLoaded, JSON.stringify(props.layouts)]);
160
154
  var updateZoom = function (value) {
@@ -231,17 +231,32 @@ export interface IRoomBuilderConfigUser extends IRoomBuilderConfigShared<Partial
231
231
  }
232
232
  export interface IRoomBuilderAttributes {
233
233
  [IElements.WALL]: string;
234
- [IElements.WINDOW]?: string;
235
- [IElements.DOOR]?: string;
236
- [IElements.OPENING]?: string;
237
- }
238
- interface IRoomBuilderPropsShared<T> {
234
+ [IElements.WINDOW]: string;
235
+ [IElements.DOOR]: string;
236
+ [IElements.OPENING]: string;
237
+ featurePositionX: string;
238
+ featurePositionY: string;
239
+ featurePositionZ: string;
240
+ featureConnectedTo: string;
241
+ featureHeight: string;
242
+ featureLength: string;
243
+ wallStartX: string;
244
+ wallStartY: string;
245
+ wallStartZ: string;
246
+ wallEndX: string;
247
+ wallEndY: string;
248
+ wallEndZ: string;
249
+ wallConnections: string;
250
+ wallThickness: string;
251
+ wallHeight: string;
252
+ }
253
+ interface IRoomBuilderPropsShared<T, U> {
239
254
  config: T;
240
- attributes: IRoomBuilderAttributes;
255
+ attributes: U;
241
256
  layouts?: Array<string>;
242
257
  }
243
- export interface IRoomBuilderHookProps extends IRoomBuilderPropsShared<undefined | Partial<IRoomBuilderConfigUser>> {
258
+ export interface IRoomBuilderHookProps extends IRoomBuilderPropsShared<undefined | Partial<IRoomBuilderConfigUser>, undefined | Partial<IRoomBuilderAttributes>> {
244
259
  }
245
- export interface IRoomBuilderStateProps extends IRoomBuilderPropsShared<IRoomBuilderConfigInternal> {
260
+ export interface IRoomBuilderStateProps extends IRoomBuilderPropsShared<IRoomBuilderConfigInternal, IRoomBuilderAttributes> {
246
261
  }
247
262
  export {};
package/dist/utils.d.ts CHANGED
@@ -53,7 +53,7 @@ export declare const hydrateAttribute: (data: [
53
53
  undefined | ITranslationMap,
54
54
  undefined | string
55
55
  ], optionSelectionHandler: (config: ISetConfiguration) => Promise<void>) => Record<string, IHydratedAttribute>;
56
- export declare const selectionToConfiguration: (value: RawAttributeValue, attributeType: ATTRIBUTE_TYPES) => string | number | boolean | IConfigurationColor | File | {
56
+ export declare const selectionToConfiguration: (value: RawAttributeValue, attributeType: ATTRIBUTE_TYPES) => string | number | boolean | File | IConfigurationColor | {
57
57
  assetId: RawAttributeValue;
58
58
  } | undefined;
59
59
  export declare const filterFormAttributes: (attributes: Record<string, IThreekitDisplayAttribute>, attributeComponentProps: IAttributesComponentProps, includeReservedAttributes: boolean) => IThreekitDisplayAttribute[];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@threekit-tools/treble",
3
- "version": "0.0.90-next-02",
3
+ "version": "0.0.90-next-03",
4
4
  "author": "Amaan Saeed",
5
5
  "license": "MIT",
6
6
  "files": [
@@ -1,2 +0,0 @@
1
- declare const useAnimationStart: () => boolean;
2
- export default useAnimationStart;
@@ -1,8 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- var store_1 = require("../../store");
4
- var treble_1 = require("../../store/treble");
5
- var useAnimationStart = function () {
6
- return (0, store_1.useThreekitSelector)(treble_1.isFirstRenderComplete);
7
- };
8
- exports.default = useAnimationStart;
@@ -1,2 +0,0 @@
1
- declare const usePlayerLoadingStatus: () => boolean;
2
- export default usePlayerLoadingStatus;
@@ -1,8 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- var store_1 = require("../../store");
4
- var treble_1 = require("../../store/treble");
5
- var usePlayerLoadingStatus = function () {
6
- return (0, store_1.useThreekitSelector)(treble_1.isPlayerLoading);
7
- };
8
- exports.default = usePlayerLoadingStatus;