@tscircuit/core 0.0.186 → 0.0.188

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
@@ -158,6 +158,7 @@ declare abstract class PrimitiveComponent<ZodProps extends ZodType = any> extend
158
158
  * components share the same names) unless you explicitly break out some ports
159
159
  */
160
160
  get isSubcircuit(): any;
161
+ get isGroup(): boolean;
161
162
  /**
162
163
  * A primitive container is a component that contains one or more ports and
163
164
  * primitive components that are designed to interact.
package/dist/index.js CHANGED
@@ -505,6 +505,9 @@ var PrimitiveComponent = class extends Renderable {
505
505
  return Boolean(this.props.subcircuit) || // Implied opaque group for top-level group
506
506
  this.lowercaseComponentName === "group" && this?.parent?.isRoot;
507
507
  }
508
+ get isGroup() {
509
+ return this.lowercaseComponentName === "group";
510
+ }
508
511
  /**
509
512
  * A primitive container is a component that contains one or more ports and
510
513
  * primitive components that are designed to interact.
@@ -2812,7 +2815,7 @@ var NormalComponent = class extends PrimitiveComponent {
2812
2815
  rotation: props.pcbRotation ?? 0,
2813
2816
  source_component_id: this.source_component_id
2814
2817
  });
2815
- if (!props.footprint) {
2818
+ if (!props.footprint && !this.isGroup) {
2816
2819
  const footprint_error = db.pcb_missing_footprint_error.insert({
2817
2820
  message: `No footprint found for component: ${this.componentName}`,
2818
2821
  source_component_id: `${this.source_component_id}`,
@@ -3981,7 +3984,7 @@ var Trace = class extends PrimitiveComponent {
3981
3984
  this.renderError(`Could not find port for selector "${selector}"`);
3982
3985
  } else {
3983
3986
  this.renderError(
3984
- `Could not find port for selector "${selector}"
3987
+ `Could not find port for selector "${selector}" (did you forget to include the pin name?)
3985
3988
  searched component ${targetComponent.getString()}, which has ports: ${targetComponent.children.filter((c) => c.componentName === "Port").map(
3986
3989
  (c) => `${c.getString()}(${c.getNameAndAliases().join(",")})`
3987
3990
  ).join(" & ")}`
@@ -4353,6 +4356,17 @@ searched component ${targetComponent.getString()}, which has ports: ${targetComp
4353
4356
  connectedTo: []
4354
4357
  });
4355
4358
  }
4359
+ if (elm.type === "schematic_text") {
4360
+ obstacles.push({
4361
+ type: "rect",
4362
+ layers: ["top"],
4363
+ center: elm.position,
4364
+ // Approximate text bounds based on text length
4365
+ width: (elm.text?.length ?? 0) * 0.1,
4366
+ height: 0.2,
4367
+ connectedTo: []
4368
+ });
4369
+ }
4356
4370
  }
4357
4371
  const portsWithPosition = connectedPorts.map(({ port }) => ({
4358
4372
  port,
@@ -4521,6 +4535,31 @@ var Chip = class extends NormalComponent {
4521
4535
  manufacturer_part_number: props.manufacturerPartNumber,
4522
4536
  supplier_part_numbers: props.supplierPartNumbers
4523
4537
  });
4538
+ const dimensions = this._getSchematicBoxDimensions();
4539
+ const schematic_box_width = dimensions?.getSize().width;
4540
+ const schematic_box_height = dimensions?.getSize().height;
4541
+ const manufacturer_part_number_text = db.schematic_text.insert({
4542
+ text: props.manufacturerPartNumber ?? "",
4543
+ schematic_component_id: source_component.source_component_id,
4544
+ anchor: "left",
4545
+ rotation: 0,
4546
+ position: {
4547
+ x: (props.schX ?? 0) + (schematic_box_width ?? 0) / 2,
4548
+ y: (props.schY ?? 0) + (schematic_box_height ?? 0) / 2 + 0.55
4549
+ },
4550
+ color: "#006464"
4551
+ });
4552
+ const component_name_text = db.schematic_text.insert({
4553
+ text: props.name ?? "",
4554
+ schematic_component_id: source_component.source_component_id,
4555
+ anchor: "left",
4556
+ rotation: 0,
4557
+ position: {
4558
+ x: (props.schX ?? 0) + (schematic_box_width ?? 0) / 2,
4559
+ y: (props.schY ?? 0) + (schematic_box_height ?? 0) / 2 + 0.35
4560
+ },
4561
+ color: "#006464"
4562
+ });
4524
4563
  this.source_component_id = source_component.source_component_id;
4525
4564
  }
4526
4565
  doInitialPcbComponentRender() {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@tscircuit/core",
3
3
  "type": "module",
4
- "version": "0.0.186",
4
+ "version": "0.0.188",
5
5
  "types": "dist/index.d.ts",
6
6
  "main": "dist/index.js",
7
7
  "module": "dist/index.js",
@@ -40,12 +40,12 @@
40
40
  "@tscircuit/footprinter": "^0.0.77",
41
41
  "@tscircuit/infgrid-ijump-astar": "^0.0.24",
42
42
  "@tscircuit/math-utils": "^0.0.5",
43
- "@tscircuit/props": "^0.0.98",
43
+ "@tscircuit/props": "^0.0.99",
44
44
  "@tscircuit/schematic-autolayout": "^0.0.6",
45
45
  "@tscircuit/soup-util": "^0.0.40",
46
46
  "circuit-json": "^0.0.104",
47
47
  "circuit-json-to-connectivity-map": "^0.0.17",
48
- "circuit-to-svg": "^0.0.77",
48
+ "circuit-to-svg": "^0.0.80",
49
49
  "format-si-unit": "^0.0.2",
50
50
  "nanoid": "^5.0.7",
51
51
  "performance-now": "^2.1.0",