easyeda 0.0.309 → 0.0.311
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 +24 -3
- package/dist/browser/index.js.map +1 -1
- package/dist/index.js +24 -3
- package/dist/index.js.map +1 -1
- package/dist/main.cjs +25 -4
- package/dist/main.cjs.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -6073,6 +6073,18 @@ var handleSilkscreenPath = (track, index) => {
|
|
|
6073
6073
|
};
|
|
6074
6074
|
var isCourtyardLayer = (layer) => layer === 13 || layer === 14 || layer === 15;
|
|
6075
6075
|
var isSilkscreenLayer = (layer) => layer === 3 || layer === 4;
|
|
6076
|
+
var isDocumentLayer = (layer) => layer === 12;
|
|
6077
|
+
var handleFabricationNotePath = (track, index) => pcb_fabrication_note_path.parse({
|
|
6078
|
+
type: "pcb_fabrication_note_path",
|
|
6079
|
+
pcb_fabrication_note_path_id: `pcb_fabrication_note_path_${index + 1}`,
|
|
6080
|
+
pcb_component_id: "pcb_component_1",
|
|
6081
|
+
layer: "top",
|
|
6082
|
+
route: track.points.map((point2) => ({
|
|
6083
|
+
x: mil10ToMm(point2.x),
|
|
6084
|
+
y: mil10ToMm(point2.y)
|
|
6085
|
+
})),
|
|
6086
|
+
stroke_width: mil10ToMm(track.width)
|
|
6087
|
+
});
|
|
6076
6088
|
var getSideFromLayer = (layer) => {
|
|
6077
6089
|
if (layer === 4 || layer === 14) return "bottom";
|
|
6078
6090
|
return "top";
|
|
@@ -6423,8 +6435,10 @@ var convertEasyEdaJsonToCircuitJson = (easyEdaJson, {
|
|
|
6423
6435
|
let hasFoundDesignator = false;
|
|
6424
6436
|
easyEdaJson.packageDetail.dataStr.shape.forEach((shape, index) => {
|
|
6425
6437
|
if (shape.type === "TRACK") {
|
|
6426
|
-
if (
|
|
6438
|
+
if (isSilkscreenLayer(shape.layer)) {
|
|
6427
6439
|
circuitElements.push(handleSilkscreenPath(shape, index));
|
|
6440
|
+
} else if (isDocumentLayer(shape.layer)) {
|
|
6441
|
+
circuitElements.push(handleFabricationNotePath(shape, index));
|
|
6428
6442
|
}
|
|
6429
6443
|
} else if (shape.type === "CIRCLE") {
|
|
6430
6444
|
if (isSilkscreenLayer(shape.layer)) {
|
|
@@ -7765,6 +7779,7 @@ var generateFootprintTsx = (circuitJson, options = {}) => {
|
|
|
7765
7779
|
const vias = su(circuitJson).pcb_via.list();
|
|
7766
7780
|
const silkscreenPaths = su(circuitJson).pcb_silkscreen_path.list();
|
|
7767
7781
|
const silkscreenTexts = su(circuitJson).pcb_silkscreen_text.list();
|
|
7782
|
+
const fabricationNotePaths = su(circuitJson).pcb_fabrication_note_path.list();
|
|
7768
7783
|
const courtyardOutlines = su(circuitJson).pcb_courtyard_outline.list();
|
|
7769
7784
|
const elementStrings = [];
|
|
7770
7785
|
for (const hole of holes) {
|
|
@@ -7841,6 +7856,11 @@ var generateFootprintTsx = (circuitJson, options = {}) => {
|
|
|
7841
7856
|
`<silkscreentext text=${textValue} pcbX="${mmStr(silkscreenText.anchor_position.x)}" pcbY="${mmStr(silkscreenText.anchor_position.y)}" anchorAlignment="${silkscreenText.anchor_alignment}"${rotationAttr}${silkscreenText.font_size ? ` fontSize="${mmStr(silkscreenText.font_size)}"` : ""} />`
|
|
7842
7857
|
);
|
|
7843
7858
|
}
|
|
7859
|
+
for (const fabricationNotePath of fabricationNotePaths) {
|
|
7860
|
+
elementStrings.push(
|
|
7861
|
+
`<fabricationnotepath route={${JSON.stringify(fabricationNotePath.route)}} strokeWidth="${mmStr(fabricationNotePath.stroke_width)}" />`
|
|
7862
|
+
);
|
|
7863
|
+
}
|
|
7844
7864
|
for (const courtyardOutline of courtyardOutlines) {
|
|
7845
7865
|
elementStrings.push(
|
|
7846
7866
|
`<courtyardoutline outline={${JSON.stringify(courtyardOutline.outline)}} />`
|
|
@@ -8646,7 +8666,7 @@ var getGeneratedComponentType = (betterEasy, pinCount) => {
|
|
|
8646
8666
|
if (isSwitchCategoryComponent(betterEasy)) return "switch";
|
|
8647
8667
|
if (isCapacitorComponent(betterEasy)) return "capacitor";
|
|
8648
8668
|
if (isResistorComponent(betterEasy) && pinCount === 2) return "resistor";
|
|
8649
|
-
if (isInductorComponent(betterEasy)) return "inductor";
|
|
8669
|
+
if (isInductorComponent(betterEasy) && pinCount === 2) return "inductor";
|
|
8650
8670
|
if (isCrystalComponent(betterEasy)) return "crystal";
|
|
8651
8671
|
if (isMicroUsbConnectorComponent(betterEasy)) return "connector";
|
|
8652
8672
|
return "chip";
|
|
@@ -8723,8 +8743,9 @@ var convertBetterEasyToTsx = async ({
|
|
|
8723
8743
|
const crystalFrequency = componentType === "crystal" ? betterEasy.dataStr.head.c_para.Value?.trim() : void 0;
|
|
8724
8744
|
const crystalPinVariant = componentType !== "crystal" ? void 0 : sourcePorts.length === 4 ? "four_pin" : sourcePorts.length === 2 ? "two_pin" : void 0;
|
|
8725
8745
|
const isMultiPinDiode = isDiodeCategoryComponent(betterEasy) && sourcePorts.length !== 2;
|
|
8746
|
+
const isMultiPinInductor = isInductorComponent(betterEasy) && sourcePorts.length !== 2;
|
|
8726
8747
|
const isPassiveWithCustomSymbol = componentType === "capacitor" || componentType === "resistor";
|
|
8727
|
-
const symbolTsx = isPassiveWithCustomSymbol || componentType === "chip" && !isMultiPinDiode && hasNonBoxSchematicSymbol(betterEasy) ? generateSymbolTsx(betterEasy, circuitJson, {
|
|
8748
|
+
const symbolTsx = isPassiveWithCustomSymbol || componentType === "chip" && !isMultiPinDiode && !isMultiPinInductor && hasNonBoxSchematicSymbol(betterEasy) ? generateSymbolTsx(betterEasy, circuitJson, {
|
|
8728
8749
|
alignPortsToDrawing: isPassiveWithCustomSymbol
|
|
8729
8750
|
}) : void 0;
|
|
8730
8751
|
return generateTypescriptComponent({
|