easyeda 0.0.306 → 0.0.307

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/index.js CHANGED
@@ -6464,6 +6464,9 @@ var convertEasyEdaJsonToCircuitJson = (easyEdaJson, {
6464
6464
  R: "bottom_right"
6465
6465
  }[shape.textAnchor ?? "L"],
6466
6466
  font_size: shape.size_mm || 1,
6467
+ ...shape.rotation !== void 0 && {
6468
+ ccw_rotation: shape.rotation
6469
+ },
6467
6470
  layer: "top"
6468
6471
  })
6469
6472
  );
@@ -7130,7 +7133,18 @@ var ShapeItemSchema = z179.object({
7130
7133
  });
7131
7134
  }
7132
7135
  case "TEXT": {
7133
- const [textAnchor, x, y, size2, layer, id, rotation2, , font, text] = shape.data.split("~");
7136
+ const [
7137
+ textAnchor,
7138
+ x,
7139
+ y,
7140
+ size2,
7141
+ rotation2,
7142
+ _mirror,
7143
+ layer,
7144
+ _net,
7145
+ font,
7146
+ text
7147
+ ] = shape.data.split("~");
7134
7148
  const r = rotation2 ? Number(rotation2) : void 0;
7135
7149
  return TextSchema.parse({
7136
7150
  type: "TEXT",
@@ -7140,7 +7154,6 @@ var ShapeItemSchema = z179.object({
7140
7154
  size_mm: Number(size2) * 2.54,
7141
7155
  // empirically this seems to match, C5248081 is a good test case
7142
7156
  layer: layer ? Number(layer) : void 0,
7143
- id,
7144
7157
  rotation: Number.isNaN(r) ? void 0 : r,
7145
7158
  textAnchor,
7146
7159
  font: font || void 0
@@ -7822,8 +7835,10 @@ var generateFootprintTsx = (circuitJson, options = {}) => {
7822
7835
  for (const silkscreenText of silkscreenTexts) {
7823
7836
  const isRefDes = silkscreenText.text === "{NAME}";
7824
7837
  const textValue = isRefDes ? JSON.stringify("{NAME}") : JSON.stringify(silkscreenText.text);
7838
+ const rotation2 = silkscreenText.ccw_rotation || 0;
7839
+ const rotationAttr = rotation2 ? ` pcbRotation="${rotation2}deg"` : "";
7825
7840
  elementStrings.push(
7826
- `<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)}"` : ""} />`
7841
+ `<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)}"` : ""} />`
7827
7842
  );
7828
7843
  }
7829
7844
  for (const courtyardOutline of courtyardOutlines) {