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/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.308",
3531
+ version: "0.0.310",
3532
3532
  files: [
3533
3533
  "dist"
3534
3534
  ],
@@ -9654,6 +9654,18 @@ var handleSilkscreenPath = (track, index) => {
9654
9654
  };
9655
9655
  var isCourtyardLayer = (layer) => layer === 13 || layer === 14 || layer === 15;
9656
9656
  var isSilkscreenLayer = (layer) => layer === 3 || layer === 4;
9657
+ var isDocumentLayer = (layer) => layer === 12;
9658
+ var handleFabricationNotePath = (track, index) => pcb_fabrication_note_path.parse({
9659
+ type: "pcb_fabrication_note_path",
9660
+ pcb_fabrication_note_path_id: `pcb_fabrication_note_path_${index + 1}`,
9661
+ pcb_component_id: "pcb_component_1",
9662
+ layer: "top",
9663
+ route: track.points.map((point2) => ({
9664
+ x: mil10ToMm(point2.x),
9665
+ y: mil10ToMm(point2.y)
9666
+ })),
9667
+ stroke_width: mil10ToMm(track.width)
9668
+ });
9657
9669
  var getSideFromLayer = (layer) => {
9658
9670
  if (layer === 4 || layer === 14) return "bottom";
9659
9671
  return "top";
@@ -10004,8 +10016,10 @@ var convertEasyEdaJsonToCircuitJson = (easyEdaJson, {
10004
10016
  let hasFoundDesignator = false;
10005
10017
  easyEdaJson.packageDetail.dataStr.shape.forEach((shape, index) => {
10006
10018
  if (shape.type === "TRACK") {
10007
- if (!isCourtyardLayer(shape.layer)) {
10019
+ if (isSilkscreenLayer(shape.layer)) {
10008
10020
  circuitElements.push(handleSilkscreenPath(shape, index));
10021
+ } else if (isDocumentLayer(shape.layer)) {
10022
+ circuitElements.push(handleFabricationNotePath(shape, index));
10009
10023
  }
10010
10024
  } else if (shape.type === "CIRCLE") {
10011
10025
  if (isSilkscreenLayer(shape.layer)) {
@@ -11172,6 +11186,7 @@ var generateFootprintTsx = (circuitJson, options = {}) => {
11172
11186
  const vias = su(circuitJson).pcb_via.list();
11173
11187
  const silkscreenPaths = su(circuitJson).pcb_silkscreen_path.list();
11174
11188
  const silkscreenTexts = su(circuitJson).pcb_silkscreen_text.list();
11189
+ const fabricationNotePaths = su(circuitJson).pcb_fabrication_note_path.list();
11175
11190
  const courtyardOutlines = su(circuitJson).pcb_courtyard_outline.list();
11176
11191
  const elementStrings = [];
11177
11192
  for (const hole of holes) {
@@ -11248,6 +11263,11 @@ var generateFootprintTsx = (circuitJson, options = {}) => {
11248
11263
  `<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)}"` : ""} />`
11249
11264
  );
11250
11265
  }
11266
+ for (const fabricationNotePath of fabricationNotePaths) {
11267
+ elementStrings.push(
11268
+ `<fabricationnotepath route={${JSON.stringify(fabricationNotePath.route)}} strokeWidth="${mmStr(fabricationNotePath.stroke_width)}" />`
11269
+ );
11270
+ }
11251
11271
  for (const courtyardOutline of courtyardOutlines) {
11252
11272
  elementStrings.push(
11253
11273
  `<courtyardoutline outline={${JSON.stringify(courtyardOutline.outline)}} />`
@@ -12053,7 +12073,7 @@ var getGeneratedComponentType = (betterEasy, pinCount) => {
12053
12073
  if (isSwitchCategoryComponent(betterEasy)) return "switch";
12054
12074
  if (isCapacitorComponent(betterEasy)) return "capacitor";
12055
12075
  if (isResistorComponent(betterEasy) && pinCount === 2) return "resistor";
12056
- if (isInductorComponent(betterEasy)) return "inductor";
12076
+ if (isInductorComponent(betterEasy) && pinCount === 2) return "inductor";
12057
12077
  if (isCrystalComponent(betterEasy)) return "crystal";
12058
12078
  if (isMicroUsbConnectorComponent(betterEasy)) return "connector";
12059
12079
  return "chip";
@@ -12130,8 +12150,9 @@ var convertBetterEasyToTsx = async ({
12130
12150
  const crystalFrequency = componentType === "crystal" ? betterEasy.dataStr.head.c_para.Value?.trim() : void 0;
12131
12151
  const crystalPinVariant = componentType !== "crystal" ? void 0 : sourcePorts.length === 4 ? "four_pin" : sourcePorts.length === 2 ? "two_pin" : void 0;
12132
12152
  const isMultiPinDiode = isDiodeCategoryComponent(betterEasy) && sourcePorts.length !== 2;
12153
+ const isMultiPinInductor = isInductorComponent(betterEasy) && sourcePorts.length !== 2;
12133
12154
  const isPassiveWithCustomSymbol = componentType === "capacitor" || componentType === "resistor";
12134
- const symbolTsx = isPassiveWithCustomSymbol || componentType === "chip" && !isMultiPinDiode && hasNonBoxSchematicSymbol(betterEasy) ? generateSymbolTsx(betterEasy, circuitJson, {
12155
+ const symbolTsx = isPassiveWithCustomSymbol || componentType === "chip" && !isMultiPinDiode && !isMultiPinInductor && hasNonBoxSchematicSymbol(betterEasy) ? generateSymbolTsx(betterEasy, circuitJson, {
12135
12156
  alignPortsToDrawing: isPassiveWithCustomSymbol
12136
12157
  }) : void 0;
12137
12158
  return generateTypescriptComponent({