@tscircuit/core 0.0.607 → 0.0.609
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 +19 -0
- package/dist/index.js +47 -5
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -1397,6 +1397,11 @@ declare class Board extends Group<typeof boardProps> {
|
|
|
1397
1397
|
schPaddingRight: zod.ZodOptional<zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>>;
|
|
1398
1398
|
schPaddingTop: zod.ZodOptional<zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>>;
|
|
1399
1399
|
schPaddingBottom: zod.ZodOptional<zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>>;
|
|
1400
|
+
pcbPadding: zod.ZodOptional<zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>>;
|
|
1401
|
+
pcbPaddingLeft: zod.ZodOptional<zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>>;
|
|
1402
|
+
pcbPaddingRight: zod.ZodOptional<zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>>;
|
|
1403
|
+
pcbPaddingTop: zod.ZodOptional<zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>>;
|
|
1404
|
+
pcbPaddingBottom: zod.ZodOptional<zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>>;
|
|
1400
1405
|
layoutMode: zod.ZodOptional<zod.ZodEnum<["grid", "flex", "match-adapt", "relative", "none"]>>;
|
|
1401
1406
|
position: zod.ZodOptional<zod.ZodEnum<["absolute", "relative"]>>;
|
|
1402
1407
|
gridCols: zod.ZodOptional<zod.ZodUnion<[zod.ZodNumber, zod.ZodString]>>;
|
|
@@ -1794,6 +1799,11 @@ declare class Board extends Group<typeof boardProps> {
|
|
|
1794
1799
|
schPaddingRight?: number | undefined;
|
|
1795
1800
|
schPaddingTop?: number | undefined;
|
|
1796
1801
|
schPaddingBottom?: number | undefined;
|
|
1802
|
+
pcbPadding?: number | undefined;
|
|
1803
|
+
pcbPaddingLeft?: number | undefined;
|
|
1804
|
+
pcbPaddingRight?: number | undefined;
|
|
1805
|
+
pcbPaddingTop?: number | undefined;
|
|
1806
|
+
pcbPaddingBottom?: number | undefined;
|
|
1797
1807
|
pcbGrid?: boolean | undefined;
|
|
1798
1808
|
pcbGridCols?: string | number | undefined;
|
|
1799
1809
|
pcbGridRows?: string | number | undefined;
|
|
@@ -2005,6 +2015,11 @@ declare class Board extends Group<typeof boardProps> {
|
|
|
2005
2015
|
schPaddingRight?: string | number | undefined;
|
|
2006
2016
|
schPaddingTop?: string | number | undefined;
|
|
2007
2017
|
schPaddingBottom?: string | number | undefined;
|
|
2018
|
+
pcbPadding?: string | number | undefined;
|
|
2019
|
+
pcbPaddingLeft?: string | number | undefined;
|
|
2020
|
+
pcbPaddingRight?: string | number | undefined;
|
|
2021
|
+
pcbPaddingTop?: string | number | undefined;
|
|
2022
|
+
pcbPaddingBottom?: string | number | undefined;
|
|
2008
2023
|
pcbGrid?: boolean | undefined;
|
|
2009
2024
|
pcbGridCols?: string | number | undefined;
|
|
2010
2025
|
pcbGridRows?: string | number | undefined;
|
|
@@ -3447,6 +3462,7 @@ declare class Chip<PinLabels extends string = never> extends NormalComponent<typ
|
|
|
3447
3462
|
}>;
|
|
3448
3463
|
shouldRenderAsSchematicBox: boolean;
|
|
3449
3464
|
};
|
|
3465
|
+
initPorts(opts?: {}): void;
|
|
3450
3466
|
doInitialSchematicComponentRender(): void;
|
|
3451
3467
|
doInitialSourceRender(): void;
|
|
3452
3468
|
doInitialPcbComponentRender(): void;
|
|
@@ -13528,6 +13544,7 @@ declare class Crystal extends NormalComponent<typeof crystalProps, PolarizedPass
|
|
|
13528
13544
|
loadCapacitance: zod.ZodEffects<zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>, number, string | number>;
|
|
13529
13545
|
pinVariant: zod.ZodOptional<zod.ZodEnum<["two_pin", "four_pin"]>>;
|
|
13530
13546
|
schOrientation: zod.ZodOptional<zod.ZodEnum<["vertical", "horizontal", "pos_top", "pos_bottom", "pos_left", "pos_right", "neg_top", "neg_bottom", "neg_left", "neg_right"]>>;
|
|
13547
|
+
connections: zod.ZodOptional<zod.ZodRecord<zod.ZodEnum<["pin1", "left", "pin2", "right"]>, zod.ZodUnion<[zod.ZodUnion<[zod.ZodString, zod.ZodReadonly<zod.ZodArray<zod.ZodString, "many">>]>, zod.ZodArray<zod.ZodString, "many">]>>>;
|
|
13531
13548
|
}, "strip", zod.ZodTypeAny, {
|
|
13532
13549
|
name: string;
|
|
13533
13550
|
frequency: number;
|
|
@@ -13609,6 +13626,7 @@ declare class Crystal extends NormalComponent<typeof crystalProps, PolarizedPass
|
|
|
13609
13626
|
children?: any;
|
|
13610
13627
|
symbolName?: string | undefined;
|
|
13611
13628
|
doNotPlace?: boolean | undefined;
|
|
13629
|
+
connections?: Partial<Record<"left" | "right" | "pin1" | "pin2", string | readonly string[] | string[]>> | undefined;
|
|
13612
13630
|
schOrientation?: "vertical" | "horizontal" | "pos_top" | "pos_bottom" | "pos_left" | "pos_right" | "neg_top" | "neg_bottom" | "neg_left" | "neg_right" | undefined;
|
|
13613
13631
|
pinVariant?: "two_pin" | "four_pin" | undefined;
|
|
13614
13632
|
}, {
|
|
@@ -13694,6 +13712,7 @@ declare class Crystal extends NormalComponent<typeof crystalProps, PolarizedPass
|
|
|
13694
13712
|
children?: any;
|
|
13695
13713
|
symbolName?: string | undefined;
|
|
13696
13714
|
doNotPlace?: boolean | undefined;
|
|
13715
|
+
connections?: Partial<Record<"left" | "right" | "pin1" | "pin2", string | readonly string[] | string[]>> | undefined;
|
|
13697
13716
|
schOrientation?: "vertical" | "horizontal" | "pos_top" | "pos_bottom" | "pos_left" | "pos_right" | "neg_top" | "neg_bottom" | "neg_left" | "neg_right" | undefined;
|
|
13698
13717
|
pinVariant?: "two_pin" | "four_pin" | undefined;
|
|
13699
13718
|
}>;
|
package/dist/index.js
CHANGED
|
@@ -5081,7 +5081,7 @@ var Trace_doInitialSchematicTraceRender = (trace) => {
|
|
|
5081
5081
|
pointsToConnect: []
|
|
5082
5082
|
};
|
|
5083
5083
|
const obstacles = getSchematicObstaclesForTrace(trace);
|
|
5084
|
-
const portsWithPosition = connectedPorts.map(({ port }) => ({
|
|
5084
|
+
const portsWithPosition = connectedPorts.filter(({ port }) => port.schematic_port_id !== null).map(({ port }) => ({
|
|
5085
5085
|
port,
|
|
5086
5086
|
position: port._getGlobalSchematicPositionAfterLayout(),
|
|
5087
5087
|
schematic_port_id: port.schematic_port_id ?? void 0,
|
|
@@ -8233,7 +8233,15 @@ var debug5 = Debug6("Group_doInitialPcbLayoutPack");
|
|
|
8233
8233
|
var Group_doInitialPcbLayoutPack = (group) => {
|
|
8234
8234
|
const { db } = group.root;
|
|
8235
8235
|
const { _parsedProps: props } = group;
|
|
8236
|
-
const {
|
|
8236
|
+
const {
|
|
8237
|
+
packOrderStrategy,
|
|
8238
|
+
packPlacementStrategy,
|
|
8239
|
+
gap: gapProp,
|
|
8240
|
+
pcbGap,
|
|
8241
|
+
// @ts-expect-error remove when props introduces pcbPackGap
|
|
8242
|
+
pcbPackGap
|
|
8243
|
+
} = props;
|
|
8244
|
+
const gap = pcbPackGap ?? pcbGap ?? gapProp;
|
|
8237
8245
|
const gapMm = length3.parse(gap ?? "0mm");
|
|
8238
8246
|
const packInput = {
|
|
8239
8247
|
...convertPackOutputToPackInput(
|
|
@@ -9217,7 +9225,6 @@ var Board = class extends Group {
|
|
|
9217
9225
|
let maxY = -Infinity;
|
|
9218
9226
|
const descendantIds = getDescendantSubcircuitIds(db, this.subcircuit_id);
|
|
9219
9227
|
const allowedSubcircuitIds = /* @__PURE__ */ new Set([this.subcircuit_id, ...descendantIds]);
|
|
9220
|
-
console.log({ allowedSubcircuitIds });
|
|
9221
9228
|
const allPcbComponents = db.pcb_component.list().filter(
|
|
9222
9229
|
(c) => c.subcircuit_id && allowedSubcircuitIds.has(c.subcircuit_id)
|
|
9223
9230
|
);
|
|
@@ -9447,6 +9454,41 @@ var Chip = class extends NormalComponent {
|
|
|
9447
9454
|
shouldRenderAsSchematicBox: true
|
|
9448
9455
|
};
|
|
9449
9456
|
}
|
|
9457
|
+
initPorts(opts = {}) {
|
|
9458
|
+
super.initPorts(opts);
|
|
9459
|
+
const { _parsedProps: props } = this;
|
|
9460
|
+
if (props.externallyConnectedPins) {
|
|
9461
|
+
const requiredPorts = /* @__PURE__ */ new Set();
|
|
9462
|
+
for (const [pin1, pin2] of props.externallyConnectedPins) {
|
|
9463
|
+
requiredPorts.add(pin1);
|
|
9464
|
+
requiredPorts.add(pin2);
|
|
9465
|
+
}
|
|
9466
|
+
for (const pinIdentifier of requiredPorts) {
|
|
9467
|
+
const existingPort = this.children.find(
|
|
9468
|
+
(child) => child instanceof Port && child.isMatchingAnyOf([pinIdentifier])
|
|
9469
|
+
);
|
|
9470
|
+
if (!existingPort) {
|
|
9471
|
+
const pinMatch = pinIdentifier.match(/^pin(\d+)$/);
|
|
9472
|
+
if (pinMatch) {
|
|
9473
|
+
const pinNumber = parseInt(pinMatch[1]);
|
|
9474
|
+
this.add(
|
|
9475
|
+
new Port({
|
|
9476
|
+
pinNumber,
|
|
9477
|
+
aliases: [pinIdentifier]
|
|
9478
|
+
})
|
|
9479
|
+
);
|
|
9480
|
+
} else {
|
|
9481
|
+
this.add(
|
|
9482
|
+
new Port({
|
|
9483
|
+
name: pinIdentifier,
|
|
9484
|
+
aliases: [pinIdentifier]
|
|
9485
|
+
})
|
|
9486
|
+
);
|
|
9487
|
+
}
|
|
9488
|
+
}
|
|
9489
|
+
}
|
|
9490
|
+
}
|
|
9491
|
+
}
|
|
9450
9492
|
doInitialSchematicComponentRender() {
|
|
9451
9493
|
const { _parsedProps: props } = this;
|
|
9452
9494
|
if (props?.noSchematicRepresentation === true) return;
|
|
@@ -11504,7 +11546,7 @@ import { identity as identity5 } from "transformation-matrix";
|
|
|
11504
11546
|
var package_default = {
|
|
11505
11547
|
name: "@tscircuit/core",
|
|
11506
11548
|
type: "module",
|
|
11507
|
-
version: "0.0.
|
|
11549
|
+
version: "0.0.608",
|
|
11508
11550
|
types: "dist/index.d.ts",
|
|
11509
11551
|
main: "dist/index.js",
|
|
11510
11552
|
module: "dist/index.js",
|
|
@@ -11536,7 +11578,7 @@ var package_default = {
|
|
|
11536
11578
|
"@tscircuit/log-soup": "^1.0.2",
|
|
11537
11579
|
"@tscircuit/math-utils": "^0.0.18",
|
|
11538
11580
|
"@tscircuit/miniflex": "^0.0.4",
|
|
11539
|
-
"@tscircuit/props": "^0.0.
|
|
11581
|
+
"@tscircuit/props": "^0.0.278",
|
|
11540
11582
|
"@tscircuit/schematic-autolayout": "^0.0.6",
|
|
11541
11583
|
"@tscircuit/schematic-corpus": "^0.0.110",
|
|
11542
11584
|
"@tscircuit/schematic-match-adapt": "^0.0.16",
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tscircuit/core",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.609",
|
|
5
5
|
"types": "dist/index.d.ts",
|
|
6
6
|
"main": "dist/index.js",
|
|
7
7
|
"module": "dist/index.js",
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
"@tscircuit/log-soup": "^1.0.2",
|
|
34
34
|
"@tscircuit/math-utils": "^0.0.18",
|
|
35
35
|
"@tscircuit/miniflex": "^0.0.4",
|
|
36
|
-
"@tscircuit/props": "^0.0.
|
|
36
|
+
"@tscircuit/props": "^0.0.278",
|
|
37
37
|
"@tscircuit/schematic-autolayout": "^0.0.6",
|
|
38
38
|
"@tscircuit/schematic-corpus": "^0.0.110",
|
|
39
39
|
"@tscircuit/schematic-match-adapt": "^0.0.16",
|