@tscircuit/core 0.0.529 → 0.0.531

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
@@ -1932,6 +1932,11 @@ declare class Board extends Group<typeof boardProps> {
1932
1932
  */
1933
1933
  get allLayers(): string[];
1934
1934
  doInitialPcbBoardAutoSize(): void;
1935
+ /**
1936
+ * Update the board information silkscreen text if platform config is set and
1937
+ * the project name, version, or url is set.
1938
+ */
1939
+ private _addBoardInformationToSilkscreen;
1935
1940
  doInitialPcbComponentRender(): void;
1936
1941
  removePcbComponentRender(): void;
1937
1942
  _computePcbGlobalTransformBeforeLayout(): Matrix;
package/dist/index.js CHANGED
@@ -8499,6 +8499,38 @@ var Board = class extends Group {
8499
8499
  center
8500
8500
  });
8501
8501
  }
8502
+ /**
8503
+ * Update the board information silkscreen text if platform config is set and
8504
+ * the project name, version, or url is set.
8505
+ */
8506
+ _addBoardInformationToSilkscreen() {
8507
+ const platform = this.root?.platform;
8508
+ if (!platform?.printBoardInformationToSilkscreen) return;
8509
+ const pcbBoard = this.root.db.pcb_board.get(this.pcb_board_id);
8510
+ if (!pcbBoard) return;
8511
+ const boardInformation = [];
8512
+ if (platform.projectName) boardInformation.push(platform.projectName);
8513
+ if (platform.version) boardInformation.push(`v${platform.version}`);
8514
+ if (platform.url) boardInformation.push(platform.url);
8515
+ if (boardInformation.length === 0) return;
8516
+ const text = boardInformation.join("\n");
8517
+ const marginX = 0.25;
8518
+ const marginY = 1;
8519
+ const position = {
8520
+ x: pcbBoard.center.x + pcbBoard.width / 2 - marginX,
8521
+ y: pcbBoard.center.y - pcbBoard.height / 2 + marginY
8522
+ };
8523
+ this.root.db.pcb_silkscreen_text.insert({
8524
+ pcb_component_id: this.pcb_board_id,
8525
+ layer: "top",
8526
+ font: "tscircuit2024",
8527
+ font_size: 0.45,
8528
+ text,
8529
+ ccw_rotation: 0,
8530
+ anchor_alignment: "bottom_right",
8531
+ anchor_position: position
8532
+ });
8533
+ }
8502
8534
  doInitialPcbComponentRender() {
8503
8535
  if (this.root?.pcbDisabled) return;
8504
8536
  const { db } = this.root;
@@ -8536,6 +8568,7 @@ var Board = class extends Group {
8536
8568
  material: props.material
8537
8569
  });
8538
8570
  this.pcb_board_id = pcb_board.pcb_board_id;
8571
+ this._addBoardInformationToSilkscreen();
8539
8572
  }
8540
8573
  removePcbComponentRender() {
8541
8574
  const { db } = this.root;
@@ -10663,7 +10696,7 @@ import { identity as identity4 } from "transformation-matrix";
10663
10696
  var package_default = {
10664
10697
  name: "@tscircuit/core",
10665
10698
  type: "module",
10666
- version: "0.0.527",
10699
+ version: "0.0.530",
10667
10700
  types: "dist/index.d.ts",
10668
10701
  main: "dist/index.js",
10669
10702
  module: "dist/index.js",
@@ -10695,7 +10728,7 @@ var package_default = {
10695
10728
  "@tscircuit/layout": "^0.0.28",
10696
10729
  "@tscircuit/log-soup": "^1.0.2",
10697
10730
  "@tscircuit/math-utils": "^0.0.18",
10698
- "@tscircuit/props": "^0.0.244",
10731
+ "@tscircuit/props": "^0.0.245",
10699
10732
  "@tscircuit/schematic-autolayout": "^0.0.6",
10700
10733
  "@tscircuit/schematic-match-adapt": "^0.0.16",
10701
10734
  "@tscircuit/simple-3d-svg": "^0.0.6",
@@ -10709,7 +10742,7 @@ var package_default = {
10709
10742
  "circuit-json": "^0.0.212",
10710
10743
  "circuit-json-to-connectivity-map": "^0.0.22",
10711
10744
  "circuit-json-to-simple-3d": "^0.0.2",
10712
- "circuit-to-svg": "^0.0.160",
10745
+ "circuit-to-svg": "^0.0.162",
10713
10746
  concurrently: "^9.1.2",
10714
10747
  debug: "^4.3.6",
10715
10748
  "graphics-debug": "^0.0.4",
@@ -10740,7 +10773,7 @@ var package_default = {
10740
10773
  },
10741
10774
  dependencies: {
10742
10775
  "@lume/kiwi": "^0.4.3",
10743
- "css-select": "^5.1.0",
10776
+ "css-select": "5.1.0",
10744
10777
  "format-si-unit": "^0.0.3",
10745
10778
  nanoid: "^5.0.7",
10746
10779
  "performance-now": "^2.1.0",
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@tscircuit/core",
3
3
  "type": "module",
4
- "version": "0.0.529",
4
+ "version": "0.0.531",
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.244",
36
+ "@tscircuit/props": "^0.0.245",
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",
@@ -47,7 +47,7 @@
47
47
  "circuit-json": "^0.0.212",
48
48
  "circuit-json-to-connectivity-map": "^0.0.22",
49
49
  "circuit-json-to-simple-3d": "^0.0.2",
50
- "circuit-to-svg": "^0.0.160",
50
+ "circuit-to-svg": "^0.0.162",
51
51
  "concurrently": "^9.1.2",
52
52
  "debug": "^4.3.6",
53
53
  "graphics-debug": "^0.0.4",
@@ -78,7 +78,7 @@
78
78
  },
79
79
  "dependencies": {
80
80
  "@lume/kiwi": "^0.4.3",
81
- "css-select": "^5.1.0",
81
+ "css-select": "5.1.0",
82
82
  "format-si-unit": "^0.0.3",
83
83
  "nanoid": "^5.0.7",
84
84
  "performance-now": "^2.1.0",