@tscircuit/core 0.0.128 → 0.0.129

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
@@ -4546,7 +4546,7 @@ declare class PlatedHole extends PrimitiveComponent<typeof platedHoleProps> {
4546
4546
  isPcbPrimitive: boolean;
4547
4547
  get config(): {
4548
4548
  componentName: string;
4549
- zodProps: zod.ZodUnion<[zod.ZodObject<zod.objectUtil.extendShape<Omit<{
4549
+ zodProps: zod.ZodDiscriminatedUnion<"shape", [zod.ZodObject<zod.objectUtil.extendShape<Omit<{
4550
4550
  pcbX: zod.ZodOptional<zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>>;
4551
4551
  pcbY: zod.ZodOptional<zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>>;
4552
4552
  pcbRotation: zod.ZodOptional<zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>>;
@@ -4622,6 +4622,47 @@ declare class PlatedHole extends PrimitiveComponent<typeof platedHoleProps> {
4622
4622
  pcbY?: string | number | undefined;
4623
4623
  name?: string | undefined;
4624
4624
  portHints?: (string | number)[] | undefined;
4625
+ }>, zod.ZodObject<zod.objectUtil.extendShape<Omit<{
4626
+ pcbX: zod.ZodOptional<zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>>;
4627
+ pcbY: zod.ZodOptional<zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>>;
4628
+ pcbRotation: zod.ZodOptional<zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>>;
4629
+ layer: zod.ZodOptional<zod.ZodEffects<zod.ZodUnion<[zod.ZodEnum<["top", "bottom", "inner1", "inner2", "inner3", "inner4", "inner5", "inner6"]>, zod.ZodObject<{
4630
+ name: zod.ZodEnum<["top", "bottom", "inner1", "inner2", "inner3", "inner4", "inner5", "inner6"]>;
4631
+ }, "strip", zod.ZodTypeAny, {
4632
+ name: "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6";
4633
+ }, {
4634
+ name: "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6";
4635
+ }>]>, "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6", "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6" | {
4636
+ name: "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6";
4637
+ }>>;
4638
+ }, "layer" | "pcbRotation">, {
4639
+ name: zod.ZodOptional<zod.ZodString>;
4640
+ shape: zod.ZodLiteral<"pill">;
4641
+ outerWidth: zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>;
4642
+ outerHeight: zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>;
4643
+ innerWidth: zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>;
4644
+ innerHeight: zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>;
4645
+ portHints: zod.ZodOptional<zod.ZodArray<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, "many">>;
4646
+ }>, "strip", zod.ZodTypeAny, {
4647
+ shape: "pill";
4648
+ outerWidth: number;
4649
+ outerHeight: number;
4650
+ innerWidth: number;
4651
+ innerHeight: number;
4652
+ pcbX?: number | undefined;
4653
+ pcbY?: number | undefined;
4654
+ name?: string | undefined;
4655
+ portHints?: (string | number)[] | undefined;
4656
+ }, {
4657
+ shape: "pill";
4658
+ outerWidth: string | number;
4659
+ outerHeight: string | number;
4660
+ innerWidth: string | number;
4661
+ innerHeight: string | number;
4662
+ pcbX?: string | number | undefined;
4663
+ pcbY?: string | number | undefined;
4664
+ name?: string | undefined;
4665
+ portHints?: (string | number)[] | undefined;
4625
4666
  }>]>;
4626
4667
  };
4627
4668
  getAvailablePcbLayers(): string[];
package/dist/index.js CHANGED
@@ -1151,7 +1151,7 @@ var PlatedHole = class extends PrimitiveComponent {
1151
1151
  if (props.shape === "circle") {
1152
1152
  return { width: props.outerDiameter, height: props.outerDiameter };
1153
1153
  }
1154
- if (props.shape === "oval") {
1154
+ if (props.shape === "oval" || props.shape === "pill") {
1155
1155
  return { width: props.outerWidth, height: props.outerHeight };
1156
1156
  }
1157
1157
  throw new Error(
@@ -1216,6 +1216,22 @@ var PlatedHole = class extends PrimitiveComponent {
1216
1216
  layers: ["top", "bottom"]
1217
1217
  });
1218
1218
  this.pcb_plated_hole_id = pcb_plated_hole.pcb_plated_hole_id;
1219
+ } else if (props.shape === "pill") {
1220
+ const pcb_plated_hole = db.pcb_plated_hole.insert({
1221
+ pcb_component_id,
1222
+ pcb_port_id: this.matchedPort?.pcb_port_id,
1223
+ outer_width: props.outerWidth,
1224
+ outer_height: props.outerHeight,
1225
+ hole_width: props.innerWidth,
1226
+ hole_height: props.innerHeight,
1227
+ shape: "pill",
1228
+ port_hints: this.getNameAndAliases(),
1229
+ x: position.x,
1230
+ y: position.y,
1231
+ layers: ["top", "bottom"]
1232
+ // NOTE: currently PcbPlatedHoleOval erroneously includes both the shape "pill" and "oval"
1233
+ });
1234
+ this.pcb_plated_hole_id = pcb_plated_hole.pcb_plated_hole_id;
1219
1235
  }
1220
1236
  }
1221
1237
  doInitialPcbPortAttachment() {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@tscircuit/core",
3
3
  "type": "module",
4
- "version": "0.0.128",
4
+ "version": "0.0.129",
5
5
  "types": "dist/index.d.ts",
6
6
  "main": "dist/index.js",
7
7
  "module": "dist/index.js",
@@ -14,6 +14,7 @@
14
14
  },
15
15
  "scripts": {
16
16
  "build": "tsup-node index.ts --format esm --dts",
17
+ "format": "biome format . --write",
17
18
  "measure-bundle": "howfat -r table ."
18
19
  },
19
20
  "devDependencies": {
@@ -38,12 +39,12 @@
38
39
  "@tscircuit/footprinter": "^0.0.77",
39
40
  "@tscircuit/infgrid-ijump-astar": "^0.0.21",
40
41
  "@tscircuit/math-utils": "^0.0.4",
41
- "@tscircuit/props": "^0.0.75",
42
+ "@tscircuit/props": "^0.0.77",
42
43
  "@tscircuit/schematic-autolayout": "^0.0.5",
43
44
  "@tscircuit/soup-util": "^0.0.33",
44
- "circuit-json": "^0.0.90",
45
+ "circuit-json": "^0.0.91",
45
46
  "circuit-json-to-connectivity-map": "^0.0.17",
46
- "circuit-to-svg": "^0.0.48",
47
+ "circuit-to-svg": "^0.0.52",
47
48
  "nanoid": "^5.0.7",
48
49
  "performance-now": "^2.1.0",
49
50
  "react": "^18.3.1",