easyeda 0.0.47 → 0.0.48
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.
|
@@ -2110,12 +2110,33 @@ var parsePolygon = (str) => {
|
|
|
2110
2110
|
};
|
|
2111
2111
|
};
|
|
2112
2112
|
var PolygonShapeSchema = z60.string().startsWith("PG~").transform(parsePolygon).pipe(PolygonShapeOutputSchema);
|
|
2113
|
+
var PathShapeOutputSchema = z60.object({
|
|
2114
|
+
type: z60.literal("PATH"),
|
|
2115
|
+
pathData: z60.string(),
|
|
2116
|
+
fillColor: z60.string(),
|
|
2117
|
+
strokeWidth: z60.number(),
|
|
2118
|
+
strokeColor: z60.string(),
|
|
2119
|
+
id: z60.string()
|
|
2120
|
+
});
|
|
2121
|
+
var parsePath = (str) => {
|
|
2122
|
+
const [, pathData, fillColor, strokeWidth, strokeColor, , id] = str.split("~");
|
|
2123
|
+
return {
|
|
2124
|
+
type: "PATH",
|
|
2125
|
+
pathData,
|
|
2126
|
+
fillColor,
|
|
2127
|
+
strokeWidth: Number(strokeWidth),
|
|
2128
|
+
strokeColor,
|
|
2129
|
+
id
|
|
2130
|
+
};
|
|
2131
|
+
};
|
|
2132
|
+
var PathShapeSchema = z60.string().startsWith("PT~").transform(parsePath).pipe(PathShapeOutputSchema);
|
|
2113
2133
|
var SingleLetterShapeSchema = z60.string().transform((x) => {
|
|
2114
2134
|
if (x.startsWith("R~")) return RectangleShapeSchema.parse(x);
|
|
2115
2135
|
if (x.startsWith("E~")) return EllipseShapeSchema.parse(x);
|
|
2116
2136
|
if (x.startsWith("P~")) return PinShapeSchema.parse(x);
|
|
2117
2137
|
if (x.startsWith("PL~")) return PolylineShapeSchema.parse(x);
|
|
2118
2138
|
if (x.startsWith("PG~")) return PolygonShapeSchema.parse(x);
|
|
2139
|
+
if (x.startsWith("PT~")) return PathShapeSchema.parse(x);
|
|
2119
2140
|
throw new Error(`Invalid shape type: ${x}`);
|
|
2120
2141
|
}).pipe(
|
|
2121
2142
|
z60.union([
|
|
@@ -2123,7 +2144,8 @@ var SingleLetterShapeSchema = z60.string().transform((x) => {
|
|
|
2123
2144
|
EllipseShapeOutputSchema,
|
|
2124
2145
|
PinShapeOutputSchema,
|
|
2125
2146
|
PolylineShapeOutputSchema,
|
|
2126
|
-
PolygonShapeOutputSchema
|
|
2147
|
+
PolygonShapeOutputSchema,
|
|
2148
|
+
PathShapeOutputSchema
|
|
2127
2149
|
])
|
|
2128
2150
|
);
|
|
2129
2151
|
|
|
@@ -2520,4 +2542,4 @@ export {
|
|
|
2520
2542
|
convertRawEasyToTsx,
|
|
2521
2543
|
convertEasyEdaJsonToVariousFormats
|
|
2522
2544
|
};
|
|
2523
|
-
//# sourceMappingURL=chunk-
|
|
2545
|
+
//# sourceMappingURL=chunk-RBPU2EIZ.js.map
|