@cristianormazabal/triton-latex 0.1.5 → 0.1.7
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/cli.cjs +16 -4
- package/dist/cli.cjs.map +2 -2
- package/package.json +1 -1
package/dist/cli.cjs
CHANGED
|
@@ -10491,7 +10491,7 @@ function connectorExtents(elements) {
|
|
|
10491
10491
|
// ../src/diagrams/triton/ds/struct/shared.ts
|
|
10492
10492
|
var ARROW_ID2 = "struct-arrow";
|
|
10493
10493
|
function arrowDef(color) {
|
|
10494
|
-
return `<marker id="${ARROW_ID2}" markerWidth="
|
|
10494
|
+
return `<marker id="${ARROW_ID2}" markerWidth="12" markerHeight="12" refX="10" refY="6" orient="auto" markerUnits="userSpaceOnUse"><path d="M0 0 L12 6 L0 12 z" fill="${color}" /></marker>`;
|
|
10495
10495
|
}
|
|
10496
10496
|
function lines(input) {
|
|
10497
10497
|
return input.split(/\r?\n/).map((l) => l.trim()).filter(Boolean);
|
|
@@ -39385,7 +39385,7 @@ function nodeStyle(kinds, theme) {
|
|
|
39385
39385
|
if (has("join")) return { shape, fill: palette.surface, stroke: palette.secondary, text: palette.text };
|
|
39386
39386
|
if (has("build") || has("muted")) return { shape, fill: palette.surface, stroke: palette.textMuted, text: palette.text };
|
|
39387
39387
|
const fill = palette.surface;
|
|
39388
|
-
return { shape, fill, stroke:
|
|
39388
|
+
return { shape, fill, stroke: palette.primary, text: palette.text };
|
|
39389
39389
|
}
|
|
39390
39390
|
function infoLine(node) {
|
|
39391
39391
|
return node.info;
|
|
@@ -39455,11 +39455,23 @@ function layoutTree(ir, theme) {
|
|
|
39455
39455
|
}
|
|
39456
39456
|
const byId = new Map(ir.nodes.map((n) => [n.id, n]));
|
|
39457
39457
|
const activeEdgeSet = new Set((ir.activePaths ?? []).map(([a, b]) => `${a}:${b}`));
|
|
39458
|
+
function circleBorder(center, radius, dir, sign) {
|
|
39459
|
+
return { x: rhu(center.x + sign * radius * dir.x), y: rhu(center.y + sign * radius * dir.y) };
|
|
39460
|
+
}
|
|
39458
39461
|
for (const node of ir.nodes) {
|
|
39459
39462
|
const pb = box(node.id);
|
|
39463
|
+
const parentShape = style.get(node.id).shape;
|
|
39460
39464
|
for (const cid of node.children) {
|
|
39461
39465
|
const cb = box(cid);
|
|
39462
|
-
const
|
|
39466
|
+
const childShape = style.get(cid).shape;
|
|
39467
|
+
const pc = { x: pb.x + pb.width / 2, y: pb.y + pb.height / 2 };
|
|
39468
|
+
const cc = { x: cb.x + cb.width / 2, y: cb.y + cb.height / 2 };
|
|
39469
|
+
const dx = cc.x - pc.x, dy = cc.y - pc.y;
|
|
39470
|
+
const len = Math.hypot(dx, dy);
|
|
39471
|
+
const dir = len > 0 ? { x: dx / len, y: dy / len } : { x: 0, y: 1 };
|
|
39472
|
+
const { start: boxStart, end: boxEnd } = connectSlots(pb, cb);
|
|
39473
|
+
const start = parentShape === "circle" ? circleBorder(pc, pb.width / 2, dir, 1) : boxStart;
|
|
39474
|
+
const end = childShape === "circle" ? circleBorder(cc, cb.width / 2, dir, -1) : boxEnd;
|
|
39463
39475
|
const isActive = activeEdgeSet.has(`${node.id}:${cid}`);
|
|
39464
39476
|
const edgeColor = isActive ? palette.primary : palette.textMuted;
|
|
39465
39477
|
const edgeWidth = isActive ? 2.5 : 1.5;
|
|
@@ -39502,7 +39514,7 @@ function layoutTree(ir, theme) {
|
|
|
39502
39514
|
}
|
|
39503
39515
|
if (node.badge !== void 0) {
|
|
39504
39516
|
const bc = badgeColor(node.badge, theme);
|
|
39505
|
-
elements.push(p.circle({ x: b.x + b.width - 3, y: b.y + 3 }, 9, palette.
|
|
39517
|
+
elements.push(p.circle({ x: b.x + b.width - 3, y: b.y + 3 }, 9, palette.surface, bc, 1.5));
|
|
39506
39518
|
elements.push(p.text(node.badge, b.x + b.width - 3, b.y + 7, smallFont, bc, { anchor: "middle", weight: "bold" }));
|
|
39507
39519
|
}
|
|
39508
39520
|
}
|