@tscircuit/core 0.0.734 → 0.0.736

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
@@ -924,6 +924,7 @@ declare class Port extends PrimitiveComponent<typeof portProps> {
924
924
  constructor(props: z.input<typeof portProps>, opts?: {
925
925
  originDescription?: string;
926
926
  });
927
+ _isBoardPinoutFromAttributes(): boolean | undefined;
927
928
  _getGlobalPcbPositionBeforeLayout(): {
928
929
  x: number;
929
930
  y: number;
package/dist/index.js CHANGED
@@ -3176,6 +3176,17 @@ var Port = class extends PrimitiveComponent2 {
3176
3176
  }
3177
3177
  this.matchedComponents = [];
3178
3178
  }
3179
+ _isBoardPinoutFromAttributes() {
3180
+ const parent = this.parent;
3181
+ if (parent?._parsedProps?.pinAttributes) {
3182
+ const pinAttributes = parent._parsedProps.pinAttributes;
3183
+ for (const alias of this.getNameAndAliases()) {
3184
+ if (pinAttributes[alias]?.includeInBoardPinout) {
3185
+ return true;
3186
+ }
3187
+ }
3188
+ }
3189
+ }
3179
3190
  _getGlobalPcbPositionBeforeLayout() {
3180
3191
  const matchedPcbElm = this.matchedComponents.find((c) => c.isPcbPrimitive);
3181
3192
  const parentComponent = this.parent;
@@ -3421,7 +3432,8 @@ var Port = class extends PrimitiveComponent2 {
3421
3432
  pcb_group_id: this.getGroup()?.pcb_group_id ?? void 0,
3422
3433
  ...isBoardPinout ? { is_board_pinout: true } : {},
3423
3434
  ...matchCenter,
3424
- source_port_id: this.source_port_id
3435
+ source_port_id: this.source_port_id,
3436
+ is_board_pinout: this._isBoardPinoutFromAttributes()
3425
3437
  });
3426
3438
  this.pcb_port_id = pcb_port.pcb_port_id;
3427
3439
  } else {
@@ -3459,7 +3471,8 @@ var Port = class extends PrimitiveComponent2 {
3459
3471
  pcb_group_id: this.getGroup()?.pcb_group_id ?? void 0,
3460
3472
  ...isBoardPinout ? { is_board_pinout: true } : {},
3461
3473
  ...matchCenter,
3462
- source_port_id: this.source_port_id
3474
+ source_port_id: this.source_port_id,
3475
+ is_board_pinout: this._isBoardPinoutFromAttributes()
3463
3476
  });
3464
3477
  this.pcb_port_id = pcb_port.pcb_port_id;
3465
3478
  }
@@ -6804,7 +6817,10 @@ var parseLibraryFootprintRef = (s) => {
6804
6817
  };
6805
6818
 
6806
6819
  // lib/components/base-components/NormalComponent/NormalComponent_doInitialPcbFootprintStringRender.ts
6807
- import { external_footprint_load_error } from "circuit-json";
6820
+ import {
6821
+ circuit_json_footprint_load_error,
6822
+ external_footprint_load_error
6823
+ } from "circuit-json";
6808
6824
  function NormalComponent_doInitialPcbFootprintStringRender(component, queueAsyncEffect) {
6809
6825
  let { footprint } = component.props;
6810
6826
  footprint ??= component._getImpliedFootprintString?.();
@@ -6920,6 +6936,38 @@ function NormalComponent_doInitialPcbFootprintStringRender(component, queueAsync
6920
6936
  if (!isReactElement(footprint) && footprint.componentName === "Footprint") {
6921
6937
  component.add(footprint);
6922
6938
  }
6939
+ if (Array.isArray(footprint) && !isReactElement(footprint) && footprint.length > 0) {
6940
+ try {
6941
+ const fpComponents = createComponentsFromCircuitJson(
6942
+ {
6943
+ componentName: component.name,
6944
+ componentRotation: pcbRotation,
6945
+ footprint: "",
6946
+ pinLabels,
6947
+ pcbPinLabels
6948
+ },
6949
+ footprint
6950
+ );
6951
+ component.addAll(fpComponents);
6952
+ } catch (err) {
6953
+ const db = component.root?.db;
6954
+ if (db && component.source_component_id && component.pcb_component_id) {
6955
+ const subcircuit = component.getSubcircuit();
6956
+ const errorMsg = `${component.getString()} failed to load json footprint: ` + (err instanceof Error ? err.message : String(err));
6957
+ const errorObj = circuit_json_footprint_load_error.parse({
6958
+ type: "circuit_json_footprint_load_error",
6959
+ message: errorMsg,
6960
+ pcb_component_id: component.pcb_component_id,
6961
+ source_component_id: component.source_component_id,
6962
+ subcircuit_id: subcircuit.subcircuit_id ?? void 0,
6963
+ pcb_group_id: component.getGroup()?.pcb_group_id ?? void 0
6964
+ });
6965
+ db.circuit_json_footprint_load_error.insert(errorObj);
6966
+ }
6967
+ throw err;
6968
+ }
6969
+ return;
6970
+ }
6923
6971
  }
6924
6972
 
6925
6973
  // lib/components/base-components/NormalComponent/NormalComponent_doInitialPcbComponentAnchorAlignment.ts
@@ -15325,7 +15373,7 @@ import { identity as identity6 } from "transformation-matrix";
15325
15373
  var package_default = {
15326
15374
  name: "@tscircuit/core",
15327
15375
  type: "module",
15328
- version: "0.0.733",
15376
+ version: "0.0.735",
15329
15377
  types: "dist/index.d.ts",
15330
15378
  main: "dist/index.js",
15331
15379
  module: "dist/index.js",
@@ -15378,7 +15426,7 @@ var package_default = {
15378
15426
  "bun-match-svg": "0.0.12",
15379
15427
  "calculate-elbow": "^0.0.12",
15380
15428
  "chokidar-cli": "^3.0.0",
15381
- "circuit-json": "^0.0.257",
15429
+ "circuit-json": "^0.0.260",
15382
15430
  "circuit-json-to-bpc": "^0.0.13",
15383
15431
  "circuit-json-to-connectivity-map": "^0.0.22",
15384
15432
  "circuit-json-to-simple-3d": "^0.0.8",
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@tscircuit/core",
3
3
  "type": "module",
4
- "version": "0.0.734",
4
+ "version": "0.0.736",
5
5
  "types": "dist/index.d.ts",
6
6
  "main": "dist/index.js",
7
7
  "module": "dist/index.js",
@@ -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.257",
57
+ "circuit-json": "^0.0.260",
58
58
  "circuit-json-to-bpc": "^0.0.13",
59
59
  "circuit-json-to-connectivity-map": "^0.0.22",
60
60
  "circuit-json-to-simple-3d": "^0.0.8",