@tscircuit/core 0.0.486 → 0.0.488
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 +6 -5
- package/dist/index.js +25 -12
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as _tscircuit_props from '@tscircuit/props';
|
|
2
|
-
import { PlatformConfig, subcircuitGroupProps, AutorouterConfig, traceProps, SupplierPartNumbers, SchematicPortArrangement, groupProps, boardProps, capacitorProps, chipProps, diodeProps, fuseProps, jumperProps, solderjumperProps, ledProps, powerSourceProps, resistorProps, constraintProps, fabricationNotePathProps, fabricationNoteTextProps, footprintProps, subcircuitProps, breakoutProps, breakoutPointProps, holeProps, pcbKeepoutProps,
|
|
2
|
+
import { PlatformConfig, subcircuitGroupProps, AutorouterConfig, traceProps, SupplierPartNumbers, SchematicPortArrangement, groupProps, boardProps, capacitorProps, chipProps, diodeProps, fuseProps, jumperProps, solderjumperProps, ledProps, powerSourceProps, resistorProps, constraintProps, fabricationNotePathProps, fabricationNoteTextProps, footprintProps, subcircuitProps, breakoutProps, breakoutPointProps, holeProps, pcbKeepoutProps, netLabelProps, platedHoleProps, silkscreenCircleProps, silkscreenPathProps, silkscreenRectProps, silkscreenTextProps, silkscreenLineProps, smtPadProps, traceHintProps, viaProps, cutoutProps, batteryProps, pinHeaderProps, resonatorProps, inductorProps, potentiometerProps, pushButtonProps, crystalProps, transistorProps, mosfetProps, switchProps, testpointProps, schematicTextProps, schematicBoxProps, CapacitorProps, ChipProps, DiodeProps, ResistorProps, ManualEditEvent, ManualEditsFile, ChipConnections, manual_edits_file } from '@tscircuit/props';
|
|
3
3
|
import React, { ReactElement, DetailedHTMLProps, SVGProps } from 'react';
|
|
4
4
|
export { createElement } from 'react';
|
|
5
5
|
import * as zod from 'zod';
|
|
@@ -760,6 +760,7 @@ declare class Trace extends PrimitiveComponent<typeof traceProps> implements Tra
|
|
|
760
760
|
ports?: undefined;
|
|
761
761
|
portsWithSelectors?: undefined;
|
|
762
762
|
};
|
|
763
|
+
_resolveNet(selector: string): Net | null;
|
|
763
764
|
_findConnectedNets(): {
|
|
764
765
|
nets: Net[];
|
|
765
766
|
netsWithSelectors: Array<{
|
|
@@ -7240,8 +7241,8 @@ declare class Keepout extends PrimitiveComponent<typeof pcbKeepoutProps> {
|
|
|
7240
7241
|
doInitialPcbPrimitiveRender(): void;
|
|
7241
7242
|
}
|
|
7242
7243
|
|
|
7243
|
-
declare class
|
|
7244
|
-
|
|
7244
|
+
declare class NetLabel extends PrimitiveComponent<typeof netLabelProps> {
|
|
7245
|
+
source_net_label_id?: string;
|
|
7245
7246
|
get config(): {
|
|
7246
7247
|
componentName: string;
|
|
7247
7248
|
zodProps: zod.ZodObject<{
|
|
@@ -14689,7 +14690,7 @@ interface TscircuitElements {
|
|
|
14689
14690
|
hole: _tscircuit_props.HoleProps;
|
|
14690
14691
|
port: _tscircuit_props.PortProps;
|
|
14691
14692
|
group: _tscircuit_props.GroupProps;
|
|
14692
|
-
|
|
14693
|
+
netlabel: _tscircuit_props.NetLabelProps;
|
|
14693
14694
|
net: _tscircuit_props.NetProps;
|
|
14694
14695
|
trace: _tscircuit_props.TraceProps;
|
|
14695
14696
|
breakout: _tscircuit_props.BreakoutProps;
|
|
@@ -14734,4 +14735,4 @@ declare module "react/jsx-runtime" {
|
|
|
14734
14735
|
}
|
|
14735
14736
|
}
|
|
14736
14737
|
|
|
14737
|
-
export { type AsyncEffect, type AutorouterCompleteEvent, type AutorouterErrorEvent, type AutorouterEvent, type AutorouterProgressEvent, type AutoroutingEndEvent, type AutoroutingErrorEvent, type AutoroutingProgressEvent, type AutoroutingStartEvent, Battery, Board, Breakout, BreakoutPoint, Capacitor, Chip, Circuit, type ComponentWithPins, Constraint, Crystal, Cutout, Diode, FabricationNotePath, FabricationNoteText, Footprint, Fuse, type GenericConnectionsAndSelectorsSel, type GenericLocalAutorouter, Group, Hole, type IRenderable, Inductor, Jumper, Keepout, Led, type LocalCacheEngine, Mosfet, Net,
|
|
14738
|
+
export { type AsyncEffect, type AutorouterCompleteEvent, type AutorouterErrorEvent, type AutorouterEvent, type AutorouterProgressEvent, type AutoroutingEndEvent, type AutoroutingErrorEvent, type AutoroutingProgressEvent, type AutoroutingStartEvent, Battery, Board, Breakout, BreakoutPoint, Capacitor, Chip, Circuit, type ComponentWithPins, Constraint, Crystal, Cutout, Diode, FabricationNotePath, FabricationNoteText, Footprint, Fuse, type GenericConnectionsAndSelectorsSel, type GenericLocalAutorouter, Group, Hole, type IRenderable, Inductor, Jumper, Keepout, Led, type LocalCacheEngine, Mosfet, Net, NetLabel, NormalComponent, type Obstacle, PcbTrace, PinHeader, type PinLabelSpec, PlatedHole, Port, Potentiometer, PowerSource, PrimitiveComponent, Project, PushButton, type RenderPhase, type RenderPhaseFn, type RenderPhaseFunctions, type RenderPhaseStates, Renderable, Resistor, Resonator, RootCircuit, type RootCircuitEventName, SchematicBox, SchematicText, type Sel, SilkscreenCircle, SilkscreenLine, SilkscreenPath, SilkscreenRect, SilkscreenText, type SimpleRouteConnection, type SimpleRouteJson, type SimplifiedPcbTrace, SmtPad, SolderJumper, Subcircuit, Switch, TestPoint, Trace, TraceHint, Transistor, Via, applyEditEvents, applyEditEventsToManualEditsFile, applyPcbEditEventsToManualEditsFile, applySchematicEditEventsToManualEditsFile, createUseComponent, getPhaseTimingsFromRenderEvents, getSimpleRouteJsonFromCircuitJson, normalizePinLabels, orderedRenderPhases, sel, useCapacitor, useChip, useDiode, useLed, useRenderedCircuit, useResistor };
|
package/dist/index.js
CHANGED
|
@@ -29,7 +29,7 @@ __export(components_exports, {
|
|
|
29
29
|
Led: () => Led,
|
|
30
30
|
Mosfet: () => Mosfet,
|
|
31
31
|
Net: () => Net,
|
|
32
|
-
|
|
32
|
+
NetLabel: () => NetLabel,
|
|
33
33
|
NormalComponent: () => NormalComponent,
|
|
34
34
|
PcbTrace: () => PcbTrace,
|
|
35
35
|
PinHeader: () => PinHeader,
|
|
@@ -4668,11 +4668,24 @@ searched component ${targetComponent.getString()}, which has ports: ${targetComp
|
|
|
4668
4668
|
ports: portsWithSelectors.map(({ port }) => port)
|
|
4669
4669
|
};
|
|
4670
4670
|
}
|
|
4671
|
+
_resolveNet(selector) {
|
|
4672
|
+
const direct = this.getSubcircuit().selectOne(selector, {
|
|
4673
|
+
type: "net"
|
|
4674
|
+
});
|
|
4675
|
+
if (direct) return direct;
|
|
4676
|
+
const match = selector.match(/^net\.(.+)$/);
|
|
4677
|
+
const netName = match ? match[1] : null;
|
|
4678
|
+
if (!netName) return null;
|
|
4679
|
+
const allDescendants = this.root._getBoard().getDescendants();
|
|
4680
|
+
return allDescendants.find(
|
|
4681
|
+
(d) => d.componentName === "Net" && d._parsedProps.name === netName
|
|
4682
|
+
) || null;
|
|
4683
|
+
}
|
|
4671
4684
|
_findConnectedNets() {
|
|
4672
4685
|
const netsWithSelectors = this.getTracePathNetSelectors().map(
|
|
4673
4686
|
(selector) => ({
|
|
4674
4687
|
selector,
|
|
4675
|
-
net: this.
|
|
4688
|
+
net: this._resolveNet(selector)
|
|
4676
4689
|
})
|
|
4677
4690
|
);
|
|
4678
4691
|
const undefinedNets = netsWithSelectors.filter((n) => !n.net);
|
|
@@ -9103,14 +9116,14 @@ var BreakoutPoint = class extends PrimitiveComponent2 {
|
|
|
9103
9116
|
}
|
|
9104
9117
|
};
|
|
9105
9118
|
|
|
9106
|
-
// lib/components/primitive-components/
|
|
9107
|
-
import {
|
|
9108
|
-
var
|
|
9109
|
-
|
|
9119
|
+
// lib/components/primitive-components/NetLabel.ts
|
|
9120
|
+
import { netLabelProps } from "@tscircuit/props";
|
|
9121
|
+
var NetLabel = class extends PrimitiveComponent2 {
|
|
9122
|
+
source_net_label_id;
|
|
9110
9123
|
get config() {
|
|
9111
9124
|
return {
|
|
9112
|
-
componentName: "
|
|
9113
|
-
zodProps:
|
|
9125
|
+
componentName: "NetLabel",
|
|
9126
|
+
zodProps: netLabelProps
|
|
9114
9127
|
};
|
|
9115
9128
|
}
|
|
9116
9129
|
doInitialSchematicComponentRender() {
|
|
@@ -9118,7 +9131,7 @@ var NetAlias = class extends PrimitiveComponent2 {
|
|
|
9118
9131
|
const { db } = this.root;
|
|
9119
9132
|
const { _parsedProps: props } = this;
|
|
9120
9133
|
const anchorPos = { x: props.schX ?? 0, y: props.schY ?? 0 };
|
|
9121
|
-
const
|
|
9134
|
+
const netLabel = db.schematic_net_label.insert({
|
|
9122
9135
|
text: props.net,
|
|
9123
9136
|
source_net_id: props.net,
|
|
9124
9137
|
anchor_position: anchorPos,
|
|
@@ -9126,7 +9139,7 @@ var NetAlias = class extends PrimitiveComponent2 {
|
|
|
9126
9139
|
center: anchorPos,
|
|
9127
9140
|
anchor_side: "bottom"
|
|
9128
9141
|
});
|
|
9129
|
-
this.
|
|
9142
|
+
this.source_net_label_id = netLabel.source_net_id;
|
|
9130
9143
|
}
|
|
9131
9144
|
};
|
|
9132
9145
|
|
|
@@ -10228,7 +10241,7 @@ import { identity as identity4 } from "transformation-matrix";
|
|
|
10228
10241
|
var package_default = {
|
|
10229
10242
|
name: "@tscircuit/core",
|
|
10230
10243
|
type: "module",
|
|
10231
|
-
version: "0.0.
|
|
10244
|
+
version: "0.0.487",
|
|
10232
10245
|
types: "dist/index.d.ts",
|
|
10233
10246
|
main: "dist/index.js",
|
|
10234
10247
|
module: "dist/index.js",
|
|
@@ -10720,7 +10733,7 @@ export {
|
|
|
10720
10733
|
Led,
|
|
10721
10734
|
Mosfet,
|
|
10722
10735
|
Net,
|
|
10723
|
-
|
|
10736
|
+
NetLabel,
|
|
10724
10737
|
NormalComponent,
|
|
10725
10738
|
PcbTrace,
|
|
10726
10739
|
PinHeader,
|