easyeda 0.0.259 → 0.0.261

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
@@ -997,7 +997,7 @@ var import_promises = __toESM(require("fs/promises"), 1);
997
997
  var package_default = {
998
998
  name: "easyeda",
999
999
  type: "module",
1000
- version: "0.0.258",
1000
+ version: "0.0.260",
1001
1001
  files: [
1002
1002
  "dist"
1003
1003
  ],
@@ -7263,6 +7263,12 @@ var parsePath = (str) => {
7263
7263
  };
7264
7264
  };
7265
7265
  var PathShapeSchema = import_zod162.z.string().startsWith("PT~").transform(parsePath).pipe(PathShapeOutputSchema);
7266
+ var optionalEasyEdaTextField = (fieldSchema) => import_zod162.z.preprocess((textField) => {
7267
+ if (textField == null || textField === "" || textField === "undefined") {
7268
+ return void 0;
7269
+ }
7270
+ return textField;
7271
+ }, fieldSchema);
7266
7272
  var TextShapeOutputSchema = import_zod162.z.object({
7267
7273
  type: import_zod162.z.literal("TEXT"),
7268
7274
  alignment: import_zod162.z.enum(["L", "C", "R"]),
@@ -7270,11 +7276,13 @@ var TextShapeOutputSchema = import_zod162.z.object({
7270
7276
  y: import_zod162.z.number(),
7271
7277
  rotation: import_zod162.z.number(),
7272
7278
  fontColor: import_zod162.z.string(),
7273
- backgroundColor: import_zod162.z.string().optional(),
7279
+ backgroundColor: optionalEasyEdaTextField(import_zod162.z.string().optional()),
7274
7280
  fontSize: import_zod162.z.string(),
7275
- fontWeight: import_zod162.z.string().optional().default("normal"),
7276
- fontStyle: import_zod162.z.enum(["normal", "italic"]).optional().default("normal"),
7277
- fontDecoration: import_zod162.z.string().optional().default(""),
7281
+ fontWeight: optionalEasyEdaTextField(import_zod162.z.string().optional().default("normal")),
7282
+ fontStyle: optionalEasyEdaTextField(
7283
+ import_zod162.z.enum(["normal", "italic"]).optional().default("normal")
7284
+ ),
7285
+ fontDecoration: optionalEasyEdaTextField(import_zod162.z.string().optional().default("")),
7278
7286
  content: import_zod162.z.string(),
7279
7287
  textType: import_zod162.z.string(),
7280
7288
  visibility: import_zod162.z.enum(["0", "1"]),
@@ -7307,11 +7315,11 @@ var parseText = (str) => {
7307
7315
  y: Number(y),
7308
7316
  rotation: Number(rotation2),
7309
7317
  fontColor,
7310
- backgroundColor: backgroundColor || void 0,
7318
+ backgroundColor,
7311
7319
  fontSize,
7312
- fontWeight: fontWeight || "normal",
7313
- fontStyle: fontStyle || "normal",
7314
- fontDecoration: fontDecoration || "",
7320
+ fontWeight,
7321
+ fontStyle,
7322
+ fontDecoration,
7315
7323
  content,
7316
7324
  textType,
7317
7325
  visibility,