easyeda 0.0.378 → 0.0.380

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.
@@ -5346,19 +5346,22 @@ declare const EasyEdaJsonSchema: z.ZodObject<{
5346
5346
  type RawEasyEdaJson = z.input<typeof EasyEdaJsonSchema>;
5347
5347
  type BetterEasyEdaJson = z.infer<typeof EasyEdaJsonSchema>;
5348
5348
 
5349
- declare const convertRawEasyToTsx: ({ rawEasy, pinAttributes, }: {
5349
+ declare const convertRawEasyToTsx: ({ rawEasy, pinAttributes, internallyConnectedPins, }: {
5350
5350
  rawEasy: any;
5351
5351
  pinAttributes?: ChipProps["pinAttributes"];
5352
+ internallyConnectedPins?: ChipProps["internallyConnectedPins"];
5352
5353
  }) => Promise<string>;
5353
- declare const convertBetterEasyToTsx: ({ betterEasy, pinAttributes, }: {
5354
+ declare const convertBetterEasyToTsx: ({ betterEasy, pinAttributes, internallyConnectedPins, }: {
5354
5355
  betterEasy: BetterEasyEdaJson;
5355
5356
  pinAttributes?: ChipProps["pinAttributes"];
5357
+ internallyConnectedPins?: ChipProps["internallyConnectedPins"];
5356
5358
  }) => Promise<string>;
5357
5359
 
5358
5360
  type GeneratedComponentType = "chip" | "diode" | "led" | "pushbutton" | "switch" | "capacitor" | "resistor" | "inductor" | "crystal" | "connector";
5359
5361
  type GenerateTypescriptComponentParams = {
5360
5362
  pinLabels: ChipProps["pinLabels"];
5361
5363
  pinAttributes?: ChipProps["pinAttributes"];
5364
+ internallyConnectedPins?: ChipProps["internallyConnectedPins"];
5362
5365
  componentName: string;
5363
5366
  objUrl?: string;
5364
5367
  stepUrl?: string;
@@ -5382,7 +5385,7 @@ type GenerateTypescriptComponentParams = {
5382
5385
  footprint: string;
5383
5386
  circuitJson?: AnyCircuitElement[];
5384
5387
  });
5385
- declare const generateTypescriptComponent: ({ pinLabels, pinAttributes, componentName, objUrl, stepUrl, circuitJson, footprint, supplierPartNumbers, manufacturerPartNumber, componentType, isPolarizedCapacitor, capacitance, resistance, inductance, crystalFrequency, crystalPinVariant, symbolTsx, schPinArrangement, useSymbolPortsOnly, inferPinAttributes, }: GenerateTypescriptComponentParams) => string;
5388
+ declare const generateTypescriptComponent: ({ pinLabels, pinAttributes, internallyConnectedPins, componentName, objUrl, stepUrl, circuitJson, footprint, supplierPartNumbers, manufacturerPartNumber, componentType, isPolarizedCapacitor, capacitance, resistance, inductance, crystalFrequency, crystalPinVariant, symbolTsx, schPinArrangement, useSymbolPortsOnly, inferPinAttributes, }: GenerateTypescriptComponentParams) => string;
5386
5389
 
5387
5390
  declare function fetchEasyEDAComponent(jlcpcbPartNumber: string, { fetch, includeModelMetadata, }?: {
5388
5391
  fetch?: typeof globalThis.fetch;
@@ -21050,9 +21050,11 @@ var generateFootprintTsx = (circuitJson, options = {}) => {
21050
21050
  elementStrings.push(
21051
21051
  `<hole pcbX="${mmStr(hole.x)}" pcbY="${mmStr(hole.y)}" diameter="${mmStr(hole.hole_diameter)}" />`
21052
21052
  );
21053
- } else if (hole.hole_shape === "oval") {
21053
+ } else if (hole.hole_shape === "oval" || hole.hole_shape === "rect" || hole.hole_shape === "pill" || hole.hole_shape === "rotated_pill") {
21054
+ const shape = hole.hole_shape === "rotated_pill" ? "pill" : hole.hole_shape;
21055
+ const rotationAttr = hole.hole_shape === "rotated_pill" ? getRotationAttr(hole.ccw_rotation) : "";
21054
21056
  elementStrings.push(
21055
- `<hole pcbX="${mmStr(hole.x)}" pcbY="${mmStr(hole.y)}" width="${mmStr(hole.hole_width)}" height="${mmStr(hole.hole_height)}" shape="oval" />`
21057
+ `<hole pcbX="${mmStr(hole.x)}" pcbY="${mmStr(hole.y)}" width="${mmStr(hole.hole_width)}" height="${mmStr(hole.hole_height)}" shape="${shape}"${rotationAttr} />`
21056
21058
  );
21057
21059
  }
21058
21060
  }
@@ -21229,6 +21231,7 @@ var inferPinAttributes = (pinLabels) => {
21229
21231
  var generateTypescriptComponent = ({
21230
21232
  pinLabels,
21231
21233
  pinAttributes,
21234
+ internallyConnectedPins,
21232
21235
  componentName,
21233
21236
  objUrl,
21234
21237
  stepUrl,
@@ -21297,6 +21300,8 @@ ${pinAttributesString}
21297
21300
 
21298
21301
  ` : "";
21299
21302
  const pinAttributesProp = pinAttributesString ? ` pinAttributes={pinAttributes}
21303
+ ` : "";
21304
+ const internallyConnectedPinsProp = internallyConnectedPins !== void 0 ? ` internallyConnectedPins={${JSON.stringify(internallyConnectedPins)}}
21300
21305
  ` : "";
21301
21306
  const polarizedPinLabelsString = Object.entries(polarizedPinLabels ?? {}).map(([pin, labels]) => ` ${pin}: ${JSON.stringify(labels)}`).join(",\n");
21302
21307
  const polarizedPinLabelsBlock = polarizedPinLabels ? `const pinLabels = {
@@ -21384,7 +21389,7 @@ ${pinAttributesBlock}export const ${componentName} = (props: PushButtonProps<typ
21384
21389
  pinLabels={pinLabels}
21385
21390
  ${symbolProp} supplierPartNumbers={${JSON.stringify(supplierPartNumbers, null, " ")}}
21386
21391
  manufacturerPartNumber=${manufacturerPartNumberTsx}
21387
- ${pinAttributesProp} footprint={${footprintTsx}}
21392
+ ${pinAttributesProp}${internallyConnectedPinsProp} footprint={${footprintTsx}}
21388
21393
  ${objUrl || stepUrl ? `cadModel={{
21389
21394
  ${cadModelLines}
21390
21395
  }}` : ""}
@@ -21411,7 +21416,7 @@ ${pinAttributesBlock}export const ${componentName} = (props: SwitchProps) => {
21411
21416
  pinLabels={pinLabels}
21412
21417
  ${symbolProp} supplierPartNumbers={${JSON.stringify(supplierPartNumbers, null, " ")}}
21413
21418
  manufacturerPartNumber=${manufacturerPartNumberTsx}
21414
- ${pinAttributesProp} footprint={${footprintTsx}}
21419
+ ${pinAttributesProp}${internallyConnectedPinsProp} footprint={${footprintTsx}}
21415
21420
  ${objUrl || stepUrl ? `cadModel={{
21416
21421
  ${cadModelLines}
21417
21422
  }}` : ""}
@@ -21539,7 +21544,7 @@ ${pinAttributesBlock}export const ${componentName} = (props: ConnectorProps) =>
21539
21544
  pinLabels={pinLabels}
21540
21545
  supplierPartNumbers={${JSON.stringify(supplierPartNumbers, null, " ")}}
21541
21546
  manufacturerPartNumber=${manufacturerPartNumberTsx}
21542
- ${pinAttributesProp} footprint={${footprintTsx}}
21547
+ ${pinAttributesProp}${internallyConnectedPinsProp} footprint={${footprintTsx}}
21543
21548
  ${objUrl || stepUrl ? `cadModel={{
21544
21549
  ${cadModelLines}
21545
21550
  }}` : ""}
@@ -21559,7 +21564,7 @@ ${pinLabelsString}
21559
21564
  ${pinAttributesBlock}export const ${componentName} = (props: ChipProps<typeof pinLabels>) => {
21560
21565
  return (
21561
21566
  <chip
21562
- ${useSymbolPortsOnly ? "" : " pinLabels={pinLabels}\n"}${pinAttributesProp}${symbolProp}${schPinArrangementProp} supplierPartNumbers={${JSON.stringify(supplierPartNumbers, null, " ")}}
21567
+ ${useSymbolPortsOnly ? "" : " pinLabels={pinLabels}\n"}${pinAttributesProp}${internallyConnectedPinsProp}${symbolProp}${schPinArrangementProp} supplierPartNumbers={${JSON.stringify(supplierPartNumbers, null, " ")}}
21563
21568
  manufacturerPartNumber=${manufacturerPartNumberTsx}
21564
21569
  footprint={${footprintTsx}}
21565
21570
  ${objUrl || stepUrl ? `cadModel={{
@@ -21796,18 +21801,21 @@ var getVisibleSchematicPinArrangement = (betterEasy) => {
21796
21801
  };
21797
21802
  var convertRawEasyToTsx = async ({
21798
21803
  rawEasy,
21799
- pinAttributes
21804
+ pinAttributes,
21805
+ internallyConnectedPins
21800
21806
  }) => {
21801
21807
  const betterEasy = EasyEdaJsonSchema.parse(rawEasy);
21802
21808
  const result = await convertBetterEasyToTsx({
21803
21809
  betterEasy,
21804
- pinAttributes
21810
+ pinAttributes,
21811
+ internallyConnectedPins
21805
21812
  });
21806
21813
  return result;
21807
21814
  };
21808
21815
  var convertBetterEasyToTsx = async ({
21809
21816
  betterEasy,
21810
- pinAttributes
21817
+ pinAttributes,
21818
+ internallyConnectedPins
21811
21819
  }) => {
21812
21820
  const cadPlacement = await getEasyEdaCadModelPlacement(betterEasy);
21813
21821
  const { circuitJson, resolvedPinAttributes } = convertEasyEdaJsonToCircuitJsonWithPinAttributes(betterEasy, {
@@ -21890,6 +21898,7 @@ var convertBetterEasyToTsx = async ({
21890
21898
  manufacturerPartNumber,
21891
21899
  pinLabels,
21892
21900
  pinAttributes: resolvedPinAttributes,
21901
+ internallyConnectedPins,
21893
21902
  objUrl: modelObjUrl,
21894
21903
  stepUrl: modelStepUrl,
21895
21904
  circuitJson,