easyeda 0.0.258 → 0.0.260
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/browser/index.d.ts +16 -16
- package/dist/browser/index.js +27 -16
- package/dist/browser/index.js.map +1 -1
- package/dist/index.d.ts +16 -16
- package/dist/index.js +27 -16
- package/dist/index.js.map +1 -1
- package/dist/main.cjs +28 -17
- package/dist/main.cjs.map +1 -1
- package/package.json +1 -1
package/dist/browser/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?:
|
|
545
|
-
fontWeight?:
|
|
546
|
-
fontStyle?:
|
|
547
|
-
fontDecoration?:
|
|
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?:
|
|
3078
|
-
fontWeight?:
|
|
3079
|
-
fontStyle?:
|
|
3080
|
-
fontDecoration?:
|
|
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/browser/index.js
CHANGED
|
@@ -9251,15 +9251,12 @@ var convertEasyEdaJsonToCircuitJson = (easyEdaJson, {
|
|
|
9251
9251
|
const innerWidth = largestOuterDimensionName === "width" ? largestInnerDimension : smallestInnerDimension;
|
|
9252
9252
|
const innerHeight = largestOuterDimensionName === "height" ? largestInnerDimension : smallestInnerDimension;
|
|
9253
9253
|
additionalPlatedHoleProps = {
|
|
9254
|
-
shape: "
|
|
9255
|
-
hole_shape: "pill",
|
|
9256
|
-
pad_shape: "rect",
|
|
9254
|
+
shape: "pill",
|
|
9257
9255
|
hole_width: innerWidth,
|
|
9258
9256
|
hole_height: innerHeight,
|
|
9259
|
-
|
|
9260
|
-
|
|
9261
|
-
|
|
9262
|
-
hole_offset_y: 0
|
|
9257
|
+
outer_width: mil2mm(pad.width),
|
|
9258
|
+
outer_height: mil2mm(pad.height),
|
|
9259
|
+
ccw_rotation: pad.rotation || 0
|
|
9263
9260
|
};
|
|
9264
9261
|
} else if (pad.shape === "RECT") {
|
|
9265
9262
|
const padWidth = mil2mm(pad.width);
|
|
@@ -10096,6 +10093,12 @@ var parsePath = (str) => {
|
|
|
10096
10093
|
};
|
|
10097
10094
|
};
|
|
10098
10095
|
var PathShapeSchema = external_exports.string().startsWith("PT~").transform(parsePath).pipe(PathShapeOutputSchema);
|
|
10096
|
+
var optionalEasyEdaTextField = (fieldSchema) => external_exports.preprocess((textField) => {
|
|
10097
|
+
if (textField == null || textField === "" || textField === "undefined") {
|
|
10098
|
+
return void 0;
|
|
10099
|
+
}
|
|
10100
|
+
return textField;
|
|
10101
|
+
}, fieldSchema);
|
|
10099
10102
|
var TextShapeOutputSchema = external_exports.object({
|
|
10100
10103
|
type: external_exports.literal("TEXT"),
|
|
10101
10104
|
alignment: external_exports.enum(["L", "C", "R"]),
|
|
@@ -10103,11 +10106,13 @@ var TextShapeOutputSchema = external_exports.object({
|
|
|
10103
10106
|
y: external_exports.number(),
|
|
10104
10107
|
rotation: external_exports.number(),
|
|
10105
10108
|
fontColor: external_exports.string(),
|
|
10106
|
-
backgroundColor: external_exports.string().optional(),
|
|
10109
|
+
backgroundColor: optionalEasyEdaTextField(external_exports.string().optional()),
|
|
10107
10110
|
fontSize: external_exports.string(),
|
|
10108
|
-
fontWeight: external_exports.string().optional().default("normal"),
|
|
10109
|
-
fontStyle:
|
|
10110
|
-
|
|
10111
|
+
fontWeight: optionalEasyEdaTextField(external_exports.string().optional().default("normal")),
|
|
10112
|
+
fontStyle: optionalEasyEdaTextField(
|
|
10113
|
+
external_exports.enum(["normal", "italic"]).optional().default("normal")
|
|
10114
|
+
),
|
|
10115
|
+
fontDecoration: optionalEasyEdaTextField(external_exports.string().optional().default("")),
|
|
10111
10116
|
content: external_exports.string(),
|
|
10112
10117
|
textType: external_exports.string(),
|
|
10113
10118
|
visibility: external_exports.enum(["0", "1"]),
|
|
@@ -10140,11 +10145,11 @@ var parseText = (str) => {
|
|
|
10140
10145
|
y: Number(y),
|
|
10141
10146
|
rotation: Number(rotation2),
|
|
10142
10147
|
fontColor,
|
|
10143
|
-
backgroundColor
|
|
10148
|
+
backgroundColor,
|
|
10144
10149
|
fontSize,
|
|
10145
|
-
fontWeight
|
|
10146
|
-
fontStyle
|
|
10147
|
-
fontDecoration
|
|
10150
|
+
fontWeight,
|
|
10151
|
+
fontStyle,
|
|
10152
|
+
fontDecoration,
|
|
10148
10153
|
content,
|
|
10149
10154
|
textType,
|
|
10150
10155
|
visibility,
|
|
@@ -10563,7 +10568,13 @@ var generateFootprintTsx = (circuitJson) => {
|
|
|
10563
10568
|
}
|
|
10564
10569
|
}
|
|
10565
10570
|
for (const platedHole of platedHoles) {
|
|
10566
|
-
if (platedHole.shape === "
|
|
10571
|
+
if (platedHole.shape === "pill" || platedHole.shape === "oval") {
|
|
10572
|
+
const cccwRotationDegree = platedHole.ccw_rotation || 0;
|
|
10573
|
+
const rotation2 = cccwRotationDegree ? ` pcbRotation="${cccwRotationDegree}deg"` : "";
|
|
10574
|
+
elementStrings.push(
|
|
10575
|
+
`<platedhole portHints={${JSON.stringify(platedHole.port_hints)}} pcbX="${mmStr(platedHole.x)}" pcbY="${mmStr(platedHole.y)}" holeWidth="${mmStr(platedHole.hole_width)}" holeHeight="${mmStr(platedHole.hole_height)}" outerWidth="${mmStr(platedHole.outer_width)}" outerHeight="${mmStr(platedHole.outer_height)}"${rotation2} shape="${platedHole.shape}" />`
|
|
10576
|
+
);
|
|
10577
|
+
} else if (platedHole.shape === "pill_hole_with_rect_pad") {
|
|
10567
10578
|
elementStrings.push(
|
|
10568
10579
|
`<platedhole portHints={${JSON.stringify(platedHole.port_hints)}} pcbX="${mmStr(platedHole.x)}" pcbY="${mmStr(platedHole.y)}" holeWidth="${mmStr(platedHole.hole_width)}" holeHeight="${mmStr(platedHole.hole_height)}" outerWidth="${mmStr(platedHole.rect_pad_width)}" outerHeight="${mmStr(platedHole.rect_pad_height)}" shape="pill" />`
|
|
10569
10580
|
);
|