@tscircuit/props 0.0.678 → 0.0.680
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/README.md +8 -1
- package/dist/index.d.ts +145 -7
- package/dist/index.js +16 -1
- package/dist/index.js.map +1 -1
- package/lib/common/layout.ts +5 -0
- package/lib/common/resolveManufacturerPartNumber.ts +23 -0
- package/lib/components/crystal.ts +0 -2
- package/lib/components/mountedboard.ts +4 -0
- package/lib/components/pcb-bend.ts +10 -1
- package/lib/index.ts +1 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -676,6 +676,7 @@ var commonComponentProps = commonLayoutProps.merge(supplierProps).extend({
|
|
|
676
676
|
"Whether to show this component's CAD model as translucent in the 3D viewer."
|
|
677
677
|
),
|
|
678
678
|
pinAttributes: z23.record(z23.string(), pinAttributeMap).optional(),
|
|
679
|
+
mpn: z23.string().describe("Manufacturer Part Number").optional(),
|
|
679
680
|
mfn: z23.string().describe("Manufacturer Part Number").optional(),
|
|
680
681
|
manufacturerPartNumber: z23.string().optional()
|
|
681
682
|
});
|
|
@@ -694,6 +695,17 @@ var lrPolarPins = [
|
|
|
694
695
|
];
|
|
695
696
|
var distanceOrMultiplier = distance8.or(z23.enum(["2x", "3x", "4x"]));
|
|
696
697
|
|
|
698
|
+
// lib/common/resolveManufacturerPartNumber.ts
|
|
699
|
+
var resolveManufacturerPartNumber = (props) => {
|
|
700
|
+
const partNumbers = [props.manufacturerPartNumber, props.mpn, props.mfn].map((partNumber) => partNumber?.trim()).filter((partNumber) => Boolean(partNumber));
|
|
701
|
+
if (new Set(partNumbers).size > 1) {
|
|
702
|
+
throw new Error(
|
|
703
|
+
"Conflicting manufacturerPartNumber, mpn, and mfn: specify the same manufacturer part number for all aliases"
|
|
704
|
+
);
|
|
705
|
+
}
|
|
706
|
+
return partNumbers[0];
|
|
707
|
+
};
|
|
708
|
+
|
|
697
709
|
// lib/common/pcbPath.ts
|
|
698
710
|
import { layer_ref as layer_ref2 } from "circuit-json";
|
|
699
711
|
import { z as z24 } from "zod";
|
|
@@ -16891,6 +16903,7 @@ var pcbBendProps = z47.object({
|
|
|
16891
16903
|
y2: finiteDistance,
|
|
16892
16904
|
bendAngle: rotation3.pipe(z47.number().finite()),
|
|
16893
16905
|
bendRadius: distance.pipe(z47.number().finite().positive()),
|
|
16906
|
+
tearReliefRadius: distance.pipe(z47.number().finite().positive()).optional(),
|
|
16894
16907
|
bendSide: z47.enum(["left", "right"])
|
|
16895
16908
|
}).refine(({ x1, y1, x2, y2 }) => x1 !== x2 || y1 !== y2, {
|
|
16896
16909
|
message: "Bend centerline endpoints must be distinct",
|
|
@@ -17487,7 +17500,6 @@ var crystalProps = commonComponentProps.extend({
|
|
|
17487
17500
|
loadCapacitance: capacitance,
|
|
17488
17501
|
maxTraceLength: distance15.optional(),
|
|
17489
17502
|
manufacturerPartNumber: z65.string().optional(),
|
|
17490
|
-
mpn: z65.string().optional(),
|
|
17491
17503
|
pinVariant: z65.enum(["two_pin", "four_pin"]).optional(),
|
|
17492
17504
|
schOrientation: schematicOrientation.optional(),
|
|
17493
17505
|
connections: createConnectionsProp(crystalPins).optional()
|
|
@@ -18008,6 +18020,8 @@ expectTypesMatch(true);
|
|
|
18008
18020
|
// lib/components/mountedboard.ts
|
|
18009
18021
|
import { z as z85 } from "zod";
|
|
18010
18022
|
var mountedboardProps = subcircuitGroupProps.extend({
|
|
18023
|
+
mpn: chipProps.shape.mpn,
|
|
18024
|
+
mfn: chipProps.shape.mfn,
|
|
18011
18025
|
manufacturerPartNumber: chipProps.shape.manufacturerPartNumber,
|
|
18012
18026
|
pinLabels: chipProps.shape.pinLabels,
|
|
18013
18027
|
showPinAliases: chipProps.shape.showPinAliases,
|
|
@@ -19880,6 +19894,7 @@ export {
|
|
|
19880
19894
|
resistorPinLabels,
|
|
19881
19895
|
resistorPins,
|
|
19882
19896
|
resistorProps,
|
|
19897
|
+
resolveManufacturerPartNumber,
|
|
19883
19898
|
resonatorProps,
|
|
19884
19899
|
rotatedPillSmtPadProps,
|
|
19885
19900
|
rotatedRectSmtPadProps,
|