@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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@celestia-island/hikari",
3
- "version": "0.55.509",
3
+ "version": "0.55.510",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "description": "Hikari UI library, Vue 3 runtime — one design system for Vue 3 and Rust/WASM applications",
@@ -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
- // The end captions sit just OFF the border, a step toward the other
293
- // end: on the border they collide with the node, any further they
294
- // drift off their line.
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 ? offsetToward(a, b, 14) : null,
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 ? offsetToward(b, a, 14) : null,
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.509 <dev>">
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" />