easyeda 0.0.335 → 0.0.337

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
@@ -8842,6 +8842,11 @@ ${polarizedPinLabelsString}
8842
8842
 
8843
8843
  ` : "";
8844
8844
  const polarizedPinLabelsProp = polarizedPinLabels ? ` pinLabels={pinLabels}
8845
+ ` : "";
8846
+ const isPolarizedCapacitor = componentType === "capacitor" && circuitJson.filter((item) => item.type === "source_port").length === 2 && polarizedPinMetadata !== void 0;
8847
+ const capacitorPolarizedPinLabelsBlock = isPolarizedCapacitor ? polarizedPinLabelsBlock : "";
8848
+ const capacitorPolarizedPinLabelsProp = isPolarizedCapacitor ? polarizedPinLabelsProp : "";
8849
+ const polarizedProp = isPolarizedCapacitor ? ` polarized
8845
8850
  ` : "";
8846
8851
  const symbolProp = symbolTsx ? ` symbol={
8847
8852
  ${symbolTsx.split("\n").map((line) => ` ${line}`).join("\n")}
@@ -8960,14 +8965,14 @@ ${cadModelLines}
8960
8965
  return `
8961
8966
  import type { CapacitorProps } from "@tscircuit/props"
8962
8967
 
8963
- export const ${componentName} = (props: Omit<CapacitorProps, "capacitance">) => {
8968
+ ${capacitorPolarizedPinLabelsBlock}export const ${componentName} = (props: Omit<CapacitorProps, "capacitance">) => {
8964
8969
  const { name = "C1", ...restProps } = props
8965
8970
 
8966
8971
  return (
8967
8972
  <capacitor
8968
8973
  name={name}
8969
8974
  capacitance=${JSON.stringify(capacitance2)}
8970
- ${symbolProp} supplierPartNumbers={${JSON.stringify(supplierPartNumbers, null, " ")}}
8975
+ ${capacitorPolarizedPinLabelsProp}${polarizedProp}${symbolProp} supplierPartNumbers={${JSON.stringify(supplierPartNumbers, null, " ")}}
8971
8976
  manufacturerPartNumber="${manufacturerPartNumber}"
8972
8977
  footprint={${footprintTsx}}
8973
8978
  ${objUrl || stepUrl ? `cadModel={{
@@ -9357,7 +9362,7 @@ var convertBetterEasyToTsx = async ({
9357
9362
  const crystalPinVariant = componentType !== "crystal" ? void 0 : sourcePorts.length === 4 ? "four_pin" : sourcePorts.length === 2 ? "two_pin" : void 0;
9358
9363
  const isMultiPinDiode = isDiodeCategoryComponent(betterEasy) && sourcePorts.length !== 2;
9359
9364
  const isMultiPinInductor = isInductorComponent(betterEasy) && sourcePorts.length !== 2;
9360
- const isPassiveWithCustomSymbol = componentType === "capacitor" || componentType === "resistor";
9365
+ const isPassiveWithCustomSymbol = componentType === "capacitor" && sourcePorts.length !== 2;
9361
9366
  const symbolTsx = isPassiveWithCustomSymbol || componentType === "chip" && !isMultiPinDiode && !isMultiPinInductor && hasNonBoxSchematicSymbol(betterEasy) ? generateSymbolTsx(betterEasy, circuitJson, {
9362
9367
  alignPortsToDrawing: isPassiveWithCustomSymbol
9363
9368
  }) : void 0;