@threekit-tools/treble 0.0.89-next-003 → 0.0.89-next-005

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.
@@ -694,6 +694,7 @@ var RoomBuilderState = (function () {
694
694
  });
695
695
  };
696
696
  RoomBuilderState.prototype.addFeature = function (type, feature, addToWallIndex) {
697
+ var _a;
697
698
  var offset = undefined;
698
699
  var index = undefined;
699
700
  if (addToWallIndex !== undefined && feature.offset !== undefined) {
@@ -721,13 +722,13 @@ var RoomBuilderState = (function () {
721
722
  return;
722
723
  var newFeature = __assign(__assign({}, feature), { offset: offset, connectedTo: [types_2.IElements.WALL, index] });
723
724
  var newFeatureIndex;
724
- if (this._state[types_2.IElements.FEATURE][type]) {
725
- this._state[types_2.IElements.FEATURE][type].push(newFeature);
725
+ if ((_a = this._state[types_2.IElements.FEATURE][type]) === null || _a === void 0 ? void 0 : _a.length) {
726
726
  newFeatureIndex = this._state[types_2.IElements.FEATURE][type].length;
727
+ this._state[types_2.IElements.FEATURE][type].push(newFeature);
727
728
  }
728
729
  else {
729
730
  this._state[types_2.IElements.FEATURE][type] = [newFeature];
730
- newFeatureIndex = 1;
731
+ newFeatureIndex = 0;
731
732
  }
732
733
  this.addFeatureToWall(index, [type, newFeatureIndex]);
733
734
  this.pushStateToConfigurator();
@@ -1118,8 +1119,6 @@ var RoomBuilderState = (function () {
1118
1119
  this.addWalls(newWallLines.map(function (line) { return ({
1119
1120
  assetId: assetId,
1120
1121
  line: line,
1121
- height: 1,
1122
- thickness: 0.6,
1123
1122
  connections: [],
1124
1123
  }); }));
1125
1124
  this._newWall = null;
@@ -3,14 +3,14 @@ export declare enum IWallAttributes {
3
3
  START_Z = "Start Z",
4
4
  END_X = "End X",
5
5
  END_Z = "End Z",
6
- HEIGHT = "Height",
7
- THICKNESS = "Thickness",
6
+ HEIGHT = "Wall Height",
7
+ THICKNESS = "Wall Thickness",
8
8
  CONNECTIONS = "Connections"
9
9
  }
10
10
  export declare enum IFeatureAttribute {
11
- POSITION_X = "Start X",
12
- POSITION_Y = "Start Y",
13
- POSITION_Z = "Start Z",
11
+ POSITION_X = "Offset X",
12
+ POSITION_Y = "Offset Y",
13
+ POSITION_Z = "Offset Z",
14
14
  HEIGHT = "Height",
15
15
  LENGTH = "Length",
16
16
  CONNECTED_TO = "Connected To"
@@ -9,15 +9,15 @@ var IWallAttributes;
9
9
  IWallAttributes["START_Z"] = "Start Z";
10
10
  IWallAttributes["END_X"] = "End X";
11
11
  IWallAttributes["END_Z"] = "End Z";
12
- IWallAttributes["HEIGHT"] = "Height";
13
- IWallAttributes["THICKNESS"] = "Thickness";
12
+ IWallAttributes["HEIGHT"] = "Wall Height";
13
+ IWallAttributes["THICKNESS"] = "Wall Thickness";
14
14
  IWallAttributes["CONNECTIONS"] = "Connections";
15
15
  })(IWallAttributes = exports.IWallAttributes || (exports.IWallAttributes = {}));
16
16
  var IFeatureAttribute;
17
17
  (function (IFeatureAttribute) {
18
- IFeatureAttribute["POSITION_X"] = "Start X";
19
- IFeatureAttribute["POSITION_Y"] = "Start Y";
20
- IFeatureAttribute["POSITION_Z"] = "Start Z";
18
+ IFeatureAttribute["POSITION_X"] = "Offset X";
19
+ IFeatureAttribute["POSITION_Y"] = "Offset Y";
20
+ IFeatureAttribute["POSITION_Z"] = "Offset Z";
21
21
  IFeatureAttribute["HEIGHT"] = "Height";
22
22
  IFeatureAttribute["LENGTH"] = "Length";
23
23
  IFeatureAttribute["CONNECTED_TO"] = "Connected To";
@@ -36,8 +36,8 @@ function drawGrid(canvas, styles) {
36
36
  if (!ctx)
37
37
  return;
38
38
  ctx.strokeStyle = styles.lineColor;
39
- var numHorizontalLines = Math.ceil(canvas.width / styles.gridStepGap);
40
- var numVerticalLines = Math.ceil(canvas.height / styles.gridStepGap);
39
+ var numHorizontalLines = Math.ceil(canvas.height / styles.gridStepGap);
40
+ var numVerticalLines = Math.ceil(canvas.width / styles.gridStepGap);
41
41
  for (var i = 0; i < numHorizontalLines; i++) {
42
42
  var y = i * styles.gridStepGap;
43
43
  ctx.lineWidth =
@@ -4,6 +4,7 @@ import type { IElementName, IElementPublic, IRoomBuilderHookProps } from './type
4
4
  import { IModes, IUnits, IElements } from './types';
5
5
  import { IThemes } from './themes';
6
6
  interface IUseRoomBuilder {
7
+ drawRoom: () => void;
7
8
  canvasRef: React.RefObject<HTMLCanvasElement>;
8
9
  [IElements.WALL]?: IHydratedAttributeArray;
9
10
  [IElements.WINDOW]?: IHydratedAttributeArray;
@@ -258,6 +258,7 @@ var useRoomBuilder = function (props) {
258
258
  setSelectedElement(null);
259
259
  };
260
260
  return {
261
+ drawRoom: drawRoom,
261
262
  canvasRef: canvasRef,
262
263
  selectedElement: selectedElement === null
263
264
  ? selectedElement
@@ -289,7 +289,6 @@ var launch = function (launchConfig) {
289
289
  }
290
290
  else {
291
291
  stageId = conf.stageId;
292
- initialConfiguration = conf.initialConfiguration;
293
292
  if (conf.configurationId)
294
293
  configurationId = conf.configurationId;
295
294
  else if ((0, utils_1.isUuid)(conf.assetId))
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@threekit-tools/treble",
3
- "version": "0.0.89-next-003",
3
+ "version": "0.0.89-next-005",
4
4
  "author": "Amaan Saeed",
5
5
  "license": "MIT",
6
6
  "files": [