@tscircuit/core 0.0.970 → 0.0.972

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
@@ -1,7 +1,7 @@
1
1
  import * as circuit_json from 'circuit-json';
2
2
  import { PcbTraceError, PcbPlacementError, PcbManualEditConflictWarning, PcbViaClearanceError, LayerRef, AnyCircuitElement, Size, AnySourceComponent, PcbTraceRoutePoint, PcbTrace as PcbTrace$1, PcbVia, SchematicPort, SchematicComponent, RouteHintPoint, CircuitJson } from 'circuit-json';
3
3
  import * as _tscircuit_props from '@tscircuit/props';
4
- import { PlatformConfig, subcircuitGroupProps, AutorouterConfig, traceProps, SupplierPartNumbers, CadModelProp, SchematicPortArrangement, groupProps, boardProps, panelProps, capacitorProps, chipProps, pinoutProps, diodeProps, fuseProps, jumperProps, interconnectProps, solderjumperProps, ledProps, powerSourceProps, voltageSourceProps, currentSourceProps, resistorProps, constraintProps, fabricationNoteRectProps, fabricationNotePathProps, fabricationNoteTextProps, fabricationNoteDimensionProps, pcbNoteLineProps, pcbNoteRectProps, pcbNoteTextProps, pcbNotePathProps, pcbNoteDimensionProps, footprintProps, subcircuitProps, breakoutProps, breakoutPointProps, holeProps, pcbKeepoutProps, netLabelProps, cadmodelProps, cadassemblyProps, platedHoleProps, silkscreenCircleProps, silkscreenPathProps, silkscreenRectProps, silkscreenTextProps, silkscreenLineProps, smtPadProps, fiducialProps, traceHintProps, viaProps, copperPourProps, copperTextProps, cutoutProps, batteryProps, pinHeaderProps, resonatorProps, inductorProps, potentiometerProps, pushButtonProps, crystalProps, transistorProps, mosfetProps, opampProps, OpAmpPinLabels, switchProps, SwitchProps, testpointProps, schematicTextProps, schematicLineProps, schematicRectProps, schematicArcProps, schematicCircleProps, schematicBoxProps, schematicTableProps, schematicRowProps, schematicCellProps, symbolProps, analogSimulationProps, voltageProbeProps, CapacitorProps, ChipProps, DiodeProps, ResistorProps, ManualEditEvent, ManualEditsFile, ChipConnections, manual_edits_file } from '@tscircuit/props';
4
+ import { PlatformConfig, subcircuitGroupProps, AutorouterConfig, traceProps, SupplierPartNumbers, CadModelProp, SchematicPortArrangement, groupProps, boardProps, panelProps, capacitorProps, chipProps, pinoutProps, diodeProps, fuseProps, jumperProps, interconnectProps, solderjumperProps, ledProps, powerSourceProps, voltageSourceProps, currentSourceProps, resistorProps, constraintProps, fabricationNoteRectProps, fabricationNotePathProps, fabricationNoteTextProps, fabricationNoteDimensionProps, pcbNoteLineProps, pcbNoteRectProps, pcbNoteTextProps, pcbNotePathProps, pcbNoteDimensionProps, footprintProps, subcircuitProps, breakoutProps, breakoutPointProps, holeProps, pcbKeepoutProps, netLabelProps, cadmodelProps, cadassemblyProps, platedHoleProps, silkscreenCircleProps, silkscreenPathProps, silkscreenRectProps, silkscreenTextProps, silkscreenLineProps, smtPadProps, fiducialProps, traceHintProps, viaProps, copperPourProps, copperTextProps, cutoutProps, batteryProps, pinHeaderProps, resonatorProps, inductorProps, potentiometerProps, pushButtonProps, crystalProps, transistorProps, mosfetProps, opampProps, OpAmpPinLabels, switchProps, SwitchProps, testpointProps, schematicTextProps, schematicLineProps, schematicRectProps, schematicArcProps, schematicCircleProps, schematicPathProps, schematicBoxProps, schematicTableProps, schematicRowProps, schematicCellProps, symbolProps, analogSimulationProps, voltageProbeProps, CapacitorProps, ChipProps, DiodeProps, ResistorProps, ManualEditEvent, ManualEditsFile, ChipConnections, manual_edits_file } from '@tscircuit/props';
5
5
  import * as react from 'react';
6
6
  import react__default, { ReactElement, DetailedHTMLProps, SVGProps } from 'react';
7
7
  export { createElement } from 'react';
@@ -45048,6 +45048,42 @@ declare class SchematicCircle extends PrimitiveComponent<typeof schematicCircleP
45048
45048
  doInitialSchematicPrimitiveRender(): void;
45049
45049
  }
45050
45050
 
45051
+ declare class SchematicPath extends PrimitiveComponent<typeof schematicPathProps> {
45052
+ isSchematicPrimitive: boolean;
45053
+ get config(): {
45054
+ componentName: string;
45055
+ zodProps: zod.ZodObject<{
45056
+ points: zod.ZodArray<zod.ZodObject<{
45057
+ x: zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>;
45058
+ y: zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>;
45059
+ }, "strip", zod.ZodTypeAny, {
45060
+ x: number;
45061
+ y: number;
45062
+ }, {
45063
+ x: string | number;
45064
+ y: string | number;
45065
+ }>, "many">;
45066
+ isFilled: zod.ZodDefault<zod.ZodOptional<zod.ZodBoolean>>;
45067
+ fillColor: zod.ZodOptional<zod.ZodEnum<["red", "blue"]>>;
45068
+ }, "strip", zod.ZodTypeAny, {
45069
+ points: {
45070
+ x: number;
45071
+ y: number;
45072
+ }[];
45073
+ isFilled: boolean;
45074
+ fillColor?: "red" | "blue" | undefined;
45075
+ }, {
45076
+ points: {
45077
+ x: string | number;
45078
+ y: string | number;
45079
+ }[];
45080
+ isFilled?: boolean | undefined;
45081
+ fillColor?: "red" | "blue" | undefined;
45082
+ }>;
45083
+ };
45084
+ doInitialSchematicPrimitiveRender(): void;
45085
+ }
45086
+
45051
45087
  declare class SchematicBox extends PrimitiveComponent<typeof schematicBoxProps> {
45052
45088
  isSchematicPrimitive: boolean;
45053
45089
  get config(): {
@@ -47161,4 +47197,4 @@ declare module "react/jsx-runtime" {
47161
47197
  }
47162
47198
  }
47163
47199
 
47164
- export { AnalogSimulation, type AsyncEffect, type AutorouterCompleteEvent, type AutorouterErrorEvent, type AutorouterEvent, type AutorouterProgressEvent, type AutoroutingEndEvent, type AutoroutingErrorEvent, type AutoroutingProgressEvent, type AutoroutingStartEvent, Battery, Board, Breakout, BreakoutPoint, CadAssembly, CadModel, Capacitor, Chip, Circuit, type ComponentWithPins, Constraint, CopperPour, CopperText, Crystal, CurrentSource, Cutout, type DebugLogOutputEvent, Diode, FabricationNoteDimension, FabricationNotePath, FabricationNoteRect, FabricationNoteText, Fiducial, Footprint, Fuse, type GenericConnectionsAndSelectorsSel, type GenericLocalAutorouter, Group, Hole, type IRenderable, Inductor, Interconnect, Jumper, Keepout, Led, type LocalCacheEngine, Mosfet, Net, NetLabel, NormalComponent, type Obstacle, OpAmp, type PackingEndEvent, type PackingErrorEvent, type PackingStartEvent, Panel, PcbNoteDimension, PcbNoteLine, PcbNotePath, PcbNoteRect, PcbNoteText, PcbTrace, PinHeader, type PinLabelSpec, Pinout, PlatedHole, Port, Potentiometer, PowerSource, PrimitiveComponent, Project, PushButton, type RenderPhase, type RenderPhaseFn, type RenderPhaseFunctions, type RenderPhaseStates, Renderable, Resistor, Resonator, RootCircuit, type RootCircuitEventName, SOLVERS, SchematicArc, SchematicBox, SchematicCell, SchematicCircle, SchematicLine, SchematicRect, SchematicRow, SchematicTable, SchematicText, type Sel, SilkscreenCircle, SilkscreenLine, SilkscreenPath, SilkscreenRect, SilkscreenText, type SimpleRouteConnection, type SimpleRouteJson, type SimplifiedPcbTrace, SmtPad, SolderJumper, type SolverName, type SolverStartedEvent, Subcircuit, Switch, SymbolComponent as Symbol, TestPoint, Trace, TraceHint, Transistor, Via, VoltageProbe, VoltageSource, applyEditEvents, applyEditEventsToManualEditsFile, applyPcbEditEventsToManualEditsFile, applySchematicEditEventsToManualEditsFile, createUseComponent, getPhaseTimingsFromRenderEvents, getSimpleRouteJsonFromCircuitJson, normalizePinLabels, orderedRenderPhases, resolveStaticFileImport, sel, useCapacitor, useChip, useDiode, useLed, useRenderedCircuit, useResistor };
47200
+ export { AnalogSimulation, type AsyncEffect, type AutorouterCompleteEvent, type AutorouterErrorEvent, type AutorouterEvent, type AutorouterProgressEvent, type AutoroutingEndEvent, type AutoroutingErrorEvent, type AutoroutingProgressEvent, type AutoroutingStartEvent, Battery, Board, Breakout, BreakoutPoint, CadAssembly, CadModel, Capacitor, Chip, Circuit, type ComponentWithPins, Constraint, CopperPour, CopperText, Crystal, CurrentSource, Cutout, type DebugLogOutputEvent, Diode, FabricationNoteDimension, FabricationNotePath, FabricationNoteRect, FabricationNoteText, Fiducial, Footprint, Fuse, type GenericConnectionsAndSelectorsSel, type GenericLocalAutorouter, Group, Hole, type IRenderable, Inductor, Interconnect, Jumper, Keepout, Led, type LocalCacheEngine, Mosfet, Net, NetLabel, NormalComponent, type Obstacle, OpAmp, type PackingEndEvent, type PackingErrorEvent, type PackingStartEvent, Panel, PcbNoteDimension, PcbNoteLine, PcbNotePath, PcbNoteRect, PcbNoteText, PcbTrace, PinHeader, type PinLabelSpec, Pinout, PlatedHole, Port, Potentiometer, PowerSource, PrimitiveComponent, Project, PushButton, type RenderPhase, type RenderPhaseFn, type RenderPhaseFunctions, type RenderPhaseStates, Renderable, Resistor, Resonator, RootCircuit, type RootCircuitEventName, SOLVERS, SchematicArc, SchematicBox, SchematicCell, SchematicCircle, SchematicLine, SchematicPath, SchematicRect, SchematicRow, SchematicTable, SchematicText, type Sel, SilkscreenCircle, SilkscreenLine, SilkscreenPath, SilkscreenRect, SilkscreenText, type SimpleRouteConnection, type SimpleRouteJson, type SimplifiedPcbTrace, SmtPad, SolderJumper, type SolverName, type SolverStartedEvent, Subcircuit, Switch, SymbolComponent as Symbol, TestPoint, Trace, TraceHint, Transistor, Via, VoltageProbe, VoltageSource, applyEditEvents, applyEditEventsToManualEditsFile, applyPcbEditEventsToManualEditsFile, applySchematicEditEventsToManualEditsFile, createUseComponent, getPhaseTimingsFromRenderEvents, getSimpleRouteJsonFromCircuitJson, normalizePinLabels, orderedRenderPhases, resolveStaticFileImport, sel, useCapacitor, useChip, useDiode, useLed, useRenderedCircuit, useResistor };
package/dist/index.js CHANGED
@@ -65,6 +65,7 @@ __export(components_exports, {
65
65
  SchematicCell: () => SchematicCell,
66
66
  SchematicCircle: () => SchematicCircle,
67
67
  SchematicLine: () => SchematicLine,
68
+ SchematicPath: () => SchematicPath,
68
69
  SchematicRect: () => SchematicRect,
69
70
  SchematicRow: () => SchematicRow,
70
71
  SchematicTable: () => SchematicTable,
@@ -16558,24 +16559,23 @@ var Board = class extends Group6 {
16558
16559
  if (Math.abs(deltaX) < 1e-6 && Math.abs(deltaY) < 1e-6) {
16559
16560
  return;
16560
16561
  }
16561
- for (const child of this.children) {
16562
- if (child instanceof NormalComponent3) {
16563
- let childOldCenter;
16564
- if (child.pcb_component_id) {
16565
- const comp = db.pcb_component.get(child.pcb_component_id);
16566
- if (comp) childOldCenter = comp.center;
16567
- } else if (child instanceof Group6 && child.pcb_group_id) {
16568
- const group = db.pcb_group.get(child.pcb_group_id);
16569
- if (group) childOldCenter = group.center;
16570
- }
16571
- if (childOldCenter) {
16572
- child._repositionOnPcb({
16573
- x: childOldCenter.x + deltaX,
16574
- y: childOldCenter.y + deltaY
16562
+ for (const child of this.getDescendants()) {
16563
+ if (child.isPcbPrimitive && "_moveCircuitJsonElements" in child && typeof child._moveCircuitJsonElements === "function") {
16564
+ child._moveCircuitJsonElements({ deltaX, deltaY });
16565
+ }
16566
+ if (child instanceof Group6) {
16567
+ const groupChild = child;
16568
+ const pcbGroup = db.pcb_group.get(groupChild.pcb_group_id || "");
16569
+ if (!pcbGroup) continue;
16570
+ if (pcbGroup.center) {
16571
+ if (!groupChild.pcb_group_id) continue;
16572
+ db.pcb_group.update(groupChild.pcb_group_id, {
16573
+ center: {
16574
+ x: pcbGroup.center.x + deltaX,
16575
+ y: pcbGroup.center.y + deltaY
16576
+ }
16575
16577
  });
16576
16578
  }
16577
- } else if (child.isPcbPrimitive && "_moveCircuitJsonElements" in child && typeof child._moveCircuitJsonElements === "function") {
16578
- child._moveCircuitJsonElements({ deltaX, deltaY });
16579
16579
  }
16580
16580
  }
16581
16581
  if (this.pcb_board_id) {
@@ -20139,6 +20139,35 @@ var SchematicCircle = class extends PrimitiveComponent2 {
20139
20139
  }
20140
20140
  };
20141
20141
 
20142
+ // lib/components/primitive-components/SchematicPath.ts
20143
+ import { schematicPathProps } from "@tscircuit/props";
20144
+ var SchematicPath = class extends PrimitiveComponent2 {
20145
+ isSchematicPrimitive = true;
20146
+ get config() {
20147
+ return {
20148
+ componentName: "SchematicPath",
20149
+ zodProps: schematicPathProps
20150
+ };
20151
+ }
20152
+ doInitialSchematicPrimitiveRender() {
20153
+ if (this.root?.schematicDisabled) return;
20154
+ const { db } = this.root;
20155
+ const { _parsedProps: props } = this;
20156
+ const globalPos = this._getGlobalSchematicPositionBeforeLayout();
20157
+ const schematic_component_id = this.getPrimitiveContainer()?.parent?.schematic_component_id;
20158
+ db.schematic_path.insert({
20159
+ schematic_component_id,
20160
+ points: props.points.map((point2) => ({
20161
+ x: point2.x + globalPos.x,
20162
+ y: point2.y + globalPos.y
20163
+ })),
20164
+ is_filled: props.isFilled,
20165
+ fill_color: props.fillColor,
20166
+ subcircuit_id: this.getSubcircuit().subcircuit_id ?? void 0
20167
+ });
20168
+ }
20169
+ };
20170
+
20142
20171
  // lib/components/primitive-components/SchematicBox.ts
20143
20172
  import { schematicBoxProps } from "@tscircuit/props";
20144
20173
 
@@ -20805,7 +20834,7 @@ import { identity as identity5 } from "transformation-matrix";
20805
20834
  var package_default = {
20806
20835
  name: "@tscircuit/core",
20807
20836
  type: "module",
20808
- version: "0.0.969",
20837
+ version: "0.0.971",
20809
20838
  types: "dist/index.d.ts",
20810
20839
  main: "dist/index.js",
20811
20840
  module: "dist/index.js",
@@ -20867,7 +20896,7 @@ var package_default = {
20867
20896
  "circuit-json-to-gltf": "^0.0.31",
20868
20897
  "circuit-json-to-simple-3d": "^0.0.9",
20869
20898
  "circuit-json-to-spice": "^0.0.33",
20870
- "circuit-to-svg": "^0.0.313",
20899
+ "circuit-to-svg": "^0.0.314",
20871
20900
  concurrently: "^9.1.2",
20872
20901
  "connectivity-map": "^1.0.0",
20873
20902
  debug: "^4.3.6",
@@ -21404,6 +21433,7 @@ export {
21404
21433
  SchematicCell,
21405
21434
  SchematicCircle,
21406
21435
  SchematicLine,
21436
+ SchematicPath,
21407
21437
  SchematicRect,
21408
21438
  SchematicRow,
21409
21439
  SchematicTable,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@tscircuit/core",
3
3
  "type": "module",
4
- "version": "0.0.970",
4
+ "version": "0.0.972",
5
5
  "types": "dist/index.d.ts",
6
6
  "main": "dist/index.js",
7
7
  "module": "dist/index.js",
@@ -63,7 +63,7 @@
63
63
  "circuit-json-to-gltf": "^0.0.31",
64
64
  "circuit-json-to-simple-3d": "^0.0.9",
65
65
  "circuit-json-to-spice": "^0.0.33",
66
- "circuit-to-svg": "^0.0.313",
66
+ "circuit-to-svg": "^0.0.314",
67
67
  "concurrently": "^9.1.2",
68
68
  "connectivity-map": "^1.0.0",
69
69
  "debug": "^4.3.6",