@tscircuit/core 0.0.548 → 0.0.549

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
@@ -7458,6 +7458,7 @@ declare class NetLabel extends PrimitiveComponent<typeof netLabelProps> {
7458
7458
  };
7459
7459
  _getAnchorSide(): "top" | "bottom" | "left" | "right";
7460
7460
  _getConnectedPorts(): Port[];
7461
+ computeSchematicPropsTransform(): Matrix;
7461
7462
  doInitialSchematicPrimitiveRender(): void;
7462
7463
  _resolveConnectsTo(): string[] | undefined;
7463
7464
  _getNetName(): string;
package/dist/index.js CHANGED
@@ -9492,6 +9492,11 @@ var BreakoutPoint = class extends PrimitiveComponent2 {
9492
9492
 
9493
9493
  // lib/components/primitive-components/NetLabel.ts
9494
9494
  import { netLabelProps } from "@tscircuit/props";
9495
+ import {
9496
+ applyToPoint as applyToPoint7,
9497
+ identity as identity4,
9498
+ translate as translate6
9499
+ } from "transformation-matrix";
9495
9500
  var NetLabel = class extends PrimitiveComponent2 {
9496
9501
  source_net_label_id;
9497
9502
  get config() {
@@ -9532,6 +9537,21 @@ var NetLabel = class extends PrimitiveComponent2 {
9532
9537
  }
9533
9538
  return connectedPorts;
9534
9539
  }
9540
+ computeSchematicPropsTransform() {
9541
+ const { _parsedProps: props } = this;
9542
+ if (props.schX === void 0 && props.schY === void 0) {
9543
+ const connectedPorts = this._getConnectedPorts();
9544
+ if (connectedPorts.length > 0) {
9545
+ const portPos = connectedPorts[0]._getGlobalSchematicPositionBeforeLayout();
9546
+ const parentCenter = applyToPoint7(
9547
+ this.parent?.computeSchematicGlobalTransform?.() ?? identity4(),
9548
+ { x: 0, y: 0 }
9549
+ );
9550
+ return translate6(portPos.x - parentCenter.x, portPos.y - parentCenter.y);
9551
+ }
9552
+ }
9553
+ return super.computeSchematicPropsTransform();
9554
+ }
9535
9555
  doInitialSchematicPrimitiveRender() {
9536
9556
  if (this.root?.schematicDisabled) return;
9537
9557
  const { db } = this.root;
@@ -9788,7 +9808,7 @@ var Via = class extends PrimitiveComponent2 {
9788
9808
  };
9789
9809
 
9790
9810
  // lib/components/primitive-components/Cutout.ts
9791
- import { applyToPoint as applyToPoint7 } from "transformation-matrix";
9811
+ import { applyToPoint as applyToPoint8 } from "transformation-matrix";
9792
9812
  import { cutoutProps } from "@tscircuit/props";
9793
9813
  var Cutout = class extends PrimitiveComponent2 {
9794
9814
  pcb_cutout_id = null;
@@ -9829,7 +9849,7 @@ var Cutout = class extends PrimitiveComponent2 {
9829
9849
  } else if (props.shape === "polygon") {
9830
9850
  const transform = this._computePcbGlobalTransformBeforeLayout();
9831
9851
  const transformedPoints = props.points.map(
9832
- (p) => applyToPoint7(transform, p)
9852
+ (p) => applyToPoint8(transform, p)
9833
9853
  );
9834
9854
  const polygonData = {
9835
9855
  shape: "polygon",
@@ -10690,13 +10710,13 @@ var SchematicBox = class extends PrimitiveComponent2 {
10690
10710
  // lib/RootCircuit.ts
10691
10711
  import { su as su5 } from "@tscircuit/circuit-json-util";
10692
10712
  import { isValidElement as isValidElement2 } from "react";
10693
- import { identity as identity4 } from "transformation-matrix";
10713
+ import { identity as identity5 } from "transformation-matrix";
10694
10714
 
10695
10715
  // package.json
10696
10716
  var package_default = {
10697
10717
  name: "@tscircuit/core",
10698
10718
  type: "module",
10699
- version: "0.0.546",
10719
+ version: "0.0.547",
10700
10720
  types: "dist/index.d.ts",
10701
10721
  main: "dist/index.js",
10702
10722
  module: "dist/index.js",
@@ -10927,10 +10947,10 @@ var RootCircuit = class {
10927
10947
  throw new Error("project.preview is not yet implemented");
10928
10948
  }
10929
10949
  computeSchematicGlobalTransform() {
10930
- return identity4();
10950
+ return identity5();
10931
10951
  }
10932
10952
  _computePcbGlobalTransformBeforeLayout() {
10933
- return identity4();
10953
+ return identity5();
10934
10954
  }
10935
10955
  selectAll(selector) {
10936
10956
  this._guessRootComponent();
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@tscircuit/core",
3
3
  "type": "module",
4
- "version": "0.0.548",
4
+ "version": "0.0.549",
5
5
  "types": "dist/index.d.ts",
6
6
  "main": "dist/index.js",
7
7
  "module": "dist/index.js",