@tscircuit/core 0.0.129 → 0.0.130

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 +27 -10
  2. package/package.json +2 -2
package/dist/index.js CHANGED
@@ -2546,6 +2546,7 @@ var FTYPE = stringProxy;
2546
2546
  import { traceProps } from "@tscircuit/props";
2547
2547
  import {
2548
2548
  MultilayerIjump,
2549
+ IJumpAutorouter,
2549
2550
  getObstaclesFromSoup
2550
2551
  } from "@tscircuit/infgrid-ijump-astar";
2551
2552
 
@@ -2558,6 +2559,22 @@ var computeObstacleBounds = (obstacles) => {
2558
2559
  return { minX, maxX, minY, maxY };
2559
2560
  };
2560
2561
 
2562
+ // lib/utils/projectPointInDirection.ts
2563
+ var projectPointInDirection = (point, direction, distance) => {
2564
+ switch (direction) {
2565
+ case "up":
2566
+ return { x: point.x, y: point.y - distance };
2567
+ case "down":
2568
+ return { x: point.x, y: point.y + distance };
2569
+ case "left":
2570
+ return { x: point.x - distance, y: point.y };
2571
+ case "right":
2572
+ return { x: point.x + distance, y: point.y };
2573
+ default:
2574
+ throw new Error(`Unknown direction "${direction}"`);
2575
+ }
2576
+ };
2577
+
2561
2578
  // lib/utils/autorouting/findPossibleTraceLayerCombinations.ts
2562
2579
  var LAYER_SELECTION_PREFERENCE = ["top", "bottom", "inner1", "inner2"];
2563
2580
  var findPossibleTraceLayerCombinations = (hints, layer_path = []) => {
@@ -3170,11 +3187,11 @@ searched component ${targetComponent.getString()}, which has ports: ${targetComp
3170
3187
  for (const { port } of ports) {
3171
3188
  connection.pointsToConnect.push({
3172
3189
  ...port._getGlobalSchematicPositionAfterLayout(),
3173
- // ...projectPointInDirection(
3174
- // port._getGlobalSchematicPositionAfterLayout(),
3175
- // port.facingDirection!,
3176
- // 0.1501,
3177
- // ),
3190
+ ...projectPointInDirection(
3191
+ port._getGlobalSchematicPositionAfterLayout(),
3192
+ port.facingDirection,
3193
+ 0.1501
3194
+ ),
3178
3195
  layer: "top"
3179
3196
  });
3180
3197
  }
@@ -3199,7 +3216,7 @@ searched component ${targetComponent.getString()}, which has ports: ${targetComp
3199
3216
  });
3200
3217
  }
3201
3218
  }
3202
- let Autorouter = MultilayerIjump;
3219
+ let Autorouter = IJumpAutorouter;
3203
3220
  if (this.getSubcircuit().props._schDirectLineRoutingEnabled) {
3204
3221
  Autorouter = DirectLineRouter;
3205
3222
  }
@@ -3523,10 +3540,10 @@ var getAllDimensionsForSchematicBox = (params) => {
3523
3540
  processSide("bottom", bottomSide, "left-to-right");
3524
3541
  }
3525
3542
  const trueEdgePositions = {
3526
- left: { x: -schWidth / 2, y: schHeight / 2 },
3527
- bottom: { x: -schWidth / 2, y: schHeight / 2 },
3528
- right: { x: schWidth / 2, y: -schHeight / 2 },
3529
- top: { x: schWidth / 2, y: -schHeight / 2 }
3543
+ left: { x: -schWidth / 2 - 0.2, y: schHeight / 2 },
3544
+ bottom: { x: -schWidth / 2, y: schHeight / 2 + 0.2 },
3545
+ right: { x: schWidth / 2 + 0.2, y: -schHeight / 2 },
3546
+ top: { x: schWidth / 2, y: -schHeight / 2 - 0.2 }
3530
3547
  };
3531
3548
  const trueEdgeTraversalDirections = {
3532
3549
  left: { x: 0, y: -1 },
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@tscircuit/core",
3
3
  "type": "module",
4
- "version": "0.0.129",
4
+ "version": "0.0.130",
5
5
  "types": "dist/index.d.ts",
6
6
  "main": "dist/index.js",
7
7
  "module": "dist/index.js",
@@ -44,7 +44,7 @@
44
44
  "@tscircuit/soup-util": "^0.0.33",
45
45
  "circuit-json": "^0.0.91",
46
46
  "circuit-json-to-connectivity-map": "^0.0.17",
47
- "circuit-to-svg": "^0.0.52",
47
+ "circuit-to-svg": "^0.0.53",
48
48
  "nanoid": "^5.0.7",
49
49
  "performance-now": "^2.1.0",
50
50
  "react": "^18.3.1",