@celestia-island/hikari 0.55.499 → 0.55.501

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.
Files changed (29) hide show
  1. package/dist/types/components/HkAdminShell.d.ts +10 -6
  2. package/dist/types/components/HkBoard.d.ts +19 -0
  3. package/dist/types/components/HkFaceShell.d.ts +10 -6
  4. package/dist/types/components/HkMermaidDiagram.d.ts +18 -9
  5. package/dist/types/composables/useBoardCamera.d.ts +8 -2
  6. package/dist/types/mermaid/layout.d.ts +61 -7
  7. package/dist/types/utils/boardCamera.d.ts +25 -4
  8. package/dist/types/utils/boardEdges.d.ts +61 -5
  9. package/package.json +1 -1
  10. package/src/components/HkAdminShell.tsx +5 -3
  11. package/src/components/HkBoard.arrows.test.tsx +311 -0
  12. package/src/components/HkBoard.tsx +48 -10
  13. package/src/components/HkDrawer.test.tsx +67 -0
  14. package/src/components/HkFaceShell.test.tsx +99 -3
  15. package/src/components/HkFaceShell.tsx +15 -3
  16. package/src/components/HkMermaidDiagram.scss +68 -3
  17. package/src/components/HkMermaidDiagram.styles.test.ts +63 -0
  18. package/src/components/HkMermaidDiagram.test.tsx +72 -4
  19. package/src/components/HkMermaidDiagram.tsx +88 -20
  20. package/src/components/__tests__/hkMermaidLayout.test.ts +279 -2
  21. package/src/components/__tests__/mermaidClusterBackEdge.test.ts +34 -0
  22. package/src/components/__tests__/mermaidClusterLane.test.ts +43 -0
  23. package/src/composables/useBoardCamera.ts +10 -2
  24. package/src/errorLandingStandalone/error-landing.html +1 -1
  25. package/src/mermaid/layout.ts +460 -77
  26. package/src/utils/boardCamera.test.ts +38 -0
  27. package/src/utils/boardCamera.ts +39 -5
  28. package/src/utils/boardEdges.test.ts +121 -3
  29. package/src/utils/boardEdges.ts +172 -16
@@ -97,9 +97,11 @@ export declare const HkAdminShell: import("vue").DefineComponent<import("vue").E
97
97
  type: StringConstructor;
98
98
  default: undefined;
99
99
  };
100
- /** Extra class for the mobile nav drawer's panel — lets consumers zero
101
- * nested paddings so drawer nav rows and a `userPanel` footer share
102
- * one left edge. */
100
+ /** Extra class for the mobile nav drawer's panel — a scoping hook for
101
+ * consumer chrome (theme/surface overrides). It is NOT a padding
102
+ * lever any more: the shell zeroes the drawer body's padding itself
103
+ * so the nav panel fills the drawer (see the HDrawer call below), so
104
+ * nav rows and the `userPanel` footer already share one left edge. */
103
105
  drawerPanelClass: {
104
106
  type: StringConstructor;
105
107
  default: undefined;
@@ -226,9 +228,11 @@ export declare const HkAdminShell: import("vue").DefineComponent<import("vue").E
226
228
  type: StringConstructor;
227
229
  default: undefined;
228
230
  };
229
- /** Extra class for the mobile nav drawer's panel — lets consumers zero
230
- * nested paddings so drawer nav rows and a `userPanel` footer share
231
- * one left edge. */
231
+ /** Extra class for the mobile nav drawer's panel — a scoping hook for
232
+ * consumer chrome (theme/surface overrides). It is NOT a padding
233
+ * lever any more: the shell zeroes the drawer body's padding itself
234
+ * so the nav panel fills the drawer (see the HDrawer call below), so
235
+ * nav rows and the `userPanel` footer already share one left edge. */
232
236
  drawerPanelClass: {
233
237
  type: StringConstructor;
234
238
  default: undefined;
@@ -56,6 +56,8 @@ export interface BoardNodeInput {
56
56
  /** Page payload, handed back through the scoped slot. */
57
57
  data?: Record<string, unknown>;
58
58
  }
59
+ /** What a drag may do once the whole content is already in view. */
60
+ export type BoardPanMode = "clamp" | "float";
59
61
  export interface BoardEdgeInput {
60
62
  id: string;
61
63
  from: string;
@@ -102,6 +104,14 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
102
104
  type: BooleanConstructor;
103
105
  default: boolean;
104
106
  };
107
+ /** `"clamp"` (default): content smaller than the viewport re-centers,
108
+ * so a fitted board cannot be dragged. `"float"`: it may be dragged
109
+ * while half of it stays in view — a diagram is content a reader
110
+ * may want to move aside, not a full-bleed scene. */
111
+ pan: {
112
+ type: PropType<BoardPanMode>;
113
+ default: string;
114
+ };
105
115
  minK: {
106
116
  type: NumberConstructor;
107
117
  default: number;
@@ -156,6 +166,14 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
156
166
  type: BooleanConstructor;
157
167
  default: boolean;
158
168
  };
169
+ /** `"clamp"` (default): content smaller than the viewport re-centers,
170
+ * so a fitted board cannot be dragged. `"float"`: it may be dragged
171
+ * while half of it stays in view — a diagram is content a reader
172
+ * may want to move aside, not a full-bleed scene. */
173
+ pan: {
174
+ type: PropType<BoardPanMode>;
175
+ default: string;
176
+ };
159
177
  minK: {
160
178
  type: NumberConstructor;
161
179
  default: number;
@@ -195,6 +213,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
195
213
  interactive: boolean;
196
214
  gridSize: number;
197
215
  minimap: boolean;
216
+ pan: BoardPanMode;
198
217
  fitOnMount: boolean;
199
218
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
200
219
  export default _default;
@@ -272,9 +272,11 @@ export declare const HkFaceShell: import("vue").DefineComponent<import("vue").Ex
272
272
  type: StringConstructor;
273
273
  default: undefined;
274
274
  };
275
- /** Extra class for the mobile nav drawer's panel — lets consumers zero
276
- * nested paddings so drawer nav rows and a `userPanel` footer share
277
- * one left edge. */
275
+ /** Extra class for the mobile nav drawer's panel — a scoping hook for
276
+ * consumer chrome (theme/surface overrides). It is NOT a padding
277
+ * lever any more: the shell zeroes the drawer body's padding itself
278
+ * so the nav panel fills the drawer (see the HDrawer call below), so
279
+ * nav rows and the `userPanel` footer already share one left edge. */
278
280
  drawerPanelClass: {
279
281
  type: StringConstructor;
280
282
  default: undefined;
@@ -435,9 +437,11 @@ export declare const HkFaceShell: import("vue").DefineComponent<import("vue").Ex
435
437
  type: StringConstructor;
436
438
  default: undefined;
437
439
  };
438
- /** Extra class for the mobile nav drawer's panel — lets consumers zero
439
- * nested paddings so drawer nav rows and a `userPanel` footer share
440
- * one left edge. */
440
+ /** Extra class for the mobile nav drawer's panel — a scoping hook for
441
+ * consumer chrome (theme/surface overrides). It is NOT a padding
442
+ * lever any more: the shell zeroes the drawer body's padding itself
443
+ * so the nav panel fills the drawer (see the HDrawer call below), so
444
+ * nav rows and the `userPanel` footer already share one left edge. */
441
445
  drawerPanelClass: {
442
446
  type: StringConstructor;
443
447
  default: undefined;
@@ -1,8 +1,7 @@
1
1
  /**
2
2
  * HkMermaidDiagram — the mermaid rendering business component, a peer of
3
3
  * the rich-text family (HkMarkdownRenderer renders prose, this renders
4
- * diagrams), built on the HkBoard 画板 (world camera, grid, minimap,
5
- * pan/zoom chrome).
4
+ * diagrams), built on the HkBoard 画板 (world camera, pan/zoom).
6
5
  *
7
6
  * Contract (user direction 2026-11-16):
8
7
  * - the PARSER is never bundled here: hosts register an engine on
@@ -10,9 +9,9 @@
10
9
  * gives syntax highlighting). No engine, or a parse failure, or an
11
10
  * unsupported diagram type → the source falls back to a plain code
12
11
  * block — never a broken surface.
13
- * - the caller decides the chrome: `minimap` hides the bottom-right
14
- * minimap, `interactive` gates canvas dragging/zoom (HkBoard props,
15
- * passed straight through).
12
+ * - the caller decides the chrome: `minimap` turns the zoom bar off,
13
+ * `interactive` gates canvas dragging/zoom (an HkBoard prop, passed
14
+ * straight through).
16
15
  *
17
16
  * Layout lives in ../mermaid/layout.ts (pure, deterministic); this file
18
17
  * only adapts the laid-out model into HkBoard nodes/edges and paints
@@ -26,7 +25,11 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
26
25
  type: StringConstructor;
27
26
  required: true;
28
27
  };
29
- /** Show the bottom-right minimap (HkBoard pass-through). */
28
+ /** Show the zoom bar under the diagram (`−` `NN%` `+` reset; the `%`
29
+ * label opens a slider). It sits in its own row BELOW the board — the
30
+ * board's own bottom-right dock is an overlay, and at fit zoom it
31
+ * covered the last node of every wide diagram (measured on
32
+ * docs.celestia.world 2026-11-27). */
30
33
  minimap: {
31
34
  type: BooleanConstructor;
32
35
  default: boolean;
@@ -42,7 +45,8 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
42
45
  type: BooleanConstructor;
43
46
  default: boolean;
44
47
  };
45
- /** Explicit viewport height in px (default: content-clamped auto). */
48
+ /** Height of the diagram STAGE in px (default: content-clamped auto).
49
+ * The zoom bar row below it adds its own height on top. */
46
50
  height: {
47
51
  type: PropType<number | "auto">;
48
52
  default: string;
@@ -60,7 +64,11 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
60
64
  type: StringConstructor;
61
65
  required: true;
62
66
  };
63
- /** Show the bottom-right minimap (HkBoard pass-through). */
67
+ /** Show the zoom bar under the diagram (`−` `NN%` `+` reset; the `%`
68
+ * label opens a slider). It sits in its own row BELOW the board — the
69
+ * board's own bottom-right dock is an overlay, and at fit zoom it
70
+ * covered the last node of every wide diagram (measured on
71
+ * docs.celestia.world 2026-11-27). */
64
72
  minimap: {
65
73
  type: BooleanConstructor;
66
74
  default: boolean;
@@ -76,7 +84,8 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
76
84
  type: BooleanConstructor;
77
85
  default: boolean;
78
86
  };
79
- /** Explicit viewport height in px (default: content-clamped auto). */
87
+ /** Height of the diagram STAGE in px (default: content-clamped auto).
88
+ * The zoom bar row below it adds its own height on top. */
80
89
  height: {
81
90
  type: PropType<number | "auto">;
82
91
  default: string;
@@ -7,13 +7,15 @@
7
7
  * snapping — an active pinch stays raw/continuous while the fingers
8
8
  * move and only animates to the nearest rung on release;
9
9
  * - wheel steps one rung per notch, anchored at the pointer;
10
- * - pan is clamped against the content bbox (half-viewport slack);
10
+ * - pan is clamped against the content bbox (half-viewport slack), and a
11
+ * board may let content smaller than the viewport float instead of
12
+ * re-centering (`smallContentPan: "keep"`);
11
13
  * - reduced-motion (or `animated: false`) skips the tween and snaps.
12
14
  *
13
15
  * The component wires DOM events; this composable stays input-agnostic.
14
16
  */
15
17
  import { type MaybeRefOrGetter, type Ref } from "vue";
16
- import { type BoardCamera, type BoardPoint, type BoardRect, type BoardViewport } from "../utils/boardCamera";
18
+ import { type BoardCamera, type BoardPoint, type BoardRect, type BoardSmallContentPan, type BoardViewport } from "../utils/boardCamera";
17
19
  export interface UseBoardCameraOptions {
18
20
  /** The viewport element (screen space) — used for anchor math. */
19
21
  viewportSize: MaybeRefOrGetter<BoardViewport>;
@@ -28,6 +30,10 @@ export interface UseBoardCameraOptions {
28
30
  * library's default cap (BOARD_FIT_CAP). Unset keeps the default; the
29
31
  * camera clamp still honours maxK. */
30
32
  fitCap?: number;
33
+ /** What a drag does with content smaller than the viewport: `"center"`
34
+ * (default) pins a fitted board, `"keep"` lets it be dragged while half
35
+ * of it stays in view (see BoardSmallContentPan). */
36
+ smallContentPan?: BoardSmallContentPan;
31
37
  }
32
38
  export interface UseBoardCameraReturn {
33
39
  camera: Ref<BoardCamera>;
@@ -13,7 +13,7 @@
13
13
  * `j:` junctions, `g:` gantt bars, `s:` section labels, `ax` the day
14
14
  * axis) so a doc can never collide two parts.
15
15
  */
16
- import type { MermaidDoc, MermaidGraphDoc } from "./types";
16
+ import type { MermaidDoc, MermaidDirection } from "./types";
17
17
  export type MermaidNodeKind = "shape" | "group" | "participant" | "class" | "section" | "task" | "axis" | "pie" | "quadrant";
18
18
  export interface LaidOutNode {
19
19
  id: string;
@@ -29,17 +29,24 @@ export interface LaidOutNode {
29
29
  passthrough?: boolean;
30
30
  data: Record<string, unknown>;
31
31
  }
32
+ /** The board anchor modes the mermaid layout asks for (a subset of the
33
+ * board's — see utils/boardEdges.ts BoardAnchorMode). */
34
+ export type MermaidAnchorMode = "center" | "nearest" | "top" | "bottom" | "left" | "right";
32
35
  export interface LaidOutEdge {
33
36
  id: string;
34
37
  from: string;
35
38
  to: string;
36
39
  /** Board route style; bezier = mermaid flowchart feel. */
37
40
  style: "straight" | "bezier" | "orthogonal";
38
- /** Border anchor overrides. An edge into a subgraph cluster lands on the
39
- * frame's border (mermaid attaches there), not on its center — the center
40
- * sits behind the frame's own members. */
41
- anchorFrom?: "center" | "nearest" | "top" | "top-left" | "fan";
42
- anchorTo?: "center" | "nearest" | "top" | "top-left" | "fan";
41
+ /** Border anchors. A flow edge leaves through the side its source's rank
42
+ * stack grows toward and arrives through the opposite side of its target
43
+ * (a top-down flowchart: bottom → top), which is how mermaid.js docks
44
+ * them — and what keeps every arrowhead head-on for the border it lands
45
+ * on. An edge into a subgraph cluster lands on the frame's border
46
+ * (`nearest`), not on its center — the center sits behind the frame's own
47
+ * own members. */
48
+ anchorFrom?: MermaidAnchorMode;
49
+ anchorTo?: MermaidAnchorMode;
43
50
  dashed: boolean;
44
51
  arrow: "none" | "solid" | "open";
45
52
  label: string | null;
@@ -71,6 +78,30 @@ interface GraphItem {
71
78
  /** Original parse order — the stable tie-break everywhere. */
72
79
  order: number;
73
80
  }
81
+ interface RankedEdge {
82
+ index: number;
83
+ from: string;
84
+ to: string;
85
+ }
86
+ /**
87
+ * The edges to read AGAINST their direction so the graph becomes a DAG (a
88
+ * feedback arc set), found by a depth-first search: an edge leading back
89
+ * to a node still on the search stack closes a cycle. The search starts
90
+ * from the true sources (fewest incoming edges first), then follows parse
91
+ * order — a cluster's members are parsed before the node that feeds them,
92
+ * and starting THERE turns the feeding edge into the "back" one (the
93
+ * audit corpus 2026-11-27: `A --> B` came out below B).
94
+ *
95
+ * WHY (measured on the same corpus): the previous ranking ran Kahn's
96
+ * algorithm on the raw graph, and Kahn's queue never reaches a node that
97
+ * sits in or after a cycle — `Start → Is it? → OK → Rethink → Is it?`
98
+ * ranked Start, OK, Rethink and End all at 0 and drew the decision diamond
99
+ * BELOW its own outputs. Reading one edge of every cycle backwards is what
100
+ * dagre (mermaid.js's engine) does; that edge is still DRAWN forwards
101
+ * afterwards, docked around the side of the stack (see `flowAnchors`).
102
+ * Returns the indexes of the edges to read backwards.
103
+ */
104
+ export declare function feedbackArcSet(items: GraphItem[], edges: RankedEdge[]): Set<number>;
74
105
  export interface GraphLayoutInput {
75
106
  /** World-rect size per node id (already includes card chrome). */
76
107
  items: GraphItem[];
@@ -78,7 +109,7 @@ export interface GraphLayoutInput {
78
109
  from: string;
79
110
  to: string;
80
111
  }>;
81
- direction: MermaidGraphDoc["direction"];
112
+ direction: MermaidDirection;
82
113
  /** Cross-axis gap between same-rank siblings, world px. Cluster frames pad
83
114
  * their members on both sides (and reserve a caption band on the stacked
84
115
  * axis), so a grouped graph widens this budget — `GROUP_CROSS_GAP_H` for
@@ -86,13 +117,36 @@ export interface GraphLayoutInput {
86
117
  * touch and overlap. */
87
118
  crossGap?: number;
88
119
  }
120
+ export interface GraphLane {
121
+ /** Index into the `edges` input. */
122
+ edge: number;
123
+ /** The lane's world centers, from the rank after the lower end to the
124
+ * rank before the upper end (visual order). */
125
+ points: Array<{
126
+ x: number;
127
+ y: number;
128
+ }>;
129
+ }
89
130
  export interface GraphLayoutOutput {
90
131
  positions: Map<string, {
91
132
  x: number;
92
133
  y: number;
93
134
  }>;
135
+ /** FLOW rank per node id — 0 is where the flow starts (the bottom for BT,
136
+ * the right for RL). An edge toward a higher flow rank points down the
137
+ * stack and docks on the stack-growing sides (see `flowAnchors`). */
138
+ ranks: Map<string, number>;
94
139
  width: number;
95
140
  height: number;
141
+ /** Lane cells, one entry per edge that skips ranks (edges read against
142
+ * their direction by the cycle breaker get none — they loop around the
143
+ * side instead). */
144
+ lanes: GraphLane[];
145
+ /** Indexes of the `edges` input the cycle breaker reads AGAINST their
146
+ * direction (the feedback arc set). The ranker never sees such an edge,
147
+ * so its source always lands in a HIGHER flow rank than its target —
148
+ * which is what makes it a back edge for docking. */
149
+ backEdges: number[];
96
150
  }
97
151
  /** Rank + barycenter-order + pixel-place a node-edge graph. */
98
152
  export declare function layoutGraph(input: GraphLayoutInput): GraphLayoutOutput;
@@ -83,12 +83,23 @@ export declare function boardToWorld(cam: BoardCamera, sx: number, sy: number):
83
83
  * callers quantize when they want the ladder (see quantizeBoardK).
84
84
  */
85
85
  export declare function boardZoomAt(cam: BoardCamera, targetK: number, anchorScreen: BoardPoint): BoardCamera;
86
+ /**
87
+ * What a drag may do with content that is SMALLER than the viewport on an
88
+ * axis.
89
+ * - `"center"` (the board default): re-center — a fitted board is pinned,
90
+ * a drag never moves it;
91
+ * - `"keep"`: it may be dragged anywhere as long as half of it stays in
92
+ * view (the same "never pushed fully out of view" invariant the larger
93
+ * than-viewport case already has, applied to small content).
94
+ */
95
+ export type BoardSmallContentPan = "center" | "keep";
86
96
  /**
87
97
  * Clamp the pan so the content bbox can never be dragged fully out of
88
98
  * view: content larger than the viewport keeps half a viewport of slack
89
- * on each side; content smaller than the viewport re-centers.
99
+ * on each side; content smaller than the viewport re-centers — unless
100
+ * `small` is `"keep"` (see BoardSmallContentPan).
90
101
  */
91
- export declare function boardClampPan(cam: BoardCamera, content: BoardRect, viewport: BoardViewport, slack?: number): BoardCamera;
102
+ export declare function boardClampPan(cam: BoardCamera, content: BoardRect, viewport: BoardViewport, slack?: number, small?: BoardSmallContentPan): BoardCamera;
92
103
  /**
93
104
  * Fit the whole content bbox into the viewport (centered, padded). Wide
94
105
  * boards shrink as far as needed to show everything — fit is allowed
@@ -116,5 +127,15 @@ export declare const boardEaseOutCubic: (t: number) => number;
116
127
  * `t` is clamped to [0, 1] and eased with ease-out cubic.
117
128
  */
118
129
  export declare function boardTweenCam(from: BoardCamera, to: BoardCamera, t: number): BoardCamera;
119
- /** Union of rects (ignoring empty ones) — the content bbox for clamp/fit. */
120
- export declare function boardBBox(rects: BoardRect[]): BoardRect;
130
+ /**
131
+ * Union of rects (ignoring empty ones) — the content bbox for clamp/fit.
132
+ * A zero-size rect is a JUNCTION (an invisible node that only routes
133
+ * edges): by default it does not count, but a board whose picture is made
134
+ * of them (a sequence diagram's message rows sit on zero-size junctions)
135
+ * must pass `points: true` or the bbox covers the participants only and
136
+ * the fit parks the camera on a quarter of the diagram (measured on
137
+ * docs.celestia.world 2026-11-27: 7 of 9 messages fell outside the card).
138
+ */
139
+ export declare function boardBBox(rects: BoardRect[], opts?: {
140
+ points?: boolean;
141
+ }): BoardRect;
@@ -11,6 +11,10 @@
11
11
  * • "nearest" — the border point closest to the other end;
12
12
  * • "top" — top-border midpoint (top-aligned columns, operations-style
13
13
  * vertical drops);
14
+ * • "bottom" / "left" / "right" — the other three border midpoints: a
15
+ * flowchart leaves through the side its rank stack grows
16
+ * toward and arrives through the opposite one, so every
17
+ * arrow is head-on for the border it lands on;
14
18
  * • "top-left" — the top-left corner (top-left aligned rows);
15
19
  * • "fan" — 天女散花: when one node feeds SEVERAL edges, the
16
20
  * attach points spread evenly across the exit border
@@ -18,7 +22,9 @@
18
22
  *
19
23
  * - ROUTE STYLE (`BoardEdgeStyle`) — how the two anchors join:
20
24
  * • "straight" — a straight segment;
21
- * • "bezier" — a horizontal-tangent cubic (flowing curve);
25
+ * • "bezier" — a normal-tangent cubic (flowing curve): it leaves
26
+ * and arrives ALONG the border normals of its anchors
27
+ * (see "Route tangents" below);
22
28
  * • "orthogonal" — strict elbow (H-V-H), the operations pipe discipline;
23
29
  * • "spine" — vertical-first elbow (V-H), for tree rails.
24
30
  *
@@ -54,7 +60,7 @@ export interface BoardNodeRect {
54
60
  w: number;
55
61
  h: number;
56
62
  }
57
- export type BoardAnchorMode = "center" | "nearest" | "top" | "top-left" | "fan";
63
+ export type BoardAnchorMode = "center" | "nearest" | "top" | "bottom" | "left" | "right" | "top-left" | "fan";
58
64
  export type BoardEdgeStyle = "straight" | "bezier" | "orthogonal" | "spine";
59
65
  /**
60
66
  * Resolve the anchor point on `rect` for an edge toward `to`.
@@ -62,12 +68,62 @@ export type BoardEdgeStyle = "straight" | "bezier" | "orthogonal" | "spine";
62
68
  * border; no-ops when count ≤ 1).
63
69
  */
64
70
  export declare function boardAnchor(rect: BoardNodeRect, mode: BoardAnchorMode, to: BoardPoint, index?: number, count?: number): BoardPoint;
71
+ /**
72
+ * Unit travel directions at the two ends of a route: what a bezier leaves
73
+ * `a` along, and what it arrives at `b` along.
74
+ *
75
+ * WHY THIS EXISTS (measured on docs.celestia.world 2026-11-27): an SVG
76
+ * `orient="auto"` arrowhead rotates to the path's END TANGENT. The bezier
77
+ * used to leave and arrive horizontally no matter where its anchors sat,
78
+ * so every arrow of a top-down flowchart pointed LEFT or RIGHT — and since
79
+ * a path ends ON the node border, the half of that sideways triangle that
80
+ * stuck out above the node was all the reader saw. (A cubic whose last
81
+ * control point coincides with its end has a ZERO tangent; Chrome 155 orients
82
+ * that marker at 180° — also sideways.) A route therefore has to arrive
83
+ * along the border normal of the node it enters, which only the caller
84
+ * knows: it owns the rects. Callers pass them in; without them the tangent
85
+ * falls back to the route's dominant travel axis.
86
+ */
87
+ export interface BoardTangents {
88
+ /** Unit direction the route leaves its first point along. */
89
+ from?: BoardPoint;
90
+ /** Unit direction the route arrives at its last point along. */
91
+ to?: BoardPoint;
92
+ }
93
+ /**
94
+ * Fallback tangent: the dominant travel axis of `a → b` (vertical when the
95
+ * route climbs or drops at least as much as it strafes). A zero-length
96
+ * leg has no travel to read — it returns the x axis.
97
+ */
98
+ export declare function boardAxisTangent(a: BoardPoint, b: BoardPoint): BoardPoint;
99
+ /**
100
+ * Outward unit normal of the border `point` sits on, or `null` when no
101
+ * border is within `tol` of it (the point sits inside the rect, or farther
102
+ * than `tol` outside it) or the rect is a degenerate junction — every
103
+ * border of a zero-size rect is the same dot, so it names no side.
104
+ *
105
+ * `outward` breaks a corner tie: at a corner two borders qualify, and the
106
+ * one whose normal points most along `outward` is the side the route is
107
+ * really using. For the route's FIRST point pass its travel direction (the
108
+ * route leaves along the normal); for its LAST point pass the negated
109
+ * travel direction (the route arrives against the normal).
110
+ */
111
+ export declare function boardAnchorNormal(rect: BoardNodeRect, point: BoardPoint, outward?: BoardPoint, tol?: number): BoardPoint | null;
65
112
  /** One edge between two anchor points. */
66
- export declare function boardEdgePath(a: BoardPoint, b: BoardPoint, style: BoardEdgeStyle): string;
113
+ export declare function boardEdgePath(a: BoardPoint, b: BoardPoint, style: BoardEdgeStyle, tangents?: BoardTangents): string;
67
114
  /**
68
115
  * One edge routed THROUGH via points (the centers of empty corner/junction
69
116
  * nodes). The style applies to every leg; orthogonal legs chain into clean
70
117
  * right angles, straight legs chain into a polyline, bezier legs chain
71
- * with smooth midpoints so long vias read as one flowing curve.
118
+ * with a tangent per point so long vias read as one flowing curve — and so
119
+ * the LAST leg still arrives along its tangent (a midpoint-derived control
120
+ * point would sit on the end point and zero the end tangent).
121
+ */
122
+ export declare function boardViaPath(a: BoardPoint, via: BoardPoint[], b: BoardPoint, style: BoardEdgeStyle, tangents?: BoardTangents): string;
123
+ /**
124
+ * Where a route's caption belongs: on the bezier itself (its parametric
125
+ * midpoint — for opposing border normals that is the chord midpoint, for
126
+ * an elbow it is the bend), on the middle via point when the route bends
127
+ * through junctions, else on the chord midpoint.
72
128
  */
73
- export declare function boardViaPath(a: BoardPoint, via: BoardPoint[], b: BoardPoint, style: BoardEdgeStyle): string;
129
+ export declare function boardEdgeMidpoint(a: BoardPoint, via: BoardPoint[], b: BoardPoint, style: BoardEdgeStyle, tangents?: BoardTangents): BoardPoint;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@celestia-island/hikari",
3
- "version": "0.55.499",
3
+ "version": "0.55.501",
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",
@@ -85,9 +85,11 @@ export const HkAdminShell = defineComponent({
85
85
  * (e.g. `"var(--s-footer-height)"`). */
86
86
  footerHeight: { type: String, default: undefined },
87
87
  navTitle: { type: String, default: undefined },
88
- /** Extra class for the mobile nav drawer's panel — lets consumers zero
89
- * nested paddings so drawer nav rows and a `userPanel` footer share
90
- * one left edge. */
88
+ /** Extra class for the mobile nav drawer's panel — a scoping hook for
89
+ * consumer chrome (theme/surface overrides). It is NOT a padding
90
+ * lever any more: the shell zeroes the drawer body's padding itself
91
+ * so the nav panel fills the drawer (see the HDrawer call below), so
92
+ * nav rows and the `userPanel` footer already share one left edge. */
91
93
  drawerPanelClass: { type: String, default: undefined },
92
94
  /** Content-area padding (inside the scroll viewport). Padding is
93
95
  * applied to an inner wrapper rather than the scroll container so