@tscircuit/core 0.0.1333 → 0.0.1335

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 +30 -6
  2. package/package.json +2 -2
package/dist/index.js CHANGED
@@ -7215,6 +7215,26 @@ import { viaProps } from "@tscircuit/props";
7215
7215
  import {
7216
7216
  layer_ref
7217
7217
  } from "circuit-json";
7218
+
7219
+ // lib/utils/getViaSpanLayers.ts
7220
+ var getViaSpanLayers = ({
7221
+ fromLayer,
7222
+ toLayer,
7223
+ layerCount
7224
+ }) => {
7225
+ if (fromLayer === toLayer) return [fromLayer];
7226
+ const stack = ["top"];
7227
+ for (let i = 1; i <= layerCount - 2; i++) {
7228
+ stack.push(`inner${i}`);
7229
+ }
7230
+ stack.push("bottom");
7231
+ const fromIndex = stack.indexOf(fromLayer);
7232
+ const toIndex = stack.indexOf(toLayer);
7233
+ if (fromIndex === -1 || toIndex === -1) return [fromLayer, toLayer];
7234
+ return fromIndex <= toIndex ? stack.slice(fromIndex, toIndex + 1) : stack.slice(toIndex, fromIndex + 1).reverse();
7235
+ };
7236
+
7237
+ // lib/components/primitive-components/PcbVia.ts
7218
7238
  import { z as z6 } from "zod";
7219
7239
  var pcbViaProps = viaProps.extend({
7220
7240
  layers: z6.array(layer_ref).optional(),
@@ -7237,8 +7257,12 @@ var PcbVia = class extends PrimitiveComponent2 {
7237
7257
  _getLayers() {
7238
7258
  const { layers, fromLayer = "top", toLayer = "bottom" } = this._parsedProps;
7239
7259
  if (layers && layers.length > 0) return layers;
7240
- if (fromLayer === toLayer) return [fromLayer];
7241
- return [fromLayer, toLayer];
7260
+ const layerCount = this.parent ? this.getSubcircuit()._getSubcircuitLayerCount() : 2;
7261
+ return getViaSpanLayers({
7262
+ fromLayer,
7263
+ toLayer,
7264
+ layerCount
7265
+ });
7242
7266
  }
7243
7267
  getAvailablePcbLayers() {
7244
7268
  return this._getLayers();
@@ -23761,7 +23785,7 @@ import { identity as identity5 } from "transformation-matrix";
23761
23785
  var package_default = {
23762
23786
  name: "@tscircuit/core",
23763
23787
  type: "module",
23764
- version: "0.0.1332",
23788
+ version: "0.0.1334",
23765
23789
  types: "dist/index.d.ts",
23766
23790
  main: "dist/index.js",
23767
23791
  module: "dist/index.js",
@@ -23844,7 +23868,7 @@ var package_default = {
23844
23868
  "looks-same": "^9.0.1",
23845
23869
  minicssgrid: "^0.0.9",
23846
23870
  "pkg-pr-new": "^0.0.37",
23847
- poppygl: "^0.0.16",
23871
+ poppygl: "^0.0.24",
23848
23872
  react: "^19.1.0",
23849
23873
  "react-dom": "^19.1.0",
23850
23874
  "schematic-symbols": "^0.0.208",
@@ -28329,8 +28353,8 @@ var Via = class extends PrimitiveComponent2 {
28329
28353
  }
28330
28354
  _getLayers() {
28331
28355
  const { fromLayer = "top", toLayer = "bottom" } = this._parsedProps;
28332
- if (fromLayer === toLayer) return [fromLayer];
28333
- return [fromLayer, toLayer];
28356
+ const layerCount = this.parent ? this.getSubcircuit()._getSubcircuitLayerCount() : 2;
28357
+ return getViaSpanLayers({ fromLayer, toLayer, layerCount });
28334
28358
  }
28335
28359
  initPorts() {
28336
28360
  const layers = this._parsedProps.layers;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@tscircuit/core",
3
3
  "type": "module",
4
- "version": "0.0.1333",
4
+ "version": "0.0.1335",
5
5
  "types": "dist/index.d.ts",
6
6
  "main": "dist/index.js",
7
7
  "module": "dist/index.js",
@@ -84,7 +84,7 @@
84
84
  "looks-same": "^9.0.1",
85
85
  "minicssgrid": "^0.0.9",
86
86
  "pkg-pr-new": "^0.0.37",
87
- "poppygl": "^0.0.16",
87
+ "poppygl": "^0.0.24",
88
88
  "react": "^19.1.0",
89
89
  "react-dom": "^19.1.0",
90
90
  "schematic-symbols": "^0.0.208",