easyeda 0.0.291 → 0.0.293
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 +39 -4
- package/dist/browser/index.js.map +1 -1
- package/dist/index.js +39 -4
- package/dist/index.js.map +1 -1
- package/dist/main.cjs +40 -5
- package/dist/main.cjs.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -7944,6 +7944,30 @@ ${cadModelLines}
|
|
|
7944
7944
|
/>
|
|
7945
7945
|
)
|
|
7946
7946
|
}
|
|
7947
|
+
`.trim();
|
|
7948
|
+
}
|
|
7949
|
+
if (componentType === "connector") {
|
|
7950
|
+
return `
|
|
7951
|
+
import type { ConnectorProps } from "@tscircuit/props"
|
|
7952
|
+
|
|
7953
|
+
const pinLabels = {
|
|
7954
|
+
${pinLabelsString}
|
|
7955
|
+
} as const
|
|
7956
|
+
|
|
7957
|
+
export const ${componentName} = (props: ConnectorProps) => {
|
|
7958
|
+
return (
|
|
7959
|
+
<connector
|
|
7960
|
+
pinLabels={pinLabels}
|
|
7961
|
+
supplierPartNumbers={${JSON.stringify(supplierPartNumbers, null, " ")}}
|
|
7962
|
+
manufacturerPartNumber="${manufacturerPartNumber}"
|
|
7963
|
+
footprint={${footprintTsx}}
|
|
7964
|
+
${objUrl || stepUrl ? `cadModel={{
|
|
7965
|
+
${cadModelLines}
|
|
7966
|
+
}}` : ""}
|
|
7967
|
+
{...props}
|
|
7968
|
+
/>
|
|
7969
|
+
)
|
|
7970
|
+
}
|
|
7947
7971
|
`.trim();
|
|
7948
7972
|
}
|
|
7949
7973
|
return `
|
|
@@ -7988,6 +8012,12 @@ var isInductorComponent = (betterEasy) => {
|
|
|
7988
8012
|
return packageName?.toUpperCase().startsWith("IND-") === true && typeof value === "string" && inductancePattern.test(value.trim());
|
|
7989
8013
|
};
|
|
7990
8014
|
|
|
8015
|
+
// lib/websafe/convert-to-typescript-component/is-micro-usb-connector-component.ts
|
|
8016
|
+
var isMicroUsbConnectorComponent = (betterEasy) => {
|
|
8017
|
+
const componentParameters = betterEasy.dataStr.head.c_para;
|
|
8018
|
+
return componentParameters.pre === "USB?" && componentParameters.package?.toUpperCase().startsWith("MICRO-USB-") === true;
|
|
8019
|
+
};
|
|
8020
|
+
|
|
7991
8021
|
// lib/websafe/convert-to-typescript-component/category-value-contains-pushbutton.ts
|
|
7992
8022
|
var categoryValueContainsPushbutton = (value) => {
|
|
7993
8023
|
if (typeof value === "string") {
|
|
@@ -8351,13 +8381,14 @@ var hasNonBoxSchematicSymbol = (easyEdaJson) => {
|
|
|
8351
8381
|
};
|
|
8352
8382
|
|
|
8353
8383
|
// lib/websafe/convert-to-typescript-component/index.tsx
|
|
8354
|
-
var getGeneratedComponentType = (betterEasy) => {
|
|
8384
|
+
var getGeneratedComponentType = (betterEasy, pinCount) => {
|
|
8355
8385
|
if (isLedCategoryComponent(betterEasy)) return "led";
|
|
8356
|
-
if (isDiodeCategoryComponent(betterEasy)) return "diode";
|
|
8386
|
+
if (isDiodeCategoryComponent(betterEasy) && pinCount === 2) return "diode";
|
|
8357
8387
|
if (isPushbuttonCategoryComponent(betterEasy)) return "pushbutton";
|
|
8358
8388
|
if (isSwitchCategoryComponent(betterEasy)) return "switch";
|
|
8359
8389
|
if (isInductorComponent(betterEasy)) return "inductor";
|
|
8360
8390
|
if (isCrystalComponent(betterEasy)) return "crystal";
|
|
8391
|
+
if (isMicroUsbConnectorComponent(betterEasy)) return "connector";
|
|
8361
8392
|
return "chip";
|
|
8362
8393
|
};
|
|
8363
8394
|
var convertRawEasyToTsx = async ({ rawEasy }) => {
|
|
@@ -8422,11 +8453,15 @@ var convertBetterEasyToTsx = async ({
|
|
|
8422
8453
|
const supplierPartNumbers = {
|
|
8423
8454
|
jlcpcb: [betterEasy.lcsc.number]
|
|
8424
8455
|
};
|
|
8425
|
-
const componentType = getGeneratedComponentType(
|
|
8456
|
+
const componentType = getGeneratedComponentType(
|
|
8457
|
+
betterEasy,
|
|
8458
|
+
sourcePorts.length
|
|
8459
|
+
);
|
|
8426
8460
|
const inductance2 = componentType === "inductor" ? betterEasy.dataStr.head.c_para.Value?.trim() : void 0;
|
|
8427
8461
|
const crystalFrequency = componentType === "crystal" ? betterEasy.dataStr.head.c_para.Value?.trim() : void 0;
|
|
8428
8462
|
const crystalPinVariant = componentType !== "crystal" ? void 0 : sourcePorts.length === 4 ? "four_pin" : sourcePorts.length === 2 ? "two_pin" : void 0;
|
|
8429
|
-
const
|
|
8463
|
+
const isMultiPinDiode = isDiodeCategoryComponent(betterEasy) && sourcePorts.length !== 2;
|
|
8464
|
+
const symbolTsx = componentType === "chip" && !isMultiPinDiode && hasNonBoxSchematicSymbol(betterEasy) ? generateSymbolTsx(betterEasy, circuitJson) : void 0;
|
|
8430
8465
|
return generateTypescriptComponent({
|
|
8431
8466
|
componentName,
|
|
8432
8467
|
manufacturerPartNumber,
|