@tscircuit/core 0.0.514 → 0.0.516
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 +2 -2
- package/dist/index.js +23 -4
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -491,7 +491,7 @@ declare abstract class PrimitiveComponent<ZodProps extends ZodType = any> extend
|
|
|
491
491
|
}
|
|
492
492
|
|
|
493
493
|
declare const netProps: z.ZodObject<{
|
|
494
|
-
name: z.ZodString
|
|
494
|
+
name: z.ZodEffects<z.ZodString, string, string>;
|
|
495
495
|
}, "strip", z.ZodTypeAny, {
|
|
496
496
|
name: string;
|
|
497
497
|
}, {
|
|
@@ -502,7 +502,7 @@ declare class Net extends PrimitiveComponent<typeof netProps> {
|
|
|
502
502
|
get config(): {
|
|
503
503
|
componentName: string;
|
|
504
504
|
zodProps: z.ZodObject<{
|
|
505
|
-
name: z.ZodString
|
|
505
|
+
name: z.ZodEffects<z.ZodString, string, string>;
|
|
506
506
|
}, "strip", z.ZodTypeAny, {
|
|
507
507
|
name: string;
|
|
508
508
|
}, {
|
package/dist/index.js
CHANGED
|
@@ -489,6 +489,11 @@ var preprocessSelector = (selector) => {
|
|
|
489
489
|
'Net names cannot contain a period, try using "sel.net..." to autocomplete with conventional net names, e.g. V3_3'
|
|
490
490
|
);
|
|
491
491
|
}
|
|
492
|
+
if (/net\.[^\s>]*[+-]/.test(selector)) {
|
|
493
|
+
throw new Error(
|
|
494
|
+
'Net names cannot contain "+" or "-", try using underscores instead, e.g. VCC_P'
|
|
495
|
+
);
|
|
496
|
+
}
|
|
492
497
|
if (/net\.[0-9]/.test(selector)) {
|
|
493
498
|
const match = selector.match(/net\.([^ >]+)/);
|
|
494
499
|
const netName = match ? match[1] : "";
|
|
@@ -1452,7 +1457,10 @@ function pairs(arr) {
|
|
|
1452
1457
|
// lib/components/primitive-components/Net.ts
|
|
1453
1458
|
import { autoroute } from "@tscircuit/infgrid-ijump-astar";
|
|
1454
1459
|
var netProps = z4.object({
|
|
1455
|
-
name: z4.string()
|
|
1460
|
+
name: z4.string().refine(
|
|
1461
|
+
(val) => !/[+-]/.test(val),
|
|
1462
|
+
'Net names cannot contain "+" or "-", try using underscores instead, e.g. VCC_P'
|
|
1463
|
+
)
|
|
1456
1464
|
});
|
|
1457
1465
|
var Net = class extends PrimitiveComponent2 {
|
|
1458
1466
|
source_net_id;
|
|
@@ -1634,6 +1642,11 @@ var createNetsFromProps = (component, props) => {
|
|
|
1634
1642
|
'Net names cannot contain a period, try using "sel.net..." to autocomplete with conventional net names, e.g. V3_3'
|
|
1635
1643
|
);
|
|
1636
1644
|
}
|
|
1645
|
+
if (/net\.[^\s>]*[+-]/.test(prop)) {
|
|
1646
|
+
throw new Error(
|
|
1647
|
+
'Net names cannot contain "+" or "-", try using underscores instead, e.g. VCC_P'
|
|
1648
|
+
);
|
|
1649
|
+
}
|
|
1637
1650
|
if (/net\.[0-9]/.test(prop)) {
|
|
1638
1651
|
const netName = prop.split("net.")[1];
|
|
1639
1652
|
throw new Error(
|
|
@@ -8714,7 +8727,10 @@ var SolderJumper = class extends NormalComponent {
|
|
|
8714
8727
|
get config() {
|
|
8715
8728
|
const props = this._parsedProps ?? this.props;
|
|
8716
8729
|
let resolvedPinCount = props.pinCount;
|
|
8717
|
-
if (!
|
|
8730
|
+
if (props.pinCount == null && !props.footprint) {
|
|
8731
|
+
resolvedPinCount = 2;
|
|
8732
|
+
}
|
|
8733
|
+
if (props.pinCount == null) {
|
|
8718
8734
|
const nums = (props.bridgedPins ?? []).flat().map((p_str) => this._getPinNumberFromBridgedPinName(p_str)).filter((n) => n !== null);
|
|
8719
8735
|
const maxPinFromBridged = nums.length > 0 ? Math.max(...nums) : 0;
|
|
8720
8736
|
const pinCountFromLabels = props.pinLabels ? Object.keys(props.pinLabels).length : 0;
|
|
@@ -8749,7 +8765,10 @@ var SolderJumper = class extends NormalComponent {
|
|
|
8749
8765
|
_getSchematicPortArrangement() {
|
|
8750
8766
|
const arrangement = super._getSchematicPortArrangement();
|
|
8751
8767
|
if (arrangement && Object.keys(arrangement).length > 0) return arrangement;
|
|
8752
|
-
|
|
8768
|
+
let pinCount = this._parsedProps.pinCount ?? (Array.isArray(this._parsedProps.pinLabels) ? this._parsedProps.pinLabels.length : this._parsedProps.pinLabels ? Object.keys(this._parsedProps.pinLabels).length : this.getPortsFromFootprint().length);
|
|
8769
|
+
if (pinCount == null && !this._parsedProps.footprint) {
|
|
8770
|
+
pinCount = 2;
|
|
8771
|
+
}
|
|
8753
8772
|
const direction = this._parsedProps.schDirection ?? "right";
|
|
8754
8773
|
return {
|
|
8755
8774
|
leftSize: direction === "left" ? pinCount : 0,
|
|
@@ -10423,7 +10442,7 @@ import { identity as identity4 } from "transformation-matrix";
|
|
|
10423
10442
|
var package_default = {
|
|
10424
10443
|
name: "@tscircuit/core",
|
|
10425
10444
|
type: "module",
|
|
10426
|
-
version: "0.0.
|
|
10445
|
+
version: "0.0.515",
|
|
10427
10446
|
types: "dist/index.d.ts",
|
|
10428
10447
|
main: "dist/index.js",
|
|
10429
10448
|
module: "dist/index.js",
|