@tscircuit/core 0.0.1276 → 0.0.1277
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 +3 -0
- package/dist/index.js +14 -4
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -1625,6 +1625,7 @@ declare abstract class PrimitiveComponent<ZodProps extends ZodType = any> extend
|
|
|
1625
1625
|
width: number;
|
|
1626
1626
|
height: number;
|
|
1627
1627
|
};
|
|
1628
|
+
protected _getPcbComponentLayer(): LayerRef | undefined;
|
|
1628
1629
|
/**
|
|
1629
1630
|
* Determine if this pcb primitive should be flipped because the primitive
|
|
1630
1631
|
* container is flipped
|
|
@@ -2207,6 +2208,8 @@ declare class NormalComponent<ZodProps extends z.ZodType = any, PortNames extend
|
|
|
2207
2208
|
updateInitializePortsFromChildren(): void;
|
|
2208
2209
|
protected getGlobalTransformRotation(): number;
|
|
2209
2210
|
private _getFootprintMetadataForPcbComponent;
|
|
2211
|
+
protected _getPcbComponentLayer(): LayerRef;
|
|
2212
|
+
protected _getFootprintOriginalLayer(): LayerRef | undefined;
|
|
2210
2213
|
protected _getPcbComponentInsertionDirection(componentLayer: LayerRef, rotationDegrees?: number): PcbComponent["insertion_direction"] | undefined;
|
|
2211
2214
|
doInitialReactSubtreesRender(): void;
|
|
2212
2215
|
doInitialPcbFootprintStringRender(): void;
|
package/dist/index.js
CHANGED
|
@@ -1683,6 +1683,9 @@ var PrimitiveComponent2 = class extends Renderable {
|
|
|
1683
1683
|
height: 0
|
|
1684
1684
|
};
|
|
1685
1685
|
}
|
|
1686
|
+
_getPcbComponentLayer() {
|
|
1687
|
+
return this._parsedProps.layer;
|
|
1688
|
+
}
|
|
1686
1689
|
/**
|
|
1687
1690
|
* Determine if this pcb primitive should be flipped because the primitive
|
|
1688
1691
|
* container is flipped
|
|
@@ -1693,8 +1696,9 @@ var PrimitiveComponent2 = class extends Renderable {
|
|
|
1693
1696
|
_getPcbPrimitiveFlippedHelpers() {
|
|
1694
1697
|
const container = this.getPrimitiveContainer();
|
|
1695
1698
|
const footprint = this.componentName === "Footprint" ? this : this._getEnclosingFootprint();
|
|
1699
|
+
const componentLayer = container?._getPcbComponentLayer();
|
|
1696
1700
|
const isFlipped = !container ? false : isFootprintFlipped({
|
|
1697
|
-
componentLayer
|
|
1701
|
+
componentLayer,
|
|
1698
1702
|
originalLayer: footprint?._parsedProps.originalLayer
|
|
1699
1703
|
});
|
|
1700
1704
|
const maybeFlipLayer = (layer) => {
|
|
@@ -12067,7 +12071,7 @@ var NormalComponent3 = class extends PrimitiveComponent2 {
|
|
|
12067
12071
|
const { db } = this.root;
|
|
12068
12072
|
const { _parsedProps: props } = this;
|
|
12069
12073
|
const subcircuit = this.getSubcircuit();
|
|
12070
|
-
const componentLayer =
|
|
12074
|
+
const componentLayer = this._getPcbComponentLayer();
|
|
12071
12075
|
if (componentLayer !== "top" && componentLayer !== "bottom") {
|
|
12072
12076
|
const error = pcb_component_invalid_layer_error.parse({
|
|
12073
12077
|
type: "pcb_component_invalid_layer_error",
|
|
@@ -12267,6 +12271,12 @@ var NormalComponent3 = class extends PrimitiveComponent2 {
|
|
|
12267
12271
|
}
|
|
12268
12272
|
return void 0;
|
|
12269
12273
|
}
|
|
12274
|
+
_getPcbComponentLayer() {
|
|
12275
|
+
return this._parsedProps.layer ?? (this._getFootprintOriginalLayer() === "bottom" ? "bottom" : "top");
|
|
12276
|
+
}
|
|
12277
|
+
_getFootprintOriginalLayer() {
|
|
12278
|
+
return this._getFootprintMetadataForPcbComponent()?.originalLayer;
|
|
12279
|
+
}
|
|
12270
12280
|
_getPcbComponentInsertionDirection(componentLayer, rotationDegrees = this.getGlobalTransformRotation()) {
|
|
12271
12281
|
const footprintMetadata = this._getFootprintMetadataForPcbComponent();
|
|
12272
12282
|
if (!footprintMetadata?.insertionDirection) return void 0;
|
|
@@ -13384,7 +13394,7 @@ var Chip = class extends NormalComponent3 {
|
|
|
13384
13394
|
});
|
|
13385
13395
|
this.pcb_missing_footprint_error_id = footprint_error.pcb_missing_footprint_error_id;
|
|
13386
13396
|
}
|
|
13387
|
-
const componentLayer =
|
|
13397
|
+
const componentLayer = this._getPcbComponentLayer();
|
|
13388
13398
|
if (componentLayer !== "top" && componentLayer !== "bottom") {
|
|
13389
13399
|
const subcircuit = this.getSubcircuit();
|
|
13390
13400
|
const error = pcb_component_invalid_layer_error2.parse({
|
|
@@ -21807,7 +21817,7 @@ import { identity as identity5 } from "transformation-matrix";
|
|
|
21807
21817
|
var package_default = {
|
|
21808
21818
|
name: "@tscircuit/core",
|
|
21809
21819
|
type: "module",
|
|
21810
|
-
version: "0.0.
|
|
21820
|
+
version: "0.0.1276",
|
|
21811
21821
|
types: "dist/index.d.ts",
|
|
21812
21822
|
main: "dist/index.js",
|
|
21813
21823
|
module: "dist/index.js",
|