circuit-to-svg 0.0.331 → 0.0.332
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.js +29 -10
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1438,6 +1438,33 @@ function createSvgObjectsFromPcbNoteText(note, ctx) {
|
|
|
1438
1438
|
dominantBaseline = "central";
|
|
1439
1439
|
break;
|
|
1440
1440
|
}
|
|
1441
|
+
const lines = text.split("\n");
|
|
1442
|
+
const children = lines.length === 1 ? [
|
|
1443
|
+
{
|
|
1444
|
+
type: "text",
|
|
1445
|
+
name: "",
|
|
1446
|
+
value: text,
|
|
1447
|
+
attributes: {},
|
|
1448
|
+
children: []
|
|
1449
|
+
}
|
|
1450
|
+
] : lines.map((line, index) => ({
|
|
1451
|
+
type: "element",
|
|
1452
|
+
name: "tspan",
|
|
1453
|
+
value: "",
|
|
1454
|
+
attributes: {
|
|
1455
|
+
x: x.toString(),
|
|
1456
|
+
...index > 0 ? { dy: "1em" } : {}
|
|
1457
|
+
},
|
|
1458
|
+
children: [
|
|
1459
|
+
{
|
|
1460
|
+
type: "text",
|
|
1461
|
+
name: "",
|
|
1462
|
+
value: line,
|
|
1463
|
+
attributes: {},
|
|
1464
|
+
children: []
|
|
1465
|
+
}
|
|
1466
|
+
]
|
|
1467
|
+
}));
|
|
1441
1468
|
const svgObject = {
|
|
1442
1469
|
name: "text",
|
|
1443
1470
|
type: "element",
|
|
@@ -1455,15 +1482,7 @@ function createSvgObjectsFromPcbNoteText(note, ctx) {
|
|
|
1455
1482
|
"data-pcb-note-text-id": note.pcb_note_text_id,
|
|
1456
1483
|
"data-pcb-layer": "overlay"
|
|
1457
1484
|
},
|
|
1458
|
-
children
|
|
1459
|
-
{
|
|
1460
|
-
type: "text",
|
|
1461
|
-
name: "",
|
|
1462
|
-
value: text,
|
|
1463
|
-
attributes: {},
|
|
1464
|
-
children: []
|
|
1465
|
-
}
|
|
1466
|
-
]
|
|
1485
|
+
children
|
|
1467
1486
|
};
|
|
1468
1487
|
return [svgObject];
|
|
1469
1488
|
}
|
|
@@ -6390,7 +6409,7 @@ function getSoftwareUsedString(circuitJson) {
|
|
|
6390
6409
|
var package_default = {
|
|
6391
6410
|
name: "circuit-to-svg",
|
|
6392
6411
|
type: "module",
|
|
6393
|
-
version: "0.0.
|
|
6412
|
+
version: "0.0.331",
|
|
6394
6413
|
description: "Convert Circuit JSON to SVG",
|
|
6395
6414
|
main: "dist/index.js",
|
|
6396
6415
|
files: [
|