@tscircuit/core 0.0.734 → 0.0.735

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 +38 -3
  2. package/package.json +2 -2
package/dist/index.js CHANGED
@@ -6804,7 +6804,10 @@ var parseLibraryFootprintRef = (s) => {
6804
6804
  };
6805
6805
 
6806
6806
  // lib/components/base-components/NormalComponent/NormalComponent_doInitialPcbFootprintStringRender.ts
6807
- import { external_footprint_load_error } from "circuit-json";
6807
+ import {
6808
+ circuit_json_footprint_load_error,
6809
+ external_footprint_load_error
6810
+ } from "circuit-json";
6808
6811
  function NormalComponent_doInitialPcbFootprintStringRender(component, queueAsyncEffect) {
6809
6812
  let { footprint } = component.props;
6810
6813
  footprint ??= component._getImpliedFootprintString?.();
@@ -6920,6 +6923,38 @@ function NormalComponent_doInitialPcbFootprintStringRender(component, queueAsync
6920
6923
  if (!isReactElement(footprint) && footprint.componentName === "Footprint") {
6921
6924
  component.add(footprint);
6922
6925
  }
6926
+ if (Array.isArray(footprint) && !isReactElement(footprint) && footprint.length > 0) {
6927
+ try {
6928
+ const fpComponents = createComponentsFromCircuitJson(
6929
+ {
6930
+ componentName: component.name,
6931
+ componentRotation: pcbRotation,
6932
+ footprint: "",
6933
+ pinLabels,
6934
+ pcbPinLabels
6935
+ },
6936
+ footprint
6937
+ );
6938
+ component.addAll(fpComponents);
6939
+ } catch (err) {
6940
+ const db = component.root?.db;
6941
+ if (db && component.source_component_id && component.pcb_component_id) {
6942
+ const subcircuit = component.getSubcircuit();
6943
+ const errorMsg = `${component.getString()} failed to load json footprint: ` + (err instanceof Error ? err.message : String(err));
6944
+ const errorObj = circuit_json_footprint_load_error.parse({
6945
+ type: "circuit_json_footprint_load_error",
6946
+ message: errorMsg,
6947
+ pcb_component_id: component.pcb_component_id,
6948
+ source_component_id: component.source_component_id,
6949
+ subcircuit_id: subcircuit.subcircuit_id ?? void 0,
6950
+ pcb_group_id: component.getGroup()?.pcb_group_id ?? void 0
6951
+ });
6952
+ db.circuit_json_footprint_load_error.insert(errorObj);
6953
+ }
6954
+ throw err;
6955
+ }
6956
+ return;
6957
+ }
6923
6958
  }
6924
6959
 
6925
6960
  // lib/components/base-components/NormalComponent/NormalComponent_doInitialPcbComponentAnchorAlignment.ts
@@ -15325,7 +15360,7 @@ import { identity as identity6 } from "transformation-matrix";
15325
15360
  var package_default = {
15326
15361
  name: "@tscircuit/core",
15327
15362
  type: "module",
15328
- version: "0.0.733",
15363
+ version: "0.0.734",
15329
15364
  types: "dist/index.d.ts",
15330
15365
  main: "dist/index.js",
15331
15366
  module: "dist/index.js",
@@ -15378,7 +15413,7 @@ var package_default = {
15378
15413
  "bun-match-svg": "0.0.12",
15379
15414
  "calculate-elbow": "^0.0.12",
15380
15415
  "chokidar-cli": "^3.0.0",
15381
- "circuit-json": "^0.0.257",
15416
+ "circuit-json": "^0.0.260",
15382
15417
  "circuit-json-to-bpc": "^0.0.13",
15383
15418
  "circuit-json-to-connectivity-map": "^0.0.22",
15384
15419
  "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.735",
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",