easyeda 0.0.377 → 0.0.379

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
@@ -15333,15 +15333,6 @@ var handleHole = (hole, index) => {
15333
15333
  pcb_hole_id: `pcb_hole_${index + 1}`
15334
15334
  });
15335
15335
  };
15336
- var handleHoleCutout = (hole, index) => {
15337
- return pcb_cutout.parse({
15338
- type: "pcb_cutout",
15339
- pcb_cutout_id: `pcb_cutout_from_hole_${index + 1}`,
15340
- shape: "circle",
15341
- center: { x: milx10(hole.center.x), y: milx10(hole.center.y) },
15342
- radius: milx10(hole.radius)
15343
- });
15344
- };
15345
15336
  var handleVia = (via, index) => {
15346
15337
  const holeDiameter = via.holeRadius * 2;
15347
15338
  return pcb_via.parse({
@@ -15556,7 +15547,6 @@ var convertEasyEdaJsonToCircuitJsonWithPinAttributes = (easyEdaJson, {
15556
15547
  (shape) => shape.type === "HOLE"
15557
15548
  ).forEach((h, index) => {
15558
15549
  circuitElements.push(handleHole(h, index));
15559
- circuitElements.push(handleHoleCutout(h, index));
15560
15550
  });
15561
15551
  easyEdaJson.packageDetail.dataStr.shape.filter((shape) => shape.type === "VIA").forEach((v, index) => {
15562
15552
  circuitElements.push(handleVia(v, index));
@@ -17634,6 +17624,7 @@ var inferPinAttributes = (pinLabels) => {
17634
17624
  var generateTypescriptComponent = ({
17635
17625
  pinLabels,
17636
17626
  pinAttributes,
17627
+ internallyConnectedPins,
17637
17628
  componentName,
17638
17629
  objUrl,
17639
17630
  stepUrl,
@@ -17702,6 +17693,8 @@ ${pinAttributesString}
17702
17693
 
17703
17694
  ` : "";
17704
17695
  const pinAttributesProp = pinAttributesString ? ` pinAttributes={pinAttributes}
17696
+ ` : "";
17697
+ const internallyConnectedPinsProp = internallyConnectedPins !== void 0 ? ` internallyConnectedPins={${JSON.stringify(internallyConnectedPins)}}
17705
17698
  ` : "";
17706
17699
  const polarizedPinLabelsString = Object.entries(polarizedPinLabels ?? {}).map(([pin, labels]) => ` ${pin}: ${JSON.stringify(labels)}`).join(",\n");
17707
17700
  const polarizedPinLabelsBlock = polarizedPinLabels ? `const pinLabels = {
@@ -17789,7 +17782,7 @@ ${pinAttributesBlock}export const ${componentName} = (props: PushButtonProps<typ
17789
17782
  pinLabels={pinLabels}
17790
17783
  ${symbolProp} supplierPartNumbers={${JSON.stringify(supplierPartNumbers, null, " ")}}
17791
17784
  manufacturerPartNumber=${manufacturerPartNumberTsx}
17792
- ${pinAttributesProp} footprint={${footprintTsx}}
17785
+ ${pinAttributesProp}${internallyConnectedPinsProp} footprint={${footprintTsx}}
17793
17786
  ${objUrl || stepUrl ? `cadModel={{
17794
17787
  ${cadModelLines}
17795
17788
  }}` : ""}
@@ -17816,7 +17809,7 @@ ${pinAttributesBlock}export const ${componentName} = (props: SwitchProps) => {
17816
17809
  pinLabels={pinLabels}
17817
17810
  ${symbolProp} supplierPartNumbers={${JSON.stringify(supplierPartNumbers, null, " ")}}
17818
17811
  manufacturerPartNumber=${manufacturerPartNumberTsx}
17819
- ${pinAttributesProp} footprint={${footprintTsx}}
17812
+ ${pinAttributesProp}${internallyConnectedPinsProp} footprint={${footprintTsx}}
17820
17813
  ${objUrl || stepUrl ? `cadModel={{
17821
17814
  ${cadModelLines}
17822
17815
  }}` : ""}
@@ -17944,7 +17937,7 @@ ${pinAttributesBlock}export const ${componentName} = (props: ConnectorProps) =>
17944
17937
  pinLabels={pinLabels}
17945
17938
  supplierPartNumbers={${JSON.stringify(supplierPartNumbers, null, " ")}}
17946
17939
  manufacturerPartNumber=${manufacturerPartNumberTsx}
17947
- ${pinAttributesProp} footprint={${footprintTsx}}
17940
+ ${pinAttributesProp}${internallyConnectedPinsProp} footprint={${footprintTsx}}
17948
17941
  ${objUrl || stepUrl ? `cadModel={{
17949
17942
  ${cadModelLines}
17950
17943
  }}` : ""}
@@ -17964,7 +17957,7 @@ ${pinLabelsString}
17964
17957
  ${pinAttributesBlock}export const ${componentName} = (props: ChipProps<typeof pinLabels>) => {
17965
17958
  return (
17966
17959
  <chip
17967
- ${useSymbolPortsOnly ? "" : " pinLabels={pinLabels}\n"}${pinAttributesProp}${symbolProp}${schPinArrangementProp} supplierPartNumbers={${JSON.stringify(supplierPartNumbers, null, " ")}}
17960
+ ${useSymbolPortsOnly ? "" : " pinLabels={pinLabels}\n"}${pinAttributesProp}${internallyConnectedPinsProp}${symbolProp}${schPinArrangementProp} supplierPartNumbers={${JSON.stringify(supplierPartNumbers, null, " ")}}
17968
17961
  manufacturerPartNumber=${manufacturerPartNumberTsx}
17969
17962
  footprint={${footprintTsx}}
17970
17963
  ${objUrl || stepUrl ? `cadModel={{
@@ -18201,18 +18194,21 @@ var getVisibleSchematicPinArrangement = (betterEasy) => {
18201
18194
  };
18202
18195
  var convertRawEasyToTsx = async ({
18203
18196
  rawEasy,
18204
- pinAttributes
18197
+ pinAttributes,
18198
+ internallyConnectedPins
18205
18199
  }) => {
18206
18200
  const betterEasy = EasyEdaJsonSchema.parse(rawEasy);
18207
18201
  const result = await convertBetterEasyToTsx({
18208
18202
  betterEasy,
18209
- pinAttributes
18203
+ pinAttributes,
18204
+ internallyConnectedPins
18210
18205
  });
18211
18206
  return result;
18212
18207
  };
18213
18208
  var convertBetterEasyToTsx = async ({
18214
18209
  betterEasy,
18215
- pinAttributes
18210
+ pinAttributes,
18211
+ internallyConnectedPins
18216
18212
  }) => {
18217
18213
  const cadPlacement = await getEasyEdaCadModelPlacement(betterEasy);
18218
18214
  const { circuitJson, resolvedPinAttributes } = convertEasyEdaJsonToCircuitJsonWithPinAttributes(betterEasy, {
@@ -18295,6 +18291,7 @@ var convertBetterEasyToTsx = async ({
18295
18291
  manufacturerPartNumber,
18296
18292
  pinLabels,
18297
18293
  pinAttributes: resolvedPinAttributes,
18294
+ internallyConnectedPins,
18298
18295
  objUrl: modelObjUrl,
18299
18296
  stepUrl: modelStepUrl,
18300
18297
  circuitJson,