@tscircuit/core 0.0.1356 → 0.0.1358
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 +7 -6
- package/dist/index.js +23 -17
- package/package.json +3 -3
package/dist/index.d.ts
CHANGED
|
@@ -478,6 +478,7 @@ declare class Trace extends PrimitiveComponent<typeof traceProps> implements Tra
|
|
|
478
478
|
* Get the explicit trace thickness, supporting 'width' as an alias for 'thickness'
|
|
479
479
|
*/
|
|
480
480
|
_getExplicitTraceThickness(): number | undefined;
|
|
481
|
+
_getSchematicNetLabelText(): string | undefined;
|
|
481
482
|
get config(): {
|
|
482
483
|
zodProps: z.ZodUnion<[z.ZodObject<{
|
|
483
484
|
key: z.ZodOptional<z.ZodString>;
|
|
@@ -88591,6 +88592,7 @@ declare const pcbViaProps: z.ZodObject<{
|
|
|
88591
88592
|
}>]>, "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6", "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6" | {
|
|
88592
88593
|
name: "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6";
|
|
88593
88594
|
}>>;
|
|
88595
|
+
name: z.ZodOptional<z.ZodString>;
|
|
88594
88596
|
layers: z.ZodOptional<z.ZodArray<z.ZodEffects<z.ZodUnion<[z.ZodEnum<["top", "bottom", "inner1", "inner2", "inner3", "inner4", "inner5", "inner6"]>, z.ZodObject<{
|
|
88595
88597
|
name: z.ZodEnum<["top", "bottom", "inner1", "inner2", "inner3", "inner4", "inner5", "inner6"]>;
|
|
88596
88598
|
}, "strip", z.ZodTypeAny, {
|
|
@@ -88600,7 +88602,6 @@ declare const pcbViaProps: z.ZodObject<{
|
|
|
88600
88602
|
}>]>, "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6", "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6" | {
|
|
88601
88603
|
name: "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6";
|
|
88602
88604
|
}>, "many">>;
|
|
88603
|
-
name: z.ZodOptional<z.ZodString>;
|
|
88604
88605
|
schX: z.ZodOptional<z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodNumber]>, number, string | number>>;
|
|
88605
88606
|
schY: z.ZodOptional<z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodNumber]>, number, string | number>>;
|
|
88606
88607
|
pcbX: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodNumber]>, number, string | number>]>>;
|
|
@@ -88703,8 +88704,8 @@ declare const pcbViaProps: z.ZodObject<{
|
|
|
88703
88704
|
}, "strip", z.ZodTypeAny, {
|
|
88704
88705
|
symbol?: _tscircuit_props.SymbolProp | undefined;
|
|
88705
88706
|
layer?: "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6" | undefined;
|
|
88706
|
-
layers?: ("top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6")[] | undefined;
|
|
88707
88707
|
name?: string | undefined;
|
|
88708
|
+
layers?: ("top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6")[] | undefined;
|
|
88708
88709
|
schX?: number | undefined;
|
|
88709
88710
|
schY?: number | undefined;
|
|
88710
88711
|
pcbX?: string | number | undefined;
|
|
@@ -88763,10 +88764,10 @@ declare const pcbViaProps: z.ZodObject<{
|
|
|
88763
88764
|
layer?: "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6" | {
|
|
88764
88765
|
name: "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6";
|
|
88765
88766
|
} | undefined;
|
|
88767
|
+
name?: string | undefined;
|
|
88766
88768
|
layers?: ("top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6" | {
|
|
88767
88769
|
name: "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6";
|
|
88768
88770
|
})[] | undefined;
|
|
88769
|
-
name?: string | undefined;
|
|
88770
88771
|
schX?: string | number | undefined;
|
|
88771
88772
|
schY?: string | number | undefined;
|
|
88772
88773
|
pcbX?: string | number | undefined;
|
|
@@ -88842,6 +88843,7 @@ declare class PcbVia extends PrimitiveComponent<typeof pcbViaProps> {
|
|
|
88842
88843
|
}>]>, "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6", "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6" | {
|
|
88843
88844
|
name: "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6";
|
|
88844
88845
|
}>>;
|
|
88846
|
+
name: z.ZodOptional<z.ZodString>;
|
|
88845
88847
|
layers: z.ZodOptional<z.ZodArray<z.ZodEffects<z.ZodUnion<[z.ZodEnum<["top", "bottom", "inner1", "inner2", "inner3", "inner4", "inner5", "inner6"]>, z.ZodObject<{
|
|
88846
88848
|
name: z.ZodEnum<["top", "bottom", "inner1", "inner2", "inner3", "inner4", "inner5", "inner6"]>;
|
|
88847
88849
|
}, "strip", z.ZodTypeAny, {
|
|
@@ -88851,7 +88853,6 @@ declare class PcbVia extends PrimitiveComponent<typeof pcbViaProps> {
|
|
|
88851
88853
|
}>]>, "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6", "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6" | {
|
|
88852
88854
|
name: "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6";
|
|
88853
88855
|
}>, "many">>;
|
|
88854
|
-
name: z.ZodOptional<z.ZodString>;
|
|
88855
88856
|
schX: z.ZodOptional<z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodNumber]>, number, string | number>>;
|
|
88856
88857
|
schY: z.ZodOptional<z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodNumber]>, number, string | number>>;
|
|
88857
88858
|
pcbX: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodNumber]>, number, string | number>]>>;
|
|
@@ -88954,8 +88955,8 @@ declare class PcbVia extends PrimitiveComponent<typeof pcbViaProps> {
|
|
|
88954
88955
|
}, "strip", z.ZodTypeAny, {
|
|
88955
88956
|
symbol?: _tscircuit_props.SymbolProp | undefined;
|
|
88956
88957
|
layer?: "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6" | undefined;
|
|
88957
|
-
layers?: ("top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6")[] | undefined;
|
|
88958
88958
|
name?: string | undefined;
|
|
88959
|
+
layers?: ("top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6")[] | undefined;
|
|
88959
88960
|
schX?: number | undefined;
|
|
88960
88961
|
schY?: number | undefined;
|
|
88961
88962
|
pcbX?: string | number | undefined;
|
|
@@ -89014,10 +89015,10 @@ declare class PcbVia extends PrimitiveComponent<typeof pcbViaProps> {
|
|
|
89014
89015
|
layer?: "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6" | {
|
|
89015
89016
|
name: "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6";
|
|
89016
89017
|
} | undefined;
|
|
89018
|
+
name?: string | undefined;
|
|
89017
89019
|
layers?: ("top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6" | {
|
|
89018
89020
|
name: "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6";
|
|
89019
89021
|
})[] | undefined;
|
|
89020
|
-
name?: string | undefined;
|
|
89021
89022
|
schX?: string | number | undefined;
|
|
89022
89023
|
schY?: string | number | undefined;
|
|
89023
89024
|
pcbX?: string | number | undefined;
|
package/dist/index.js
CHANGED
|
@@ -3723,6 +3723,7 @@ var Trace_doInitialSchematicTraceRender = (trace) => {
|
|
|
3723
3723
|
if (trace.getCollapsedSchematicBoxAncestor()) return;
|
|
3724
3724
|
const { db } = trace.root;
|
|
3725
3725
|
const { _parsedProps: props, parent } = trace;
|
|
3726
|
+
const schematicNetLabelText = trace._getSchematicNetLabelText();
|
|
3726
3727
|
if (!parent) throw new Error("Trace has no parent");
|
|
3727
3728
|
let allPortsFound;
|
|
3728
3729
|
let connectedPorts;
|
|
@@ -3812,16 +3813,16 @@ var Trace_doInitialSchematicTraceRender = (trace) => {
|
|
|
3812
3813
|
trace.schematic_trace_id = dbTrace2.schematic_trace_id;
|
|
3813
3814
|
return;
|
|
3814
3815
|
}
|
|
3815
|
-
if (
|
|
3816
|
+
if (schematicNetLabelText) {
|
|
3816
3817
|
const side2 = getEnteringEdgeFromDirection(port.facingDirection) ?? "bottom";
|
|
3817
3818
|
db.schematic_net_label.insert({
|
|
3818
|
-
text:
|
|
3819
|
+
text: schematicNetLabelText,
|
|
3819
3820
|
source_net_id: net.source_net_id,
|
|
3820
3821
|
anchor_position: anchorPos,
|
|
3821
3822
|
center: computeSchematicNetLabelCenter({
|
|
3822
3823
|
anchor_position: anchorPos,
|
|
3823
3824
|
anchor_side: side2,
|
|
3824
|
-
text:
|
|
3825
|
+
text: schematicNetLabelText
|
|
3825
3826
|
}),
|
|
3826
3827
|
anchor_side: side2
|
|
3827
3828
|
});
|
|
@@ -3841,7 +3842,7 @@ var Trace_doInitialSchematicTraceRender = (trace) => {
|
|
|
3841
3842
|
});
|
|
3842
3843
|
return;
|
|
3843
3844
|
}
|
|
3844
|
-
if (
|
|
3845
|
+
if (schematicNetLabelText) {
|
|
3845
3846
|
if ("from" in trace.props && "to" in trace.props || "path" in trace.props) {
|
|
3846
3847
|
trace._doInitialSchematicTraceRenderWithDisplayLabel();
|
|
3847
3848
|
return;
|
|
@@ -5077,7 +5078,7 @@ function Trace__doInitialSchematicTraceRenderWithDisplayLabel(trace) {
|
|
|
5077
5078
|
const [firstPort, secondPort] = connectedPorts.map(({ port }) => port);
|
|
5078
5079
|
const isFirstPortSchematicBox = firstPort.parent?.config.shouldRenderAsSchematicBox;
|
|
5079
5080
|
const pinFullName = isFirstPortSchematicBox ? `${firstPort?.parent?.props.name}_${firstPort?.props.name}` : `${secondPort?.parent?.props.name}_${secondPort?.props.name}`;
|
|
5080
|
-
const netLabelText = trace.
|
|
5081
|
+
const netLabelText = trace._getSchematicNetLabelText() ?? pinFullName;
|
|
5081
5082
|
if (existingFromNetLabel && existingFromNetLabel.text !== netLabelText) {
|
|
5082
5083
|
existingFromNetLabel.text = `${netLabelText} / ${existingFromNetLabel.text}`;
|
|
5083
5084
|
}
|
|
@@ -5087,13 +5088,13 @@ function Trace__doInitialSchematicTraceRenderWithDisplayLabel(trace) {
|
|
|
5087
5088
|
if (!existingToNetLabel) {
|
|
5088
5089
|
const toSide = getEnteringEdgeFromDirection(toPort.facingDirection) ?? "bottom";
|
|
5089
5090
|
db.schematic_net_label.insert({
|
|
5090
|
-
text:
|
|
5091
|
+
text: netLabelText,
|
|
5091
5092
|
source_net_id: toPort.source_port_id,
|
|
5092
5093
|
anchor_position: toAnchorPos,
|
|
5093
5094
|
center: computeSchematicNetLabelCenter({
|
|
5094
5095
|
anchor_position: toAnchorPos,
|
|
5095
5096
|
anchor_side: toSide,
|
|
5096
|
-
text:
|
|
5097
|
+
text: netLabelText
|
|
5097
5098
|
}),
|
|
5098
5099
|
anchor_side: toSide
|
|
5099
5100
|
});
|
|
@@ -5101,13 +5102,13 @@ function Trace__doInitialSchematicTraceRenderWithDisplayLabel(trace) {
|
|
|
5101
5102
|
if (!existingFromNetLabel) {
|
|
5102
5103
|
const fromSide = getEnteringEdgeFromDirection(fromPort.facingDirection) ?? "bottom";
|
|
5103
5104
|
db.schematic_net_label.insert({
|
|
5104
|
-
text:
|
|
5105
|
+
text: netLabelText,
|
|
5105
5106
|
source_net_id: fromPort.source_port_id,
|
|
5106
5107
|
anchor_position: fromAnchorPos,
|
|
5107
5108
|
center: computeSchematicNetLabelCenter({
|
|
5108
5109
|
anchor_position: fromAnchorPos,
|
|
5109
5110
|
anchor_side: fromSide,
|
|
5110
|
-
text:
|
|
5111
|
+
text: netLabelText
|
|
5111
5112
|
}),
|
|
5112
5113
|
anchor_side: fromSide
|
|
5113
5114
|
});
|
|
@@ -5225,6 +5226,9 @@ var Trace3 = class extends PrimitiveComponent2 {
|
|
|
5225
5226
|
_getExplicitTraceThickness() {
|
|
5226
5227
|
return this._parsedProps.thickness ?? this._parsedProps.width;
|
|
5227
5228
|
}
|
|
5229
|
+
_getSchematicNetLabelText() {
|
|
5230
|
+
return this._parsedProps.schDisplayLabel ?? this._parsedProps.displayName ?? this._parsedProps.name;
|
|
5231
|
+
}
|
|
5228
5232
|
get config() {
|
|
5229
5233
|
return {
|
|
5230
5234
|
zodProps: traceProps,
|
|
@@ -5377,11 +5381,12 @@ var Trace3 = class extends PrimitiveComponent2 {
|
|
|
5377
5381
|
connected_source_port_ids: ports.map((p) => p.port.source_port_id),
|
|
5378
5382
|
connected_source_net_ids: nets.map((n) => n.source_net_id),
|
|
5379
5383
|
subcircuit_id: this.getSubcircuit()?.subcircuit_id,
|
|
5384
|
+
name: props.name,
|
|
5380
5385
|
max_length: getMaxLengthFromConnectedCapacitors(
|
|
5381
5386
|
ports.map((p) => p.port),
|
|
5382
5387
|
{ db }
|
|
5383
5388
|
) ?? props.maxLength,
|
|
5384
|
-
display_name: displayName,
|
|
5389
|
+
display_name: props.displayName ?? displayName,
|
|
5385
5390
|
min_trace_thickness: this._getExplicitTraceThickness()
|
|
5386
5391
|
});
|
|
5387
5392
|
this.source_trace_id = trace.source_trace_id;
|
|
@@ -19369,7 +19374,8 @@ function createSchematicTraceSolverInputProblem(group) {
|
|
|
19369
19374
|
const pairKey = [a, b].sort().join("::");
|
|
19370
19375
|
if (!connectedPairKeys.has(pairKey)) {
|
|
19371
19376
|
connectedPairKeys.add(pairKey);
|
|
19372
|
-
const
|
|
19377
|
+
const traceLabel = st.name ?? st.display_name;
|
|
19378
|
+
const userNetId = traceLabel ?? st.source_trace_id;
|
|
19373
19379
|
if (st.subcircuit_connectivity_map_key) {
|
|
19374
19380
|
userNetIdToConnKey.set(userNetId, st.subcircuit_connectivity_map_key);
|
|
19375
19381
|
}
|
|
@@ -19383,10 +19389,10 @@ function createSchematicTraceSolverInputProblem(group) {
|
|
|
19383
19389
|
}
|
|
19384
19390
|
const maxMspDist = group._parsedProps.schMaxTraceDistance ?? DEFAULT_MAX_MSP_PAIR_DISTANCE;
|
|
19385
19391
|
let netLabelWidth;
|
|
19386
|
-
if (
|
|
19392
|
+
if (traceLabel && !traceLabel.startsWith(".") && portDistance > maxMspDist) {
|
|
19387
19393
|
netLabelWidth = Number(
|
|
19388
19394
|
getSchematicNetLabelTextWidth({
|
|
19389
|
-
text: String(
|
|
19395
|
+
text: String(traceLabel),
|
|
19390
19396
|
font_size: 0.14
|
|
19391
19397
|
}).toFixed(2)
|
|
19392
19398
|
);
|
|
@@ -20144,7 +20150,7 @@ var getNetNameFromPorts = (ports) => {
|
|
|
20144
20150
|
for (const port of ports) {
|
|
20145
20151
|
const traces = port._getDirectlyConnectedTraces();
|
|
20146
20152
|
for (const trace of traces) {
|
|
20147
|
-
const displayLabel = trace.
|
|
20153
|
+
const displayLabel = trace._getSchematicNetLabelText();
|
|
20148
20154
|
if (displayLabel) {
|
|
20149
20155
|
return { name: displayLabel, wasAssignedDisplayLabel: true };
|
|
20150
20156
|
}
|
|
@@ -24231,7 +24237,7 @@ import { identity as identity5 } from "transformation-matrix";
|
|
|
24231
24237
|
var package_default = {
|
|
24232
24238
|
name: "@tscircuit/core",
|
|
24233
24239
|
type: "module",
|
|
24234
|
-
version: "0.0.
|
|
24240
|
+
version: "0.0.1357",
|
|
24235
24241
|
types: "dist/index.d.ts",
|
|
24236
24242
|
main: "dist/index.js",
|
|
24237
24243
|
module: "dist/index.js",
|
|
@@ -24294,12 +24300,12 @@ var package_default = {
|
|
|
24294
24300
|
"bun-match-svg": "0.0.12",
|
|
24295
24301
|
"calculate-elbow": "^0.0.12",
|
|
24296
24302
|
"chokidar-cli": "^3.0.0",
|
|
24297
|
-
"circuit-json": "^0.0.
|
|
24303
|
+
"circuit-json": "^0.0.439",
|
|
24298
24304
|
"circuit-json-to-bpc": "^0.0.13",
|
|
24299
24305
|
"circuit-json-to-connectivity-map": "^0.0.23",
|
|
24300
24306
|
"circuit-json-to-gltf": "^0.0.105",
|
|
24301
24307
|
"circuit-json-to-simple-3d": "^0.0.9",
|
|
24302
|
-
"circuit-json-to-spice": "^0.0.
|
|
24308
|
+
"circuit-json-to-spice": "^0.0.40",
|
|
24303
24309
|
"circuit-to-svg": "^0.0.360",
|
|
24304
24310
|
concurrently: "^9.1.2",
|
|
24305
24311
|
"connectivity-map": "^1.0.0",
|
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.1358",
|
|
5
5
|
"types": "dist/index.d.ts",
|
|
6
6
|
"main": "dist/index.js",
|
|
7
7
|
"module": "dist/index.js",
|
|
@@ -64,12 +64,12 @@
|
|
|
64
64
|
"bun-match-svg": "0.0.12",
|
|
65
65
|
"calculate-elbow": "^0.0.12",
|
|
66
66
|
"chokidar-cli": "^3.0.0",
|
|
67
|
-
"circuit-json": "^0.0.
|
|
67
|
+
"circuit-json": "^0.0.439",
|
|
68
68
|
"circuit-json-to-bpc": "^0.0.13",
|
|
69
69
|
"circuit-json-to-connectivity-map": "^0.0.23",
|
|
70
70
|
"circuit-json-to-gltf": "^0.0.105",
|
|
71
71
|
"circuit-json-to-simple-3d": "^0.0.9",
|
|
72
|
-
"circuit-json-to-spice": "^0.0.
|
|
72
|
+
"circuit-json-to-spice": "^0.0.40",
|
|
73
73
|
"circuit-to-svg": "^0.0.360",
|
|
74
74
|
"concurrently": "^9.1.2",
|
|
75
75
|
"connectivity-map": "^1.0.0",
|