@tscircuit/core 0.0.1202 → 0.0.1204

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.
package/dist/index.d.ts CHANGED
@@ -188,9 +188,9 @@ interface IIsolatedCircuit {
188
188
  interface IRootCircuit extends IIsolatedCircuit {
189
189
  }
190
190
 
191
- declare const orderedRenderPhases: readonly ["ReactSubtreesRender", "RenderIsolatedSubcircuits", "InflateSubcircuitCircuitJson", "SourceNameDuplicateComponentRemoval", "PcbFootprintStringRender", "FetchPartFootprint", "InitializePortsFromChildren", "CreateNetsFromProps", "AssignFallbackProps", "CreateTracesFromProps", "CreateTracesFromNetLabels", "CreateTraceHintsFromProps", "SourceGroupRender", "AssignNameToUnnamedComponents", "SourceRender", "SourceComponentPropertyValidation", "SourceParentAttachment", "PortMatching", "OptimizeSelectorCache", "SourceTraceRender", "SourceAddConnectivityMapKey", "SourceDesignRuleChecks", "SimulationRender", "SchematicComponentRender", "SchematicPortRender", "SymbolContainerRender", "SchematicPrimitiveRender", "SchematicSymbolResize", "SchematicComponentSizeCalculation", "SchematicLayout", "SchematicTraceRender", "SchematicReplaceNetLabelsWithSymbols", "PanelBoardLayout", "ValidatePcbCoordinates", "PcbComponentRender", "PcbPrimitiveRender", "PcbFootprintLayout", "PcbPortRender", "PcbPortAttachment", "PcbComponentSizeCalculation", "PcbComponentAnchorAlignment", "PcbCalcPlacementResolution", "PcbLayout", "PcbBoardAutoSize", "PanelLayout", "PcbTraceHintRender", "PcbManualTraceRender", "PcbTraceRender", "PcbRouteNetIslands", "PcbCopperPourRender", "PcbDesignRuleChecks", "SilkscreenOverlapAdjustment", "CadModelRender", "PartsEngineRender", "SimulationSpiceEngineRender"];
191
+ declare const orderedRenderPhases: readonly ["ReactSubtreesRender", "RenderIsolatedSubcircuits", "InflateSubcircuitCircuitJson", "SourceNameDuplicateComponentRemoval", "PcbFootprintStringRender", "FetchPartFootprint", "InitializePortsFromChildren", "CreateNetsFromProps", "AssignFallbackProps", "CreateTracesFromProps", "CreateTracesFromNetLabels", "CreateTraceHintsFromProps", "SourceGroupRender", "AssignNameToUnnamedComponents", "SourceRender", "SourceComponentPropertyValidation", "SourceParentAttachment", "PortMatching", "OptimizeSelectorCache", "SourceTraceRender", "SourceAddConnectivityMapKey", "SourceDesignRuleChecks", "SimulationRender", "SchematicComponentRender", "SchematicPortRender", "SymbolContainerRender", "SchematicPrimitiveRender", "SchematicSymbolResize", "SchematicComponentSizeCalculation", "SchematicLayout", "SchematicTraceRender", "SchematicReplaceNetLabelsWithSymbols", "PanelBoardLayout", "ValidatePcbCoordinates", "PcbComponentRender", "PcbPrimitiveRender", "PcbFootprintLayout", "PcbPortRender", "PcbPortAttachment", "PcbComponentSizeCalculation", "PcbComponentAnchorAlignment", "PcbCalcPlacementResolution", "PcbLayout", "PcbBoardAutoSize", "PanelLayout", "PcbTraceHintRender", "PcbManualTraceRender", "PcbTraceRender", "PcbRouteNetIslands", "PcbCopperPourRender", "PcbDesignRuleChecks", "SilkscreenOverlapAdjustment", "CadModelRender", "PartsEngineRender", "SupplierFootprintMismatchWarning", "SimulationSpiceEngineRender"];
192
192
  type RenderPhase = (typeof orderedRenderPhases)[number];
193
- declare const renderPhaseIndexMap: Map<"ReactSubtreesRender" | "RenderIsolatedSubcircuits" | "InflateSubcircuitCircuitJson" | "SourceNameDuplicateComponentRemoval" | "PcbFootprintStringRender" | "FetchPartFootprint" | "InitializePortsFromChildren" | "CreateNetsFromProps" | "AssignFallbackProps" | "CreateTracesFromProps" | "CreateTracesFromNetLabels" | "CreateTraceHintsFromProps" | "SourceGroupRender" | "AssignNameToUnnamedComponents" | "SourceRender" | "SourceComponentPropertyValidation" | "SourceParentAttachment" | "PortMatching" | "OptimizeSelectorCache" | "SourceTraceRender" | "SourceAddConnectivityMapKey" | "SourceDesignRuleChecks" | "SimulationRender" | "SchematicComponentRender" | "SchematicPortRender" | "SymbolContainerRender" | "SchematicPrimitiveRender" | "SchematicSymbolResize" | "SchematicComponentSizeCalculation" | "SchematicLayout" | "SchematicTraceRender" | "SchematicReplaceNetLabelsWithSymbols" | "PanelBoardLayout" | "ValidatePcbCoordinates" | "PcbComponentRender" | "PcbPrimitiveRender" | "PcbFootprintLayout" | "PcbPortRender" | "PcbPortAttachment" | "PcbComponentSizeCalculation" | "PcbComponentAnchorAlignment" | "PcbCalcPlacementResolution" | "PcbLayout" | "PcbBoardAutoSize" | "PanelLayout" | "PcbTraceHintRender" | "PcbManualTraceRender" | "PcbTraceRender" | "PcbRouteNetIslands" | "PcbCopperPourRender" | "PcbDesignRuleChecks" | "SilkscreenOverlapAdjustment" | "CadModelRender" | "PartsEngineRender" | "SimulationSpiceEngineRender", number>;
193
+ declare const renderPhaseIndexMap: Map<"ReactSubtreesRender" | "RenderIsolatedSubcircuits" | "InflateSubcircuitCircuitJson" | "SourceNameDuplicateComponentRemoval" | "PcbFootprintStringRender" | "FetchPartFootprint" | "InitializePortsFromChildren" | "CreateNetsFromProps" | "AssignFallbackProps" | "CreateTracesFromProps" | "CreateTracesFromNetLabels" | "CreateTraceHintsFromProps" | "SourceGroupRender" | "AssignNameToUnnamedComponents" | "SourceRender" | "SourceComponentPropertyValidation" | "SourceParentAttachment" | "PortMatching" | "OptimizeSelectorCache" | "SourceTraceRender" | "SourceAddConnectivityMapKey" | "SourceDesignRuleChecks" | "SimulationRender" | "SchematicComponentRender" | "SchematicPortRender" | "SymbolContainerRender" | "SchematicPrimitiveRender" | "SchematicSymbolResize" | "SchematicComponentSizeCalculation" | "SchematicLayout" | "SchematicTraceRender" | "SchematicReplaceNetLabelsWithSymbols" | "PanelBoardLayout" | "ValidatePcbCoordinates" | "PcbComponentRender" | "PcbPrimitiveRender" | "PcbFootprintLayout" | "PcbPortRender" | "PcbPortAttachment" | "PcbComponentSizeCalculation" | "PcbComponentAnchorAlignment" | "PcbCalcPlacementResolution" | "PcbLayout" | "PcbBoardAutoSize" | "PanelLayout" | "PcbTraceHintRender" | "PcbManualTraceRender" | "PcbTraceRender" | "PcbRouteNetIslands" | "PcbCopperPourRender" | "PcbDesignRuleChecks" | "SilkscreenOverlapAdjustment" | "CadModelRender" | "PartsEngineRender" | "SupplierFootprintMismatchWarning" | "SimulationSpiceEngineRender", number>;
194
194
  type RenderPhaseFn<K extends RenderPhase = RenderPhase> = `doInitial${K}` | `update${K}` | `remove${K}`;
195
195
  type RenderPhaseStates = Record<RenderPhase, {
196
196
  initialized: boolean;
@@ -1888,6 +1888,7 @@ declare class NormalComponent<ZodProps extends z.ZodType = any, PortNames extend
1888
1888
  _inferredInternallyConnectedPinNames: string[][];
1889
1889
  pcb_missing_footprint_error_id?: string;
1890
1890
  _hasStartedFootprintUrlLoad: boolean;
1891
+ _hasStartedSupplierFootprintMismatchWarningCheck: boolean;
1891
1892
  private _invalidFootprintPropMessages;
1892
1893
  private _invalidPinLabelMessages;
1893
1894
  /**
@@ -2023,6 +2024,8 @@ declare class NormalComponent<ZodProps extends z.ZodType = any, PortNames extend
2023
2024
  protected _getSupplierPartNumbers(partsEngine: any, source_component: any, footprinterString: string | undefined): Promise<any>;
2024
2025
  doInitialPartsEngineRender(): void;
2025
2026
  updatePartsEngineRender(): void;
2027
+ doInitialSupplierFootprintMismatchWarning(): void;
2028
+ updateSupplierFootprintMismatchWarning(): void;
2026
2029
  doInitialAssignFallbackProps(): void;
2027
2030
  doInitialCreateTracesFromProps(): void;
2028
2031
  _createTracesFromConnectionsProp(): void;
package/dist/index.js CHANGED
@@ -105,7 +105,7 @@ import {
105
105
  point3 as point32,
106
106
  rotation as rotation2,
107
107
  schematic_manual_edit_conflict_warning,
108
- unknown_error_finding_part
108
+ unknown_error_finding_part as unknown_error_finding_part2
109
109
  } from "circuit-json";
110
110
  import Debug5 from "debug";
111
111
 
@@ -353,6 +353,7 @@ var orderedRenderPhases = [
353
353
  "SilkscreenOverlapAdjustment",
354
354
  "CadModelRender",
355
355
  "PartsEngineRender",
356
+ "SupplierFootprintMismatchWarning",
356
357
  "SimulationSpiceEngineRender"
357
358
  ];
358
359
  var renderPhaseIndexMap = new Map(
@@ -399,6 +400,11 @@ var asyncPhaseDependencies = {
399
400
  ],
400
401
  CadModelRender: ["PcbFootprintStringRender", "FetchPartFootprint"],
401
402
  PartsEngineRender: ["PcbFootprintStringRender", "FetchPartFootprint"],
403
+ SupplierFootprintMismatchWarning: [
404
+ "PcbFootprintStringRender",
405
+ "FetchPartFootprint",
406
+ "PartsEngineRender"
407
+ ],
402
408
  PcbComponentAnchorAlignment: [
403
409
  "PcbFootprintStringRender",
404
410
  "FetchPartFootprint"
@@ -2599,53 +2605,6 @@ var getObstaclesFromRoute = (route, source_trace_id, { viaDiameter = 0.5 } = {})
2599
2605
  return obstacles;
2600
2606
  };
2601
2607
 
2602
- // lib/utils/obstacles/generateApproximatingRects.ts
2603
- function generateApproximatingRects(rotatedRect, numRects = 2) {
2604
- const { center, width, height, rotation: rotation4 } = rotatedRect;
2605
- const rects = [];
2606
- const angleRad = rotation4 * Math.PI / 180;
2607
- const cosAngle = Math.cos(angleRad);
2608
- const sinAngle = Math.sin(angleRad);
2609
- const normalizedRotation = (rotation4 % 360 + 360) % 360;
2610
- const sliceAlongWidth = height <= width ? normalizedRotation >= 45 && normalizedRotation < 135 || normalizedRotation >= 225 && normalizedRotation < 315 : normalizedRotation >= 135 && normalizedRotation < 225 || normalizedRotation >= 315 || normalizedRotation < 45;
2611
- if (sliceAlongWidth) {
2612
- const sliceWidth = width / numRects;
2613
- for (let i = 0; i < numRects; i++) {
2614
- const x = (i - numRects / 2 + 0.5) * sliceWidth;
2615
- const rotatedX = -x * cosAngle;
2616
- const rotatedY = -x * sinAngle;
2617
- const coverageWidth = sliceWidth * 1.1;
2618
- const coverageHeight = Math.abs(height * cosAngle) + Math.abs(sliceWidth * sinAngle);
2619
- rects.push({
2620
- center: {
2621
- x: center.x + rotatedX,
2622
- y: center.y + rotatedY
2623
- },
2624
- width: coverageWidth,
2625
- height: coverageHeight
2626
- });
2627
- }
2628
- } else {
2629
- const sliceHeight = height / numRects;
2630
- for (let i = 0; i < numRects; i++) {
2631
- const y = (i - numRects / 2 + 0.5) * sliceHeight;
2632
- const rotatedX = -y * sinAngle;
2633
- const rotatedY = y * cosAngle;
2634
- const coverageWidth = Math.abs(width * cosAngle) + Math.abs(sliceHeight * sinAngle);
2635
- const coverageHeight = sliceHeight * 1.1;
2636
- rects.push({
2637
- center: {
2638
- x: center.x + rotatedX,
2639
- y: center.y + rotatedY
2640
- },
2641
- width: coverageWidth,
2642
- height: coverageHeight
2643
- });
2644
- }
2645
- }
2646
- return rects;
2647
- }
2648
-
2649
2608
  // lib/utils/obstacles/fillPolygonWithRects.ts
2650
2609
  function fillPolygonWithRects(polygon, options = {}) {
2651
2610
  if (polygon.length < 3) return [];
@@ -2772,18 +2731,16 @@ var getObstaclesFromCircuitJson = (soup, connMap) => {
2772
2731
  rotation: element.ccw_rotation
2773
2732
  };
2774
2733
  const singleRect = getAxisAlignedRectFromRotatedRect(rotatedRect);
2775
- const rects = singleRect ? [singleRect] : generateApproximatingRects(rotatedRect);
2776
- for (const rect of rects) {
2777
- obstacles.push({
2778
- type: "rect",
2779
- layers: [element.layer],
2780
- center: rect.center,
2781
- width: rect.width,
2782
- height: rect.height,
2783
- ...singleRect ? {} : { ccwRotationDegrees: element.ccw_rotation },
2784
- connectedTo: withNetId([element.pcb_smtpad_id])
2785
- });
2786
- }
2734
+ const rect = singleRect ?? rotatedRect;
2735
+ obstacles.push({
2736
+ type: "rect",
2737
+ layers: [element.layer],
2738
+ center: rect.center,
2739
+ width: rect.width,
2740
+ height: rect.height,
2741
+ ccwRotationDegrees: element.ccw_rotation,
2742
+ connectedTo: withNetId([element.pcb_smtpad_id])
2743
+ });
2787
2744
  } else if (element.shape === "pill" || element.shape === "rotated_pill") {
2788
2745
  obstacles.push({
2789
2746
  type: "rect",
@@ -10835,6 +10792,133 @@ var shouldCheckPortForMissingTrace = (component, port) => {
10835
10792
  return true;
10836
10793
  };
10837
10794
 
10795
+ // lib/components/base-components/NormalComponent/NormalComponent_doInitialSupplierFootprintMismatchWarning.ts
10796
+ import { getBoundsOfPcbElements } from "@tscircuit/circuit-json-util";
10797
+ import {
10798
+ supplierProps
10799
+ } from "@tscircuit/props";
10800
+ import {
10801
+ supplier_footprint_mismatch_warning,
10802
+ unknown_error_finding_part
10803
+ } from "circuit-json";
10804
+ var SUPPLIER_FOOTPRINT_IOU_WARNING_THRESHOLD = 0.8;
10805
+ var supplierNames = supplierProps.shape.supplierPartNumbers.unwrap().keySchema.options;
10806
+ var isCopperElement = (elm) => elm.type === "pcb_smtpad" || elm.type === "pcb_plated_hole";
10807
+ var isValidBounds = (bounds) => Number.isFinite(bounds.minX) && Number.isFinite(bounds.minY) && Number.isFinite(bounds.maxX) && Number.isFinite(bounds.maxY) && bounds.maxX > bounds.minX && bounds.maxY > bounds.minY;
10808
+ var getCopperBounds = (elements) => {
10809
+ const copperElements = elements.filter(isCopperElement);
10810
+ if (copperElements.length === 0) return null;
10811
+ const bounds = getBoundsOfPcbElements(copperElements);
10812
+ if (!isValidBounds(bounds)) return null;
10813
+ return bounds;
10814
+ };
10815
+ var getBoundsSize = (bounds) => ({
10816
+ width: bounds.maxX - bounds.minX,
10817
+ height: bounds.maxY - bounds.minY
10818
+ });
10819
+ var getCenteredBoundsIou = (boundsA, boundsB, opts) => {
10820
+ const sizeA = getBoundsSize(boundsA);
10821
+ const sizeB = getBoundsSize(boundsB);
10822
+ const bWidth = opts?.rotateB ? sizeB.height : sizeB.width;
10823
+ const bHeight = opts?.rotateB ? sizeB.width : sizeB.height;
10824
+ const intersectionWidth = Math.min(sizeA.width, bWidth);
10825
+ const intersectionHeight = Math.min(sizeA.height, bHeight);
10826
+ const intersectionArea = intersectionWidth * intersectionHeight;
10827
+ const unionArea = sizeA.width * sizeA.height + bWidth * bHeight - intersectionArea;
10828
+ if (unionArea <= 0) return 0;
10829
+ return intersectionArea / unionArea;
10830
+ };
10831
+ var getBestBoundsIou = (localBounds, supplierBounds) => Math.max(
10832
+ getCenteredBoundsIou(localBounds, supplierBounds),
10833
+ getCenteredBoundsIou(localBounds, supplierBounds, { rotateB: true })
10834
+ );
10835
+ var getSupplierPartCandidates = (supplierPartNumbers) => {
10836
+ if (!supplierPartNumbers) return [];
10837
+ const candidates = [];
10838
+ for (const supplierName of supplierNames) {
10839
+ const partNumbers = supplierPartNumbers[supplierName];
10840
+ if (!Array.isArray(partNumbers)) continue;
10841
+ for (const supplierPartNumber of partNumbers) {
10842
+ if (!supplierPartNumber) continue;
10843
+ candidates.push({ supplierName, supplierPartNumber });
10844
+ }
10845
+ }
10846
+ return candidates;
10847
+ };
10848
+ function NormalComponent_doInitialSupplierFootprintMismatchWarning(component) {
10849
+ if (component.root?.pcbDisabled) return;
10850
+ if (component.props.doNotPlace) return;
10851
+ if (component.props.footprint === void 0) return;
10852
+ if (component.getInheritedProperty("bomDisabled")) return;
10853
+ if (component.getInheritedProperty("partsEngineDisabled")) return;
10854
+ const partsEngine = component.getInheritedProperty("partsEngine");
10855
+ if (!partsEngine?.fetchPartCircuitJson) return;
10856
+ const { db } = component.root;
10857
+ const sourceComponent = db.source_component.get(
10858
+ component.source_component_id
10859
+ );
10860
+ if (!sourceComponent?.supplier_part_numbers) return;
10861
+ if (!component.pcb_component_id) return;
10862
+ if (component._hasStartedSupplierFootprintMismatchWarningCheck) return;
10863
+ const supplierPartCandidates = getSupplierPartCandidates(
10864
+ sourceComponent.supplier_part_numbers
10865
+ );
10866
+ if (supplierPartCandidates.length === 0) return;
10867
+ const localCopperElements = [
10868
+ ...db.pcb_smtpad.list({ pcb_component_id: component.pcb_component_id }),
10869
+ ...db.pcb_plated_hole.list({
10870
+ pcb_component_id: component.pcb_component_id
10871
+ })
10872
+ ];
10873
+ const localBounds = getCopperBounds(localCopperElements);
10874
+ if (!localBounds) return;
10875
+ component._hasStartedSupplierFootprintMismatchWarningCheck = true;
10876
+ component._queueAsyncEffect("check-supplier-footprint-mismatch", async () => {
10877
+ const { db: db2 } = component.root;
10878
+ const fetchPartCircuitJson = partsEngine.fetchPartCircuitJson;
10879
+ for (const supplierPartCandidate of supplierPartCandidates) {
10880
+ const { supplierName, supplierPartNumber } = supplierPartCandidate;
10881
+ try {
10882
+ const supplierCircuitJson = await Promise.resolve(
10883
+ fetchPartCircuitJson({ supplierPartNumber })
10884
+ ) ?? null;
10885
+ if (!supplierCircuitJson?.length) continue;
10886
+ const supplierBounds = getCopperBounds(supplierCircuitJson);
10887
+ if (!supplierBounds) continue;
10888
+ const footprintCopperIou = getBestBoundsIou(localBounds, supplierBounds);
10889
+ if (footprintCopperIou >= SUPPLIER_FOOTPRINT_IOU_WARNING_THRESHOLD) {
10890
+ return;
10891
+ }
10892
+ const footprintLabel = typeof component.props.footprint === "string" ? `"${component.props.footprint}"` : "the provided footprint";
10893
+ const roundedIou = Number(footprintCopperIou.toFixed(4));
10894
+ const warning = supplier_footprint_mismatch_warning.parse({
10895
+ type: "supplier_footprint_mismatch_warning",
10896
+ message: `${component.getString()} footprint ${footprintLabel} does not match supplier footprint ${supplierName}:${supplierPartNumber} (copper IoU ${roundedIou}).`,
10897
+ source_component_id: component.source_component_id,
10898
+ pcb_component_id: component.pcb_component_id,
10899
+ pcb_group_id: component.getGroup()?.pcb_group_id ?? void 0,
10900
+ subcircuit_id: component.getSubcircuit()?.subcircuit_id ?? void 0,
10901
+ supplier_name: supplierName,
10902
+ supplier_part_number: supplierPartNumber,
10903
+ footprint_copper_intersection_over_union: roundedIou
10904
+ });
10905
+ db2.supplier_footprint_mismatch_warning.insert(warning);
10906
+ return;
10907
+ } catch (error) {
10908
+ const errorMessage = error instanceof Error ? error.message : String(error);
10909
+ const errorObj = unknown_error_finding_part.parse({
10910
+ type: "unknown_error_finding_part",
10911
+ message: `Failed to fetch supplier footprint for ${component.getString()} (${supplierName}:${supplierPartNumber}): ${errorMessage}`,
10912
+ source_component_id: component.source_component_id,
10913
+ subcircuit_id: component.getSubcircuit()?.subcircuit_id
10914
+ });
10915
+ db2.unknown_error_finding_part.insert(errorObj);
10916
+ return;
10917
+ }
10918
+ }
10919
+ });
10920
+ }
10921
+
10838
10922
  // lib/components/base-components/NormalComponent/utils/canMergePortDefinitions.ts
10839
10923
  var canMergePortDefinitions = (a, b) => {
10840
10924
  const aPinNumber = a._parsedProps.pinNumber;
@@ -11016,6 +11100,7 @@ var NormalComponent3 = class extends PrimitiveComponent2 {
11016
11100
  _inferredInternallyConnectedPinNames = [];
11017
11101
  pcb_missing_footprint_error_id;
11018
11102
  _hasStartedFootprintUrlLoad = false;
11103
+ _hasStartedSupplierFootprintMismatchWarningCheck = false;
11019
11104
  _invalidFootprintPropMessages = [];
11020
11105
  _invalidPinLabelMessages = [];
11021
11106
  /**
@@ -12270,7 +12355,7 @@ var NormalComponent3 = class extends PrimitiveComponent2 {
12270
12355
  this._markDirty("PartsEngineRender");
12271
12356
  }).catch((error) => {
12272
12357
  this._asyncSupplierPartNumbers = {};
12273
- const errorObj = unknown_error_finding_part.parse({
12358
+ const errorObj = unknown_error_finding_part2.parse({
12274
12359
  type: "unknown_error_finding_part",
12275
12360
  message: `Failed to fetch supplier part numbers for ${this.getString()}: ${error.message}`,
12276
12361
  source_component_id: this.source_component_id,
@@ -12296,6 +12381,12 @@ var NormalComponent3 = class extends PrimitiveComponent2 {
12296
12381
  return;
12297
12382
  }
12298
12383
  }
12384
+ doInitialSupplierFootprintMismatchWarning() {
12385
+ NormalComponent_doInitialSupplierFootprintMismatchWarning(this);
12386
+ }
12387
+ updateSupplierFootprintMismatchWarning() {
12388
+ this.doInitialSupplierFootprintMismatchWarning();
12389
+ }
12299
12390
  doInitialAssignFallbackProps() {
12300
12391
  const { _parsedProps: props } = this;
12301
12392
  if (props.connections && !this.name) {
@@ -14317,7 +14408,7 @@ var TraceHint = class extends PrimitiveComponent2 {
14317
14408
  };
14318
14409
 
14319
14410
  // lib/components/primitive-components/Group/Group_doInitialPcbCalcPlacementResolution.ts
14320
- import { getBoundsOfPcbElements } from "@tscircuit/circuit-json-util";
14411
+ import { getBoundsOfPcbElements as getBoundsOfPcbElements2 } from "@tscircuit/circuit-json-util";
14321
14412
  var SUPPORTED_COMPONENT_FIELDS = /* @__PURE__ */ new Set([
14322
14413
  "x",
14323
14414
  "y",
@@ -14604,7 +14695,7 @@ function updateVarsForNamedComponent(component, vars) {
14604
14695
  });
14605
14696
  const padElementsByReference = collectPadElementsByReference(component);
14606
14697
  for (const [referencePath, elements] of padElementsByReference.entries()) {
14607
- const bounds = getBoundsOfPcbElements(elements);
14698
+ const bounds = getBoundsOfPcbElements2(elements);
14608
14699
  const minX = bounds.minX;
14609
14700
  const maxX = bounds.maxX;
14610
14701
  const minY = bounds.minY;
@@ -20123,7 +20214,7 @@ import { identity as identity5 } from "transformation-matrix";
20123
20214
  var package_default = {
20124
20215
  name: "@tscircuit/core",
20125
20216
  type: "module",
20126
- version: "0.0.1201",
20217
+ version: "0.0.1203",
20127
20218
  types: "dist/index.d.ts",
20128
20219
  main: "dist/index.js",
20129
20220
  module: "dist/index.js",
@@ -20155,7 +20246,7 @@ var package_default = {
20155
20246
  "@biomejs/biome": "^1.8.3",
20156
20247
  "@resvg/resvg-js": "^2.6.2",
20157
20248
  "@tscircuit/alphabet": "0.0.25",
20158
- "@tscircuit/capacity-autorouter": "^0.0.473",
20249
+ "@tscircuit/capacity-autorouter": "^0.0.475",
20159
20250
  "@tscircuit/checks": "0.0.125",
20160
20251
  "@tscircuit/circuit-json-util": "^0.0.94",
20161
20252
  "@tscircuit/common": "^0.0.20",
@@ -20183,7 +20274,7 @@ var package_default = {
20183
20274
  "bun-match-svg": "0.0.12",
20184
20275
  "calculate-elbow": "^0.0.12",
20185
20276
  "chokidar-cli": "^3.0.0",
20186
- "circuit-json": "^0.0.419",
20277
+ "circuit-json": "^0.0.421",
20187
20278
  "circuit-json-to-bpc": "^0.0.13",
20188
20279
  "circuit-json-to-connectivity-map": "^0.0.23",
20189
20280
  "circuit-json-to-gltf": "^0.0.96",
@@ -23939,7 +24030,7 @@ import { guessCableInsertCenter } from "@tscircuit/infer-cable-insertion-point";
23939
24030
  import {
23940
24031
  connectorProps
23941
24032
  } from "@tscircuit/props";
23942
- import { unknown_error_finding_part as unknown_error_finding_part2 } from "circuit-json";
24033
+ import { unknown_error_finding_part as unknown_error_finding_part3 } from "circuit-json";
23943
24034
 
23944
24035
  // lib/utils/connectors/convertCircuitJsonToUsbCStandardCircuitJson.ts
23945
24036
  var STANDARD_USB_C_PIN_LABELS = [
@@ -24186,7 +24277,7 @@ var Connector = class extends Chip {
24186
24277
  }
24187
24278
  _insertStandardConnectorCircuitJsonError(standard, message) {
24188
24279
  const { db } = this.root;
24189
- const errorObj = unknown_error_finding_part2.parse({
24280
+ const errorObj = unknown_error_finding_part3.parse({
24190
24281
  type: "unknown_error_finding_part",
24191
24282
  message: `Failed to fetch circuit JSON for ${this.getString()} (standard="${standard}"): ${message}`,
24192
24283
  source_component_id: this.source_component_id ?? void 0,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@tscircuit/core",
3
3
  "type": "module",
4
- "version": "0.0.1202",
4
+ "version": "0.0.1204",
5
5
  "types": "dist/index.d.ts",
6
6
  "main": "dist/index.js",
7
7
  "module": "dist/index.js",
@@ -33,7 +33,7 @@
33
33
  "@biomejs/biome": "^1.8.3",
34
34
  "@resvg/resvg-js": "^2.6.2",
35
35
  "@tscircuit/alphabet": "0.0.25",
36
- "@tscircuit/capacity-autorouter": "^0.0.473",
36
+ "@tscircuit/capacity-autorouter": "^0.0.475",
37
37
  "@tscircuit/checks": "0.0.125",
38
38
  "@tscircuit/circuit-json-util": "^0.0.94",
39
39
  "@tscircuit/common": "^0.0.20",
@@ -61,7 +61,7 @@
61
61
  "bun-match-svg": "0.0.12",
62
62
  "calculate-elbow": "^0.0.12",
63
63
  "chokidar-cli": "^3.0.0",
64
- "circuit-json": "^0.0.419",
64
+ "circuit-json": "^0.0.421",
65
65
  "circuit-json-to-bpc": "^0.0.13",
66
66
  "circuit-json-to-connectivity-map": "^0.0.23",
67
67
  "circuit-json-to-gltf": "^0.0.96",