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/main.cjs CHANGED
@@ -1078,7 +1078,7 @@ var import_promises = __toESM(require("fs/promises"), 1);
1078
1078
  var package_default = {
1079
1079
  name: "easyeda",
1080
1080
  type: "module",
1081
- version: "0.0.377",
1081
+ version: "0.0.379",
1082
1082
  files: [
1083
1083
  "dist"
1084
1084
  ],
@@ -18356,9 +18356,11 @@ var generateFootprintTsx = (circuitJson, options = {}) => {
18356
18356
  elementStrings.push(
18357
18357
  `<hole pcbX="${mmStr(hole.x)}" pcbY="${mmStr(hole.y)}" diameter="${mmStr(hole.hole_diameter)}" />`
18358
18358
  );
18359
- } else if (hole.hole_shape === "oval") {
18359
+ } else if (hole.hole_shape === "oval" || hole.hole_shape === "rect" || hole.hole_shape === "pill" || hole.hole_shape === "rotated_pill") {
18360
+ const shape = hole.hole_shape === "rotated_pill" ? "pill" : hole.hole_shape;
18361
+ const rotationAttr = hole.hole_shape === "rotated_pill" ? getRotationAttr(hole.ccw_rotation) : "";
18360
18362
  elementStrings.push(
18361
- `<hole pcbX="${mmStr(hole.x)}" pcbY="${mmStr(hole.y)}" width="${mmStr(hole.hole_width)}" height="${mmStr(hole.hole_height)}" shape="oval" />`
18363
+ `<hole pcbX="${mmStr(hole.x)}" pcbY="${mmStr(hole.y)}" width="${mmStr(hole.hole_width)}" height="${mmStr(hole.hole_height)}" shape="${shape}"${rotationAttr} />`
18362
18364
  );
18363
18365
  }
18364
18366
  }
@@ -18535,6 +18537,7 @@ var inferPinAttributes = (pinLabels) => {
18535
18537
  var generateTypescriptComponent = ({
18536
18538
  pinLabels,
18537
18539
  pinAttributes,
18540
+ internallyConnectedPins,
18538
18541
  componentName,
18539
18542
  objUrl,
18540
18543
  stepUrl,
@@ -18603,6 +18606,8 @@ ${pinAttributesString}
18603
18606
 
18604
18607
  ` : "";
18605
18608
  const pinAttributesProp = pinAttributesString ? ` pinAttributes={pinAttributes}
18609
+ ` : "";
18610
+ const internallyConnectedPinsProp = internallyConnectedPins !== void 0 ? ` internallyConnectedPins={${JSON.stringify(internallyConnectedPins)}}
18606
18611
  ` : "";
18607
18612
  const polarizedPinLabelsString = Object.entries(polarizedPinLabels ?? {}).map(([pin, labels]) => ` ${pin}: ${JSON.stringify(labels)}`).join(",\n");
18608
18613
  const polarizedPinLabelsBlock = polarizedPinLabels ? `const pinLabels = {
@@ -18690,7 +18695,7 @@ ${pinAttributesBlock}export const ${componentName} = (props: PushButtonProps<typ
18690
18695
  pinLabels={pinLabels}
18691
18696
  ${symbolProp} supplierPartNumbers={${JSON.stringify(supplierPartNumbers, null, " ")}}
18692
18697
  manufacturerPartNumber=${manufacturerPartNumberTsx}
18693
- ${pinAttributesProp} footprint={${footprintTsx}}
18698
+ ${pinAttributesProp}${internallyConnectedPinsProp} footprint={${footprintTsx}}
18694
18699
  ${objUrl || stepUrl ? `cadModel={{
18695
18700
  ${cadModelLines}
18696
18701
  }}` : ""}
@@ -18717,7 +18722,7 @@ ${pinAttributesBlock}export const ${componentName} = (props: SwitchProps) => {
18717
18722
  pinLabels={pinLabels}
18718
18723
  ${symbolProp} supplierPartNumbers={${JSON.stringify(supplierPartNumbers, null, " ")}}
18719
18724
  manufacturerPartNumber=${manufacturerPartNumberTsx}
18720
- ${pinAttributesProp} footprint={${footprintTsx}}
18725
+ ${pinAttributesProp}${internallyConnectedPinsProp} footprint={${footprintTsx}}
18721
18726
  ${objUrl || stepUrl ? `cadModel={{
18722
18727
  ${cadModelLines}
18723
18728
  }}` : ""}
@@ -18845,7 +18850,7 @@ ${pinAttributesBlock}export const ${componentName} = (props: ConnectorProps) =>
18845
18850
  pinLabels={pinLabels}
18846
18851
  supplierPartNumbers={${JSON.stringify(supplierPartNumbers, null, " ")}}
18847
18852
  manufacturerPartNumber=${manufacturerPartNumberTsx}
18848
- ${pinAttributesProp} footprint={${footprintTsx}}
18853
+ ${pinAttributesProp}${internallyConnectedPinsProp} footprint={${footprintTsx}}
18849
18854
  ${objUrl || stepUrl ? `cadModel={{
18850
18855
  ${cadModelLines}
18851
18856
  }}` : ""}
@@ -18865,7 +18870,7 @@ ${pinLabelsString}
18865
18870
  ${pinAttributesBlock}export const ${componentName} = (props: ChipProps<typeof pinLabels>) => {
18866
18871
  return (
18867
18872
  <chip
18868
- ${useSymbolPortsOnly ? "" : " pinLabels={pinLabels}\n"}${pinAttributesProp}${symbolProp}${schPinArrangementProp} supplierPartNumbers={${JSON.stringify(supplierPartNumbers, null, " ")}}
18873
+ ${useSymbolPortsOnly ? "" : " pinLabels={pinLabels}\n"}${pinAttributesProp}${internallyConnectedPinsProp}${symbolProp}${schPinArrangementProp} supplierPartNumbers={${JSON.stringify(supplierPartNumbers, null, " ")}}
18869
18874
  manufacturerPartNumber=${manufacturerPartNumberTsx}
18870
18875
  footprint={${footprintTsx}}
18871
18876
  ${objUrl || stepUrl ? `cadModel={{
@@ -19102,18 +19107,21 @@ var getVisibleSchematicPinArrangement = (betterEasy) => {
19102
19107
  };
19103
19108
  var convertRawEasyToTsx = async ({
19104
19109
  rawEasy,
19105
- pinAttributes
19110
+ pinAttributes,
19111
+ internallyConnectedPins
19106
19112
  }) => {
19107
19113
  const betterEasy = EasyEdaJsonSchema.parse(rawEasy);
19108
19114
  const result = await convertBetterEasyToTsx({
19109
19115
  betterEasy,
19110
- pinAttributes
19116
+ pinAttributes,
19117
+ internallyConnectedPins
19111
19118
  });
19112
19119
  return result;
19113
19120
  };
19114
19121
  var convertBetterEasyToTsx = async ({
19115
19122
  betterEasy,
19116
- pinAttributes
19123
+ pinAttributes,
19124
+ internallyConnectedPins
19117
19125
  }) => {
19118
19126
  const cadPlacement = await getEasyEdaCadModelPlacement(betterEasy);
19119
19127
  const { circuitJson, resolvedPinAttributes } = convertEasyEdaJsonToCircuitJsonWithPinAttributes(betterEasy, {
@@ -19196,6 +19204,7 @@ var convertBetterEasyToTsx = async ({
19196
19204
  manufacturerPartNumber,
19197
19205
  pinLabels,
19198
19206
  pinAttributes: resolvedPinAttributes,
19207
+ internallyConnectedPins,
19199
19208
  objUrl: modelObjUrl,
19200
19209
  stepUrl: modelStepUrl,
19201
19210
  circuitJson,