easyeda 0.0.292 → 0.0.294
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/browser/index.js +9 -5
- package/dist/browser/index.js.map +1 -1
- package/dist/index.js +9 -5
- package/dist/index.js.map +1 -1
- package/dist/main.cjs +10 -6
- package/dist/main.cjs.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -8381,9 +8381,9 @@ var hasNonBoxSchematicSymbol = (easyEdaJson) => {
|
|
|
8381
8381
|
};
|
|
8382
8382
|
|
|
8383
8383
|
// lib/websafe/convert-to-typescript-component/index.tsx
|
|
8384
|
-
var getGeneratedComponentType = (betterEasy) => {
|
|
8385
|
-
if (isLedCategoryComponent(betterEasy)) return "led";
|
|
8386
|
-
if (isDiodeCategoryComponent(betterEasy)) return "diode";
|
|
8384
|
+
var getGeneratedComponentType = (betterEasy, pinCount) => {
|
|
8385
|
+
if (isLedCategoryComponent(betterEasy) && pinCount === 2) return "led";
|
|
8386
|
+
if (isDiodeCategoryComponent(betterEasy) && pinCount === 2) return "diode";
|
|
8387
8387
|
if (isPushbuttonCategoryComponent(betterEasy)) return "pushbutton";
|
|
8388
8388
|
if (isSwitchCategoryComponent(betterEasy)) return "switch";
|
|
8389
8389
|
if (isInductorComponent(betterEasy)) return "inductor";
|
|
@@ -8453,11 +8453,15 @@ var convertBetterEasyToTsx = async ({
|
|
|
8453
8453
|
const supplierPartNumbers = {
|
|
8454
8454
|
jlcpcb: [betterEasy.lcsc.number]
|
|
8455
8455
|
};
|
|
8456
|
-
const componentType = getGeneratedComponentType(
|
|
8456
|
+
const componentType = getGeneratedComponentType(
|
|
8457
|
+
betterEasy,
|
|
8458
|
+
sourcePorts.length
|
|
8459
|
+
);
|
|
8457
8460
|
const inductance2 = componentType === "inductor" ? betterEasy.dataStr.head.c_para.Value?.trim() : void 0;
|
|
8458
8461
|
const crystalFrequency = componentType === "crystal" ? betterEasy.dataStr.head.c_para.Value?.trim() : void 0;
|
|
8459
8462
|
const crystalPinVariant = componentType !== "crystal" ? void 0 : sourcePorts.length === 4 ? "four_pin" : sourcePorts.length === 2 ? "two_pin" : void 0;
|
|
8460
|
-
const
|
|
8463
|
+
const isMultiPinDiode = isDiodeCategoryComponent(betterEasy) && sourcePorts.length !== 2;
|
|
8464
|
+
const symbolTsx = componentType === "chip" && !isMultiPinDiode && hasNonBoxSchematicSymbol(betterEasy) ? generateSymbolTsx(betterEasy, circuitJson) : void 0;
|
|
8461
8465
|
return generateTypescriptComponent({
|
|
8462
8466
|
componentName,
|
|
8463
8467
|
manufacturerPartNumber,
|