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/index.d.ts CHANGED
@@ -501,11 +501,11 @@ declare const DataStrSchema: z.ZodObject<{
501
501
  y: z.ZodNumber;
502
502
  rotation: z.ZodNumber;
503
503
  fontColor: z.ZodString;
504
- backgroundColor: z.ZodOptional<z.ZodString>;
504
+ backgroundColor: z.ZodEffects<z.ZodOptional<z.ZodString>, string | undefined, unknown>;
505
505
  fontSize: z.ZodString;
506
- fontWeight: z.ZodDefault<z.ZodOptional<z.ZodString>>;
507
- fontStyle: z.ZodDefault<z.ZodOptional<z.ZodEnum<["normal", "italic"]>>>;
508
- fontDecoration: z.ZodDefault<z.ZodOptional<z.ZodString>>;
506
+ fontWeight: z.ZodEffects<z.ZodDefault<z.ZodOptional<z.ZodString>>, string, unknown>;
507
+ fontStyle: z.ZodEffects<z.ZodDefault<z.ZodOptional<z.ZodEnum<["normal", "italic"]>>>, "normal" | "italic", unknown>;
508
+ fontDecoration: z.ZodEffects<z.ZodDefault<z.ZodOptional<z.ZodString>>, string, unknown>;
509
509
  content: z.ZodString;
510
510
  textType: z.ZodString;
511
511
  visibility: z.ZodEnum<["0", "1"]>;
@@ -541,10 +541,10 @@ declare const DataStrSchema: z.ZodObject<{
541
541
  content: string;
542
542
  textType: string;
543
543
  mirror: string;
544
- backgroundColor?: string | undefined;
545
- fontWeight?: string | undefined;
546
- fontStyle?: "normal" | "italic" | undefined;
547
- fontDecoration?: string | undefined;
544
+ backgroundColor?: unknown;
545
+ fontWeight?: unknown;
546
+ fontStyle?: unknown;
547
+ fontDecoration?: unknown;
548
548
  }>, z.ZodObject<{
549
549
  type: z.ZodLiteral<"ARC">;
550
550
  start: z.ZodObject<{
@@ -3034,11 +3034,11 @@ declare const EasyEdaJsonSchema: z.ZodObject<{
3034
3034
  y: z.ZodNumber;
3035
3035
  rotation: z.ZodNumber;
3036
3036
  fontColor: z.ZodString;
3037
- backgroundColor: z.ZodOptional<z.ZodString>;
3037
+ backgroundColor: z.ZodEffects<z.ZodOptional<z.ZodString>, string | undefined, unknown>;
3038
3038
  fontSize: z.ZodString;
3039
- fontWeight: z.ZodDefault<z.ZodOptional<z.ZodString>>;
3040
- fontStyle: z.ZodDefault<z.ZodOptional<z.ZodEnum<["normal", "italic"]>>>;
3041
- fontDecoration: z.ZodDefault<z.ZodOptional<z.ZodString>>;
3039
+ fontWeight: z.ZodEffects<z.ZodDefault<z.ZodOptional<z.ZodString>>, string, unknown>;
3040
+ fontStyle: z.ZodEffects<z.ZodDefault<z.ZodOptional<z.ZodEnum<["normal", "italic"]>>>, "normal" | "italic", unknown>;
3041
+ fontDecoration: z.ZodEffects<z.ZodDefault<z.ZodOptional<z.ZodString>>, string, unknown>;
3042
3042
  content: z.ZodString;
3043
3043
  textType: z.ZodString;
3044
3044
  visibility: z.ZodEnum<["0", "1"]>;
@@ -3074,10 +3074,10 @@ declare const EasyEdaJsonSchema: z.ZodObject<{
3074
3074
  content: string;
3075
3075
  textType: string;
3076
3076
  mirror: string;
3077
- backgroundColor?: string | undefined;
3078
- fontWeight?: string | undefined;
3079
- fontStyle?: "normal" | "italic" | undefined;
3080
- fontDecoration?: string | undefined;
3077
+ backgroundColor?: unknown;
3078
+ fontWeight?: unknown;
3079
+ fontStyle?: unknown;
3080
+ fontDecoration?: unknown;
3081
3081
  }>, z.ZodObject<{
3082
3082
  type: z.ZodLiteral<"ARC">;
3083
3083
  start: z.ZodObject<{
package/dist/index.js CHANGED
@@ -6360,6 +6360,12 @@ var parsePath = (str) => {
6360
6360
  };
6361
6361
  };
6362
6362
  var PathShapeSchema = z162.string().startsWith("PT~").transform(parsePath).pipe(PathShapeOutputSchema);
6363
+ var optionalEasyEdaTextField = (fieldSchema) => z162.preprocess((textField) => {
6364
+ if (textField == null || textField === "" || textField === "undefined") {
6365
+ return void 0;
6366
+ }
6367
+ return textField;
6368
+ }, fieldSchema);
6363
6369
  var TextShapeOutputSchema = z162.object({
6364
6370
  type: z162.literal("TEXT"),
6365
6371
  alignment: z162.enum(["L", "C", "R"]),
@@ -6367,11 +6373,13 @@ var TextShapeOutputSchema = z162.object({
6367
6373
  y: z162.number(),
6368
6374
  rotation: z162.number(),
6369
6375
  fontColor: z162.string(),
6370
- backgroundColor: z162.string().optional(),
6376
+ backgroundColor: optionalEasyEdaTextField(z162.string().optional()),
6371
6377
  fontSize: z162.string(),
6372
- fontWeight: z162.string().optional().default("normal"),
6373
- fontStyle: z162.enum(["normal", "italic"]).optional().default("normal"),
6374
- fontDecoration: z162.string().optional().default(""),
6378
+ fontWeight: optionalEasyEdaTextField(z162.string().optional().default("normal")),
6379
+ fontStyle: optionalEasyEdaTextField(
6380
+ z162.enum(["normal", "italic"]).optional().default("normal")
6381
+ ),
6382
+ fontDecoration: optionalEasyEdaTextField(z162.string().optional().default("")),
6375
6383
  content: z162.string(),
6376
6384
  textType: z162.string(),
6377
6385
  visibility: z162.enum(["0", "1"]),
@@ -6404,11 +6412,11 @@ var parseText = (str) => {
6404
6412
  y: Number(y),
6405
6413
  rotation: Number(rotation2),
6406
6414
  fontColor,
6407
- backgroundColor: backgroundColor || void 0,
6415
+ backgroundColor,
6408
6416
  fontSize,
6409
- fontWeight: fontWeight || "normal",
6410
- fontStyle: fontStyle || "normal",
6411
- fontDecoration: fontDecoration || "",
6417
+ fontWeight,
6418
+ fontStyle,
6419
+ fontDecoration,
6412
6420
  content,
6413
6421
  textType,
6414
6422
  visibility,