@tscircuit/core 0.0.362 → 0.0.364

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
@@ -5649,15 +5649,15 @@ declare class PlatedHole extends PrimitiveComponent<typeof platedHoleProps> {
5649
5649
  shape: zod.ZodLiteral<"oval">;
5650
5650
  outerWidth: zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>;
5651
5651
  outerHeight: zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>;
5652
- innerWidth: zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>;
5653
- innerHeight: zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>;
5652
+ holeWidth: zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>;
5653
+ holeHeight: zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>;
5654
5654
  portHints: zod.ZodOptional<zod.ZodArray<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, "many">>;
5655
5655
  }>, "strip", zod.ZodTypeAny, {
5656
5656
  shape: "oval";
5657
5657
  outerWidth: number;
5658
5658
  outerHeight: number;
5659
- innerWidth: number;
5660
- innerHeight: number;
5659
+ holeWidth: number;
5660
+ holeHeight: number;
5661
5661
  pcbX?: number | undefined;
5662
5662
  pcbY?: number | undefined;
5663
5663
  name?: string | undefined;
@@ -5666,8 +5666,8 @@ declare class PlatedHole extends PrimitiveComponent<typeof platedHoleProps> {
5666
5666
  shape: "oval";
5667
5667
  outerWidth: string | number;
5668
5668
  outerHeight: string | number;
5669
- innerWidth: string | number;
5670
- innerHeight: string | number;
5669
+ holeWidth: string | number;
5670
+ holeHeight: string | number;
5671
5671
  pcbX?: string | number | undefined;
5672
5672
  pcbY?: string | number | undefined;
5673
5673
  name?: string | undefined;
@@ -5690,15 +5690,15 @@ declare class PlatedHole extends PrimitiveComponent<typeof platedHoleProps> {
5690
5690
  shape: zod.ZodLiteral<"pill">;
5691
5691
  outerWidth: zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>;
5692
5692
  outerHeight: zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>;
5693
- innerWidth: zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>;
5694
- innerHeight: zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>;
5693
+ holeWidth: zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>;
5694
+ holeHeight: zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>;
5695
5695
  portHints: zod.ZodOptional<zod.ZodArray<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, "many">>;
5696
5696
  }>, "strip", zod.ZodTypeAny, {
5697
5697
  shape: "pill";
5698
5698
  outerWidth: number;
5699
5699
  outerHeight: number;
5700
- innerWidth: number;
5701
- innerHeight: number;
5700
+ holeWidth: number;
5701
+ holeHeight: number;
5702
5702
  pcbX?: number | undefined;
5703
5703
  pcbY?: number | undefined;
5704
5704
  name?: string | undefined;
@@ -5707,8 +5707,8 @@ declare class PlatedHole extends PrimitiveComponent<typeof platedHoleProps> {
5707
5707
  shape: "pill";
5708
5708
  outerWidth: string | number;
5709
5709
  outerHeight: string | number;
5710
- innerWidth: string | number;
5711
- innerHeight: string | number;
5710
+ holeWidth: string | number;
5711
+ holeHeight: string | number;
5712
5712
  pcbX?: string | number | undefined;
5713
5713
  pcbY?: string | number | undefined;
5714
5714
  name?: string | undefined;
@@ -11430,6 +11430,12 @@ declare const applyPcbEditEventsToManualEditsFile: ({ circuitJson, editEvents, m
11430
11430
  manualEditsFile: z.infer<typeof manual_edits_file>;
11431
11431
  }) => z.infer<typeof manual_edits_file>;
11432
11432
 
11433
+ declare const applySchematicEditEventsToManualEditsFile: ({ circuitJson, editEvents, manualEditsFile, }: {
11434
+ circuitJson: CircuitJson;
11435
+ editEvents: ManualEditEvent[];
11436
+ manualEditsFile: z.infer<typeof manual_edits_file>;
11437
+ }) => z.infer<typeof manual_edits_file>;
11438
+
11433
11439
  interface TscircuitElements {
11434
11440
  resistor: _tscircuit_props.ResistorProps;
11435
11441
  capacitor: _tscircuit_props.CapacitorProps;
@@ -11495,4 +11501,4 @@ declare module "react/jsx-runtime" {
11495
11501
  }
11496
11502
  }
11497
11503
 
11498
- export { type AsyncEffect, type AutorouterCompleteEvent, type AutorouterErrorEvent, type AutorouterEvent, type AutorouterProgressEvent, type AutoroutingEndEvent, type AutoroutingErrorEvent, type AutoroutingProgressEvent, type AutoroutingStartEvent, Battery, Board, Capacitor, Chip, Circuit, type ComponentWithPins, Constraint, Crystal, Diode, FabricationNotePath, FabricationNoteText, Footprint, type GenericLocalAutorouter, Group, Hole, type IRenderable, Inductor, Jumper, Keepout, Led, Mosfet, Net, NetAlias, NormalComponent, type Obstacle, PinHeader, type PinLabelSpec, PlatedHole, Port, Potentiometer, PowerSource, PrimitiveComponent, Project, PushButton, type RenderPhase, type RenderPhaseFn, type RenderPhaseFunctions, type RenderPhaseStates, Renderable, Resistor, Resonator, RootCircuit, type RootCircuitEventName, type Sel, SilkscreenCircle, SilkscreenLine, SilkscreenPath, SilkscreenRect, SilkscreenText, type SimpleRouteConnection, type SimpleRouteJson, type SimplifiedPcbTrace, SmtPad, Subcircuit, Switch, Trace, TraceHint, Transistor, Via, applyEditEventsToManualEditsFile, applyPcbEditEventsToManualEditsFile, createUseComponent, getPhaseTimingsFromRenderEvents, getSimpleRouteJsonFromCircuitJson, orderedRenderPhases, sel, useCapacitor, useChip, useDiode, useLed, useRenderedCircuit, useResistor };
11504
+ export { type AsyncEffect, type AutorouterCompleteEvent, type AutorouterErrorEvent, type AutorouterEvent, type AutorouterProgressEvent, type AutoroutingEndEvent, type AutoroutingErrorEvent, type AutoroutingProgressEvent, type AutoroutingStartEvent, Battery, Board, Capacitor, Chip, Circuit, type ComponentWithPins, Constraint, Crystal, Diode, FabricationNotePath, FabricationNoteText, Footprint, type GenericLocalAutorouter, Group, Hole, type IRenderable, Inductor, Jumper, Keepout, Led, Mosfet, Net, NetAlias, NormalComponent, type Obstacle, PinHeader, type PinLabelSpec, PlatedHole, Port, Potentiometer, PowerSource, PrimitiveComponent, Project, PushButton, type RenderPhase, type RenderPhaseFn, type RenderPhaseFunctions, type RenderPhaseStates, Renderable, Resistor, Resonator, RootCircuit, type RootCircuitEventName, type Sel, SilkscreenCircle, SilkscreenLine, SilkscreenPath, SilkscreenRect, SilkscreenText, type SimpleRouteConnection, type SimpleRouteJson, type SimplifiedPcbTrace, SmtPad, Subcircuit, Switch, Trace, TraceHint, Transistor, Via, applyEditEventsToManualEditsFile, applyPcbEditEventsToManualEditsFile, applySchematicEditEventsToManualEditsFile, createUseComponent, getPhaseTimingsFromRenderEvents, getSimpleRouteJsonFromCircuitJson, orderedRenderPhases, sel, useCapacitor, useChip, useDiode, useLed, useRenderedCircuit, useResistor };
package/dist/index.js CHANGED
@@ -1723,8 +1723,8 @@ var PlatedHole = class extends PrimitiveComponent {
1723
1723
  pcb_port_id: this.matchedPort?.pcb_port_id,
1724
1724
  outer_width: props.outerWidth,
1725
1725
  outer_height: props.outerHeight,
1726
- hole_width: props.innerWidth,
1727
- hole_height: props.innerHeight,
1726
+ hole_width: props.holeWidth,
1727
+ hole_height: props.holeHeight,
1728
1728
  shape: props.shape,
1729
1729
  port_hints: this.getNameAndAliases(),
1730
1730
  x: position.x,
@@ -7362,7 +7362,7 @@ import { identity as identity4 } from "transformation-matrix";
7362
7362
  var package_default = {
7363
7363
  name: "@tscircuit/core",
7364
7364
  type: "module",
7365
- version: "0.0.361",
7365
+ version: "0.0.363",
7366
7366
  types: "dist/index.d.ts",
7367
7367
  main: "dist/index.js",
7368
7368
  module: "dist/index.js",
@@ -7419,7 +7419,7 @@ var package_default = {
7419
7419
  "@tscircuit/circuit-json-util": "^0.0.45",
7420
7420
  "@tscircuit/infgrid-ijump-astar": "^0.0.33",
7421
7421
  "@tscircuit/math-utils": "^0.0.12",
7422
- "@tscircuit/props": "^0.0.165",
7422
+ "@tscircuit/props": "^0.0.167",
7423
7423
  "@tscircuit/schematic-autolayout": "^0.0.6",
7424
7424
  "@tscircuit/soup-util": "^0.0.41",
7425
7425
  "circuit-json": "^0.0.153",
@@ -7807,6 +7807,47 @@ var applyPcbEditEventsToManualEditsFile = ({
7807
7807
  return updatedManualEditsFile;
7808
7808
  };
7809
7809
 
7810
+ // lib/utils/edit-events/apply-schematic-edit-events-to-manual-edits-file.ts
7811
+ import { su as su5 } from "@tscircuit/soup-util";
7812
+ import "zod";
7813
+ var applySchematicEditEventsToManualEditsFile = ({
7814
+ circuitJson,
7815
+ editEvents,
7816
+ manualEditsFile
7817
+ }) => {
7818
+ const updatedManualEditsFile = {
7819
+ ...manualEditsFile,
7820
+ schematic_placements: [...manualEditsFile.schematic_placements ?? []]
7821
+ };
7822
+ for (const editEvent of editEvents) {
7823
+ if (editEvent.edit_event_type === "edit_schematic_component_location") {
7824
+ const { schematic_component_id, new_center } = editEvent;
7825
+ const schematic_component2 = su5(circuitJson).schematic_component.get(
7826
+ schematic_component_id
7827
+ );
7828
+ if (!schematic_component2) continue;
7829
+ const source_component = su5(circuitJson).source_component.get(
7830
+ schematic_component2.source_component_id
7831
+ );
7832
+ if (!source_component) continue;
7833
+ const existingPlacementIndex = updatedManualEditsFile.schematic_placements?.findIndex(
7834
+ (p) => p.selector === source_component.name
7835
+ );
7836
+ const newPlacement = {
7837
+ selector: source_component.name,
7838
+ center: new_center,
7839
+ relative_to: "group_center"
7840
+ };
7841
+ if (existingPlacementIndex >= 0) {
7842
+ updatedManualEditsFile.schematic_placements[existingPlacementIndex] = newPlacement;
7843
+ } else {
7844
+ updatedManualEditsFile.schematic_placements.push(newPlacement);
7845
+ }
7846
+ }
7847
+ }
7848
+ return updatedManualEditsFile;
7849
+ };
7850
+
7810
7851
  // lib/index.ts
7811
7852
  import { createElement } from "react";
7812
7853
 
@@ -7863,6 +7904,7 @@ export {
7863
7904
  Via,
7864
7905
  applyEditEventsToManualEditsFile,
7865
7906
  applyPcbEditEventsToManualEditsFile,
7907
+ applySchematicEditEventsToManualEditsFile,
7866
7908
  createElement,
7867
7909
  createUseComponent,
7868
7910
  getPhaseTimingsFromRenderEvents,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@tscircuit/core",
3
3
  "type": "module",
4
- "version": "0.0.362",
4
+ "version": "0.0.364",
5
5
  "types": "dist/index.d.ts",
6
6
  "main": "dist/index.js",
7
7
  "module": "dist/index.js",
@@ -58,7 +58,7 @@
58
58
  "@tscircuit/circuit-json-util": "^0.0.45",
59
59
  "@tscircuit/infgrid-ijump-astar": "^0.0.33",
60
60
  "@tscircuit/math-utils": "^0.0.12",
61
- "@tscircuit/props": "^0.0.165",
61
+ "@tscircuit/props": "^0.0.167",
62
62
  "@tscircuit/schematic-autolayout": "^0.0.6",
63
63
  "@tscircuit/soup-util": "^0.0.41",
64
64
  "circuit-json": "^0.0.153",