@tscircuit/props 0.0.679 → 0.0.681
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 +5 -1
- package/dist/index.d.ts +139 -6
- 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/copper-pour.ts +6 -0
- package/lib/components/crystal.ts +0 -2
- package/lib/components/mountedboard.ts +4 -0
- 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";
|
|
@@ -17488,7 +17500,6 @@ var crystalProps = commonComponentProps.extend({
|
|
|
17488
17500
|
loadCapacitance: capacitance,
|
|
17489
17501
|
maxTraceLength: distance15.optional(),
|
|
17490
17502
|
manufacturerPartNumber: z65.string().optional(),
|
|
17491
|
-
mpn: z65.string().optional(),
|
|
17492
17503
|
pinVariant: z65.enum(["two_pin", "four_pin"]).optional(),
|
|
17493
17504
|
schOrientation: schematicOrientation.optional(),
|
|
17494
17505
|
connections: createConnectionsProp(crystalPins).optional()
|
|
@@ -18009,6 +18020,8 @@ expectTypesMatch(true);
|
|
|
18009
18020
|
// lib/components/mountedboard.ts
|
|
18010
18021
|
import { z as z85 } from "zod";
|
|
18011
18022
|
var mountedboardProps = subcircuitGroupProps.extend({
|
|
18023
|
+
mpn: chipProps.shape.mpn,
|
|
18024
|
+
mfn: chipProps.shape.mfn,
|
|
18012
18025
|
manufacturerPartNumber: chipProps.shape.manufacturerPartNumber,
|
|
18013
18026
|
pinLabels: chipProps.shape.pinLabels,
|
|
18014
18027
|
showPinAliases: chipProps.shape.showPinAliases,
|
|
@@ -18883,6 +18896,7 @@ var copperPourProps = z120.object({
|
|
|
18883
18896
|
name: z120.string().optional(),
|
|
18884
18897
|
layer: layer_ref11,
|
|
18885
18898
|
connectsTo: z120.string(),
|
|
18899
|
+
crosshatch: z120.boolean().optional(),
|
|
18886
18900
|
unbroken: z120.boolean().optional().describe(
|
|
18887
18901
|
"Reserves the pour region during autorouting so unrelated traces do not split it. Vias may still cross the region using antipads."
|
|
18888
18902
|
),
|
|
@@ -19881,6 +19895,7 @@ export {
|
|
|
19881
19895
|
resistorPinLabels,
|
|
19882
19896
|
resistorPins,
|
|
19883
19897
|
resistorProps,
|
|
19898
|
+
resolveManufacturerPartNumber,
|
|
19884
19899
|
resonatorProps,
|
|
19885
19900
|
rotatedPillSmtPadProps,
|
|
19886
19901
|
rotatedRectSmtPadProps,
|