@tscircuit/core 0.0.447 → 0.0.449
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 +2 -1
- package/dist/index.js +29 -6
- package/package.json +4 -4
package/dist/index.d.ts
CHANGED
|
@@ -12,7 +12,7 @@ import * as _tscircuit_layout from '@tscircuit/layout';
|
|
|
12
12
|
import { ConnectivityMap } from 'circuit-json-to-connectivity-map';
|
|
13
13
|
import { GraphicsObject } from 'graphics-debug';
|
|
14
14
|
|
|
15
|
-
declare const orderedRenderPhases: readonly ["ReactSubtreesRender", "PcbFootprintStringRender", "InitializePortsFromChildren", "CreateNetsFromProps", "CreateTracesFromProps", "CreateTraceHintsFromProps", "SourceRender", "SourceParentAttachment", "PortMatching", "OptimizeSelectorCache", "SourceTraceRender", "SourceAddConnectivityMapKey", "SchematicComponentRender", "SchematicPortRender", "SchematicPrimitiveRender", "SchematicLayout", "SchematicTraceRender", "PcbComponentRender", "PcbPrimitiveRender", "PcbFootprintLayout", "PcbPortRender", "PcbPortAttachment", "PcbLayout", "PcbComponentSizeCalculation", "PcbBoardAutoSize", "PcbTraceHintRender", "PcbTraceRender", "PcbRouteNetIslands", "PcbDesignRuleChecks", "CadModelRender", "PartsEngineRender"];
|
|
15
|
+
declare const orderedRenderPhases: readonly ["ReactSubtreesRender", "PcbFootprintStringRender", "InitializePortsFromChildren", "CreateNetsFromProps", "CreateTracesFromProps", "CreateTraceHintsFromProps", "SourceRender", "SourceParentAttachment", "PortMatching", "OptimizeSelectorCache", "SourceTraceRender", "SourceAddConnectivityMapKey", "SchematicComponentRender", "SchematicPortRender", "SchematicPrimitiveRender", "SchematicLayout", "SchematicTraceRender", "SchematicReplaceNetLabelsWithSymbols", "PcbComponentRender", "PcbPrimitiveRender", "PcbFootprintLayout", "PcbPortRender", "PcbPortAttachment", "PcbLayout", "PcbComponentSizeCalculation", "PcbBoardAutoSize", "PcbTraceHintRender", "PcbTraceRender", "PcbRouteNetIslands", "PcbDesignRuleChecks", "CadModelRender", "PartsEngineRender"];
|
|
16
16
|
type RenderPhase = (typeof orderedRenderPhases)[number];
|
|
17
17
|
type RenderPhaseFn<K extends RenderPhase = RenderPhase> = `doInitial${K}` | `update${K}` | `remove${K}`;
|
|
18
18
|
type RenderPhaseStates = Record<RenderPhase, {
|
|
@@ -1080,6 +1080,7 @@ declare class Group<Props extends z.ZodType<any, any, any> = typeof groupProps>
|
|
|
1080
1080
|
*/
|
|
1081
1081
|
_shouldUseTraceByTraceRouting(): boolean;
|
|
1082
1082
|
doInitialPcbDesignRuleChecks(): void;
|
|
1083
|
+
doInitialSchematicReplaceNetLabelsWithSymbols(): void;
|
|
1083
1084
|
}
|
|
1084
1085
|
|
|
1085
1086
|
declare class Board extends Group<typeof boardProps> {
|
package/dist/index.js
CHANGED
|
@@ -93,6 +93,7 @@ var orderedRenderPhases = [
|
|
|
93
93
|
"SchematicPrimitiveRender",
|
|
94
94
|
"SchematicLayout",
|
|
95
95
|
"SchematicTraceRender",
|
|
96
|
+
"SchematicReplaceNetLabelsWithSymbols",
|
|
96
97
|
"PcbComponentRender",
|
|
97
98
|
"PcbPrimitiveRender",
|
|
98
99
|
"PcbFootprintLayout",
|
|
@@ -2348,6 +2349,7 @@ var SilkscreenText = class extends PrimitiveComponent2 {
|
|
|
2348
2349
|
var createPinrowSilkscreenText = ({
|
|
2349
2350
|
elm,
|
|
2350
2351
|
pinLabels,
|
|
2352
|
+
layer,
|
|
2351
2353
|
readableRotation,
|
|
2352
2354
|
anchorAlignment
|
|
2353
2355
|
}) => {
|
|
@@ -2355,13 +2357,14 @@ var createPinrowSilkscreenText = ({
|
|
|
2355
2357
|
let label = pinNum;
|
|
2356
2358
|
if (Array.isArray(pinLabels)) {
|
|
2357
2359
|
const index = parseInt(pinNum.replace(/[^\d]/g, ""), 10) - 1;
|
|
2358
|
-
label = pinLabels[index] ?? pinNum;
|
|
2360
|
+
label = String(pinLabels[index] ?? pinNum);
|
|
2359
2361
|
} else if (typeof pinLabels === "object") {
|
|
2360
|
-
label = pinLabels[pinNum]
|
|
2362
|
+
label = String(pinLabels[pinNum] ?? pinNum);
|
|
2361
2363
|
}
|
|
2362
2364
|
return new SilkscreenText({
|
|
2363
2365
|
anchorAlignment: anchorAlignment || "center",
|
|
2364
2366
|
text: label ?? pinNum,
|
|
2367
|
+
layer: layer || "top",
|
|
2365
2368
|
fontSize: elm.font_size + 0.2,
|
|
2366
2369
|
pcbX: isNaN(elm.anchor_position.x) ? 0 : elm.anchor_position.x,
|
|
2367
2370
|
pcbY: elm.anchor_position.y,
|
|
@@ -2478,6 +2481,7 @@ var createComponentsFromCircuitJson = ({
|
|
|
2478
2481
|
createPinrowSilkscreenText({
|
|
2479
2482
|
elm,
|
|
2480
2483
|
pinLabels,
|
|
2484
|
+
layer: elm.layer,
|
|
2481
2485
|
readableRotation: ccwRotation,
|
|
2482
2486
|
anchorAlignment: elm.anchor_alignment
|
|
2483
2487
|
})
|
|
@@ -7617,6 +7621,25 @@ var Group = class extends NormalComponent {
|
|
|
7617
7621
|
}
|
|
7618
7622
|
}
|
|
7619
7623
|
}
|
|
7624
|
+
doInitialSchematicReplaceNetLabelsWithSymbols() {
|
|
7625
|
+
if (this.root?.schematicDisabled) return;
|
|
7626
|
+
const { db } = this.root;
|
|
7627
|
+
for (const nl of db.schematic_net_label.list()) {
|
|
7628
|
+
const net = db.source_net.get(nl.source_net_id);
|
|
7629
|
+
const text = nl.text || net?.name || "";
|
|
7630
|
+
if (nl.anchor_side === "top" && /^gnd/i.test(text)) {
|
|
7631
|
+
db.schematic_net_label.update(nl.schematic_net_label_id, {
|
|
7632
|
+
symbol_name: "ground_down"
|
|
7633
|
+
});
|
|
7634
|
+
continue;
|
|
7635
|
+
}
|
|
7636
|
+
if (nl.anchor_side === "bottom" && /^v/i.test(text)) {
|
|
7637
|
+
db.schematic_net_label.update(nl.schematic_net_label_id, {
|
|
7638
|
+
symbol_name: "vcc_up"
|
|
7639
|
+
});
|
|
7640
|
+
}
|
|
7641
|
+
}
|
|
7642
|
+
}
|
|
7620
7643
|
};
|
|
7621
7644
|
|
|
7622
7645
|
// lib/components/normal-components/Board.ts
|
|
@@ -9296,7 +9319,7 @@ import { identity as identity4 } from "transformation-matrix";
|
|
|
9296
9319
|
var package_default = {
|
|
9297
9320
|
name: "@tscircuit/core",
|
|
9298
9321
|
type: "module",
|
|
9299
|
-
version: "0.0.
|
|
9322
|
+
version: "0.0.448",
|
|
9300
9323
|
types: "dist/index.d.ts",
|
|
9301
9324
|
main: "dist/index.js",
|
|
9302
9325
|
module: "dist/index.js",
|
|
@@ -9322,7 +9345,7 @@ var package_default = {
|
|
|
9322
9345
|
"@tscircuit/capacity-autorouter": "^0.0.67",
|
|
9323
9346
|
"@tscircuit/checks": "^0.0.52",
|
|
9324
9347
|
"@tscircuit/circuit-json-util": "^0.0.47",
|
|
9325
|
-
"@tscircuit/footprinter": "^0.0.
|
|
9348
|
+
"@tscircuit/footprinter": "^0.0.175",
|
|
9326
9349
|
"@tscircuit/import-snippet": "^0.0.4",
|
|
9327
9350
|
"@tscircuit/infgrid-ijump-astar": "^0.0.33",
|
|
9328
9351
|
"@tscircuit/layout": "^0.0.28",
|
|
@@ -9342,7 +9365,7 @@ var package_default = {
|
|
|
9342
9365
|
"circuit-json": "^0.0.194",
|
|
9343
9366
|
"circuit-json-to-connectivity-map": "^0.0.22",
|
|
9344
9367
|
"circuit-json-to-simple-3d": "^0.0.2",
|
|
9345
|
-
"circuit-to-svg": "^0.0.
|
|
9368
|
+
"circuit-to-svg": "^0.0.151",
|
|
9346
9369
|
concurrently: "^9.1.2",
|
|
9347
9370
|
debug: "^4.3.6",
|
|
9348
9371
|
"graphics-debug": "^0.0.4",
|
|
@@ -9352,7 +9375,7 @@ var package_default = {
|
|
|
9352
9375
|
"pkg-pr-new": "^0.0.37",
|
|
9353
9376
|
react: "^19.0.0",
|
|
9354
9377
|
"react-dom": "^19.0.0",
|
|
9355
|
-
"schematic-symbols": "^0.0.
|
|
9378
|
+
"schematic-symbols": "^0.0.153",
|
|
9356
9379
|
"ts-expect": "^1.3.0",
|
|
9357
9380
|
tsup: "^8.2.4"
|
|
9358
9381
|
},
|
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.449",
|
|
5
5
|
"types": "dist/index.d.ts",
|
|
6
6
|
"main": "dist/index.js",
|
|
7
7
|
"module": "dist/index.js",
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
"@tscircuit/capacity-autorouter": "^0.0.67",
|
|
28
28
|
"@tscircuit/checks": "^0.0.52",
|
|
29
29
|
"@tscircuit/circuit-json-util": "^0.0.47",
|
|
30
|
-
"@tscircuit/footprinter": "^0.0.
|
|
30
|
+
"@tscircuit/footprinter": "^0.0.175",
|
|
31
31
|
"@tscircuit/import-snippet": "^0.0.4",
|
|
32
32
|
"@tscircuit/infgrid-ijump-astar": "^0.0.33",
|
|
33
33
|
"@tscircuit/layout": "^0.0.28",
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
"circuit-json": "^0.0.194",
|
|
48
48
|
"circuit-json-to-connectivity-map": "^0.0.22",
|
|
49
49
|
"circuit-json-to-simple-3d": "^0.0.2",
|
|
50
|
-
"circuit-to-svg": "^0.0.
|
|
50
|
+
"circuit-to-svg": "^0.0.151",
|
|
51
51
|
"concurrently": "^9.1.2",
|
|
52
52
|
"debug": "^4.3.6",
|
|
53
53
|
"graphics-debug": "^0.0.4",
|
|
@@ -57,7 +57,7 @@
|
|
|
57
57
|
"pkg-pr-new": "^0.0.37",
|
|
58
58
|
"react": "^19.0.0",
|
|
59
59
|
"react-dom": "^19.0.0",
|
|
60
|
-
"schematic-symbols": "^0.0.
|
|
60
|
+
"schematic-symbols": "^0.0.153",
|
|
61
61
|
"ts-expect": "^1.3.0",
|
|
62
62
|
"tsup": "^8.2.4"
|
|
63
63
|
},
|