@tscircuit/core 0.0.584 → 0.0.586

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.js CHANGED
@@ -4958,6 +4958,21 @@ var pushEdgesOfSchematicTraceToPreventOverlap = ({
4958
4958
  }
4959
4959
  };
4960
4960
 
4961
+ // lib/utils/schematic/convertFacingDirectionToElbowDirection.ts
4962
+ var convertFacingDirectionToElbowDirection = (facingDirection) => {
4963
+ switch (facingDirection) {
4964
+ case "up":
4965
+ return "y+";
4966
+ case "down":
4967
+ return "y-";
4968
+ case "left":
4969
+ return "x-";
4970
+ case "right":
4971
+ return "x+";
4972
+ default:
4973
+ }
4974
+ };
4975
+
4961
4976
  // lib/components/primitive-components/Trace/Trace_doInitialSchematicTraceRender.ts
4962
4977
  var Trace_doInitialSchematicTraceRender = (trace) => {
4963
4978
  if (trace.root?.schematicDisabled) return;
@@ -5078,12 +5093,16 @@ var Trace_doInitialSchematicTraceRender = (trace) => {
5078
5093
  {
5079
5094
  x: start.position.x,
5080
5095
  y: start.position.y,
5081
- facingDirection: start.facingDirection
5096
+ facingDirection: convertFacingDirectionToElbowDirection(
5097
+ start.facingDirection
5098
+ )
5082
5099
  },
5083
5100
  {
5084
5101
  x: end.position.x,
5085
5102
  y: end.position.y,
5086
- facingDirection: end.facingDirection
5103
+ facingDirection: convertFacingDirectionToElbowDirection(
5104
+ end.facingDirection
5105
+ )
5087
5106
  }
5088
5107
  );
5089
5108
  for (let j = 0; j < path.length - 1; j++) {
@@ -7606,7 +7625,7 @@ function Group_doInitialSchematicLayoutMatchAdapt(group) {
7606
7625
  if (debug4.enabled) {
7607
7626
  global.debugGraphics?.push(
7608
7627
  getGraphicsForBpcGraph(bpcGraphBeforeGeneratedNetLabels, {
7609
- title: "floatingBpcGraph"
7628
+ title: `floatingBpcGraph-${group.name}`
7610
7629
  })
7611
7630
  );
7612
7631
  }
@@ -7652,7 +7671,7 @@ function Group_doInitialSchematicLayoutMatchAdapt(group) {
7652
7671
  if (debug4.enabled) {
7653
7672
  global.debugGraphics?.push(
7654
7673
  getGraphicsForBpcGraph(laidOutBpcGraph, {
7655
- title: "laidOutBpcGraph"
7674
+ title: `laidOutBpcGraph-${group.name}`
7656
7675
  })
7657
7676
  );
7658
7677
  }
@@ -8178,6 +8197,12 @@ var Group = class extends NormalComponent {
8178
8197
  }
8179
8198
  doInitialSourceParentAttachment() {
8180
8199
  const { db } = this.root;
8200
+ const parentGroup = this.parent?.getGroup?.();
8201
+ if (parentGroup?.source_group_id) {
8202
+ db.source_group.update(this.source_group_id, {
8203
+ parent_source_group_id: parentGroup.source_group_id
8204
+ });
8205
+ }
8181
8206
  if (!this.isSubcircuit) return;
8182
8207
  const parent_subcircuit_id = this.parent?.getSubcircuit?.()?.subcircuit_id;
8183
8208
  if (!parent_subcircuit_id) return;
@@ -8639,20 +8664,25 @@ var Group = class extends NormalComponent {
8639
8664
  }
8640
8665
  _getSchematicLayoutMode() {
8641
8666
  const props = this._parsedProps;
8642
- if (props.schLayout?.layoutMode === "none") return "none";
8667
+ if (props.schLayout?.layoutMode === "none") return "relative";
8668
+ if (props.schLayout?.layoutMode === "relative") return "relative";
8643
8669
  if (props.schLayout?.matchAdapt) return "match-adapt";
8644
8670
  if (props.schLayout?.flex) return "flex";
8645
8671
  if (props.schLayout?.grid) return "grid";
8646
8672
  if (props.matchAdapt) return "match-adapt";
8647
8673
  if (props.flex) return "flex";
8648
8674
  if (props.grid) return "grid";
8675
+ if (props.relative) return "relative";
8676
+ if (props.schRelative) return "relative";
8649
8677
  const anyChildHasSchCoords = this.children.some((child) => {
8650
8678
  const cProps = child._parsedProps;
8651
8679
  return cProps?.schX !== void 0 || cProps?.schY !== void 0;
8652
8680
  });
8681
+ const anyChildIsGroup = this.children.some((child) => child.isGroup);
8653
8682
  const hasManualEdits = (props.manualEdits?.schematic_placements?.length ?? 0) > 0;
8654
- if (!anyChildHasSchCoords && !hasManualEdits) return "match-adapt";
8655
- return "none";
8683
+ if (!anyChildHasSchCoords && !hasManualEdits && !anyChildIsGroup)
8684
+ return "match-adapt";
8685
+ return "relative";
8656
8686
  }
8657
8687
  doInitialSchematicLayout() {
8658
8688
  const props = this._parsedProps;
@@ -11140,7 +11170,7 @@ import { identity as identity5 } from "transformation-matrix";
11140
11170
  var package_default = {
11141
11171
  name: "@tscircuit/core",
11142
11172
  type: "module",
11143
- version: "0.0.583",
11173
+ version: "0.0.585",
11144
11174
  types: "dist/index.d.ts",
11145
11175
  main: "dist/index.js",
11146
11176
  module: "dist/index.js",
@@ -11166,13 +11196,13 @@ var package_default = {
11166
11196
  "@tscircuit/capacity-autorouter": "^0.0.100",
11167
11197
  "@tscircuit/checks": "^0.0.56",
11168
11198
  "@tscircuit/circuit-json-flex": "^0.0.1",
11169
- "@tscircuit/circuit-json-util": "^0.0.51",
11199
+ "@tscircuit/circuit-json-util": "^0.0.54",
11170
11200
  "@tscircuit/footprinter": "^0.0.204",
11171
11201
  "@tscircuit/import-snippet": "^0.0.4",
11172
11202
  "@tscircuit/infgrid-ijump-astar": "^0.0.33",
11173
11203
  "@tscircuit/log-soup": "^1.0.2",
11174
11204
  "@tscircuit/math-utils": "^0.0.18",
11175
- "@tscircuit/props": "^0.0.265",
11205
+ "@tscircuit/props": "^0.0.268",
11176
11206
  "@tscircuit/schematic-autolayout": "^0.0.6",
11177
11207
  "@tscircuit/schematic-corpus": "^0.0.52",
11178
11208
  "@tscircuit/schematic-match-adapt": "^0.0.16",
@@ -11186,7 +11216,7 @@ var package_default = {
11186
11216
  "bun-match-svg": "0.0.12",
11187
11217
  "calculate-elbow": "^0.0.5",
11188
11218
  "chokidar-cli": "^3.0.0",
11189
- "circuit-json": "^0.0.219",
11219
+ "circuit-json": "^0.0.221",
11190
11220
  "circuit-json-to-bpc": "^0.0.13",
11191
11221
  "circuit-json-to-connectivity-map": "^0.0.22",
11192
11222
  "circuit-json-to-simple-3d": "^0.0.2",
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@tscircuit/core",
3
3
  "type": "module",
4
- "version": "0.0.584",
4
+ "version": "0.0.586",
5
5
  "types": "dist/index.d.ts",
6
6
  "main": "dist/index.js",
7
7
  "module": "dist/index.js",
@@ -27,13 +27,13 @@
27
27
  "@tscircuit/capacity-autorouter": "^0.0.100",
28
28
  "@tscircuit/checks": "^0.0.56",
29
29
  "@tscircuit/circuit-json-flex": "^0.0.1",
30
- "@tscircuit/circuit-json-util": "^0.0.51",
30
+ "@tscircuit/circuit-json-util": "^0.0.54",
31
31
  "@tscircuit/footprinter": "^0.0.204",
32
32
  "@tscircuit/import-snippet": "^0.0.4",
33
33
  "@tscircuit/infgrid-ijump-astar": "^0.0.33",
34
34
  "@tscircuit/log-soup": "^1.0.2",
35
35
  "@tscircuit/math-utils": "^0.0.18",
36
- "@tscircuit/props": "^0.0.265",
36
+ "@tscircuit/props": "^0.0.268",
37
37
  "@tscircuit/schematic-autolayout": "^0.0.6",
38
38
  "@tscircuit/schematic-corpus": "^0.0.52",
39
39
  "@tscircuit/schematic-match-adapt": "^0.0.16",
@@ -47,7 +47,7 @@
47
47
  "bun-match-svg": "0.0.12",
48
48
  "calculate-elbow": "^0.0.5",
49
49
  "chokidar-cli": "^3.0.0",
50
- "circuit-json": "^0.0.219",
50
+ "circuit-json": "^0.0.221",
51
51
  "circuit-json-to-bpc": "^0.0.13",
52
52
  "circuit-json-to-connectivity-map": "^0.0.22",
53
53
  "circuit-json-to-simple-3d": "^0.0.2",