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.
package/dist/index.d.ts CHANGED
@@ -5374,15 +5374,17 @@ declare function fetchEasyEDAComponent(jlcpcbPartNumber: string, { fetch, includ
5374
5374
  includeModelMetadata?: boolean;
5375
5375
  }): Promise<RawEasyEdaJson>;
5376
5376
 
5377
- declare const convertRawEasyToTsx: ({ rawEasy, pinAttributes, }: {
5377
+ declare const convertRawEasyToTsx: ({ rawEasy, pinAttributes, internallyConnectedPins, }: {
5378
5378
  rawEasy: any;
5379
5379
  pinAttributes?: ChipProps["pinAttributes"];
5380
+ internallyConnectedPins?: ChipProps["internallyConnectedPins"];
5380
5381
  }) => Promise<string>;
5381
5382
 
5382
5383
  type GeneratedComponentType = "chip" | "diode" | "led" | "pushbutton" | "switch" | "capacitor" | "resistor" | "inductor" | "crystal" | "connector";
5383
5384
  type GenerateTypescriptComponentParams = {
5384
5385
  pinLabels: ChipProps["pinLabels"];
5385
5386
  pinAttributes?: ChipProps["pinAttributes"];
5387
+ internallyConnectedPins?: ChipProps["internallyConnectedPins"];
5386
5388
  componentName: string;
5387
5389
  objUrl?: string;
5388
5390
  stepUrl?: string;
@@ -5406,7 +5408,7 @@ type GenerateTypescriptComponentParams = {
5406
5408
  footprint: string;
5407
5409
  circuitJson?: AnyCircuitElement[];
5408
5410
  });
5409
- 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;
5411
+ 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;
5410
5412
 
5411
5413
  declare function normalizeManufacturerPartNumber(partNumber: string): string;
5412
5414
 
package/dist/index.js CHANGED
@@ -17445,9 +17445,11 @@ var generateFootprintTsx = (circuitJson, options = {}) => {
17445
17445
  elementStrings.push(
17446
17446
  `<hole pcbX="${mmStr(hole.x)}" pcbY="${mmStr(hole.y)}" diameter="${mmStr(hole.hole_diameter)}" />`
17447
17447
  );
17448
- } else if (hole.hole_shape === "oval") {
17448
+ } else if (hole.hole_shape === "oval" || hole.hole_shape === "rect" || hole.hole_shape === "pill" || hole.hole_shape === "rotated_pill") {
17449
+ const shape = hole.hole_shape === "rotated_pill" ? "pill" : hole.hole_shape;
17450
+ const rotationAttr = hole.hole_shape === "rotated_pill" ? getRotationAttr(hole.ccw_rotation) : "";
17449
17451
  elementStrings.push(
17450
- `<hole pcbX="${mmStr(hole.x)}" pcbY="${mmStr(hole.y)}" width="${mmStr(hole.hole_width)}" height="${mmStr(hole.hole_height)}" shape="oval" />`
17452
+ `<hole pcbX="${mmStr(hole.x)}" pcbY="${mmStr(hole.y)}" width="${mmStr(hole.hole_width)}" height="${mmStr(hole.hole_height)}" shape="${shape}"${rotationAttr} />`
17451
17453
  );
17452
17454
  }
17453
17455
  }
@@ -17624,6 +17626,7 @@ var inferPinAttributes = (pinLabels) => {
17624
17626
  var generateTypescriptComponent = ({
17625
17627
  pinLabels,
17626
17628
  pinAttributes,
17629
+ internallyConnectedPins,
17627
17630
  componentName,
17628
17631
  objUrl,
17629
17632
  stepUrl,
@@ -17692,6 +17695,8 @@ ${pinAttributesString}
17692
17695
 
17693
17696
  ` : "";
17694
17697
  const pinAttributesProp = pinAttributesString ? ` pinAttributes={pinAttributes}
17698
+ ` : "";
17699
+ const internallyConnectedPinsProp = internallyConnectedPins !== void 0 ? ` internallyConnectedPins={${JSON.stringify(internallyConnectedPins)}}
17695
17700
  ` : "";
17696
17701
  const polarizedPinLabelsString = Object.entries(polarizedPinLabels ?? {}).map(([pin, labels]) => ` ${pin}: ${JSON.stringify(labels)}`).join(",\n");
17697
17702
  const polarizedPinLabelsBlock = polarizedPinLabels ? `const pinLabels = {
@@ -17779,7 +17784,7 @@ ${pinAttributesBlock}export const ${componentName} = (props: PushButtonProps<typ
17779
17784
  pinLabels={pinLabels}
17780
17785
  ${symbolProp} supplierPartNumbers={${JSON.stringify(supplierPartNumbers, null, " ")}}
17781
17786
  manufacturerPartNumber=${manufacturerPartNumberTsx}
17782
- ${pinAttributesProp} footprint={${footprintTsx}}
17787
+ ${pinAttributesProp}${internallyConnectedPinsProp} footprint={${footprintTsx}}
17783
17788
  ${objUrl || stepUrl ? `cadModel={{
17784
17789
  ${cadModelLines}
17785
17790
  }}` : ""}
@@ -17806,7 +17811,7 @@ ${pinAttributesBlock}export const ${componentName} = (props: SwitchProps) => {
17806
17811
  pinLabels={pinLabels}
17807
17812
  ${symbolProp} supplierPartNumbers={${JSON.stringify(supplierPartNumbers, null, " ")}}
17808
17813
  manufacturerPartNumber=${manufacturerPartNumberTsx}
17809
- ${pinAttributesProp} footprint={${footprintTsx}}
17814
+ ${pinAttributesProp}${internallyConnectedPinsProp} footprint={${footprintTsx}}
17810
17815
  ${objUrl || stepUrl ? `cadModel={{
17811
17816
  ${cadModelLines}
17812
17817
  }}` : ""}
@@ -17934,7 +17939,7 @@ ${pinAttributesBlock}export const ${componentName} = (props: ConnectorProps) =>
17934
17939
  pinLabels={pinLabels}
17935
17940
  supplierPartNumbers={${JSON.stringify(supplierPartNumbers, null, " ")}}
17936
17941
  manufacturerPartNumber=${manufacturerPartNumberTsx}
17937
- ${pinAttributesProp} footprint={${footprintTsx}}
17942
+ ${pinAttributesProp}${internallyConnectedPinsProp} footprint={${footprintTsx}}
17938
17943
  ${objUrl || stepUrl ? `cadModel={{
17939
17944
  ${cadModelLines}
17940
17945
  }}` : ""}
@@ -17954,7 +17959,7 @@ ${pinLabelsString}
17954
17959
  ${pinAttributesBlock}export const ${componentName} = (props: ChipProps<typeof pinLabels>) => {
17955
17960
  return (
17956
17961
  <chip
17957
- ${useSymbolPortsOnly ? "" : " pinLabels={pinLabels}\n"}${pinAttributesProp}${symbolProp}${schPinArrangementProp} supplierPartNumbers={${JSON.stringify(supplierPartNumbers, null, " ")}}
17962
+ ${useSymbolPortsOnly ? "" : " pinLabels={pinLabels}\n"}${pinAttributesProp}${internallyConnectedPinsProp}${symbolProp}${schPinArrangementProp} supplierPartNumbers={${JSON.stringify(supplierPartNumbers, null, " ")}}
17958
17963
  manufacturerPartNumber=${manufacturerPartNumberTsx}
17959
17964
  footprint={${footprintTsx}}
17960
17965
  ${objUrl || stepUrl ? `cadModel={{
@@ -18191,18 +18196,21 @@ var getVisibleSchematicPinArrangement = (betterEasy) => {
18191
18196
  };
18192
18197
  var convertRawEasyToTsx = async ({
18193
18198
  rawEasy,
18194
- pinAttributes
18199
+ pinAttributes,
18200
+ internallyConnectedPins
18195
18201
  }) => {
18196
18202
  const betterEasy = EasyEdaJsonSchema.parse(rawEasy);
18197
18203
  const result = await convertBetterEasyToTsx({
18198
18204
  betterEasy,
18199
- pinAttributes
18205
+ pinAttributes,
18206
+ internallyConnectedPins
18200
18207
  });
18201
18208
  return result;
18202
18209
  };
18203
18210
  var convertBetterEasyToTsx = async ({
18204
18211
  betterEasy,
18205
- pinAttributes
18212
+ pinAttributes,
18213
+ internallyConnectedPins
18206
18214
  }) => {
18207
18215
  const cadPlacement = await getEasyEdaCadModelPlacement(betterEasy);
18208
18216
  const { circuitJson, resolvedPinAttributes } = convertEasyEdaJsonToCircuitJsonWithPinAttributes(betterEasy, {
@@ -18285,6 +18293,7 @@ var convertBetterEasyToTsx = async ({
18285
18293
  manufacturerPartNumber,
18286
18294
  pinLabels,
18287
18295
  pinAttributes: resolvedPinAttributes,
18296
+ internallyConnectedPins,
18288
18297
  objUrl: modelObjUrl,
18289
18298
  stepUrl: modelStepUrl,
18290
18299
  circuitJson,