@tscircuit/core 0.0.81 → 0.0.83

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 +15 -2
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -582,6 +582,19 @@ var Footprint = class extends PrimitiveComponent {
582
582
  (child) => child.componentName === "Constraint"
583
583
  );
584
584
  if (constraints.length === 0) return;
585
+ const { isFlipped } = this._getPcbPrimitiveFlippedHelpers();
586
+ const maybeFlipLeftRight = (props) => {
587
+ if (isFlipped) {
588
+ if ("left" in props && "right" in props) {
589
+ return {
590
+ ...props,
591
+ left: props.right,
592
+ right: props.left
593
+ };
594
+ }
595
+ }
596
+ return props;
597
+ };
585
598
  const involvedComponents = constraints.flatMap(
586
599
  (constraint) => constraint._getAllReferencedComponents().componentsWithSelectors
587
600
  ).map(({ component, selector, componentSelector, edge }) => ({
@@ -617,7 +630,7 @@ var Footprint = class extends PrimitiveComponent {
617
630
  for (const constraint of constraints) {
618
631
  const props = constraint._parsedProps;
619
632
  if ("xDist" in props) {
620
- const { xDist, left, right, edgeToEdge, centerToCenter } = props;
633
+ const { xDist, left, right, edgeToEdge, centerToCenter } = maybeFlipLeftRight(props);
621
634
  const leftVar = getKVar(`${left}_x`);
622
635
  const rightVar = getKVar(`${right}_x`);
623
636
  const leftBounds = getComponentDetails(left)?.bounds;
@@ -2043,7 +2056,7 @@ var NormalComponent = class extends PrimitiveComponent {
2043
2056
  rotation: {
2044
2057
  x: 0,
2045
2058
  y: this.props.layer === "top" ? 0 : 180,
2046
- z: pcb_component?.rotation ?? 0
2059
+ z: (pcb_component?.rotation ?? 0) + (this.props.layer === "bottom" ? 180 : 0)
2047
2060
  },
2048
2061
  pcb_component_id: this.pcb_component_id,
2049
2062
  source_component_id: this.source_component_id,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@tscircuit/core",
3
3
  "type": "module",
4
- "version": "0.0.81",
4
+ "version": "0.0.83",
5
5
  "types": "dist/index.d.ts",
6
6
  "main": "dist/index.js",
7
7
  "module": "dist/index.js",