@tscircuit/core 0.0.667 → 0.0.669

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.
Files changed (2) hide show
  1. package/dist/index.js +25 -11
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -1231,7 +1231,7 @@ var ErrorPlaceholderComponent = class extends PrimitiveComponent2 {
1231
1231
  this.root.db.source_failed_to_create_component_error.insert({
1232
1232
  component_name: this._parsedProps.component_name,
1233
1233
  error_type: "source_failed_to_create_component_error",
1234
- message: this._parsedProps.error?.formattedError?._errors?.join("; ") || this._parsedProps.message,
1234
+ message: `Could not create ${this._parsedProps.componentType ?? "component"}${this._parsedProps.name ? ` "${this._parsedProps.name}"` : ""}. ${this._parsedProps.error?.formattedError?._errors?.join("; ") || this._parsedProps.message}`,
1235
1235
  pcb_center: pcbPosition,
1236
1236
  schematic_center: schematicPosition
1237
1237
  });
@@ -1268,7 +1268,10 @@ var hostConfig = {
1268
1268
  const instance = prepare(new target(props), {});
1269
1269
  return instance;
1270
1270
  } catch (error) {
1271
- return createErrorPlaceholderComponent(props, error);
1271
+ return createErrorPlaceholderComponent(
1272
+ { ...props, componentType: type },
1273
+ error
1274
+ );
1272
1275
  }
1273
1276
  },
1274
1277
  createTextInstance(text) {
@@ -12960,14 +12963,25 @@ var PinHeader = class extends NormalComponent {
12960
12963
  initPorts() {
12961
12964
  const pinCount = this._parsedProps.pinCount ?? (Array.isArray(this._parsedProps.pinLabels) ? this._parsedProps.pinLabels.length : this._parsedProps.pinLabels ? Object.keys(this._parsedProps.pinLabels).length : 1);
12962
12965
  for (let i = 1; i <= pinCount; i++) {
12963
- const label = Array.isArray(this._parsedProps.pinLabels) ? this._parsedProps.pinLabels[i - 1] : this._parsedProps.pinLabels?.[i];
12964
- this.add(
12965
- new Port({
12966
- name: `pin${i}`,
12967
- pinNumber: i,
12968
- aliases: [label].filter(Boolean)
12969
- })
12970
- );
12966
+ const rawLabel = Array.isArray(this._parsedProps.pinLabels) ? this._parsedProps.pinLabels[i - 1] : this._parsedProps.pinLabels?.[`pin${i}`];
12967
+ if (rawLabel) {
12968
+ const primaryLabel = Array.isArray(rawLabel) ? rawLabel[0] : rawLabel;
12969
+ const otherLabels = Array.isArray(rawLabel) ? rawLabel.slice(1) : [];
12970
+ this.add(
12971
+ new Port({
12972
+ pinNumber: i,
12973
+ name: primaryLabel,
12974
+ aliases: [`pin${i}`, ...otherLabels]
12975
+ })
12976
+ );
12977
+ } else {
12978
+ this.add(
12979
+ new Port({
12980
+ pinNumber: i,
12981
+ name: `pin${i}`
12982
+ })
12983
+ );
12984
+ }
12971
12985
  }
12972
12986
  }
12973
12987
  _getSchematicPortArrangement() {
@@ -13848,7 +13862,7 @@ import { identity as identity5 } from "transformation-matrix";
13848
13862
  var package_default = {
13849
13863
  name: "@tscircuit/core",
13850
13864
  type: "module",
13851
- version: "0.0.666",
13865
+ version: "0.0.668",
13852
13866
  types: "dist/index.d.ts",
13853
13867
  main: "dist/index.js",
13854
13868
  module: "dist/index.js",
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@tscircuit/core",
3
3
  "type": "module",
4
- "version": "0.0.667",
4
+ "version": "0.0.669",
5
5
  "types": "dist/index.d.ts",
6
6
  "main": "dist/index.js",
7
7
  "module": "dist/index.js",