easyeda 0.0.296 → 0.0.297

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.
@@ -11609,7 +11609,7 @@ export const ${componentName} = (props: Omit<CapacitorProps, "capacitance">) =>
11609
11609
  <capacitor
11610
11610
  name={name}
11611
11611
  capacitance=${JSON.stringify(capacitance2)}
11612
- supplierPartNumbers={${JSON.stringify(supplierPartNumbers, null, " ")}}
11612
+ ${symbolProp} supplierPartNumbers={${JSON.stringify(supplierPartNumbers, null, " ")}}
11613
11613
  manufacturerPartNumber="${manufacturerPartNumber}"
11614
11614
  footprint={${footprintTsx}}
11615
11615
  ${objUrl || stepUrl ? `cadModel={{
@@ -11635,7 +11635,7 @@ export const ${componentName} = (props: Omit<ResistorProps, "resistance">) => {
11635
11635
  <resistor
11636
11636
  name={name}
11637
11637
  resistance=${JSON.stringify(resistance2)}
11638
- supplierPartNumbers={${JSON.stringify(supplierPartNumbers, null, " ")}}
11638
+ ${symbolProp} supplierPartNumbers={${JSON.stringify(supplierPartNumbers, null, " ")}}
11639
11639
  manufacturerPartNumber="${manufacturerPartNumber}"
11640
11640
  footprint={${footprintTsx}}
11641
11641
  ${objUrl || stepUrl ? `cadModel={{
@@ -12142,7 +12142,7 @@ var generateShapeTsx = ({
12142
12142
  }
12143
12143
  return void 0;
12144
12144
  };
12145
- var generateSymbolTsx = (easyEdaJson, circuitJson) => {
12145
+ var generateSymbolTsx = (easyEdaJson, circuitJson, { includePorts = true } = {}) => {
12146
12146
  const shapes = easyEdaJson.dataStr.shape;
12147
12147
  if (shapes.length === 0) return void 0;
12148
12148
  const headOrigin = {
@@ -12159,7 +12159,7 @@ var generateSymbolTsx = (easyEdaJson, circuitJson) => {
12159
12159
  easyEdaJson,
12160
12160
  circuitJson
12161
12161
  );
12162
- const shapeTsx = shapes.map(
12162
+ const shapeTsx = shapes.filter((shape) => includePorts || shape.type !== "PIN").map(
12163
12163
  (shape) => generateShapeTsx({
12164
12164
  shape,
12165
12165
  origin,
@@ -12270,7 +12270,11 @@ var convertBetterEasyToTsx = async ({
12270
12270
  const crystalFrequency = componentType === "crystal" ? betterEasy.dataStr.head.c_para.Value?.trim() : void 0;
12271
12271
  const crystalPinVariant = componentType !== "crystal" ? void 0 : sourcePorts.length === 4 ? "four_pin" : sourcePorts.length === 2 ? "two_pin" : void 0;
12272
12272
  const isMultiPinDiode = isDiodeCategoryComponent(betterEasy) && sourcePorts.length !== 2;
12273
- const symbolTsx = componentType === "chip" && !isMultiPinDiode && hasNonBoxSchematicSymbol(betterEasy) ? generateSymbolTsx(betterEasy, circuitJson) : void 0;
12273
+ const isPassiveWithCustomSymbol = componentType === "capacitor" || componentType === "resistor";
12274
+ const symbolTsx = isPassiveWithCustomSymbol || componentType === "chip" && !isMultiPinDiode && hasNonBoxSchematicSymbol(betterEasy) ? generateSymbolTsx(betterEasy, circuitJson, {
12275
+ // Passive primitives already create their two source ports.
12276
+ includePorts: !isPassiveWithCustomSymbol
12277
+ }) : void 0;
12274
12278
  return generateTypescriptComponent({
12275
12279
  componentName,
12276
12280
  manufacturerPartNumber,