easyeda 0.0.233 → 0.0.235

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.d.ts CHANGED
@@ -243,7 +243,7 @@ declare const DataStrSchema: z.ZodObject<{
243
243
  y: number;
244
244
  id: string;
245
245
  rotation: number;
246
- visibility: "show" | "hide";
246
+ visibility: "show" | "hide" | "none";
247
247
  pinNumber: string | number;
248
248
  label: string;
249
249
  labelColor: string;
@@ -371,7 +371,7 @@ declare const DataStrSchema: z.ZodObject<{
371
371
  color: string;
372
372
  }>, z.ZodObject<{
373
373
  type: z.ZodLiteral<"PIN">;
374
- visibility: z.ZodEnum<["show", "hide"]>;
374
+ visibility: z.ZodEnum<["show", "hide", "none"]>;
375
375
  pinNumber: z.ZodUnion<[z.ZodString, z.ZodNumber]>;
376
376
  x: z.ZodNumber;
377
377
  y: z.ZodNumber;
@@ -388,7 +388,7 @@ declare const DataStrSchema: z.ZodObject<{
388
388
  y: number;
389
389
  id: string;
390
390
  rotation: number;
391
- visibility: "show" | "hide";
391
+ visibility: "show" | "hide" | "none";
392
392
  pinNumber: string | number;
393
393
  label: string;
394
394
  labelColor: string;
@@ -400,7 +400,7 @@ declare const DataStrSchema: z.ZodObject<{
400
400
  y: number;
401
401
  id: string;
402
402
  rotation: number;
403
- visibility: "show" | "hide";
403
+ visibility: "show" | "hide" | "none";
404
404
  pinNumber: string | number;
405
405
  label: string;
406
406
  labelColor: string;
@@ -666,7 +666,7 @@ declare const DataStrSchema: z.ZodObject<{
666
666
  y: number;
667
667
  id: string;
668
668
  rotation: number;
669
- visibility: "show" | "hide";
669
+ visibility: "show" | "hide" | "none";
670
670
  pinNumber: string | number;
671
671
  label: string;
672
672
  labelColor: string;
@@ -2726,7 +2726,7 @@ declare const EasyEdaJsonSchema: z.ZodObject<{
2726
2726
  y: number;
2727
2727
  id: string;
2728
2728
  rotation: number;
2729
- visibility: "show" | "hide";
2729
+ visibility: "show" | "hide" | "none";
2730
2730
  pinNumber: string | number;
2731
2731
  label: string;
2732
2732
  labelColor: string;
@@ -2854,7 +2854,7 @@ declare const EasyEdaJsonSchema: z.ZodObject<{
2854
2854
  color: string;
2855
2855
  }>, z.ZodObject<{
2856
2856
  type: z.ZodLiteral<"PIN">;
2857
- visibility: z.ZodEnum<["show", "hide"]>;
2857
+ visibility: z.ZodEnum<["show", "hide", "none"]>;
2858
2858
  pinNumber: z.ZodUnion<[z.ZodString, z.ZodNumber]>;
2859
2859
  x: z.ZodNumber;
2860
2860
  y: z.ZodNumber;
@@ -2871,7 +2871,7 @@ declare const EasyEdaJsonSchema: z.ZodObject<{
2871
2871
  y: number;
2872
2872
  id: string;
2873
2873
  rotation: number;
2874
- visibility: "show" | "hide";
2874
+ visibility: "show" | "hide" | "none";
2875
2875
  pinNumber: string | number;
2876
2876
  label: string;
2877
2877
  labelColor: string;
@@ -2883,7 +2883,7 @@ declare const EasyEdaJsonSchema: z.ZodObject<{
2883
2883
  y: number;
2884
2884
  id: string;
2885
2885
  rotation: number;
2886
- visibility: "show" | "hide";
2886
+ visibility: "show" | "hide" | "none";
2887
2887
  pinNumber: string | number;
2888
2888
  label: string;
2889
2889
  labelColor: string;
@@ -3149,7 +3149,7 @@ declare const EasyEdaJsonSchema: z.ZodObject<{
3149
3149
  y: number;
3150
3150
  id: string;
3151
3151
  rotation: number;
3152
- visibility: "show" | "hide";
3152
+ visibility: "show" | "hide" | "none";
3153
3153
  pinNumber: string | number;
3154
3154
  label: string;
3155
3155
  labelColor: string;
@@ -4327,7 +4327,7 @@ declare const EasyEdaJsonSchema: z.ZodObject<{
4327
4327
  y: number;
4328
4328
  id: string;
4329
4329
  rotation: number;
4330
- visibility: "show" | "hide";
4330
+ visibility: "show" | "hide" | "none";
4331
4331
  pinNumber: string | number;
4332
4332
  label: string;
4333
4333
  labelColor: string;
package/dist/index.js CHANGED
@@ -71,6 +71,14 @@ import { normalizePinLabels } from "@tscircuit/core";
71
71
  // lib/constants.ts
72
72
  var DEFAULT_PCB_THICKNESS_MM = 1.6;
73
73
 
74
+ // lib/utils/normalize-symbol-name.ts
75
+ var normalizeSymbolName = (name) => {
76
+ const trimmedName = name.trim();
77
+ if (trimmedName === "+") return "_POS";
78
+ if (trimmedName === "-") return "_NEG";
79
+ return trimmedName;
80
+ };
81
+
74
82
  // lib/convert-easyeda-json-to-tscircuit-soup-json.ts
75
83
  var mil2mm = (mil) => {
76
84
  if (typeof mil === "number") return mm(`${mil}mil`);
@@ -222,7 +230,7 @@ var convertEasyEdaJsonToCircuitJson = (easyEdaJson, { useModelCdn, shouldRecente
222
230
  const labels = [];
223
231
  if (pad.number) labels.push(pad.number.toString());
224
232
  const pin = pins.find((p) => p.pinNumber === pad.number);
225
- if (pin) labels.push(pin.label);
233
+ if (pin) labels.push(normalizeSymbolName(pin.label));
226
234
  return labels;
227
235
  });
228
236
  const normalizedPinLabels = normalizePinLabels(pinLabelSets);
@@ -389,7 +397,7 @@ var convertEasyEdaJsonToCircuitJson = (easyEdaJson, { useModelCdn, shouldRecente
389
397
  type: "pcb_silkscreen_text",
390
398
  pcb_silkscreen_text_id: `pcb_silkscreen_text_${index + 1}`,
391
399
  pcb_component_id: "pcb_component_1",
392
- text: shape.text,
400
+ text: normalizeSymbolName(shape.text),
393
401
  anchor_position: {
394
402
  x: mil2mm(shape.x),
395
403
  y: mil2mm(shape.y)
@@ -980,7 +988,7 @@ var parseArc = (str) => {
980
988
  var ArcShapeSchema = z2.string().startsWith("A~").transform(parseArc).pipe(ArcShapeOutputSchema);
981
989
  var PinShapeOutputSchema = z2.object({
982
990
  type: z2.literal("PIN"),
983
- visibility: z2.enum(["show", "hide"]),
991
+ visibility: z2.enum(["show", "hide", "none"]),
984
992
  pinNumber: z2.union([z2.string(), z2.number()]),
985
993
  x: z2.number(),
986
994
  y: z2.number(),