@tscircuit/core 0.0.396 → 0.0.398

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
@@ -4266,6 +4266,7 @@ declare class Jumper<PinLabels extends string = never> extends NormalComponent<t
4266
4266
  };
4267
4267
  doInitialSourceRender(): void;
4268
4268
  doInitialPcbComponentRender(): void;
4269
+ doInitialPcbTraceRender(): void;
4269
4270
  }
4270
4271
 
4271
4272
  declare class Led extends NormalComponent<typeof ledProps, PolarizedPassivePorts> {
@@ -11828,7 +11829,8 @@ declare class SchematicText extends PrimitiveComponent<typeof schematicTextProps
11828
11829
  schX: zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>;
11829
11830
  schY: zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>;
11830
11831
  text: zod.ZodString;
11831
- anchor: zod.ZodUnion<[zod.ZodEnum<["center", "left", "right", "top", "bottom"]>, zod.ZodEnum<["top_left", "top_center", "top_right", "center_left", "center", "center_right", "bottom_left", "bottom_center", "bottom_right"]>]>;
11832
+ fontSize: zod.ZodDefault<zod.ZodNumber>;
11833
+ anchor: zod.ZodDefault<zod.ZodUnion<[zod.ZodEnum<["center", "left", "right", "top", "bottom"]>, zod.ZodEnum<["top_left", "top_center", "top_right", "center_left", "center", "center_right", "bottom_left", "bottom_center", "bottom_right"]>]>>;
11832
11834
  color: zod.ZodDefault<zod.ZodString>;
11833
11835
  schRotation: zod.ZodDefault<zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>>;
11834
11836
  }, "strip", zod.ZodTypeAny, {
@@ -11838,13 +11840,15 @@ declare class SchematicText extends PrimitiveComponent<typeof schematicTextProps
11838
11840
  schRotation: number;
11839
11841
  color: string;
11840
11842
  text: string;
11843
+ fontSize: number;
11841
11844
  }, {
11842
- anchor: "left" | "right" | "top" | "bottom" | "center" | "top_left" | "top_right" | "bottom_left" | "bottom_right" | "top_center" | "center_left" | "center_right" | "bottom_center";
11843
11845
  schX: string | number;
11844
11846
  schY: string | number;
11845
11847
  text: string;
11848
+ anchor?: "left" | "right" | "top" | "bottom" | "center" | "top_left" | "top_right" | "bottom_left" | "bottom_right" | "top_center" | "center_left" | "center_right" | "bottom_center" | undefined;
11846
11849
  schRotation?: string | number | undefined;
11847
11850
  color?: string | undefined;
11851
+ fontSize?: number | undefined;
11848
11852
  }>;
11849
11853
  };
11850
11854
  doInitialSchematicPrimitiveRender(): void;
package/dist/index.js CHANGED
@@ -5286,7 +5286,8 @@ var NormalComponent = class extends PrimitiveComponent2 {
5286
5286
  x: hasTopOrBottomPins ? center.x + (schematic_box_width ?? 0) / 2 + 0.1 : center.x - (schematic_box_width ?? 0) / 2,
5287
5287
  y: hasTopOrBottomPins ? center.y + (schematic_box_height ?? 0) / 2 + 0.35 : center.y - (schematic_box_height ?? 0) / 2 - 0.13
5288
5288
  },
5289
- color: "#006464"
5289
+ color: "#006464",
5290
+ font_size: 0.05
5290
5291
  });
5291
5292
  const component_name_text = db.schematic_text.insert({
5292
5293
  text: props.name ?? "",
@@ -5297,7 +5298,8 @@ var NormalComponent = class extends PrimitiveComponent2 {
5297
5298
  x: hasTopOrBottomPins ? center.x + (schematic_box_width ?? 0) / 2 + 0.1 : center.x - (schematic_box_width ?? 0) / 2,
5298
5299
  y: hasTopOrBottomPins ? center.y + (schematic_box_height ?? 0) / 2 + 0.55 : center.y + (schematic_box_height ?? 0) / 2 + 0.13
5299
5300
  },
5300
- color: "#006464"
5301
+ color: "#006464",
5302
+ font_size: 0.05
5301
5303
  });
5302
5304
  this.schematic_component_id = schematic_component2.schematic_component_id;
5303
5305
  }
@@ -7170,6 +7172,36 @@ var Jumper = class extends NormalComponent {
7170
7172
  });
7171
7173
  this.pcb_component_id = pcb_component.pcb_component_id;
7172
7174
  }
7175
+ doInitialPcbTraceRender() {
7176
+ const { db } = this.root;
7177
+ const pcb_ports = db.pcb_port.list({
7178
+ pcb_component_id: this.pcb_component_id
7179
+ });
7180
+ const pinLabelToPortId = {};
7181
+ for (const port of pcb_ports) {
7182
+ const match = port.source_port_id && port.source_port_id.match(/(\d+)$/);
7183
+ if (match) {
7184
+ const label = (parseInt(match[1], 10) + 1).toString();
7185
+ pinLabelToPortId[label] = port.pcb_port_id;
7186
+ }
7187
+ }
7188
+ const traces = db.pcb_trace.list();
7189
+ const updatePortId = (portId) => {
7190
+ if (portId && typeof portId === "string" && portId.startsWith("{PIN")) {
7191
+ const pin = portId.replace("{PIN", "").replace("}", "");
7192
+ return pinLabelToPortId[pin] || portId;
7193
+ }
7194
+ return portId;
7195
+ };
7196
+ for (const trace of traces) {
7197
+ if (!trace.route) continue;
7198
+ for (const segment of trace.route) {
7199
+ if (segment.route_type !== "wire") continue;
7200
+ segment.start_pcb_port_id = updatePortId(segment.start_pcb_port_id);
7201
+ segment.end_pcb_port_id = updatePortId(segment.end_pcb_port_id);
7202
+ }
7203
+ }
7204
+ }
7173
7205
  };
7174
7206
 
7175
7207
  // lib/components/normal-components/Led.ts
@@ -8105,6 +8137,7 @@ var SchematicText = class extends PrimitiveComponent2 {
8105
8137
  db.schematic_text.insert({
8106
8138
  anchor: props.anchor ?? "center",
8107
8139
  text: props.text,
8140
+ font_size: props.fontSize,
8108
8141
  color: props.color || "#000000",
8109
8142
  position: {
8110
8143
  x: props.schX,
@@ -8124,7 +8157,7 @@ import { identity as identity4 } from "transformation-matrix";
8124
8157
  var package_default = {
8125
8158
  name: "@tscircuit/core",
8126
8159
  type: "module",
8127
- version: "0.0.395",
8160
+ version: "0.0.397",
8128
8161
  types: "dist/index.d.ts",
8129
8162
  main: "dist/index.js",
8130
8163
  module: "dist/index.js",
@@ -8147,7 +8180,7 @@ var package_default = {
8147
8180
  },
8148
8181
  devDependencies: {
8149
8182
  "@biomejs/biome": "^1.8.3",
8150
- "@tscircuit/footprinter": "^0.0.155",
8183
+ "@tscircuit/footprinter": "^0.0.156",
8151
8184
  "@tscircuit/import-snippet": "^0.0.4",
8152
8185
  "@tscircuit/layout": "^0.0.28",
8153
8186
  "@tscircuit/log-soup": "^1.0.2",
@@ -8178,14 +8211,14 @@ var package_default = {
8178
8211
  dependencies: {
8179
8212
  "@lume/kiwi": "^0.4.3",
8180
8213
  "@tscircuit/capacity-autorouter": "^0.0.52",
8181
- "@tscircuit/checks": "^0.0.37",
8214
+ "@tscircuit/checks": "^0.0.46",
8182
8215
  "@tscircuit/circuit-json-util": "^0.0.47",
8183
8216
  "@tscircuit/infgrid-ijump-astar": "^0.0.33",
8184
8217
  "@tscircuit/math-utils": "^0.0.14",
8185
- "@tscircuit/props": "^0.0.177",
8218
+ "@tscircuit/props": "^0.0.178",
8186
8219
  "@tscircuit/schematic-autolayout": "^0.0.6",
8187
- "circuit-json": "0.0.169",
8188
- "circuit-json-to-connectivity-map": "^0.0.20",
8220
+ "circuit-json-to-connectivity-map": "^0.0.22",
8221
+ "circuit-json": "0.0.170",
8189
8222
  "css-select": "^5.1.0",
8190
8223
  "format-si-unit": "^0.0.3",
8191
8224
  nanoid: "^5.0.7",
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@tscircuit/core",
3
3
  "type": "module",
4
- "version": "0.0.396",
4
+ "version": "0.0.398",
5
5
  "types": "dist/index.d.ts",
6
6
  "main": "dist/index.js",
7
7
  "module": "dist/index.js",
@@ -24,7 +24,7 @@
24
24
  },
25
25
  "devDependencies": {
26
26
  "@biomejs/biome": "^1.8.3",
27
- "@tscircuit/footprinter": "^0.0.155",
27
+ "@tscircuit/footprinter": "^0.0.156",
28
28
  "@tscircuit/import-snippet": "^0.0.4",
29
29
  "@tscircuit/layout": "^0.0.28",
30
30
  "@tscircuit/log-soup": "^1.0.2",
@@ -55,14 +55,14 @@
55
55
  "dependencies": {
56
56
  "@lume/kiwi": "^0.4.3",
57
57
  "@tscircuit/capacity-autorouter": "^0.0.52",
58
- "@tscircuit/checks": "^0.0.37",
58
+ "@tscircuit/checks": "^0.0.46",
59
59
  "@tscircuit/circuit-json-util": "^0.0.47",
60
60
  "@tscircuit/infgrid-ijump-astar": "^0.0.33",
61
61
  "@tscircuit/math-utils": "^0.0.14",
62
- "@tscircuit/props": "^0.0.177",
62
+ "@tscircuit/props": "^0.0.178",
63
63
  "@tscircuit/schematic-autolayout": "^0.0.6",
64
- "circuit-json": "0.0.169",
65
- "circuit-json-to-connectivity-map": "^0.0.20",
64
+ "circuit-json-to-connectivity-map": "^0.0.22",
65
+ "circuit-json": "0.0.170",
66
66
  "css-select": "^5.1.0",
67
67
  "format-si-unit": "^0.0.3",
68
68
  "nanoid": "^5.0.7",