@tscircuit/core 0.0.501 → 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 +35 -18
- 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
|
@@ -7560,11 +7560,13 @@ var Group = class extends NormalComponent {
|
|
|
7560
7560
|
name: this._parsedProps.name,
|
|
7561
7561
|
is_subcircuit: this.isSubcircuit
|
|
7562
7562
|
});
|
|
7563
|
-
this.subcircuit_id = `subcircuit_${source_group.source_group_id}`;
|
|
7564
7563
|
this.source_group_id = source_group.source_group_id;
|
|
7565
|
-
|
|
7566
|
-
subcircuit_id
|
|
7567
|
-
|
|
7564
|
+
if (this.isSubcircuit) {
|
|
7565
|
+
this.subcircuit_id = `subcircuit_${source_group.source_group_id}`;
|
|
7566
|
+
db.source_group.update(source_group.source_group_id, {
|
|
7567
|
+
subcircuit_id: this.subcircuit_id
|
|
7568
|
+
});
|
|
7569
|
+
}
|
|
7568
7570
|
}
|
|
7569
7571
|
doInitialSourceRender() {
|
|
7570
7572
|
const { db } = this.root;
|
|
@@ -8688,27 +8690,42 @@ var Jumper = class extends NormalComponent {
|
|
|
8688
8690
|
import { solderjumperProps } from "@tscircuit/props";
|
|
8689
8691
|
var SolderJumper = class extends NormalComponent {
|
|
8690
8692
|
schematicDimensions = null;
|
|
8693
|
+
_getPinNumberFromBridgedPinName(pinName) {
|
|
8694
|
+
const port = this.selectOne(`port.${pinName}`, {
|
|
8695
|
+
type: "port"
|
|
8696
|
+
});
|
|
8697
|
+
return port?._parsedProps.pinNumber ?? null;
|
|
8698
|
+
}
|
|
8691
8699
|
get defaultInternallyConnectedPinNames() {
|
|
8692
8700
|
return this._parsedProps.bridgedPins ?? [];
|
|
8693
8701
|
}
|
|
8694
8702
|
get config() {
|
|
8695
|
-
|
|
8703
|
+
const props = this._parsedProps ?? this.props;
|
|
8704
|
+
let resolvedPinCount = props.pinCount;
|
|
8696
8705
|
if (!resolvedPinCount) {
|
|
8697
|
-
const nums = (
|
|
8698
|
-
|
|
8699
|
-
|
|
8700
|
-
|
|
8701
|
-
|
|
8702
|
-
|
|
8703
|
-
if (maxPin === 2 || maxPin === 3) {
|
|
8704
|
-
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;
|
|
8705
8712
|
}
|
|
8706
8713
|
}
|
|
8707
8714
|
let symbolName = "";
|
|
8708
|
-
if (resolvedPinCount)
|
|
8709
|
-
|
|
8710
|
-
|
|
8711
|
-
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
|
+
}
|
|
8712
8729
|
}
|
|
8713
8730
|
return {
|
|
8714
8731
|
schematicSymbolName: symbolName,
|
|
@@ -10388,7 +10405,7 @@ import { identity as identity4 } from "transformation-matrix";
|
|
|
10388
10405
|
var package_default = {
|
|
10389
10406
|
name: "@tscircuit/core",
|
|
10390
10407
|
type: "module",
|
|
10391
|
-
version: "0.0.
|
|
10408
|
+
version: "0.0.502",
|
|
10392
10409
|
types: "dist/index.d.ts",
|
|
10393
10410
|
main: "dist/index.js",
|
|
10394
10411
|
module: "dist/index.js",
|