easyeda 0.0.55 → 0.0.57
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.
|
@@ -2134,6 +2134,63 @@ var parsePath = (str) => {
|
|
|
2134
2134
|
};
|
|
2135
2135
|
};
|
|
2136
2136
|
var PathShapeSchema = z60.string().startsWith("PT~").transform(parsePath).pipe(PathShapeOutputSchema);
|
|
2137
|
+
var TextShapeOutputSchema = z60.object({
|
|
2138
|
+
type: z60.literal("TEXT"),
|
|
2139
|
+
alignment: z60.enum(["L", "C", "R"]),
|
|
2140
|
+
x: z60.number(),
|
|
2141
|
+
y: z60.number(),
|
|
2142
|
+
rotation: z60.number(),
|
|
2143
|
+
fontColor: z60.string(),
|
|
2144
|
+
backgroundColor: z60.string().optional(),
|
|
2145
|
+
fontSize: z60.string(),
|
|
2146
|
+
fontWeight: z60.enum(["normal", "bold"]).optional().default("normal"),
|
|
2147
|
+
fontStyle: z60.enum(["normal", "italic"]).optional().default("normal"),
|
|
2148
|
+
fontDecoration: z60.enum(["", "underline"]),
|
|
2149
|
+
content: z60.string(),
|
|
2150
|
+
textType: z60.string(),
|
|
2151
|
+
visibility: z60.enum(["0", "1"]),
|
|
2152
|
+
mirror: z60.string(),
|
|
2153
|
+
id: z60.string()
|
|
2154
|
+
});
|
|
2155
|
+
var parseText = (str) => {
|
|
2156
|
+
const [
|
|
2157
|
+
,
|
|
2158
|
+
alignment,
|
|
2159
|
+
x,
|
|
2160
|
+
y,
|
|
2161
|
+
rotation2,
|
|
2162
|
+
fontColor,
|
|
2163
|
+
backgroundColor,
|
|
2164
|
+
fontSize,
|
|
2165
|
+
fontWeight,
|
|
2166
|
+
fontStyle,
|
|
2167
|
+
fontDecoration,
|
|
2168
|
+
content,
|
|
2169
|
+
textType,
|
|
2170
|
+
visibility,
|
|
2171
|
+
mirror,
|
|
2172
|
+
id
|
|
2173
|
+
] = str.split("~");
|
|
2174
|
+
return {
|
|
2175
|
+
type: "TEXT",
|
|
2176
|
+
alignment,
|
|
2177
|
+
x: Number(x),
|
|
2178
|
+
y: Number(y),
|
|
2179
|
+
rotation: Number(rotation2),
|
|
2180
|
+
fontColor,
|
|
2181
|
+
backgroundColor: backgroundColor || void 0,
|
|
2182
|
+
fontSize,
|
|
2183
|
+
fontWeight: fontWeight || "normal",
|
|
2184
|
+
fontStyle: fontStyle || "normal",
|
|
2185
|
+
fontDecoration,
|
|
2186
|
+
content,
|
|
2187
|
+
textType,
|
|
2188
|
+
visibility,
|
|
2189
|
+
mirror,
|
|
2190
|
+
id
|
|
2191
|
+
};
|
|
2192
|
+
};
|
|
2193
|
+
var TextShapeSchema = z60.string().startsWith("T~").transform(parseText).pipe(TextShapeOutputSchema);
|
|
2137
2194
|
var SingleLetterShapeSchema = z60.string().transform((x) => {
|
|
2138
2195
|
if (x.startsWith("R~")) return RectangleShapeSchema.parse(x);
|
|
2139
2196
|
if (x.startsWith("E~")) return EllipseShapeSchema.parse(x);
|
|
@@ -2141,6 +2198,7 @@ var SingleLetterShapeSchema = z60.string().transform((x) => {
|
|
|
2141
2198
|
if (x.startsWith("PL~")) return PolylineShapeSchema.parse(x);
|
|
2142
2199
|
if (x.startsWith("PG~")) return PolygonShapeSchema.parse(x);
|
|
2143
2200
|
if (x.startsWith("PT~")) return PathShapeSchema.parse(x);
|
|
2201
|
+
if (x.startsWith("T~")) return TextShapeSchema.parse(x);
|
|
2144
2202
|
throw new Error(`Invalid shape type: ${x}`);
|
|
2145
2203
|
}).pipe(
|
|
2146
2204
|
z60.union([
|
|
@@ -2149,7 +2207,8 @@ var SingleLetterShapeSchema = z60.string().transform((x) => {
|
|
|
2149
2207
|
PinShapeOutputSchema,
|
|
2150
2208
|
PolylineShapeOutputSchema,
|
|
2151
2209
|
PolygonShapeOutputSchema,
|
|
2152
|
-
PathShapeOutputSchema
|
|
2210
|
+
PathShapeOutputSchema,
|
|
2211
|
+
TextShapeOutputSchema
|
|
2153
2212
|
])
|
|
2154
2213
|
);
|
|
2155
2214
|
|
|
@@ -2496,7 +2555,7 @@ var convertEasyEdaJsonToVariousFormats = async ({
|
|
|
2496
2555
|
outputFilename = `${filename}.${outputFormat}`;
|
|
2497
2556
|
}
|
|
2498
2557
|
if (!outputFilename) {
|
|
2499
|
-
console.log("specify --output file (-o) or --
|
|
2558
|
+
console.log("specify --output file (-o) or --output-format");
|
|
2500
2559
|
process.exit(1);
|
|
2501
2560
|
}
|
|
2502
2561
|
if (outputFilename.endsWith(".raweasy.json")) {
|
|
@@ -2554,4 +2613,4 @@ export {
|
|
|
2554
2613
|
convertRawEasyToTsx,
|
|
2555
2614
|
convertEasyEdaJsonToVariousFormats
|
|
2556
2615
|
};
|
|
2557
|
-
//# sourceMappingURL=chunk-
|
|
2616
|
+
//# sourceMappingURL=chunk-LLXDIHGV.js.map
|