@tscircuit/core 0.0.469 → 0.0.471

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
@@ -1248,6 +1248,19 @@ declare class Board extends Group<typeof boardProps> {
1248
1248
  matchAdapt?: boolean | undefined;
1249
1249
  matchAdaptTemplate?: any;
1250
1250
  }>>;
1251
+ cellBorder: zod.ZodOptional<zod.ZodObject<{
1252
+ strokeWidth: zod.ZodOptional<zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>>;
1253
+ dashed: zod.ZodOptional<zod.ZodBoolean>;
1254
+ solid: zod.ZodOptional<zod.ZodBoolean>;
1255
+ }, "strip", zod.ZodTypeAny, {
1256
+ strokeWidth?: number | undefined;
1257
+ dashed?: boolean | undefined;
1258
+ solid?: boolean | undefined;
1259
+ }, {
1260
+ strokeWidth?: string | number | undefined;
1261
+ dashed?: boolean | undefined;
1262
+ solid?: boolean | undefined;
1263
+ }>>;
1251
1264
  layoutMode: zod.ZodOptional<zod.ZodEnum<["grid", "flex", "match-adapt", "none"]>>;
1252
1265
  position: zod.ZodOptional<zod.ZodEnum<["absolute", "relative"]>>;
1253
1266
  grid: zod.ZodOptional<zod.ZodBoolean>;
@@ -1568,6 +1581,11 @@ declare class Board extends Group<typeof boardProps> {
1568
1581
  matchAdapt?: boolean | undefined;
1569
1582
  matchAdaptTemplate?: any;
1570
1583
  } | undefined;
1584
+ cellBorder?: {
1585
+ strokeWidth?: number | undefined;
1586
+ dashed?: boolean | undefined;
1587
+ solid?: boolean | undefined;
1588
+ } | undefined;
1571
1589
  layout?: _tscircuit_layout.LayoutBuilder | undefined;
1572
1590
  manualEdits?: {
1573
1591
  pcb_placements?: {
@@ -1702,6 +1720,11 @@ declare class Board extends Group<typeof boardProps> {
1702
1720
  matchAdapt?: boolean | undefined;
1703
1721
  matchAdaptTemplate?: any;
1704
1722
  } | undefined;
1723
+ cellBorder?: {
1724
+ strokeWidth?: string | number | undefined;
1725
+ dashed?: boolean | undefined;
1726
+ solid?: boolean | undefined;
1727
+ } | undefined;
1705
1728
  layout?: _tscircuit_layout.LayoutBuilder | undefined;
1706
1729
  manualEdits?: {
1707
1730
  pcb_placements?: {
@@ -6854,8 +6877,8 @@ declare class FabricationNotePath extends PrimitiveComponent<typeof fabricationN
6854
6877
  trace_width?: number | undefined;
6855
6878
  }[];
6856
6879
  layer?: "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6" | undefined;
6857
- color?: string | undefined;
6858
6880
  strokeWidth?: number | undefined;
6881
+ color?: string | undefined;
6859
6882
  }, {
6860
6883
  route: {
6861
6884
  x: string | number;
@@ -6869,8 +6892,8 @@ declare class FabricationNotePath extends PrimitiveComponent<typeof fabricationN
6869
6892
  layer?: "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6" | {
6870
6893
  name: "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6";
6871
6894
  } | undefined;
6872
- color?: string | undefined;
6873
6895
  strokeWidth?: string | number | undefined;
6896
+ color?: string | undefined;
6874
6897
  }>;
6875
6898
  };
6876
6899
  doInitialPcbPrimitiveRender(): void;
@@ -7760,7 +7783,7 @@ declare class SilkscreenRect extends PrimitiveComponent<typeof silkscreenRectPro
7760
7783
  layer?: "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6" | undefined;
7761
7784
  strokeWidth?: number | undefined;
7762
7785
  filled?: boolean | undefined;
7763
- stroke?: "none" | "solid" | "dashed" | undefined;
7786
+ stroke?: "none" | "dashed" | "solid" | undefined;
7764
7787
  }, {
7765
7788
  width: string | number;
7766
7789
  height: string | number;
@@ -7771,7 +7794,7 @@ declare class SilkscreenRect extends PrimitiveComponent<typeof silkscreenRectPro
7771
7794
  } | undefined;
7772
7795
  strokeWidth?: string | number | undefined;
7773
7796
  filled?: boolean | undefined;
7774
- stroke?: "none" | "solid" | "dashed" | undefined;
7797
+ stroke?: "none" | "dashed" | "solid" | undefined;
7775
7798
  }>;
7776
7799
  };
7777
7800
  doInitialPcbPrimitiveRender(): void;
@@ -13812,7 +13835,7 @@ declare class TestPoint extends NormalComponent<typeof testpointProps> {
13812
13835
  symbolName: zod.ZodOptional<zod.ZodString>;
13813
13836
  doNotPlace: zod.ZodOptional<zod.ZodBoolean>;
13814
13837
  } & {
13815
- footprintVariant: zod.ZodDefault<zod.ZodOptional<zod.ZodEnum<["pad", "through_hole"]>>>;
13838
+ footprintVariant: zod.ZodOptional<zod.ZodEnum<["pad", "through_hole"]>>;
13816
13839
  padShape: zod.ZodDefault<zod.ZodOptional<zod.ZodEnum<["rect", "circle"]>>>;
13817
13840
  padDiameter: zod.ZodOptional<zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>>;
13818
13841
  holeDiameter: zod.ZodOptional<zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>>;
@@ -13821,7 +13844,6 @@ declare class TestPoint extends NormalComponent<typeof testpointProps> {
13821
13844
  }, "strip", zod.ZodTypeAny, {
13822
13845
  name: string;
13823
13846
  padShape: "circle" | "rect";
13824
- footprintVariant: "pad" | "through_hole";
13825
13847
  pcbX?: number | undefined;
13826
13848
  pcbY?: number | undefined;
13827
13849
  pcbRotation?: number | undefined;
@@ -13891,6 +13913,7 @@ declare class TestPoint extends NormalComponent<typeof testpointProps> {
13891
13913
  width?: number | undefined;
13892
13914
  height?: number | undefined;
13893
13915
  holeDiameter?: number | undefined;
13916
+ footprintVariant?: "pad" | "through_hole" | undefined;
13894
13917
  padDiameter?: number | undefined;
13895
13918
  }, {
13896
13919
  name: string;
@@ -13971,7 +13994,6 @@ declare class TestPoint extends NormalComponent<typeof testpointProps> {
13971
13994
  }>, {
13972
13995
  name: string;
13973
13996
  padShape: "circle" | "rect";
13974
- footprintVariant: "pad" | "through_hole";
13975
13997
  pcbX?: number | undefined;
13976
13998
  pcbY?: number | undefined;
13977
13999
  pcbRotation?: number | undefined;
@@ -14041,6 +14063,7 @@ declare class TestPoint extends NormalComponent<typeof testpointProps> {
14041
14063
  width?: number | undefined;
14042
14064
  height?: number | undefined;
14043
14065
  holeDiameter?: number | undefined;
14066
+ footprintVariant?: "pad" | "through_hole" | undefined;
14044
14067
  padDiameter?: number | undefined;
14045
14068
  }, {
14046
14069
  name: string;
@@ -14184,7 +14207,7 @@ declare class SchematicBox extends PrimitiveComponent<typeof schematicBoxProps>
14184
14207
  schY: number;
14185
14208
  titleAlignment: "center" | "top_left" | "top_right" | "bottom_left" | "bottom_right" | "top_center" | "center_left" | "center_right" | "bottom_center";
14186
14209
  titleInside: boolean;
14187
- strokeStyle: "solid" | "dashed";
14210
+ strokeStyle: "dashed" | "solid";
14188
14211
  width?: number | undefined;
14189
14212
  height?: number | undefined;
14190
14213
  padding?: number | undefined;
@@ -14212,13 +14235,13 @@ declare class SchematicBox extends PrimitiveComponent<typeof schematicBoxProps>
14212
14235
  titleColor?: string | undefined;
14213
14236
  titleFontSize?: string | number | undefined;
14214
14237
  titleInside?: boolean | undefined;
14215
- strokeStyle?: "solid" | "dashed" | undefined;
14238
+ strokeStyle?: "dashed" | "solid" | undefined;
14216
14239
  }>, {
14217
14240
  schX: number;
14218
14241
  schY: number;
14219
14242
  titleAlignment: "center" | "top_left" | "top_right" | "bottom_left" | "bottom_right" | "top_center" | "center_left" | "center_right" | "bottom_center";
14220
14243
  titleInside: boolean;
14221
- strokeStyle: "solid" | "dashed";
14244
+ strokeStyle: "dashed" | "solid";
14222
14245
  width?: number | undefined;
14223
14246
  height?: number | undefined;
14224
14247
  padding?: number | undefined;
@@ -14246,13 +14269,13 @@ declare class SchematicBox extends PrimitiveComponent<typeof schematicBoxProps>
14246
14269
  titleColor?: string | undefined;
14247
14270
  titleFontSize?: string | number | undefined;
14248
14271
  titleInside?: boolean | undefined;
14249
- strokeStyle?: "solid" | "dashed" | undefined;
14272
+ strokeStyle?: "dashed" | "solid" | undefined;
14250
14273
  }>, {
14251
14274
  schX: number;
14252
14275
  schY: number;
14253
14276
  titleAlignment: "center" | "top_left" | "top_right" | "bottom_left" | "bottom_right" | "top_center" | "center_left" | "center_right" | "bottom_center";
14254
14277
  titleInside: boolean;
14255
- strokeStyle: "solid" | "dashed";
14278
+ strokeStyle: "dashed" | "solid";
14256
14279
  width?: number | undefined;
14257
14280
  height?: number | undefined;
14258
14281
  padding?: number | undefined;
@@ -14280,7 +14303,7 @@ declare class SchematicBox extends PrimitiveComponent<typeof schematicBoxProps>
14280
14303
  titleColor?: string | undefined;
14281
14304
  titleFontSize?: string | number | undefined;
14282
14305
  titleInside?: boolean | undefined;
14283
- strokeStyle?: "solid" | "dashed" | undefined;
14306
+ strokeStyle?: "dashed" | "solid" | undefined;
14284
14307
  }>;
14285
14308
  shouldRenderAsSchematicBox: boolean;
14286
14309
  };
package/dist/index.js CHANGED
@@ -9774,8 +9774,9 @@ var SchematicBox = class extends PrimitiveComponent2 {
9774
9774
  } else if (hasFixedSize) {
9775
9775
  width = props.width;
9776
9776
  height = props.height;
9777
- centerX = typeof props.schX === "number" ? props.schX : 0;
9778
- centerY = typeof props.schY === "number" ? props.schY : 0;
9777
+ const center = this._getGlobalSchematicPositionBeforeLayout();
9778
+ centerX = center.x;
9779
+ centerY = center.y;
9779
9780
  x = centerX - width / 2;
9780
9781
  y = centerY - height / 2;
9781
9782
  } else {
@@ -9837,7 +9838,7 @@ import { identity as identity4 } from "transformation-matrix";
9837
9838
  var package_default = {
9838
9839
  name: "@tscircuit/core",
9839
9840
  type: "module",
9840
- version: "0.0.468",
9841
+ version: "0.0.470",
9841
9842
  types: "dist/index.d.ts",
9842
9843
  main: "dist/index.js",
9843
9844
  module: "dist/index.js",
@@ -9869,7 +9870,7 @@ var package_default = {
9869
9870
  "@tscircuit/layout": "^0.0.28",
9870
9871
  "@tscircuit/log-soup": "^1.0.2",
9871
9872
  "@tscircuit/math-utils": "^0.0.18",
9872
- "@tscircuit/props": "^0.0.220",
9873
+ "@tscircuit/props": "^0.0.222",
9873
9874
  "@tscircuit/schematic-autolayout": "^0.0.6",
9874
9875
  "@tscircuit/schematic-match-adapt": "^0.0.16",
9875
9876
  "@tscircuit/simple-3d-svg": "^0.0.6",
@@ -9994,9 +9995,10 @@ var RootCircuit = class {
9994
9995
  return;
9995
9996
  }
9996
9997
  }
9997
- throw new Error(
9998
- "Not able to guess root component: RootCircuit has multiple children and no board"
9999
- );
9998
+ const group = new Group({ subcircuit: false });
9999
+ group.addAll(this.children);
10000
+ this.children = [group];
10001
+ this.firstChild = group;
10000
10002
  }
10001
10003
  render() {
10002
10004
  if (!this.firstChild) {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@tscircuit/core",
3
3
  "type": "module",
4
- "version": "0.0.469",
4
+ "version": "0.0.471",
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
  "@tscircuit/layout": "^0.0.28",
34
34
  "@tscircuit/log-soup": "^1.0.2",
35
35
  "@tscircuit/math-utils": "^0.0.18",
36
- "@tscircuit/props": "^0.0.220",
36
+ "@tscircuit/props": "^0.0.222",
37
37
  "@tscircuit/schematic-autolayout": "^0.0.6",
38
38
  "@tscircuit/schematic-match-adapt": "^0.0.16",
39
39
  "@tscircuit/simple-3d-svg": "^0.0.6",