easyeda 0.0.296 → 0.0.298

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.js CHANGED
@@ -7910,7 +7910,7 @@ export const ${componentName} = (props: Omit<CapacitorProps, "capacitance">) =>
7910
7910
  <capacitor
7911
7911
  name={name}
7912
7912
  capacitance=${JSON.stringify(capacitance2)}
7913
- supplierPartNumbers={${JSON.stringify(supplierPartNumbers, null, " ")}}
7913
+ ${symbolProp} supplierPartNumbers={${JSON.stringify(supplierPartNumbers, null, " ")}}
7914
7914
  manufacturerPartNumber="${manufacturerPartNumber}"
7915
7915
  footprint={${footprintTsx}}
7916
7916
  ${objUrl || stepUrl ? `cadModel={{
@@ -7936,7 +7936,7 @@ export const ${componentName} = (props: Omit<ResistorProps, "resistance">) => {
7936
7936
  <resistor
7937
7937
  name={name}
7938
7938
  resistance=${JSON.stringify(resistance2)}
7939
- supplierPartNumbers={${JSON.stringify(supplierPartNumbers, null, " ")}}
7939
+ ${symbolProp} supplierPartNumbers={${JSON.stringify(supplierPartNumbers, null, " ")}}
7940
7940
  manufacturerPartNumber="${manufacturerPartNumber}"
7941
7941
  footprint={${footprintTsx}}
7942
7942
  ${objUrl || stepUrl ? `cadModel={{
@@ -8443,7 +8443,7 @@ var generateShapeTsx = ({
8443
8443
  }
8444
8444
  return void 0;
8445
8445
  };
8446
- var generateSymbolTsx = (easyEdaJson, circuitJson) => {
8446
+ var generateSymbolTsx = (easyEdaJson, circuitJson, { includePorts = true } = {}) => {
8447
8447
  const shapes = easyEdaJson.dataStr.shape;
8448
8448
  if (shapes.length === 0) return void 0;
8449
8449
  const headOrigin = {
@@ -8460,7 +8460,7 @@ var generateSymbolTsx = (easyEdaJson, circuitJson) => {
8460
8460
  easyEdaJson,
8461
8461
  circuitJson
8462
8462
  );
8463
- const shapeTsx = shapes.map(
8463
+ const shapeTsx = shapes.filter((shape) => includePorts || shape.type !== "PIN").map(
8464
8464
  (shape) => generateShapeTsx({
8465
8465
  shape,
8466
8466
  origin,
@@ -8571,7 +8571,11 @@ var convertBetterEasyToTsx = async ({
8571
8571
  const crystalFrequency = componentType === "crystal" ? betterEasy.dataStr.head.c_para.Value?.trim() : void 0;
8572
8572
  const crystalPinVariant = componentType !== "crystal" ? void 0 : sourcePorts.length === 4 ? "four_pin" : sourcePorts.length === 2 ? "two_pin" : void 0;
8573
8573
  const isMultiPinDiode = isDiodeCategoryComponent(betterEasy) && sourcePorts.length !== 2;
8574
- const symbolTsx = componentType === "chip" && !isMultiPinDiode && hasNonBoxSchematicSymbol(betterEasy) ? generateSymbolTsx(betterEasy, circuitJson) : void 0;
8574
+ const isPassiveWithCustomSymbol = componentType === "capacitor" || componentType === "resistor";
8575
+ const symbolTsx = isPassiveWithCustomSymbol || componentType === "chip" && !isMultiPinDiode && hasNonBoxSchematicSymbol(betterEasy) ? generateSymbolTsx(betterEasy, circuitJson, {
8576
+ // Passive primitives already create their two source ports.
8577
+ includePorts: !isPassiveWithCustomSymbol
8578
+ }) : void 0;
8575
8579
  return generateTypescriptComponent({
8576
8580
  componentName,
8577
8581
  manufacturerPartNumber,