@celestia-island/hikari 0.55.509 → 0.55.510
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/package.json
CHANGED
|
@@ -51,6 +51,17 @@
|
|
|
51
51
|
stroke-linejoin: round;
|
|
52
52
|
}
|
|
53
53
|
|
|
54
|
+
.hk-board-edge-endlabel {
|
|
55
|
+
// One step smaller than the midpoint caption: the multiplicities are
|
|
56
|
+
// metadata, the caption is the message.
|
|
57
|
+
font-size: 10px;
|
|
58
|
+
fill: rgb(var(--color-text) / 85%);
|
|
59
|
+
paint-order: stroke;
|
|
60
|
+
stroke: rgb(var(--color-surface));
|
|
61
|
+
stroke-width: 4px;
|
|
62
|
+
stroke-linejoin: round;
|
|
63
|
+
}
|
|
64
|
+
|
|
54
65
|
// Edge ink (fill/stroke/linecap) is set as presentation attributes on every
|
|
55
66
|
// emitted path (HkBoard.tsx) — no CSS declaration here, only per-edge attrs.
|
|
56
67
|
|
|
@@ -223,6 +223,20 @@ export default defineComponent({
|
|
|
223
223
|
return { x: from.x + (dx / len) * dist, y: from.y + (dy / len) * dist };
|
|
224
224
|
};
|
|
225
225
|
|
|
226
|
+
/** An end caption's anchor: `dist` px along the line from its border and
|
|
227
|
+
* `side` px OFF the shaft (perpendicular). On the shaft the caption
|
|
228
|
+
* crosses the arrow and is illegible (audit screenshot, 2026-11-28);
|
|
229
|
+
* off to one side it reads like mermaid's own placement. The two ends
|
|
230
|
+
* naturally land on opposite sides because their directions invert. */
|
|
231
|
+
const offsetEnd = (from: BoardPoint, to: BoardPoint, dist: number, side: number): { x: number; y: number } => {
|
|
232
|
+
const dx = to.x - from.x;
|
|
233
|
+
const dy = to.y - from.y;
|
|
234
|
+
const len = Math.hypot(dx, dy) || 1;
|
|
235
|
+
const ux = dx / len;
|
|
236
|
+
const uy = dy / len;
|
|
237
|
+
return { x: from.x + ux * dist - uy * side, y: from.y + uy * dist + ux * side };
|
|
238
|
+
};
|
|
239
|
+
|
|
226
240
|
const edgePaths = computed(() => {
|
|
227
241
|
const rects = rectOf.value;
|
|
228
242
|
const out: {
|
|
@@ -248,6 +262,7 @@ export default defineComponent({
|
|
|
248
262
|
const toCenter = { x: to.x + to.w / 2, y: to.y + to.h / 2 };
|
|
249
263
|
const fromCenter = { x: from.x + from.w / 2, y: from.y + from.h / 2 };
|
|
250
264
|
const fan = fanOrdinal.value.get(e.id) ?? { index: 0, count: 1 };
|
|
265
|
+
const edgeLen = Math.hypot(toCenter.x - fromCenter.x, toCenter.y - fromCenter.y);
|
|
251
266
|
const a = boardAnchor(from, e.anchorFrom ?? "center", toCenter, fan.index, fan.count);
|
|
252
267
|
const b = boardAnchor(to, e.anchorTo ?? "center", fromCenter, fan.index, fan.count);
|
|
253
268
|
const viaCenters = (e.via ?? [])
|
|
@@ -289,13 +304,19 @@ export default defineComponent({
|
|
|
289
304
|
headStart: e.headStart,
|
|
290
305
|
label: e.label && e.label !== "" ? e.label : null,
|
|
291
306
|
labelAt: mid,
|
|
292
|
-
//
|
|
293
|
-
//
|
|
294
|
-
//
|
|
307
|
+
// End captions sit OFF the shaft (perpendicular to the line): on it
|
|
308
|
+
// they cross the arrow and are illegible (audit screenshot,
|
|
309
|
+
// 2026-11-28). Short edges (adjacent classes) would stack them onto
|
|
310
|
+
// the midpoint caption, so they step closer to the border and
|
|
311
|
+
// further off the shaft as the edge shrinks.
|
|
295
312
|
labelFrom: e.labelFrom ?? null,
|
|
296
|
-
labelFromAt: e.labelFrom
|
|
313
|
+
labelFromAt: e.labelFrom
|
|
314
|
+
? offsetEnd(a, b, edgeLen > 90 ? 14 : 8, edgeLen > 90 ? 12 : 16)
|
|
315
|
+
: null,
|
|
297
316
|
labelTo: e.labelTo ?? null,
|
|
298
|
-
labelToAt: e.labelTo
|
|
317
|
+
labelToAt: e.labelTo
|
|
318
|
+
? offsetEnd(b, a, edgeLen > 90 ? 14 : 8, edgeLen > 90 ? 12 : 16)
|
|
319
|
+
: null,
|
|
299
320
|
});
|
|
300
321
|
}
|
|
301
322
|
return out;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<!doctype html>
|
|
2
2
|
<html lang="en">
|
|
3
3
|
<head>
|
|
4
|
-
<meta name="hk-error-landing" content="v1 0.55.
|
|
4
|
+
<meta name="hk-error-landing" content="v1 0.55.510 <dev>">
|
|
5
5
|
<meta charset="utf-8" />
|
|
6
6
|
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
7
7
|
<meta name="robots" content="noindex" />
|