@tscircuit/core 0.0.776 → 0.0.778

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
@@ -661,8 +661,8 @@ declare class Trace extends PrimitiveComponent<typeof traceProps> implements Tra
661
661
  })[];
662
662
  key?: string | undefined;
663
663
  highlightColor?: string | undefined;
664
- maxLength?: number | undefined;
665
664
  thickness?: number | undefined;
665
+ maxLength?: number | undefined;
666
666
  schematicRouteHints?: {
667
667
  x: number;
668
668
  y: number;
@@ -687,8 +687,8 @@ declare class Trace extends PrimitiveComponent<typeof traceProps> implements Tra
687
687
  })[];
688
688
  key?: string | undefined;
689
689
  highlightColor?: string | undefined;
690
- maxLength?: string | number | undefined;
691
690
  thickness?: string | number | undefined;
691
+ maxLength?: string | number | undefined;
692
692
  schematicRouteHints?: {
693
693
  x: string | number;
694
694
  y: string | number;
@@ -786,8 +786,8 @@ declare class Trace extends PrimitiveComponent<typeof traceProps> implements Tra
786
786
  };
787
787
  key?: string | undefined;
788
788
  highlightColor?: string | undefined;
789
- maxLength?: number | undefined;
790
789
  thickness?: number | undefined;
790
+ maxLength?: number | undefined;
791
791
  schematicRouteHints?: {
792
792
  x: number;
793
793
  y: number;
@@ -815,8 +815,8 @@ declare class Trace extends PrimitiveComponent<typeof traceProps> implements Tra
815
815
  };
816
816
  key?: string | undefined;
817
817
  highlightColor?: string | undefined;
818
- maxLength?: string | number | undefined;
819
818
  thickness?: string | number | undefined;
819
+ maxLength?: string | number | undefined;
820
820
  schematicRouteHints?: {
821
821
  x: string | number;
822
822
  y: string | number;
@@ -1176,6 +1176,7 @@ declare class NormalComponent<ZodProps extends z.ZodType = any, PortNames extend
1176
1176
  */
1177
1177
  _getSchematicPortArrangement(): SchematicPortArrangement | null;
1178
1178
  _getSchematicBoxDimensions(): SchematicBoxDimensions | null;
1179
+ getFootprinterString(): string | null;
1179
1180
  doInitialCadModelRender(): void;
1180
1181
  private _addCachebustToModelUrl;
1181
1182
  private _getPartsEngineCacheKey;
@@ -1294,13 +1295,14 @@ declare class Group<Props extends z.ZodType<any, any, any> = typeof groupProps>
1294
1295
 
1295
1296
  declare class Board extends Group<typeof boardProps> {
1296
1297
  pcb_board_id: string | null;
1298
+ source_board_id: string | null;
1297
1299
  _drcChecksComplete: boolean;
1298
1300
  _connectedSchematicPortPairs: Set<string>;
1299
1301
  get isSubcircuit(): boolean;
1300
1302
  get isGroup(): boolean;
1301
1303
  get config(): {
1302
1304
  componentName: string;
1303
- zodProps: zod.ZodObject<{
1305
+ zodProps: zod.ZodObject<Omit<{
1304
1306
  pcbX: zod.ZodOptional<zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>>;
1305
1307
  pcbY: zod.ZodOptional<zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>>;
1306
1308
  pcbRotation: zod.ZodOptional<zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>>;
@@ -1970,10 +1972,11 @@ declare class Board extends Group<typeof boardProps> {
1970
1972
  }>, "many">>;
1971
1973
  outlineOffsetX: zod.ZodOptional<zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>>;
1972
1974
  outlineOffsetY: zod.ZodOptional<zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>>;
1973
- } & {
1975
+ }, "connections"> & {
1974
1976
  material: zod.ZodDefault<zod.ZodEnum<["fr4", "fr1"]>>;
1975
1977
  layers: zod.ZodDefault<zod.ZodUnion<[zod.ZodLiteral<2>, zod.ZodLiteral<4>]>>;
1976
1978
  borderRadius: zod.ZodOptional<zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>>;
1979
+ thickness: zod.ZodOptional<zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>>;
1977
1980
  boardAnchorPosition: zod.ZodOptional<zod.ZodObject<{
1978
1981
  x: zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>;
1979
1982
  y: zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>;
@@ -1985,6 +1988,7 @@ declare class Board extends Group<typeof boardProps> {
1985
1988
  y: string | number;
1986
1989
  }>>;
1987
1990
  boardAnchorAlignment: zod.ZodOptional<zod.ZodEnum<["top_left", "top_center", "top_right", "center_left", "center", "center_right", "bottom_left", "bottom_center", "bottom_right"]>>;
1991
+ title: zod.ZodOptional<zod.ZodString>;
1988
1992
  solderMaskColor: zod.ZodOptional<zod.ZodType<_tscircuit_props.BoardColor, zod.ZodTypeDef, _tscircuit_props.BoardColor>>;
1989
1993
  topSolderMaskColor: zod.ZodOptional<zod.ZodType<_tscircuit_props.BoardColor, zod.ZodTypeDef, _tscircuit_props.BoardColor>>;
1990
1994
  bottomSolderMaskColor: zod.ZodOptional<zod.ZodType<_tscircuit_props.BoardColor, zod.ZodTypeDef, _tscircuit_props.BoardColor>>;
@@ -2056,7 +2060,6 @@ declare class Board extends Group<typeof boardProps> {
2056
2060
  matchAdaptTemplate?: any;
2057
2061
  schTitle?: string | undefined;
2058
2062
  showAsSchematicBox?: boolean | undefined;
2059
- connections?: Record<string, string | readonly string[] | string[] | undefined> | undefined;
2060
2063
  schPinArrangement?: {
2061
2064
  leftSize?: number | undefined;
2062
2065
  topSize?: number | undefined;
@@ -2270,7 +2273,9 @@ declare class Board extends Group<typeof boardProps> {
2270
2273
  }[] | undefined;
2271
2274
  outlineOffsetX?: number | undefined;
2272
2275
  outlineOffsetY?: number | undefined;
2276
+ title?: string | undefined;
2273
2277
  borderRadius?: number | undefined;
2278
+ thickness?: number | undefined;
2274
2279
  boardAnchorPosition?: {
2275
2280
  x: number;
2276
2281
  y: number;
@@ -2347,7 +2352,6 @@ declare class Board extends Group<typeof boardProps> {
2347
2352
  matchAdaptTemplate?: any;
2348
2353
  schTitle?: string | undefined;
2349
2354
  showAsSchematicBox?: boolean | undefined;
2350
- connections?: Record<string, string | readonly string[] | string[] | undefined> | undefined;
2351
2355
  schPinArrangement?: {
2352
2356
  leftSize?: number | undefined;
2353
2357
  topSize?: number | undefined;
@@ -2563,9 +2567,11 @@ declare class Board extends Group<typeof boardProps> {
2563
2567
  }[] | undefined;
2564
2568
  outlineOffsetX?: string | number | undefined;
2565
2569
  outlineOffsetY?: string | number | undefined;
2570
+ title?: string | undefined;
2566
2571
  material?: "fr4" | "fr1" | undefined;
2567
2572
  layers?: 2 | 4 | undefined;
2568
2573
  borderRadius?: string | number | undefined;
2574
+ thickness?: string | number | undefined;
2569
2575
  boardAnchorPosition?: {
2570
2576
  x: string | number;
2571
2577
  y: string | number;
@@ -2592,6 +2598,7 @@ declare class Board extends Group<typeof boardProps> {
2592
2598
  * the project name, version, or url is set.
2593
2599
  */
2594
2600
  private _addBoardInformationToSilkscreen;
2601
+ doInitialSourceRender(): void;
2595
2602
  doInitialPcbComponentRender(): void;
2596
2603
  removePcbComponentRender(): void;
2597
2604
  _computePcbGlobalTransformBeforeLayout(): Matrix;
@@ -12928,6 +12935,7 @@ declare class Led extends NormalComponent<typeof ledProps, PolarizedPassivePorts
12928
12935
  };
12929
12936
  initPorts(): void;
12930
12937
  _getSchematicSymbolDisplayValue(): string | undefined;
12938
+ getFootprinterString(): string | null;
12931
12939
  doInitialSourceRender(): void;
12932
12940
  pos: Port;
12933
12941
  anode: Port;
@@ -17770,6 +17778,7 @@ declare class CadModel extends PrimitiveComponent<typeof cadmodelProps> {
17770
17778
  modelUnitToMmScale: z.ZodOptional<z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodNumber]>, number, string | number>>;
17771
17779
  } & {
17772
17780
  modelUrl: z.ZodString;
17781
+ stepUrl: z.ZodOptional<z.ZodString>;
17773
17782
  } & {
17774
17783
  pcbX: z.ZodOptional<z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodNumber]>, number, string | number>>;
17775
17784
  pcbY: z.ZodOptional<z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodNumber]>, number, string | number>>;
@@ -17792,6 +17801,7 @@ declare class CadModel extends PrimitiveComponent<typeof cadmodelProps> {
17792
17801
  z: number;
17793
17802
  } | undefined;
17794
17803
  modelUnitToMmScale?: number | undefined;
17804
+ stepUrl?: string | undefined;
17795
17805
  pcbX?: number | undefined;
17796
17806
  pcbY?: number | undefined;
17797
17807
  pcbZ?: number | undefined;
@@ -17813,6 +17823,7 @@ declare class CadModel extends PrimitiveComponent<typeof cadmodelProps> {
17813
17823
  z: string | number;
17814
17824
  } | undefined;
17815
17825
  modelUnitToMmScale?: string | number | undefined;
17826
+ stepUrl?: string | undefined;
17816
17827
  pcbX?: string | number | undefined;
17817
17828
  pcbY?: string | number | undefined;
17818
17829
  pcbZ?: string | number | undefined;
@@ -32479,8 +32490,8 @@ declare class SchematicRect extends PrimitiveComponent<typeof schematicRectProps
32479
32490
  width: number;
32480
32491
  height: number;
32481
32492
  color: string;
32482
- isDashed: boolean;
32483
32493
  isFilled: boolean;
32494
+ isDashed: boolean;
32484
32495
  rotation: number;
32485
32496
  schX?: number | undefined;
32486
32497
  schY?: number | undefined;
@@ -32493,8 +32504,8 @@ declare class SchematicRect extends PrimitiveComponent<typeof schematicRectProps
32493
32504
  schY?: string | number | undefined;
32494
32505
  strokeWidth?: string | number | undefined;
32495
32506
  color?: string | undefined;
32496
- isDashed?: boolean | undefined;
32497
32507
  isFilled?: boolean | undefined;
32508
+ isDashed?: boolean | undefined;
32498
32509
  fillColor?: string | undefined;
32499
32510
  rotation?: string | number | undefined;
32500
32511
  }>;
@@ -32583,8 +32594,8 @@ declare class SchematicCircle extends PrimitiveComponent<typeof schematicCircleP
32583
32594
  };
32584
32595
  radius: number;
32585
32596
  color: string;
32586
- isDashed: boolean;
32587
32597
  isFilled: boolean;
32598
+ isDashed: boolean;
32588
32599
  strokeWidth?: number | undefined;
32589
32600
  fillColor?: string | undefined;
32590
32601
  }, {
@@ -32595,8 +32606,8 @@ declare class SchematicCircle extends PrimitiveComponent<typeof schematicCircleP
32595
32606
  radius: string | number;
32596
32607
  strokeWidth?: string | number | undefined;
32597
32608
  color?: string | undefined;
32598
- isDashed?: boolean | undefined;
32599
32609
  isFilled?: boolean | undefined;
32610
+ isDashed?: boolean | undefined;
32600
32611
  fillColor?: string | undefined;
32601
32612
  }>;
32602
32613
  };
@@ -32638,8 +32649,8 @@ declare class SchematicBox extends PrimitiveComponent<typeof schematicBoxProps>
32638
32649
  paddingBottom?: number | undefined;
32639
32650
  width?: number | undefined;
32640
32651
  height?: number | undefined;
32641
- overlay?: string[] | undefined;
32642
32652
  title?: string | undefined;
32653
+ overlay?: string[] | undefined;
32643
32654
  titleColor?: string | undefined;
32644
32655
  titleFontSize?: number | undefined;
32645
32656
  }, {
@@ -32652,8 +32663,8 @@ declare class SchematicBox extends PrimitiveComponent<typeof schematicBoxProps>
32652
32663
  paddingBottom?: string | number | undefined;
32653
32664
  width?: string | number | undefined;
32654
32665
  height?: string | number | undefined;
32655
- overlay?: string[] | undefined;
32656
32666
  title?: string | undefined;
32667
+ overlay?: string[] | undefined;
32657
32668
  titleAlignment?: "top_left" | "top_center" | "top_right" | "center_left" | "center" | "center_right" | "bottom_left" | "bottom_center" | "bottom_right" | undefined;
32658
32669
  titleColor?: string | undefined;
32659
32670
  titleFontSize?: string | number | undefined;
@@ -32672,8 +32683,8 @@ declare class SchematicBox extends PrimitiveComponent<typeof schematicBoxProps>
32672
32683
  paddingBottom?: number | undefined;
32673
32684
  width?: number | undefined;
32674
32685
  height?: number | undefined;
32675
- overlay?: string[] | undefined;
32676
32686
  title?: string | undefined;
32687
+ overlay?: string[] | undefined;
32677
32688
  titleColor?: string | undefined;
32678
32689
  titleFontSize?: number | undefined;
32679
32690
  }, {
@@ -32686,8 +32697,8 @@ declare class SchematicBox extends PrimitiveComponent<typeof schematicBoxProps>
32686
32697
  paddingBottom?: string | number | undefined;
32687
32698
  width?: string | number | undefined;
32688
32699
  height?: string | number | undefined;
32689
- overlay?: string[] | undefined;
32690
32700
  title?: string | undefined;
32701
+ overlay?: string[] | undefined;
32691
32702
  titleAlignment?: "top_left" | "top_center" | "top_right" | "center_left" | "center" | "center_right" | "bottom_left" | "bottom_center" | "bottom_right" | undefined;
32692
32703
  titleColor?: string | undefined;
32693
32704
  titleFontSize?: string | number | undefined;
@@ -32706,8 +32717,8 @@ declare class SchematicBox extends PrimitiveComponent<typeof schematicBoxProps>
32706
32717
  paddingBottom?: number | undefined;
32707
32718
  width?: number | undefined;
32708
32719
  height?: number | undefined;
32709
- overlay?: string[] | undefined;
32710
32720
  title?: string | undefined;
32721
+ overlay?: string[] | undefined;
32711
32722
  titleColor?: string | undefined;
32712
32723
  titleFontSize?: number | undefined;
32713
32724
  }, {
@@ -32720,8 +32731,8 @@ declare class SchematicBox extends PrimitiveComponent<typeof schematicBoxProps>
32720
32731
  paddingBottom?: string | number | undefined;
32721
32732
  width?: string | number | undefined;
32722
32733
  height?: string | number | undefined;
32723
- overlay?: string[] | undefined;
32724
32734
  title?: string | undefined;
32735
+ overlay?: string[] | undefined;
32725
32736
  titleAlignment?: "top_left" | "top_center" | "top_right" | "center_left" | "center" | "center_right" | "bottom_left" | "bottom_center" | "bottom_right" | undefined;
32726
32737
  titleColor?: string | undefined;
32727
32738
  titleFontSize?: string | number | undefined;
package/dist/index.js CHANGED
@@ -8182,13 +8182,19 @@ var NormalComponent3 = class extends PrimitiveComponent2 {
8182
8182
  });
8183
8183
  return dimensions;
8184
8184
  }
8185
+ getFootprinterString() {
8186
+ if (typeof this._parsedProps.footprint === "string") {
8187
+ return this._parsedProps.footprint;
8188
+ }
8189
+ return null;
8190
+ }
8185
8191
  doInitialCadModelRender() {
8186
8192
  if (this._isCadModelChild) return;
8187
8193
  const { db } = this.root;
8188
8194
  const { boardThickness = 0 } = this.root?._getBoard() ?? {};
8189
8195
  const cadModelProp = this._parsedProps.cadModel;
8190
8196
  const cadModel = cadModelProp === void 0 ? this._asyncFootprintCadModel : cadModelProp;
8191
- const footprint = this.props.footprint ?? this._getImpliedFootprintString();
8197
+ const footprint = this.getFootprinterString() ?? this._getImpliedFootprintString();
8192
8198
  if (!this.pcb_component_id) return;
8193
8199
  if (!cadModel && !footprint) return;
8194
8200
  if (cadModel === null) return;
@@ -12962,6 +12968,7 @@ var getRoundedRectOutline = (width, height, radius) => {
12962
12968
  };
12963
12969
  var Board = class extends Group6 {
12964
12970
  pcb_board_id = null;
12971
+ source_board_id = null;
12965
12972
  _drcChecksComplete = false;
12966
12973
  _connectedSchematicPortPairs = /* @__PURE__ */ new Set();
12967
12974
  get isSubcircuit() {
@@ -13099,6 +13106,15 @@ var Board = class extends Group6 {
13099
13106
  anchor_position: position
13100
13107
  });
13101
13108
  }
13109
+ doInitialSourceRender() {
13110
+ super.doInitialSourceRender();
13111
+ const { db } = this.root;
13112
+ const source_board = db.source_board.insert({
13113
+ source_group_id: this.source_group_id,
13114
+ title: this.props.title || this.props.name
13115
+ });
13116
+ this.source_board_id = source_board.source_board_id;
13117
+ }
13102
13118
  doInitialPcbComponentRender() {
13103
13119
  if (this.root?.pcbDisabled) return;
13104
13120
  const { db } = this.root;
@@ -13847,6 +13863,13 @@ var Led = class extends NormalComponent3 {
13847
13863
  _getSchematicSymbolDisplayValue() {
13848
13864
  return this._parsedProps.schDisplayValue || this._parsedProps.color || void 0;
13849
13865
  }
13866
+ getFootprinterString() {
13867
+ const baseFootprint = super.getFootprinterString();
13868
+ if (baseFootprint && this.props.color) {
13869
+ return `${baseFootprint}_color(${this.props.color})`;
13870
+ }
13871
+ return baseFootprint;
13872
+ }
13850
13873
  doInitialSourceRender() {
13851
13874
  const { db } = this.root;
13852
13875
  const { _parsedProps: props } = this;
@@ -16195,7 +16218,7 @@ import { identity as identity6 } from "transformation-matrix";
16195
16218
  var package_default = {
16196
16219
  name: "@tscircuit/core",
16197
16220
  type: "module",
16198
- version: "0.0.775",
16221
+ version: "0.0.777",
16199
16222
  types: "dist/index.d.ts",
16200
16223
  main: "dist/index.js",
16201
16224
  module: "dist/index.js",
@@ -16235,7 +16258,7 @@ var package_default = {
16235
16258
  "@tscircuit/matchpack": "^0.0.16",
16236
16259
  "@tscircuit/math-utils": "^0.0.21",
16237
16260
  "@tscircuit/miniflex": "^0.0.4",
16238
- "@tscircuit/props": "0.0.352",
16261
+ "@tscircuit/props": "0.0.357",
16239
16262
  "@tscircuit/schematic-autolayout": "^0.0.6",
16240
16263
  "@tscircuit/schematic-match-adapt": "^0.0.16",
16241
16264
  "@tscircuit/schematic-trace-solver": "^0.0.41",
@@ -16248,7 +16271,7 @@ var package_default = {
16248
16271
  "bun-match-svg": "0.0.12",
16249
16272
  "calculate-elbow": "^0.0.12",
16250
16273
  "chokidar-cli": "^3.0.0",
16251
- "circuit-json": "^0.0.273",
16274
+ "circuit-json": "^0.0.275",
16252
16275
  "circuit-json-to-bpc": "^0.0.13",
16253
16276
  "circuit-json-to-connectivity-map": "^0.0.22",
16254
16277
  "circuit-json-to-gltf": "^0.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.776",
4
+ "version": "0.0.778",
5
5
  "types": "dist/index.d.ts",
6
6
  "main": "dist/index.js",
7
7
  "module": "dist/index.js",
@@ -41,7 +41,7 @@
41
41
  "@tscircuit/matchpack": "^0.0.16",
42
42
  "@tscircuit/math-utils": "^0.0.21",
43
43
  "@tscircuit/miniflex": "^0.0.4",
44
- "@tscircuit/props": "0.0.352",
44
+ "@tscircuit/props": "0.0.357",
45
45
  "@tscircuit/schematic-autolayout": "^0.0.6",
46
46
  "@tscircuit/schematic-match-adapt": "^0.0.16",
47
47
  "@tscircuit/schematic-trace-solver": "^0.0.41",
@@ -54,7 +54,7 @@
54
54
  "bun-match-svg": "0.0.12",
55
55
  "calculate-elbow": "^0.0.12",
56
56
  "chokidar-cli": "^3.0.0",
57
- "circuit-json": "^0.0.273",
57
+ "circuit-json": "^0.0.275",
58
58
  "circuit-json-to-bpc": "^0.0.13",
59
59
  "circuit-json-to-connectivity-map": "^0.0.22",
60
60
  "circuit-json-to-gltf": "^0.0.7",