@tscircuit/core 0.0.400 → 0.0.402
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 +1 -1
- package/dist/index.js +16 -8
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -11823,7 +11823,7 @@ declare class Switch extends NormalComponent<typeof switchProps> {
|
|
|
11823
11823
|
}
|
|
11824
11824
|
|
|
11825
11825
|
declare class SchematicText extends PrimitiveComponent<typeof schematicTextProps> {
|
|
11826
|
-
|
|
11826
|
+
isSchematicPrimitive: boolean;
|
|
11827
11827
|
get config(): {
|
|
11828
11828
|
componentName: string;
|
|
11829
11829
|
zodProps: zod.ZodObject<{
|
package/dist/index.js
CHANGED
|
@@ -1850,10 +1850,18 @@ var PcbTrace = class extends PrimitiveComponent2 {
|
|
|
1850
1850
|
const { _parsedProps: props } = this;
|
|
1851
1851
|
const container = this.getPrimitiveContainer();
|
|
1852
1852
|
const subcircuit = this.getSubcircuit();
|
|
1853
|
-
const
|
|
1853
|
+
const { maybeFlipLayer } = this._getPcbPrimitiveFlippedHelpers();
|
|
1854
|
+
const parentTransform = this._computePcbGlobalTransformBeforeLayout();
|
|
1854
1855
|
const transformedRoute = props.route.map((point) => {
|
|
1855
1856
|
const { x, y, ...restOfPoint } = point;
|
|
1856
1857
|
const transformedPoint = applyToPoint3(parentTransform, { x, y });
|
|
1858
|
+
if (point.route_type === "wire" && point.layer) {
|
|
1859
|
+
return {
|
|
1860
|
+
...transformedPoint,
|
|
1861
|
+
...restOfPoint,
|
|
1862
|
+
layer: maybeFlipLayer(point.layer)
|
|
1863
|
+
};
|
|
1864
|
+
}
|
|
1857
1865
|
return { ...transformedPoint, ...restOfPoint };
|
|
1858
1866
|
});
|
|
1859
1867
|
const pcb_trace = db.pcb_trace.insert({
|
|
@@ -2394,7 +2402,7 @@ function getRelativeDirection(pointA, pointB) {
|
|
|
2394
2402
|
|
|
2395
2403
|
// lib/components/primitive-components/Port/Port.ts
|
|
2396
2404
|
import "schematic-symbols";
|
|
2397
|
-
import { applyToPoint as applyToPoint4, compose as
|
|
2405
|
+
import { applyToPoint as applyToPoint4, compose as compose3, translate as translate3 } from "transformation-matrix";
|
|
2398
2406
|
import { z as z5 } from "zod";
|
|
2399
2407
|
|
|
2400
2408
|
// lib/components/primitive-components/Port/areAllPcbPrimitivesOverlapping.ts
|
|
@@ -2563,9 +2571,9 @@ var Port = class extends PrimitiveComponent2 {
|
|
|
2563
2571
|
);
|
|
2564
2572
|
}
|
|
2565
2573
|
}
|
|
2566
|
-
const transform =
|
|
2574
|
+
const transform = compose3(
|
|
2567
2575
|
this.parent.computeSchematicGlobalTransform(),
|
|
2568
|
-
|
|
2576
|
+
translate3(-symbol.center.x, -symbol.center.y)
|
|
2569
2577
|
);
|
|
2570
2578
|
return applyToPoint4(transform, schematicSymbolPortDef);
|
|
2571
2579
|
}
|
|
@@ -6009,7 +6017,7 @@ var applyEditEventsToManualEditsFile = ({
|
|
|
6009
6017
|
|
|
6010
6018
|
// lib/utils/edit-events/apply-edit-events-to-circuit-json.ts
|
|
6011
6019
|
import { transformPCBElement } from "@tscircuit/circuit-json-util";
|
|
6012
|
-
import { translate as
|
|
6020
|
+
import { translate as translate4 } from "transformation-matrix";
|
|
6013
6021
|
|
|
6014
6022
|
// lib/utils/edit-events/apply-trace-hint-edit-event.ts
|
|
6015
6023
|
import { su as su3 } from "@tscircuit/circuit-json-util";
|
|
@@ -6054,7 +6062,7 @@ var applyEditEvents = ({
|
|
|
6054
6062
|
);
|
|
6055
6063
|
const needsMovement = !component || component.center.x !== editEvent.new_center.x || component.center.y !== editEvent.new_center.y;
|
|
6056
6064
|
if (needsMovement && editEvent.original_center) {
|
|
6057
|
-
const mat =
|
|
6065
|
+
const mat = translate4(
|
|
6058
6066
|
editEvent.new_center.x - editEvent.original_center.x,
|
|
6059
6067
|
editEvent.new_center.y - editEvent.original_center.y
|
|
6060
6068
|
);
|
|
@@ -8132,7 +8140,7 @@ var Switch = class extends NormalComponent {
|
|
|
8132
8140
|
// lib/components/primitive-components/SchematicText.ts
|
|
8133
8141
|
import { schematicTextProps } from "@tscircuit/props";
|
|
8134
8142
|
var SchematicText = class extends PrimitiveComponent2 {
|
|
8135
|
-
|
|
8143
|
+
isSchematicPrimitive = true;
|
|
8136
8144
|
get config() {
|
|
8137
8145
|
return {
|
|
8138
8146
|
componentName: "SchematicText",
|
|
@@ -8166,7 +8174,7 @@ import { identity as identity4 } from "transformation-matrix";
|
|
|
8166
8174
|
var package_default = {
|
|
8167
8175
|
name: "@tscircuit/core",
|
|
8168
8176
|
type: "module",
|
|
8169
|
-
version: "0.0.
|
|
8177
|
+
version: "0.0.401",
|
|
8170
8178
|
types: "dist/index.d.ts",
|
|
8171
8179
|
main: "dist/index.js",
|
|
8172
8180
|
module: "dist/index.js",
|