From 3cc3278a452426e364d2d905a8e42d87cf80a6d1 Mon Sep 17 00:00:00 2001 From: techmannih2 Date: Sat, 4 Apr 2026 09:48:27 +0530 Subject: [PATCH] feat: add 'standard' property support to ChipPropsSU --- generated/COMPONENT_TYPES.md | 43 +++++++++++------------------------- generated/PROPS_OVERVIEW.md | 20 +++-------------- lib/components/chip.ts | 2 ++ 3 files changed, 18 insertions(+), 47 deletions(-) diff --git a/generated/COMPONENT_TYPES.md b/generated/COMPONENT_TYPES.md index 61ed731..042512f 100644 --- a/generated/COMPONENT_TYPES.md +++ b/generated/COMPONENT_TYPES.md @@ -38,6 +38,7 @@ export interface CadModelBase { pcbRotationOffset?: number zOffsetFromSurface?: Distance showAsTranslucentModel?: boolean + stepUrl?: string } export const cadModelBase = z.object({ rotationOffset: z.number().or(rotationPoint3).optional(), @@ -49,6 +50,7 @@ export const cadModelBase = z.object({ pcbRotationOffset: z.number().optional(), zOffsetFromSurface: distance.optional(), showAsTranslucentModel: z.boolean().optional(), + stepUrl: url.optional(), }) export interface CadModelStl extends CadModelBase { stlUrl: string @@ -1082,6 +1084,7 @@ export interface ChipPropsSU< PinLabel extends SchematicPinLabel = SchematicPinLabel, > extends CommonComponentProps { manufacturerPartNumber?: string + standard?: string pinLabels?: PinLabelsProp showPinAliases?: boolean pcbPinLabels?: Record @@ -1120,6 +1123,7 @@ export const pinCompatibleVariant = z.object({ }) export const chipProps = commonComponentProps.extend({ manufacturerPartNumber: z.string().optional(), + standard: z.string().optional(), pinLabels: pinLabelsProp.optional(), showPinAliases: z.boolean().optional(), pcbPinLabels: z.record(z.string(), z.string()).optional(), @@ -1142,41 +1146,13 @@ export const chipProps = commonComponentProps.extend({ ### connector ```typescript -export interface ConnectorProps extends CommonComponentProps { - manufacturerPartNumber?: string - pinLabels?: Record< - number | SchematicPinLabel, - SchematicPinLabel | SchematicPinLabel[] - > - schPinStyle?: SchematicPinStyle - schPinSpacing?: number | string - schWidth?: number | string - schHeight?: number | string - schDirection?: "left" | "right" - schPortArrangement?: SchematicPortArrangement - internallyConnectedPins?: (string | number)[][] +export interface ConnectorProps extends ChipPropsSU { standard?: "usb_c" | "m2" } /** * Connector standard, e.g. usb_c, m2 */ -export const connectorProps = commonComponentProps.extend({ - manufacturerPartNumber: z.string().optional(), - pinLabels: z - .record( - z.number().or(schematicPinLabel), - schematicPinLabel.or(z.array(schematicPinLabel)), - ) - .optional(), - schPinStyle: schematicPinStyle.optional(), - schPinSpacing: distance.optional(), - schWidth: distance.optional(), - schHeight: distance.optional(), - schDirection: z.enum(["left", "right"]).optional(), - schPortArrangement: schematicPortArrangement.optional(), - internallyConnectedPins: z - .array(z.array(z.union([z.string(), z.number()]))) - .optional(), +export const connectorProps = chipProps.extend({ standard: z.enum(["usb_c", "m2"]).optional(), }) ``` @@ -1943,6 +1919,13 @@ export type PartsEngine = { sourceComponent: AnySourceComponent footprinterString?: string }) => Promise | SupplierPartNumbers + fetchPartCircuitJson?: (params: { + supplierPartNumber?: string + manufacturerPartNumber?: string + }) => + | Promise + | AnyCircuitElement[] + | undefined } export interface PcbRouteCache { pcbTraces: PcbTrace[] diff --git a/generated/PROPS_OVERVIEW.md b/generated/PROPS_OVERVIEW.md index ffbfecd..9e5f0df 100644 --- a/generated/PROPS_OVERVIEW.md +++ b/generated/PROPS_OVERVIEW.md @@ -304,6 +304,7 @@ export interface CadModelBase { pcbRotationOffset?: number zOffsetFromSurface?: Distance showAsTranslucentModel?: boolean + stepUrl?: string } @@ -379,6 +380,7 @@ export interface ChipPropsSU< PinLabel extends SchematicPinLabel = SchematicPinLabel, > extends CommonComponentProps { manufacturerPartNumber?: string + standard?: string pinLabels?: PinLabelsProp /** * Whether to show pin aliases in the schematic @@ -564,23 +566,7 @@ export interface CommonLayoutProps { } -export interface ConnectorProps extends CommonComponentProps { - manufacturerPartNumber?: string - pinLabels?: Record< - number | SchematicPinLabel, - SchematicPinLabel | SchematicPinLabel[] - > - schPinStyle?: SchematicPinStyle - schPinSpacing?: number | string - schWidth?: number | string - schHeight?: number | string - schDirection?: "left" | "right" - schPortArrangement?: SchematicPortArrangement - /** - * Groups of pins that are internally connected - * e.g., [["1","2"], ["2","3"]] - */ - internallyConnectedPins?: (string | number)[][] +export interface ConnectorProps extends ChipPropsSU { /** * Connector standard, e.g. usb_c, m2 */ diff --git a/lib/components/chip.ts b/lib/components/chip.ts index f683d4b..258486e 100644 --- a/lib/components/chip.ts +++ b/lib/components/chip.ts @@ -40,6 +40,7 @@ export interface ChipPropsSU< PinLabel extends SchematicPinLabel = SchematicPinLabel, > extends CommonComponentProps { manufacturerPartNumber?: string + standard?: string pinLabels?: PinLabelsProp /** * Whether to show pin aliases in the schematic @@ -135,6 +136,7 @@ export const pinCompatibleVariant = z.object({ export const chipProps = commonComponentProps.extend({ manufacturerPartNumber: z.string().optional(), + standard: z.string().optional(), pinLabels: pinLabelsProp.optional(), showPinAliases: z.boolean().optional(), pcbPinLabels: z.record(z.string(), z.string()).optional(),