@tscircuit/core 0.0.717 → 0.0.718

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 +21 -3
  2. package/package.json +2 -2
package/dist/index.js CHANGED
@@ -10180,11 +10180,29 @@ var Group_doInitialPcbLayoutPack = (group) => {
10180
10180
  } = props;
10181
10181
  const gap = pcbPackGap ?? pcbGap ?? gapProp;
10182
10182
  const gapMm = length4.parse(gap ?? DEFAULT_MIN_GAP);
10183
+ const chipMarginsMap = {};
10184
+ const collectMargins = (comp) => {
10185
+ if (comp?.pcb_component_id && comp?._parsedProps) {
10186
+ const props2 = comp._parsedProps;
10187
+ const left = length4.parse(props2.pcbMarginLeft ?? props2.pcbMarginX ?? 0);
10188
+ const right = length4.parse(props2.pcbMarginRight ?? props2.pcbMarginX ?? 0);
10189
+ const top = length4.parse(props2.pcbMarginTop ?? props2.pcbMarginY ?? 0);
10190
+ const bottom = length4.parse(
10191
+ props2.pcbMarginBottom ?? props2.pcbMarginY ?? 0
10192
+ );
10193
+ if (left || right || top || bottom) {
10194
+ chipMarginsMap[comp.pcb_component_id] = { left, right, top, bottom };
10195
+ }
10196
+ }
10197
+ if (comp?.children) comp.children.forEach(collectMargins);
10198
+ };
10199
+ collectMargins(group);
10183
10200
  const packInput = {
10184
10201
  ...convertPackOutputToPackInput(
10185
10202
  convertCircuitJsonToPackOutput(db.toArray(), {
10186
10203
  source_group_id: group.source_group_id,
10187
- shouldAddInnerObstacles: true
10204
+ shouldAddInnerObstacles: true,
10205
+ chipMarginsMap
10188
10206
  })
10189
10207
  ),
10190
10208
  // @ts-expect-error we're missing some pack order strategies
@@ -14776,7 +14794,7 @@ import { identity as identity6 } from "transformation-matrix";
14776
14794
  var package_default = {
14777
14795
  name: "@tscircuit/core",
14778
14796
  type: "module",
14779
- version: "0.0.716",
14797
+ version: "0.0.717",
14780
14798
  types: "dist/index.d.ts",
14781
14799
  main: "dist/index.js",
14782
14800
  module: "dist/index.js",
@@ -14871,7 +14889,7 @@ var package_default = {
14871
14889
  dependencies: {
14872
14890
  "@flatten-js/core": "^1.6.2",
14873
14891
  "@lume/kiwi": "^0.4.3",
14874
- "calculate-packing": "0.0.33",
14892
+ "calculate-packing": "0.0.34",
14875
14893
  "css-select": "5.1.0",
14876
14894
  "format-si-unit": "^0.0.3",
14877
14895
  nanoid: "^5.0.7",
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@tscircuit/core",
3
3
  "type": "module",
4
- "version": "0.0.717",
4
+ "version": "0.0.718",
5
5
  "types": "dist/index.d.ts",
6
6
  "main": "dist/index.js",
7
7
  "module": "dist/index.js",
@@ -96,7 +96,7 @@
96
96
  "dependencies": {
97
97
  "@flatten-js/core": "^1.6.2",
98
98
  "@lume/kiwi": "^0.4.3",
99
- "calculate-packing": "0.0.33",
99
+ "calculate-packing": "0.0.34",
100
100
  "css-select": "5.1.0",
101
101
  "format-si-unit": "^0.0.3",
102
102
  "nanoid": "^5.0.7",