@tscircuit/core 0.0.502 → 0.0.503
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 +1 -0
- package/dist/index.js +29 -14
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -4976,6 +4976,7 @@ declare class Jumper<PinLabels extends string = never> extends NormalComponent<t
|
|
|
4976
4976
|
|
|
4977
4977
|
declare class SolderJumper<PinLabels extends string = never> extends NormalComponent<typeof solderjumperProps, PinLabels> {
|
|
4978
4978
|
schematicDimensions: SchematicBoxDimensions | null;
|
|
4979
|
+
_getPinNumberFromBridgedPinName(pinName: string): number | null;
|
|
4979
4980
|
get defaultInternallyConnectedPinNames(): string[][];
|
|
4980
4981
|
get config(): {
|
|
4981
4982
|
schematicSymbolName: string;
|
package/dist/index.js
CHANGED
|
@@ -8690,27 +8690,42 @@ var Jumper = class extends NormalComponent {
|
|
|
8690
8690
|
import { solderjumperProps } from "@tscircuit/props";
|
|
8691
8691
|
var SolderJumper = class extends NormalComponent {
|
|
8692
8692
|
schematicDimensions = null;
|
|
8693
|
+
_getPinNumberFromBridgedPinName(pinName) {
|
|
8694
|
+
const port = this.selectOne(`port.${pinName}`, {
|
|
8695
|
+
type: "port"
|
|
8696
|
+
});
|
|
8697
|
+
return port?._parsedProps.pinNumber ?? null;
|
|
8698
|
+
}
|
|
8693
8699
|
get defaultInternallyConnectedPinNames() {
|
|
8694
8700
|
return this._parsedProps.bridgedPins ?? [];
|
|
8695
8701
|
}
|
|
8696
8702
|
get config() {
|
|
8697
|
-
|
|
8703
|
+
const props = this._parsedProps ?? this.props;
|
|
8704
|
+
let resolvedPinCount = props.pinCount;
|
|
8698
8705
|
if (!resolvedPinCount) {
|
|
8699
|
-
const nums = (
|
|
8700
|
-
|
|
8701
|
-
|
|
8702
|
-
|
|
8703
|
-
|
|
8704
|
-
|
|
8705
|
-
if (maxPin === 2 || maxPin === 3) {
|
|
8706
|
-
resolvedPinCount = maxPin;
|
|
8706
|
+
const nums = (props.bridgedPins ?? []).flat().map((p_str) => this._getPinNumberFromBridgedPinName(p_str)).filter((n) => n !== null);
|
|
8707
|
+
const maxPinFromBridged = nums.length > 0 ? Math.max(...nums) : 0;
|
|
8708
|
+
const pinCountFromLabels = props.pinLabels ? Object.keys(props.pinLabels).length : 0;
|
|
8709
|
+
const finalPinCount = Math.max(maxPinFromBridged, pinCountFromLabels);
|
|
8710
|
+
if (finalPinCount === 2 || finalPinCount === 3) {
|
|
8711
|
+
resolvedPinCount = finalPinCount;
|
|
8707
8712
|
}
|
|
8708
8713
|
}
|
|
8709
8714
|
let symbolName = "";
|
|
8710
|
-
if (resolvedPinCount)
|
|
8711
|
-
|
|
8712
|
-
|
|
8713
|
-
symbolName
|
|
8715
|
+
if (resolvedPinCount) {
|
|
8716
|
+
symbolName += `solderjumper${resolvedPinCount}`;
|
|
8717
|
+
} else {
|
|
8718
|
+
symbolName = "solderjumper";
|
|
8719
|
+
}
|
|
8720
|
+
if (Array.isArray(props.bridgedPins) && props.bridgedPins.length > 0) {
|
|
8721
|
+
const pinNumbers = Array.from(
|
|
8722
|
+
new Set(
|
|
8723
|
+
props.bridgedPins.flat().map((pinName) => this._getPinNumberFromBridgedPinName(pinName)).filter((n) => n !== null)
|
|
8724
|
+
)
|
|
8725
|
+
).sort((a, b) => a - b);
|
|
8726
|
+
if (pinNumbers.length > 0) {
|
|
8727
|
+
symbolName += `_bridged${pinNumbers.join("")}`;
|
|
8728
|
+
}
|
|
8714
8729
|
}
|
|
8715
8730
|
return {
|
|
8716
8731
|
schematicSymbolName: symbolName,
|
|
@@ -10390,7 +10405,7 @@ import { identity as identity4 } from "transformation-matrix";
|
|
|
10390
10405
|
var package_default = {
|
|
10391
10406
|
name: "@tscircuit/core",
|
|
10392
10407
|
type: "module",
|
|
10393
|
-
version: "0.0.
|
|
10408
|
+
version: "0.0.502",
|
|
10394
10409
|
types: "dist/index.d.ts",
|
|
10395
10410
|
main: "dist/index.js",
|
|
10396
10411
|
module: "dist/index.js",
|