@tscircuit/core 0.0.470 → 0.0.472

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
@@ -546,8 +546,7 @@ var PrimitiveComponent2 = class extends Renderable {
546
546
  * components share the same names) unless you explicitly break out some ports
547
547
  */
548
548
  get isSubcircuit() {
549
- return Boolean(this.props.subcircuit) || // Implied opaque group for top-level group
550
- this.lowercaseComponentName === "group" && this?.parent?.isRoot;
549
+ return Boolean(this.props.subcircuit) || this.lowercaseComponentName === "group" && this?.parent?.isRoot;
551
550
  }
552
551
  get isGroup() {
553
552
  return this.lowercaseComponentName === "group";
@@ -9838,7 +9837,7 @@ import { identity as identity4 } from "transformation-matrix";
9838
9837
  var package_default = {
9839
9838
  name: "@tscircuit/core",
9840
9839
  type: "module",
9841
- version: "0.0.469",
9840
+ version: "0.0.471",
9842
9841
  types: "dist/index.d.ts",
9843
9842
  main: "dist/index.js",
9844
9843
  module: "dist/index.js",
@@ -9870,7 +9869,7 @@ var package_default = {
9870
9869
  "@tscircuit/layout": "^0.0.28",
9871
9870
  "@tscircuit/log-soup": "^1.0.2",
9872
9871
  "@tscircuit/math-utils": "^0.0.18",
9873
- "@tscircuit/props": "^0.0.220",
9872
+ "@tscircuit/props": "^0.0.222",
9874
9873
  "@tscircuit/schematic-autolayout": "^0.0.6",
9875
9874
  "@tscircuit/schematic-match-adapt": "^0.0.16",
9876
9875
  "@tscircuit/simple-3d-svg": "^0.0.6",
@@ -9979,25 +9978,20 @@ var RootCircuit = class {
9979
9978
  }
9980
9979
  _guessRootComponent() {
9981
9980
  if (this.firstChild) return;
9982
- if (this.children.length === 1) {
9983
- this.firstChild = this.children[0];
9984
- return;
9985
- }
9986
9981
  if (this.children.length === 0) {
9987
9982
  throw new Error(
9988
9983
  "Not able to guess root component: RootCircuit has no children (use circuit.add(...))"
9989
9984
  );
9990
9985
  }
9991
- if (this.children.length > 0) {
9992
- const board = this.children.find((c) => c.componentName === "Board") ?? null;
9993
- if (board) {
9994
- this.firstChild = board;
9995
- return;
9996
- }
9986
+ if (this.children.length === 1 && this.children[0].isGroup) {
9987
+ this.firstChild = this.children[0];
9988
+ return;
9997
9989
  }
9998
- throw new Error(
9999
- "Not able to guess root component: RootCircuit has multiple children and no board"
10000
- );
9990
+ const group = new Group({ subcircuit: true });
9991
+ group.parent = this;
9992
+ group.addAll(this.children);
9993
+ this.children = [group];
9994
+ this.firstChild = group;
10001
9995
  }
10002
9996
  render() {
10003
9997
  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.470",
4
+ "version": "0.0.472",
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",