@tscircuit/core 0.0.825 → 0.0.827
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 +22 -1
- package/dist/index.js +75 -33
- package/package.json +5 -3
package/dist/index.d.ts
CHANGED
|
@@ -206,6 +206,8 @@ interface DebugLogOutputEvent {
|
|
|
206
206
|
content: any;
|
|
207
207
|
}
|
|
208
208
|
|
|
209
|
+
declare function resolveStaticFileImport(path: string, platform?: PlatformConfig): Promise<string>;
|
|
210
|
+
|
|
209
211
|
declare class RootCircuit {
|
|
210
212
|
firstChild: PrimitiveComponent | null;
|
|
211
213
|
children: PrimitiveComponent[];
|
|
@@ -235,6 +237,7 @@ declare class RootCircuit {
|
|
|
235
237
|
projectUrl?: string;
|
|
236
238
|
});
|
|
237
239
|
add(componentOrElm: PrimitiveComponent | ReactElement): void;
|
|
240
|
+
setPlatform(platform: Partial<PlatformConfig>): void;
|
|
238
241
|
/**
|
|
239
242
|
* Get the main board for this Circuit.
|
|
240
243
|
*/
|
|
@@ -18978,6 +18981,9 @@ declare class FabricationNoteDimension extends PrimitiveComponent<typeof fabrica
|
|
|
18978
18981
|
color: zod.ZodOptional<zod.ZodString>;
|
|
18979
18982
|
arrowSize: zod.ZodOptional<zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>>;
|
|
18980
18983
|
units: zod.ZodOptional<zod.ZodEnum<["in", "mm"]>>;
|
|
18984
|
+
outerEdgeToEdge: zod.ZodOptional<zod.ZodLiteral<true>>;
|
|
18985
|
+
centerToCenter: zod.ZodOptional<zod.ZodLiteral<true>>;
|
|
18986
|
+
innerEdgeToEdge: zod.ZodOptional<zod.ZodLiteral<true>>;
|
|
18981
18987
|
}, "strip", zod.ZodTypeAny, {
|
|
18982
18988
|
from: string | {
|
|
18983
18989
|
x: number;
|
|
@@ -18998,6 +19004,7 @@ declare class FabricationNoteDimension extends PrimitiveComponent<typeof fabrica
|
|
|
18998
19004
|
pcbMarginY?: number | undefined;
|
|
18999
19005
|
pcbRelative?: boolean | undefined;
|
|
19000
19006
|
relative?: boolean | undefined;
|
|
19007
|
+
centerToCenter?: true | undefined;
|
|
19001
19008
|
color?: string | undefined;
|
|
19002
19009
|
text?: string | undefined;
|
|
19003
19010
|
font?: "tscircuit2024" | undefined;
|
|
@@ -19005,6 +19012,8 @@ declare class FabricationNoteDimension extends PrimitiveComponent<typeof fabrica
|
|
|
19005
19012
|
offset?: number | undefined;
|
|
19006
19013
|
arrowSize?: number | undefined;
|
|
19007
19014
|
units?: "in" | "mm" | undefined;
|
|
19015
|
+
outerEdgeToEdge?: true | undefined;
|
|
19016
|
+
innerEdgeToEdge?: true | undefined;
|
|
19008
19017
|
}, {
|
|
19009
19018
|
from: string | {
|
|
19010
19019
|
x: string | number;
|
|
@@ -19027,6 +19036,7 @@ declare class FabricationNoteDimension extends PrimitiveComponent<typeof fabrica
|
|
|
19027
19036
|
pcbMarginY?: string | number | undefined;
|
|
19028
19037
|
pcbRelative?: boolean | undefined;
|
|
19029
19038
|
relative?: boolean | undefined;
|
|
19039
|
+
centerToCenter?: true | undefined;
|
|
19030
19040
|
color?: string | undefined;
|
|
19031
19041
|
text?: string | undefined;
|
|
19032
19042
|
font?: "tscircuit2024" | undefined;
|
|
@@ -19034,6 +19044,8 @@ declare class FabricationNoteDimension extends PrimitiveComponent<typeof fabrica
|
|
|
19034
19044
|
offset?: string | number | undefined;
|
|
19035
19045
|
arrowSize?: string | number | undefined;
|
|
19036
19046
|
units?: "in" | "mm" | undefined;
|
|
19047
|
+
outerEdgeToEdge?: true | undefined;
|
|
19048
|
+
innerEdgeToEdge?: true | undefined;
|
|
19037
19049
|
}>;
|
|
19038
19050
|
};
|
|
19039
19051
|
private _resolvePoint;
|
|
@@ -19493,6 +19505,9 @@ declare class PcbNoteDimension extends PrimitiveComponent<typeof pcbNoteDimensio
|
|
|
19493
19505
|
color: zod.ZodOptional<zod.ZodString>;
|
|
19494
19506
|
arrowSize: zod.ZodOptional<zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>>;
|
|
19495
19507
|
units: zod.ZodOptional<zod.ZodEnum<["in", "mm"]>>;
|
|
19508
|
+
outerEdgeToEdge: zod.ZodOptional<zod.ZodLiteral<true>>;
|
|
19509
|
+
centerToCenter: zod.ZodOptional<zod.ZodLiteral<true>>;
|
|
19510
|
+
innerEdgeToEdge: zod.ZodOptional<zod.ZodLiteral<true>>;
|
|
19496
19511
|
}, "strip", zod.ZodTypeAny, {
|
|
19497
19512
|
from: string | {
|
|
19498
19513
|
x: number;
|
|
@@ -19513,6 +19528,7 @@ declare class PcbNoteDimension extends PrimitiveComponent<typeof pcbNoteDimensio
|
|
|
19513
19528
|
pcbMarginY?: number | undefined;
|
|
19514
19529
|
pcbRelative?: boolean | undefined;
|
|
19515
19530
|
relative?: boolean | undefined;
|
|
19531
|
+
centerToCenter?: true | undefined;
|
|
19516
19532
|
color?: string | undefined;
|
|
19517
19533
|
text?: string | undefined;
|
|
19518
19534
|
font?: "tscircuit2024" | undefined;
|
|
@@ -19520,6 +19536,8 @@ declare class PcbNoteDimension extends PrimitiveComponent<typeof pcbNoteDimensio
|
|
|
19520
19536
|
offset?: number | undefined;
|
|
19521
19537
|
arrowSize?: number | undefined;
|
|
19522
19538
|
units?: "in" | "mm" | undefined;
|
|
19539
|
+
outerEdgeToEdge?: true | undefined;
|
|
19540
|
+
innerEdgeToEdge?: true | undefined;
|
|
19523
19541
|
}, {
|
|
19524
19542
|
from: string | {
|
|
19525
19543
|
x: string | number;
|
|
@@ -19542,6 +19560,7 @@ declare class PcbNoteDimension extends PrimitiveComponent<typeof pcbNoteDimensio
|
|
|
19542
19560
|
pcbMarginY?: string | number | undefined;
|
|
19543
19561
|
pcbRelative?: boolean | undefined;
|
|
19544
19562
|
relative?: boolean | undefined;
|
|
19563
|
+
centerToCenter?: true | undefined;
|
|
19545
19564
|
color?: string | undefined;
|
|
19546
19565
|
text?: string | undefined;
|
|
19547
19566
|
font?: "tscircuit2024" | undefined;
|
|
@@ -19549,6 +19568,8 @@ declare class PcbNoteDimension extends PrimitiveComponent<typeof pcbNoteDimensio
|
|
|
19549
19568
|
offset?: string | number | undefined;
|
|
19550
19569
|
arrowSize?: string | number | undefined;
|
|
19551
19570
|
units?: "in" | "mm" | undefined;
|
|
19571
|
+
outerEdgeToEdge?: true | undefined;
|
|
19572
|
+
innerEdgeToEdge?: true | undefined;
|
|
19552
19573
|
}>;
|
|
19553
19574
|
};
|
|
19554
19575
|
private _resolvePoint;
|
|
@@ -37706,4 +37727,4 @@ declare module "react/jsx-runtime" {
|
|
|
37706
37727
|
}
|
|
37707
37728
|
}
|
|
37708
37729
|
|
|
37709
|
-
export { AnalogSimulation, type AsyncEffect, type AutorouterCompleteEvent, type AutorouterErrorEvent, type AutorouterEvent, type AutorouterProgressEvent, type AutoroutingEndEvent, type AutoroutingErrorEvent, type AutoroutingProgressEvent, type AutoroutingStartEvent, Battery, Board, Breakout, BreakoutPoint, CadAssembly, CadModel, Capacitor, Chip, Circuit, type ComponentWithPins, Constraint, CopperPour, Crystal, Cutout, type DebugLogOutputEvent, Diode, FabricationNoteDimension, FabricationNotePath, FabricationNoteRect, FabricationNoteText, Footprint, Fuse, type GenericConnectionsAndSelectorsSel, type GenericLocalAutorouter, Group, Hole, type IRenderable, Inductor, Jumper, Keepout, Led, type LocalCacheEngine, Mosfet, Net, NetLabel, NormalComponent, type Obstacle, Panel, PcbNoteDimension, PcbNoteLine, PcbNotePath, PcbNoteRect, PcbNoteText, PcbTrace, PinHeader, type PinLabelSpec, Pinout, PlatedHole, Port, Potentiometer, PowerSource, PrimitiveComponent, Project, PushButton, type RenderPhase, type RenderPhaseFn, type RenderPhaseFunctions, type RenderPhaseStates, Renderable, Resistor, Resonator, RootCircuit, type RootCircuitEventName, SchematicArc, SchematicBox, SchematicCell, SchematicCircle, SchematicLine, SchematicRect, SchematicRow, SchematicTable, SchematicText, type Sel, SilkscreenCircle, SilkscreenLine, SilkscreenPath, SilkscreenRect, SilkscreenText, type SimpleRouteConnection, type SimpleRouteJson, type SimplifiedPcbTrace, SmtPad, SolderJumper, Subcircuit, Switch, SymbolComponent as Symbol, TestPoint, Trace, TraceHint, Transistor, Via, VoltageProbe, VoltageSource, applyEditEvents, applyEditEventsToManualEditsFile, applyPcbEditEventsToManualEditsFile, applySchematicEditEventsToManualEditsFile, createUseComponent, getPhaseTimingsFromRenderEvents, getSimpleRouteJsonFromCircuitJson, normalizePinLabels, orderedRenderPhases, sel, useCapacitor, useChip, useDiode, useLed, useRenderedCircuit, useResistor };
|
|
37730
|
+
export { AnalogSimulation, type AsyncEffect, type AutorouterCompleteEvent, type AutorouterErrorEvent, type AutorouterEvent, type AutorouterProgressEvent, type AutoroutingEndEvent, type AutoroutingErrorEvent, type AutoroutingProgressEvent, type AutoroutingStartEvent, Battery, Board, Breakout, BreakoutPoint, CadAssembly, CadModel, Capacitor, Chip, Circuit, type ComponentWithPins, Constraint, CopperPour, Crystal, Cutout, type DebugLogOutputEvent, Diode, FabricationNoteDimension, FabricationNotePath, FabricationNoteRect, FabricationNoteText, Footprint, Fuse, type GenericConnectionsAndSelectorsSel, type GenericLocalAutorouter, Group, Hole, type IRenderable, Inductor, Jumper, Keepout, Led, type LocalCacheEngine, Mosfet, Net, NetLabel, NormalComponent, type Obstacle, Panel, PcbNoteDimension, PcbNoteLine, PcbNotePath, PcbNoteRect, PcbNoteText, PcbTrace, PinHeader, type PinLabelSpec, Pinout, PlatedHole, Port, Potentiometer, PowerSource, PrimitiveComponent, Project, PushButton, type RenderPhase, type RenderPhaseFn, type RenderPhaseFunctions, type RenderPhaseStates, Renderable, Resistor, Resonator, RootCircuit, type RootCircuitEventName, SchematicArc, SchematicBox, SchematicCell, SchematicCircle, SchematicLine, SchematicRect, SchematicRow, SchematicTable, SchematicText, type Sel, SilkscreenCircle, SilkscreenLine, SilkscreenPath, SilkscreenRect, SilkscreenText, type SimpleRouteConnection, type SimpleRouteJson, type SimplifiedPcbTrace, SmtPad, SolderJumper, Subcircuit, Switch, SymbolComponent as Symbol, TestPoint, Trace, TraceHint, Transistor, Via, VoltageProbe, VoltageSource, applyEditEvents, applyEditEventsToManualEditsFile, applyPcbEditEventsToManualEditsFile, applySchematicEditEventsToManualEditsFile, createUseComponent, getPhaseTimingsFromRenderEvents, getSimpleRouteJsonFromCircuitJson, normalizePinLabels, orderedRenderPhases, resolveStaticFileImport, sel, useCapacitor, useChip, useDiode, useLed, useRenderedCircuit, useResistor };
|
package/dist/index.js
CHANGED
|
@@ -94,7 +94,7 @@ import {
|
|
|
94
94
|
schematic_manual_edit_conflict_warning
|
|
95
95
|
} from "circuit-json";
|
|
96
96
|
import { decomposeTSR as decomposeTSR5 } from "transformation-matrix";
|
|
97
|
-
import
|
|
97
|
+
import Debug5 from "debug";
|
|
98
98
|
|
|
99
99
|
// lib/fiber/create-instance-from-react-element.ts
|
|
100
100
|
import "react";
|
|
@@ -7227,6 +7227,28 @@ import {
|
|
|
7227
7227
|
// lib/components/base-components/NormalComponent/utils/isStaticAssetPath.ts
|
|
7228
7228
|
var isStaticAssetPath = (s) => s.startsWith("/");
|
|
7229
7229
|
|
|
7230
|
+
// lib/utils/resolveStaticFileImport.ts
|
|
7231
|
+
import Debug4 from "debug";
|
|
7232
|
+
var resolveStaticFileImportDebug = Debug4(
|
|
7233
|
+
"tscircuit:core:resolveStaticFileImport"
|
|
7234
|
+
);
|
|
7235
|
+
async function resolveStaticFileImport(path, platform) {
|
|
7236
|
+
if (!path) return path;
|
|
7237
|
+
const resolver = platform?.resolveProjectStaticFileImportUrl;
|
|
7238
|
+
if (resolver && path.startsWith("/")) {
|
|
7239
|
+
try {
|
|
7240
|
+
const resolved = await resolver(path);
|
|
7241
|
+
if (resolved) return resolved;
|
|
7242
|
+
} catch (error) {
|
|
7243
|
+
resolveStaticFileImportDebug(
|
|
7244
|
+
"failed to resolve static file via platform resolver",
|
|
7245
|
+
error
|
|
7246
|
+
);
|
|
7247
|
+
}
|
|
7248
|
+
}
|
|
7249
|
+
return constructAssetUrl(path, platform?.projectBaseUrl);
|
|
7250
|
+
}
|
|
7251
|
+
|
|
7230
7252
|
// lib/components/base-components/NormalComponent/NormalComponent_doInitialPcbFootprintStringRender.ts
|
|
7231
7253
|
function NormalComponent_doInitialPcbFootprintStringRender(component, queueAsyncEffect) {
|
|
7232
7254
|
let { footprint } = component.props;
|
|
@@ -7238,9 +7260,8 @@ function NormalComponent_doInitialPcbFootprintStringRender(component, queueAsync
|
|
|
7238
7260
|
if (typeof footprint === "string" && (isHttpUrl(footprint) || isStaticAssetPath(footprint)) && footprintParser) {
|
|
7239
7261
|
if (component._hasStartedFootprintUrlLoad) return;
|
|
7240
7262
|
component._hasStartedFootprintUrlLoad = true;
|
|
7241
|
-
const projectBaseUrl = component.root?.platform?.projectBaseUrl;
|
|
7242
|
-
const footprintUrl = isHttpUrl(footprint) ? footprint : constructAssetUrl(footprint, projectBaseUrl);
|
|
7243
7263
|
queueAsyncEffect("load-footprint-from-platform-file-parser", async () => {
|
|
7264
|
+
const footprintUrl = isHttpUrl(footprint) ? footprint : await resolveStaticFileImport(footprint, component.root?.platform);
|
|
7244
7265
|
try {
|
|
7245
7266
|
const result = await footprintParser.loadFromUrl(footprintUrl);
|
|
7246
7267
|
const fpComponents = createComponentsFromCircuitJson(
|
|
@@ -7503,7 +7524,7 @@ function NormalComponent_doInitialPcbComponentAnchorAlignment(component) {
|
|
|
7503
7524
|
|
|
7504
7525
|
// lib/components/base-components/NormalComponent/NormalComponent.ts
|
|
7505
7526
|
import { normalizeDegrees } from "@tscircuit/math-utils";
|
|
7506
|
-
var debug3 =
|
|
7527
|
+
var debug3 = Debug5("tscircuit:core");
|
|
7507
7528
|
var rotation32 = z9.object({
|
|
7508
7529
|
x: rotation2,
|
|
7509
7530
|
y: rotation2,
|
|
@@ -8810,7 +8831,7 @@ var CapacityMeshAutorouter = class {
|
|
|
8810
8831
|
import {
|
|
8811
8832
|
distance as distance5
|
|
8812
8833
|
} from "circuit-json";
|
|
8813
|
-
import
|
|
8834
|
+
import Debug13 from "debug";
|
|
8814
8835
|
import "zod";
|
|
8815
8836
|
|
|
8816
8837
|
// lib/components/primitive-components/TraceHint.ts
|
|
@@ -9459,7 +9480,7 @@ import { getBoundsFromPoints as getBoundsFromPoints3 } from "@tscircuit/math-uti
|
|
|
9459
9480
|
// lib/components/primitive-components/Group/Group_doInitialSchematicLayoutMatchAdapt.ts
|
|
9460
9481
|
import { convertCircuitJsonToBpc } from "circuit-json-to-bpc";
|
|
9461
9482
|
import { getGraphicsForBpcGraph, layoutSchematicGraphVariants } from "bpc-graph";
|
|
9462
|
-
import
|
|
9483
|
+
import Debug6 from "debug";
|
|
9463
9484
|
import { buildSubtree } from "@tscircuit/circuit-json-util";
|
|
9464
9485
|
|
|
9465
9486
|
// lib/components/primitive-components/Group/utils/updateSchematicPrimitivesForLayoutShift.ts
|
|
@@ -9502,7 +9523,7 @@ function updateSchematicPrimitivesForLayoutShift({
|
|
|
9502
9523
|
}
|
|
9503
9524
|
|
|
9504
9525
|
// lib/components/primitive-components/Group/Group_doInitialSchematicLayoutMatchAdapt.ts
|
|
9505
|
-
var debug4 =
|
|
9526
|
+
var debug4 = Debug6("Group_doInitialSchematicLayoutMatchAdapt");
|
|
9506
9527
|
function Group_doInitialSchematicLayoutMatchAdapt(group) {
|
|
9507
9528
|
const { db } = group.root;
|
|
9508
9529
|
const subtreeCircuitJson = buildSubtree(db.toArray(), {
|
|
@@ -9628,8 +9649,8 @@ import {
|
|
|
9628
9649
|
getCircuitJsonTree
|
|
9629
9650
|
} from "@tscircuit/circuit-json-util";
|
|
9630
9651
|
import { LayoutPipelineSolver } from "@tscircuit/matchpack";
|
|
9631
|
-
import
|
|
9632
|
-
var debug5 =
|
|
9652
|
+
import Debug7 from "debug";
|
|
9653
|
+
var debug5 = Debug7("Group_doInitialSchematicLayoutMatchpack");
|
|
9633
9654
|
function facingDirectionToSide(facingDirection) {
|
|
9634
9655
|
switch (facingDirection) {
|
|
9635
9656
|
case "up":
|
|
@@ -10906,7 +10927,7 @@ import {
|
|
|
10906
10927
|
import {
|
|
10907
10928
|
length as length4
|
|
10908
10929
|
} from "circuit-json";
|
|
10909
|
-
import
|
|
10930
|
+
import Debug8 from "debug";
|
|
10910
10931
|
|
|
10911
10932
|
// lib/components/primitive-components/Group/Group_doInitialPcbLayoutPack/applyComponentConstraintClusters.ts
|
|
10912
10933
|
import * as kiwi2 from "@lume/kiwi";
|
|
@@ -11343,7 +11364,7 @@ function getObstacleDimensionsFromPlatedHole(hole) {
|
|
|
11343
11364
|
|
|
11344
11365
|
// lib/components/primitive-components/Group/Group_doInitialPcbLayoutPack/Group_doInitialPcbLayoutPack.ts
|
|
11345
11366
|
var DEFAULT_MIN_GAP = "1mm";
|
|
11346
|
-
var debug6 =
|
|
11367
|
+
var debug6 = Debug8("Group_doInitialPcbLayoutPack");
|
|
11347
11368
|
var Group_doInitialPcbLayoutPack = (group) => {
|
|
11348
11369
|
const { db } = group.root;
|
|
11349
11370
|
const { _parsedProps: props } = group;
|
|
@@ -11635,7 +11656,7 @@ import { convertSrjToGraphicsObject } from "@tscircuit/capacity-autorouter";
|
|
|
11635
11656
|
|
|
11636
11657
|
// lib/components/primitive-components/Group/Group_doInitialSchematicTraceRender/Group_doInitialSchematicTraceRender.ts
|
|
11637
11658
|
import { SchematicTracePipelineSolver as SchematicTracePipelineSolver4 } from "@tscircuit/schematic-trace-solver";
|
|
11638
|
-
import
|
|
11659
|
+
import Debug11 from "debug";
|
|
11639
11660
|
|
|
11640
11661
|
// lib/components/primitive-components/Group/Group_doInitialSchematicTraceRender/createSchematicTraceSolverInputProblem.ts
|
|
11641
11662
|
import "@tscircuit/schematic-trace-solver";
|
|
@@ -12154,8 +12175,8 @@ function computeJunctions(traces, opts = {}) {
|
|
|
12154
12175
|
}
|
|
12155
12176
|
|
|
12156
12177
|
// lib/components/primitive-components/Group/Group_doInitialSchematicTraceRender/applyTracesFromSolverOutput.ts
|
|
12157
|
-
import
|
|
12158
|
-
var debug7 =
|
|
12178
|
+
import Debug9 from "debug";
|
|
12179
|
+
var debug7 = Debug9("Group_doInitialSchematicTraceRender");
|
|
12159
12180
|
function applyTracesFromSolverOutput(args) {
|
|
12160
12181
|
const { group, solver, pinIdToSchematicPortId, userNetIdToSck } = args;
|
|
12161
12182
|
const { db } = group.root;
|
|
@@ -12267,8 +12288,8 @@ var getNetNameFromPorts = (ports) => {
|
|
|
12267
12288
|
};
|
|
12268
12289
|
|
|
12269
12290
|
// lib/components/primitive-components/Group/Group_doInitialSchematicTraceRender/applyNetLabelPlacements.ts
|
|
12270
|
-
import
|
|
12271
|
-
var debug8 =
|
|
12291
|
+
import Debug10 from "debug";
|
|
12292
|
+
var debug8 = Debug10("Group_doInitialSchematicTraceRender");
|
|
12272
12293
|
function applyNetLabelPlacements(args) {
|
|
12273
12294
|
const {
|
|
12274
12295
|
group,
|
|
@@ -12433,7 +12454,7 @@ var getSchematicPortIdsWithRoutedTraces = ({
|
|
|
12433
12454
|
};
|
|
12434
12455
|
|
|
12435
12456
|
// lib/components/primitive-components/Group/Group_doInitialSchematicTraceRender/Group_doInitialSchematicTraceRender.ts
|
|
12436
|
-
var debug9 =
|
|
12457
|
+
var debug9 = Debug11("Group_doInitialSchematicTraceRender");
|
|
12437
12458
|
var Group_doInitialSchematicTraceRender = (group) => {
|
|
12438
12459
|
if (!group.root?._featureMspSchematicTraceRouting) return;
|
|
12439
12460
|
if (!group.isSubcircuit) return;
|
|
@@ -12493,7 +12514,7 @@ var Group_doInitialSchematicTraceRender = (group) => {
|
|
|
12493
12514
|
|
|
12494
12515
|
// lib/components/primitive-components/Group/Group_doInitialSimulationSpiceEngineRender.ts
|
|
12495
12516
|
import { circuitJsonToSpice } from "circuit-json-to-spice";
|
|
12496
|
-
import
|
|
12517
|
+
import Debug12 from "debug";
|
|
12497
12518
|
|
|
12498
12519
|
// lib/spice/get-spicey-engine.ts
|
|
12499
12520
|
import { simulate, spiceyTranToVGraphs } from "spicey";
|
|
@@ -12515,7 +12536,7 @@ var getSpiceyEngine = () => {
|
|
|
12515
12536
|
};
|
|
12516
12537
|
|
|
12517
12538
|
// lib/components/primitive-components/Group/Group_doInitialSimulationSpiceEngineRender.ts
|
|
12518
|
-
var debug10 =
|
|
12539
|
+
var debug10 = Debug12("tscircuit:core:Group_doInitialSimulationSpiceEngineRender");
|
|
12519
12540
|
function Group_doInitialSimulationSpiceEngineRender(group) {
|
|
12520
12541
|
if (!group.isSubcircuit) return;
|
|
12521
12542
|
const { root } = group;
|
|
@@ -12537,9 +12558,21 @@ ${spiceString}`);
|
|
|
12537
12558
|
debug10(`Failed to convert circuit JSON to SPICE: ${error}`);
|
|
12538
12559
|
return;
|
|
12539
12560
|
}
|
|
12540
|
-
for (const
|
|
12541
|
-
|
|
12542
|
-
|
|
12561
|
+
for (const analogSim of analogSims) {
|
|
12562
|
+
const engineName = analogSim._parsedProps.spiceEngine ?? "spicey";
|
|
12563
|
+
const spiceEngine = spiceEngineMap[engineName];
|
|
12564
|
+
if (!spiceEngine) {
|
|
12565
|
+
throw new Error(
|
|
12566
|
+
`SPICE engine "${engineName}" not found in platform config. Available engines: ${JSON.stringify(
|
|
12567
|
+
Object.keys(spiceEngineMap).filter((k) => k !== "spicey")
|
|
12568
|
+
)}`
|
|
12569
|
+
);
|
|
12570
|
+
}
|
|
12571
|
+
const effectId = `spice-simulation-${engineName}-${analogSim.source_component_id}`;
|
|
12572
|
+
debug10(
|
|
12573
|
+
`Queueing simulation for spice engine: ${engineName} (id: ${effectId})`
|
|
12574
|
+
);
|
|
12575
|
+
group._queueAsyncEffect(effectId, async () => {
|
|
12543
12576
|
try {
|
|
12544
12577
|
debug10(`Running simulation with engine: ${engineName}`);
|
|
12545
12578
|
const result = await spiceEngine.simulate(spiceString);
|
|
@@ -12860,14 +12893,14 @@ var Group6 = class extends NormalComponent3 {
|
|
|
12860
12893
|
return false;
|
|
12861
12894
|
}
|
|
12862
12895
|
_hasTracesToRoute() {
|
|
12863
|
-
const debug11 =
|
|
12896
|
+
const debug11 = Debug13("tscircuit:core:_hasTracesToRoute");
|
|
12864
12897
|
const traces = this.selectAll("trace");
|
|
12865
12898
|
debug11(`[${this.getString()}] has ${traces.length} traces to route`);
|
|
12866
12899
|
return traces.length > 0;
|
|
12867
12900
|
}
|
|
12868
12901
|
async _runEffectMakeHttpAutoroutingRequest() {
|
|
12869
12902
|
const { db } = this.root;
|
|
12870
|
-
const debug11 =
|
|
12903
|
+
const debug11 = Debug13("tscircuit:core:_runEffectMakeHttpAutoroutingRequest");
|
|
12871
12904
|
const props = this._parsedProps;
|
|
12872
12905
|
const autorouterConfig = this._getAutorouterConfig();
|
|
12873
12906
|
const serverUrl = autorouterConfig.serverUrl;
|
|
@@ -12989,7 +13022,7 @@ var Group6 = class extends NormalComponent3 {
|
|
|
12989
13022
|
async _runLocalAutorouting() {
|
|
12990
13023
|
const { db } = this.root;
|
|
12991
13024
|
const props = this._parsedProps;
|
|
12992
|
-
const debug11 =
|
|
13025
|
+
const debug11 = Debug13("tscircuit:core:_runLocalAutorouting");
|
|
12993
13026
|
debug11(`[${this.getString()}] starting local autorouting`);
|
|
12994
13027
|
const autorouterConfig = this._getAutorouterConfig();
|
|
12995
13028
|
const { simpleRouteJson } = getSimpleRouteJsonFromCircuitJson({
|
|
@@ -13090,7 +13123,7 @@ var Group6 = class extends NormalComponent3 {
|
|
|
13090
13123
|
}
|
|
13091
13124
|
}
|
|
13092
13125
|
doInitialPcbTraceRender() {
|
|
13093
|
-
const debug11 =
|
|
13126
|
+
const debug11 = Debug13("tscircuit:core:doInitialPcbTraceRender");
|
|
13094
13127
|
if (!this.isSubcircuit) return;
|
|
13095
13128
|
if (this.root?.pcbDisabled) return;
|
|
13096
13129
|
if (this.getInheritedProperty("routingDisabled")) return;
|
|
@@ -13111,7 +13144,7 @@ var Group6 = class extends NormalComponent3 {
|
|
|
13111
13144
|
Group_doInitialSchematicTraceRender(this);
|
|
13112
13145
|
}
|
|
13113
13146
|
updatePcbTraceRender() {
|
|
13114
|
-
const debug11 =
|
|
13147
|
+
const debug11 = Debug13("tscircuit:core:updatePcbTraceRender");
|
|
13115
13148
|
debug11(`[${this.getString()}] updating...`);
|
|
13116
13149
|
if (!this.isSubcircuit) return;
|
|
13117
13150
|
if (this._shouldRouteAsync() && this._hasTracesToRoute() && !this._hasStartedAsyncAutorouting) {
|
|
@@ -17289,7 +17322,7 @@ import { identity as identity6 } from "transformation-matrix";
|
|
|
17289
17322
|
var package_default = {
|
|
17290
17323
|
name: "@tscircuit/core",
|
|
17291
17324
|
type: "module",
|
|
17292
|
-
version: "0.0.
|
|
17325
|
+
version: "0.0.826",
|
|
17293
17326
|
types: "dist/index.d.ts",
|
|
17294
17327
|
main: "dist/index.js",
|
|
17295
17328
|
module: "dist/index.js",
|
|
@@ -17330,7 +17363,8 @@ var package_default = {
|
|
|
17330
17363
|
"@tscircuit/matchpack": "^0.0.16",
|
|
17331
17364
|
"@tscircuit/math-utils": "^0.0.29",
|
|
17332
17365
|
"@tscircuit/miniflex": "^0.0.4",
|
|
17333
|
-
"@tscircuit/
|
|
17366
|
+
"@tscircuit/ngspice-spice-engine": "^0.0.2",
|
|
17367
|
+
"@tscircuit/props": "0.0.381",
|
|
17334
17368
|
"@tscircuit/schematic-autolayout": "^0.0.6",
|
|
17335
17369
|
"@tscircuit/schematic-match-adapt": "^0.0.16",
|
|
17336
17370
|
"@tscircuit/schematic-trace-solver": "^0.0.41",
|
|
@@ -17348,11 +17382,12 @@ var package_default = {
|
|
|
17348
17382
|
"circuit-json-to-connectivity-map": "^0.0.22",
|
|
17349
17383
|
"circuit-json-to-gltf": "^0.0.31",
|
|
17350
17384
|
"circuit-json-to-simple-3d": "^0.0.9",
|
|
17351
|
-
"circuit-json-to-spice": "^0.0.
|
|
17385
|
+
"circuit-json-to-spice": "^0.0.16",
|
|
17352
17386
|
"circuit-to-svg": "^0.0.253",
|
|
17353
17387
|
concurrently: "^9.1.2",
|
|
17354
17388
|
"connectivity-map": "^1.0.0",
|
|
17355
17389
|
debug: "^4.3.6",
|
|
17390
|
+
"eecircuit-engine": "^1.5.6",
|
|
17356
17391
|
flatbush: "^4.5.0",
|
|
17357
17392
|
"graphics-debug": "^0.0.60",
|
|
17358
17393
|
howfat: "^0.3.8",
|
|
@@ -17401,7 +17436,7 @@ var package_default = {
|
|
|
17401
17436
|
};
|
|
17402
17437
|
|
|
17403
17438
|
// lib/RootCircuit.ts
|
|
17404
|
-
import
|
|
17439
|
+
import Debug14 from "debug";
|
|
17405
17440
|
var RootCircuit = class {
|
|
17406
17441
|
firstChild = null;
|
|
17407
17442
|
children;
|
|
@@ -17446,6 +17481,12 @@ var RootCircuit = class {
|
|
|
17446
17481
|
}
|
|
17447
17482
|
this.children.push(component);
|
|
17448
17483
|
}
|
|
17484
|
+
setPlatform(platform) {
|
|
17485
|
+
this.platform = {
|
|
17486
|
+
...this.platform,
|
|
17487
|
+
...platform
|
|
17488
|
+
};
|
|
17489
|
+
}
|
|
17449
17490
|
/**
|
|
17450
17491
|
* Get the main board for this Circuit.
|
|
17451
17492
|
*/
|
|
@@ -17587,9 +17628,9 @@ var RootCircuit = class {
|
|
|
17587
17628
|
}
|
|
17588
17629
|
enableDebug(debug11) {
|
|
17589
17630
|
if (typeof debug11 === "string") {
|
|
17590
|
-
|
|
17631
|
+
Debug14.enable(debug11);
|
|
17591
17632
|
} else if (debug11 === null || debug11 === false) {
|
|
17592
|
-
|
|
17633
|
+
Debug14.disable();
|
|
17593
17634
|
}
|
|
17594
17635
|
}
|
|
17595
17636
|
getClientOrigin() {
|
|
@@ -17899,6 +17940,7 @@ export {
|
|
|
17899
17940
|
getSimpleRouteJsonFromCircuitJson,
|
|
17900
17941
|
normalizePinLabels,
|
|
17901
17942
|
orderedRenderPhases,
|
|
17943
|
+
resolveStaticFileImport,
|
|
17902
17944
|
sel,
|
|
17903
17945
|
useCapacitor,
|
|
17904
17946
|
useChip,
|
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.827",
|
|
5
5
|
"types": "dist/index.d.ts",
|
|
6
6
|
"main": "dist/index.js",
|
|
7
7
|
"module": "dist/index.js",
|
|
@@ -42,7 +42,8 @@
|
|
|
42
42
|
"@tscircuit/matchpack": "^0.0.16",
|
|
43
43
|
"@tscircuit/math-utils": "^0.0.29",
|
|
44
44
|
"@tscircuit/miniflex": "^0.0.4",
|
|
45
|
-
"@tscircuit/
|
|
45
|
+
"@tscircuit/ngspice-spice-engine": "^0.0.2",
|
|
46
|
+
"@tscircuit/props": "0.0.381",
|
|
46
47
|
"@tscircuit/schematic-autolayout": "^0.0.6",
|
|
47
48
|
"@tscircuit/schematic-match-adapt": "^0.0.16",
|
|
48
49
|
"@tscircuit/schematic-trace-solver": "^0.0.41",
|
|
@@ -60,11 +61,12 @@
|
|
|
60
61
|
"circuit-json-to-connectivity-map": "^0.0.22",
|
|
61
62
|
"circuit-json-to-gltf": "^0.0.31",
|
|
62
63
|
"circuit-json-to-simple-3d": "^0.0.9",
|
|
63
|
-
"circuit-json-to-spice": "^0.0.
|
|
64
|
+
"circuit-json-to-spice": "^0.0.16",
|
|
64
65
|
"circuit-to-svg": "^0.0.253",
|
|
65
66
|
"concurrently": "^9.1.2",
|
|
66
67
|
"connectivity-map": "^1.0.0",
|
|
67
68
|
"debug": "^4.3.6",
|
|
69
|
+
"eecircuit-engine": "^1.5.6",
|
|
68
70
|
"flatbush": "^4.5.0",
|
|
69
71
|
"graphics-debug": "^0.0.60",
|
|
70
72
|
"howfat": "^0.3.8",
|