easyeda 0.0.306 → 0.0.308

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
@@ -3528,7 +3528,7 @@ var import_promises = __toESM(require("fs/promises"), 1);
3528
3528
  var package_default = {
3529
3529
  name: "easyeda",
3530
3530
  type: "module",
3531
- version: "0.0.305",
3531
+ version: "0.0.307",
3532
3532
  files: [
3533
3533
  "dist"
3534
3534
  ],
@@ -10045,6 +10045,9 @@ var convertEasyEdaJsonToCircuitJson = (easyEdaJson, {
10045
10045
  R: "bottom_right"
10046
10046
  }[shape.textAnchor ?? "L"],
10047
10047
  font_size: shape.size_mm || 1,
10048
+ ...shape.rotation !== void 0 && {
10049
+ ccw_rotation: shape.rotation
10050
+ },
10048
10051
  layer: "top"
10049
10052
  })
10050
10053
  );
@@ -10537,7 +10540,18 @@ var ShapeItemSchema = import_zod179.z.object({
10537
10540
  });
10538
10541
  }
10539
10542
  case "TEXT": {
10540
- const [textAnchor, x, y, size2, layer, id, rotation2, , font, text] = shape.data.split("~");
10543
+ const [
10544
+ textAnchor,
10545
+ x,
10546
+ y,
10547
+ size2,
10548
+ rotation2,
10549
+ _mirror,
10550
+ layer,
10551
+ _net,
10552
+ font,
10553
+ text
10554
+ ] = shape.data.split("~");
10541
10555
  const r = rotation2 ? Number(rotation2) : void 0;
10542
10556
  return TextSchema.parse({
10543
10557
  type: "TEXT",
@@ -10547,7 +10561,6 @@ var ShapeItemSchema = import_zod179.z.object({
10547
10561
  size_mm: Number(size2) * 2.54,
10548
10562
  // empirically this seems to match, C5248081 is a good test case
10549
10563
  layer: layer ? Number(layer) : void 0,
10550
- id,
10551
10564
  rotation: Number.isNaN(r) ? void 0 : r,
10552
10565
  textAnchor,
10553
10566
  font: font || void 0
@@ -11229,8 +11242,10 @@ var generateFootprintTsx = (circuitJson, options = {}) => {
11229
11242
  for (const silkscreenText of silkscreenTexts) {
11230
11243
  const isRefDes = silkscreenText.text === "{NAME}";
11231
11244
  const textValue = isRefDes ? JSON.stringify("{NAME}") : JSON.stringify(silkscreenText.text);
11245
+ const rotation2 = silkscreenText.ccw_rotation || 0;
11246
+ const rotationAttr = rotation2 ? ` pcbRotation="${rotation2}deg"` : "";
11232
11247
  elementStrings.push(
11233
- `<silkscreentext text=${textValue} pcbX="${mmStr(silkscreenText.anchor_position.x)}" pcbY="${mmStr(silkscreenText.anchor_position.y)}" anchorAlignment="${silkscreenText.anchor_alignment}" ${silkscreenText.font_size ? `fontSize="${mmStr(silkscreenText.font_size)}"` : ""} />`
11248
+ `<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)}"` : ""} />`
11234
11249
  );
11235
11250
  }
11236
11251
  for (const courtyardOutline of courtyardOutlines) {