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.
@@ -9936,6 +9936,18 @@ var handleSilkscreenPath = (track, index) => {
9936
9936
  };
9937
9937
  var isCourtyardLayer = (layer) => layer === 13 || layer === 14 || layer === 15;
9938
9938
  var isSilkscreenLayer = (layer) => layer === 3 || layer === 4;
9939
+ var isDocumentLayer = (layer) => layer === 12;
9940
+ var handleFabricationNotePath = (track, index) => pcb_fabrication_note_path.parse({
9941
+ type: "pcb_fabrication_note_path",
9942
+ pcb_fabrication_note_path_id: `pcb_fabrication_note_path_${index + 1}`,
9943
+ pcb_component_id: "pcb_component_1",
9944
+ layer: "top",
9945
+ route: track.points.map((point2) => ({
9946
+ x: mil10ToMm(point2.x),
9947
+ y: mil10ToMm(point2.y)
9948
+ })),
9949
+ stroke_width: mil10ToMm(track.width)
9950
+ });
9939
9951
  var getSideFromLayer = (layer) => {
9940
9952
  if (layer === 4 || layer === 14) return "bottom";
9941
9953
  return "top";
@@ -10286,8 +10298,10 @@ var convertEasyEdaJsonToCircuitJson = (easyEdaJson, {
10286
10298
  let hasFoundDesignator = false;
10287
10299
  easyEdaJson.packageDetail.dataStr.shape.forEach((shape, index) => {
10288
10300
  if (shape.type === "TRACK") {
10289
- if (!isCourtyardLayer(shape.layer)) {
10301
+ if (isSilkscreenLayer(shape.layer)) {
10290
10302
  circuitElements.push(handleSilkscreenPath(shape, index));
10303
+ } else if (isDocumentLayer(shape.layer)) {
10304
+ circuitElements.push(handleFabricationNotePath(shape, index));
10291
10305
  }
10292
10306
  } else if (shape.type === "CIRCLE") {
10293
10307
  if (isSilkscreenLayer(shape.layer)) {
@@ -11464,6 +11478,7 @@ var generateFootprintTsx = (circuitJson, options = {}) => {
11464
11478
  const vias = su(circuitJson).pcb_via.list();
11465
11479
  const silkscreenPaths = su(circuitJson).pcb_silkscreen_path.list();
11466
11480
  const silkscreenTexts = su(circuitJson).pcb_silkscreen_text.list();
11481
+ const fabricationNotePaths = su(circuitJson).pcb_fabrication_note_path.list();
11467
11482
  const courtyardOutlines = su(circuitJson).pcb_courtyard_outline.list();
11468
11483
  const elementStrings = [];
11469
11484
  for (const hole of holes) {
@@ -11540,6 +11555,11 @@ var generateFootprintTsx = (circuitJson, options = {}) => {
11540
11555
  `<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)}"` : ""} />`
11541
11556
  );
11542
11557
  }
11558
+ for (const fabricationNotePath of fabricationNotePaths) {
11559
+ elementStrings.push(
11560
+ `<fabricationnotepath route={${JSON.stringify(fabricationNotePath.route)}} strokeWidth="${mmStr(fabricationNotePath.stroke_width)}" />`
11561
+ );
11562
+ }
11543
11563
  for (const courtyardOutline of courtyardOutlines) {
11544
11564
  elementStrings.push(
11545
11565
  `<courtyardoutline outline={${JSON.stringify(courtyardOutline.outline)}} />`
@@ -12345,7 +12365,7 @@ var getGeneratedComponentType = (betterEasy, pinCount) => {
12345
12365
  if (isSwitchCategoryComponent(betterEasy)) return "switch";
12346
12366
  if (isCapacitorComponent(betterEasy)) return "capacitor";
12347
12367
  if (isResistorComponent(betterEasy) && pinCount === 2) return "resistor";
12348
- if (isInductorComponent(betterEasy)) return "inductor";
12368
+ if (isInductorComponent(betterEasy) && pinCount === 2) return "inductor";
12349
12369
  if (isCrystalComponent(betterEasy)) return "crystal";
12350
12370
  if (isMicroUsbConnectorComponent(betterEasy)) return "connector";
12351
12371
  return "chip";
@@ -12422,8 +12442,9 @@ var convertBetterEasyToTsx = async ({
12422
12442
  const crystalFrequency = componentType === "crystal" ? betterEasy.dataStr.head.c_para.Value?.trim() : void 0;
12423
12443
  const crystalPinVariant = componentType !== "crystal" ? void 0 : sourcePorts.length === 4 ? "four_pin" : sourcePorts.length === 2 ? "two_pin" : void 0;
12424
12444
  const isMultiPinDiode = isDiodeCategoryComponent(betterEasy) && sourcePorts.length !== 2;
12445
+ const isMultiPinInductor = isInductorComponent(betterEasy) && sourcePorts.length !== 2;
12425
12446
  const isPassiveWithCustomSymbol = componentType === "capacitor" || componentType === "resistor";
12426
- const symbolTsx = isPassiveWithCustomSymbol || componentType === "chip" && !isMultiPinDiode && hasNonBoxSchematicSymbol(betterEasy) ? generateSymbolTsx(betterEasy, circuitJson, {
12447
+ const symbolTsx = isPassiveWithCustomSymbol || componentType === "chip" && !isMultiPinDiode && !isMultiPinInductor && hasNonBoxSchematicSymbol(betterEasy) ? generateSymbolTsx(betterEasy, circuitJson, {
12427
12448
  alignPortsToDrawing: isPassiveWithCustomSymbol
12428
12449
  }) : void 0;
12429
12450
  return generateTypescriptComponent({