@tscircuit/core 0.0.247 → 0.0.249

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/index.js +9 -8
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -2916,8 +2916,9 @@ var NormalComponent = class extends PrimitiveComponent {
2916
2916
  primaryPortLabels[port] = Array.isArray(label) ? label[0] : label;
2917
2917
  }
2918
2918
  }
2919
+ const center = this._getGlobalSchematicPositionBeforeLayout();
2919
2920
  const schematic_component2 = db.schematic_component.insert({
2920
- center: { x: props.schX ?? 0, y: props.schY ?? 0 },
2921
+ center,
2921
2922
  rotation: props.schRotation ?? 0,
2922
2923
  size: dimensions.getSize(),
2923
2924
  port_arrangement: underscorifyPortArrangement(
@@ -2938,8 +2939,8 @@ var NormalComponent = class extends PrimitiveComponent {
2938
2939
  anchor: "left",
2939
2940
  rotation: 0,
2940
2941
  position: {
2941
- x: hasTopOrBottomPins ? (props.schX ?? 0) + (schematic_box_width ?? 0) / 2 + 0.1 : (props.schX ?? 0) - (schematic_box_width ?? 0) / 2,
2942
- y: hasTopOrBottomPins ? (props.schY ?? 0) + (schematic_box_height ?? 0) / 2 + 0.35 : (props.schY ?? 0) - (schematic_box_height ?? 0) / 2 - 0.13
2942
+ x: hasTopOrBottomPins ? center.x + (schematic_box_width ?? 0) / 2 + 0.1 : center.x - (schematic_box_width ?? 0) / 2,
2943
+ y: hasTopOrBottomPins ? center.y + (schematic_box_height ?? 0) / 2 + 0.35 : center.y - (schematic_box_height ?? 0) / 2 - 0.13
2943
2944
  },
2944
2945
  color: "#006464"
2945
2946
  });
@@ -2949,8 +2950,8 @@ var NormalComponent = class extends PrimitiveComponent {
2949
2950
  anchor: "left",
2950
2951
  rotation: 0,
2951
2952
  position: {
2952
- x: hasTopOrBottomPins ? (props.schX ?? 0) + (schematic_box_width ?? 0) / 2 + 0.1 : (props.schX ?? 0) - (schematic_box_width ?? 0) / 2,
2953
- y: hasTopOrBottomPins ? (props.schY ?? 0) + (schematic_box_height ?? 0) / 2 + 0.55 : (props.schY ?? 0) + (schematic_box_height ?? 0) / 2 + 0.13
2953
+ x: hasTopOrBottomPins ? center.x + (schematic_box_width ?? 0) / 2 + 0.1 : center.x - (schematic_box_width ?? 0) / 2,
2954
+ y: hasTopOrBottomPins ? center.y + (schematic_box_height ?? 0) / 2 + 0.55 : center.y + (schematic_box_height ?? 0) / 2 + 0.13
2954
2955
  },
2955
2956
  color: "#006464"
2956
2957
  });
@@ -6000,7 +6001,7 @@ var RootCircuit = class {
6000
6001
  }
6001
6002
  if (this.children.length === 0) {
6002
6003
  throw new Error(
6003
- "Not able to guess root component: Project has no children (use project.add(...))"
6004
+ "Not able to guess root component: RootCircuit has no children (use circuit.add(...))"
6004
6005
  );
6005
6006
  }
6006
6007
  if (this.children.length > 0) {
@@ -6011,7 +6012,7 @@ var RootCircuit = class {
6011
6012
  }
6012
6013
  }
6013
6014
  throw new Error(
6014
- "Not able to guess root component: Project has multiple children and no board"
6015
+ "Not able to guess root component: RootCircuit has multiple children and no board"
6015
6016
  );
6016
6017
  }
6017
6018
  render() {
@@ -6019,7 +6020,7 @@ var RootCircuit = class {
6019
6020
  this._guessRootComponent();
6020
6021
  }
6021
6022
  const { firstChild, db } = this;
6022
- if (!firstChild) throw new Error("Project has no root component");
6023
+ if (!firstChild) throw new Error("RootCircuit has no root component");
6023
6024
  firstChild.parent = this;
6024
6025
  firstChild.runRenderCycle();
6025
6026
  this._hasRenderedAtleastOnce = true;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@tscircuit/core",
3
3
  "type": "module",
4
- "version": "0.0.247",
4
+ "version": "0.0.249",
5
5
  "types": "dist/index.d.ts",
6
6
  "main": "dist/index.js",
7
7
  "module": "dist/index.js",