easyeda 0.0.336 → 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/main.cjs CHANGED
@@ -1026,7 +1026,7 @@ var import_promises = __toESM(require("fs/promises"), 1);
1026
1026
  var package_default = {
1027
1027
  name: "easyeda",
1028
1028
  type: "module",
1029
- version: "0.0.335",
1029
+ version: "0.0.336",
1030
1030
  files: [
1031
1031
  "dist"
1032
1032
  ],
@@ -9747,6 +9747,11 @@ ${polarizedPinLabelsString}
9747
9747
 
9748
9748
  ` : "";
9749
9749
  const polarizedPinLabelsProp = polarizedPinLabels ? ` pinLabels={pinLabels}
9750
+ ` : "";
9751
+ const isPolarizedCapacitor = componentType === "capacitor" && circuitJson.filter((item) => item.type === "source_port").length === 2 && polarizedPinMetadata !== void 0;
9752
+ const capacitorPolarizedPinLabelsBlock = isPolarizedCapacitor ? polarizedPinLabelsBlock : "";
9753
+ const capacitorPolarizedPinLabelsProp = isPolarizedCapacitor ? polarizedPinLabelsProp : "";
9754
+ const polarizedProp = isPolarizedCapacitor ? ` polarized
9750
9755
  ` : "";
9751
9756
  const symbolProp = symbolTsx ? ` symbol={
9752
9757
  ${symbolTsx.split("\n").map((line) => ` ${line}`).join("\n")}
@@ -9865,14 +9870,14 @@ ${cadModelLines}
9865
9870
  return `
9866
9871
  import type { CapacitorProps } from "@tscircuit/props"
9867
9872
 
9868
- export const ${componentName} = (props: Omit<CapacitorProps, "capacitance">) => {
9873
+ ${capacitorPolarizedPinLabelsBlock}export const ${componentName} = (props: Omit<CapacitorProps, "capacitance">) => {
9869
9874
  const { name = "C1", ...restProps } = props
9870
9875
 
9871
9876
  return (
9872
9877
  <capacitor
9873
9878
  name={name}
9874
9879
  capacitance=${JSON.stringify(capacitance2)}
9875
- ${symbolProp} supplierPartNumbers={${JSON.stringify(supplierPartNumbers, null, " ")}}
9880
+ ${capacitorPolarizedPinLabelsProp}${polarizedProp}${symbolProp} supplierPartNumbers={${JSON.stringify(supplierPartNumbers, null, " ")}}
9876
9881
  manufacturerPartNumber="${manufacturerPartNumber}"
9877
9882
  footprint={${footprintTsx}}
9878
9883
  ${objUrl || stepUrl ? `cadModel={{
@@ -10262,7 +10267,7 @@ var convertBetterEasyToTsx = async ({
10262
10267
  const crystalPinVariant = componentType !== "crystal" ? void 0 : sourcePorts.length === 4 ? "four_pin" : sourcePorts.length === 2 ? "two_pin" : void 0;
10263
10268
  const isMultiPinDiode = isDiodeCategoryComponent(betterEasy) && sourcePorts.length !== 2;
10264
10269
  const isMultiPinInductor = isInductorComponent(betterEasy) && sourcePorts.length !== 2;
10265
- const isPassiveWithCustomSymbol = componentType === "capacitor";
10270
+ const isPassiveWithCustomSymbol = componentType === "capacitor" && sourcePorts.length !== 2;
10266
10271
  const symbolTsx = isPassiveWithCustomSymbol || componentType === "chip" && !isMultiPinDiode && !isMultiPinInductor && hasNonBoxSchematicSymbol(betterEasy) ? generateSymbolTsx(betterEasy, circuitJson, {
10267
10272
  alignPortsToDrawing: isPassiveWithCustomSymbol
10268
10273
  }) : void 0;