easyeda 0.0.291 → 0.0.293

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.
@@ -11643,6 +11643,30 @@ ${cadModelLines}
11643
11643
  />
11644
11644
  )
11645
11645
  }
11646
+ `.trim();
11647
+ }
11648
+ if (componentType === "connector") {
11649
+ return `
11650
+ import type { ConnectorProps } from "@tscircuit/props"
11651
+
11652
+ const pinLabels = {
11653
+ ${pinLabelsString}
11654
+ } as const
11655
+
11656
+ export const ${componentName} = (props: ConnectorProps) => {
11657
+ return (
11658
+ <connector
11659
+ pinLabels={pinLabels}
11660
+ supplierPartNumbers={${JSON.stringify(supplierPartNumbers, null, " ")}}
11661
+ manufacturerPartNumber="${manufacturerPartNumber}"
11662
+ footprint={${footprintTsx}}
11663
+ ${objUrl || stepUrl ? `cadModel={{
11664
+ ${cadModelLines}
11665
+ }}` : ""}
11666
+ {...props}
11667
+ />
11668
+ )
11669
+ }
11646
11670
  `.trim();
11647
11671
  }
11648
11672
  return `
@@ -11687,6 +11711,12 @@ var isInductorComponent = (betterEasy) => {
11687
11711
  return packageName?.toUpperCase().startsWith("IND-") === true && typeof value === "string" && inductancePattern.test(value.trim());
11688
11712
  };
11689
11713
 
11714
+ // lib/websafe/convert-to-typescript-component/is-micro-usb-connector-component.ts
11715
+ var isMicroUsbConnectorComponent = (betterEasy) => {
11716
+ const componentParameters = betterEasy.dataStr.head.c_para;
11717
+ return componentParameters.pre === "USB?" && componentParameters.package?.toUpperCase().startsWith("MICRO-USB-") === true;
11718
+ };
11719
+
11690
11720
  // lib/websafe/convert-to-typescript-component/category-value-contains-pushbutton.ts
11691
11721
  var categoryValueContainsPushbutton = (value) => {
11692
11722
  if (typeof value === "string") {
@@ -12050,13 +12080,14 @@ var hasNonBoxSchematicSymbol = (easyEdaJson) => {
12050
12080
  };
12051
12081
 
12052
12082
  // lib/websafe/convert-to-typescript-component/index.tsx
12053
- var getGeneratedComponentType = (betterEasy) => {
12083
+ var getGeneratedComponentType = (betterEasy, pinCount) => {
12054
12084
  if (isLedCategoryComponent(betterEasy)) return "led";
12055
- if (isDiodeCategoryComponent(betterEasy)) return "diode";
12085
+ if (isDiodeCategoryComponent(betterEasy) && pinCount === 2) return "diode";
12056
12086
  if (isPushbuttonCategoryComponent(betterEasy)) return "pushbutton";
12057
12087
  if (isSwitchCategoryComponent(betterEasy)) return "switch";
12058
12088
  if (isInductorComponent(betterEasy)) return "inductor";
12059
12089
  if (isCrystalComponent(betterEasy)) return "crystal";
12090
+ if (isMicroUsbConnectorComponent(betterEasy)) return "connector";
12060
12091
  return "chip";
12061
12092
  };
12062
12093
  var convertRawEasyToTsx = async ({ rawEasy }) => {
@@ -12121,11 +12152,15 @@ var convertBetterEasyToTsx = async ({
12121
12152
  const supplierPartNumbers = {
12122
12153
  jlcpcb: [betterEasy.lcsc.number]
12123
12154
  };
12124
- const componentType = getGeneratedComponentType(betterEasy);
12155
+ const componentType = getGeneratedComponentType(
12156
+ betterEasy,
12157
+ sourcePorts.length
12158
+ );
12125
12159
  const inductance2 = componentType === "inductor" ? betterEasy.dataStr.head.c_para.Value?.trim() : void 0;
12126
12160
  const crystalFrequency = componentType === "crystal" ? betterEasy.dataStr.head.c_para.Value?.trim() : void 0;
12127
12161
  const crystalPinVariant = componentType !== "crystal" ? void 0 : sourcePorts.length === 4 ? "four_pin" : sourcePorts.length === 2 ? "two_pin" : void 0;
12128
- const symbolTsx = componentType === "chip" && hasNonBoxSchematicSymbol(betterEasy) ? generateSymbolTsx(betterEasy, circuitJson) : void 0;
12162
+ const isMultiPinDiode = isDiodeCategoryComponent(betterEasy) && sourcePorts.length !== 2;
12163
+ const symbolTsx = componentType === "chip" && !isMultiPinDiode && hasNonBoxSchematicSymbol(betterEasy) ? generateSymbolTsx(betterEasy, circuitJson) : void 0;
12129
12164
  return generateTypescriptComponent({
12130
12165
  componentName,
12131
12166
  manufacturerPartNumber,