@crewlethq/ui 0.128.2 → 0.129.1

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 (38) hide show
  1. package/README.md +14 -0
  2. package/dist/ArtifactCard/index.js +2 -2
  3. package/dist/Canvas/Canvas.d.ts +30 -3
  4. package/dist/Canvas/geometry.d.ts +17 -3
  5. package/dist/Canvas/index.js +1 -1
  6. package/dist/CanvasBoard/index.js +3 -3
  7. package/dist/CanvasToolbar/index.js +2 -2
  8. package/dist/GraphCanvas/GraphCanvas.d.ts +11 -5
  9. package/dist/GraphCanvas/index.d.ts +1 -1
  10. package/dist/GraphCanvas/index.js +2 -2
  11. package/dist/GraphCanvas/layout.d.ts +35 -1
  12. package/dist/Link/Link.d.ts +5 -0
  13. package/dist/Link/index.js +1 -1
  14. package/dist/{Link-Z23PLCVS.css → Link-Y7RHTR6F.css} +14 -1
  15. package/dist/ObjectHeader/index.js +2 -2
  16. package/dist/PropertyList/index.js +3 -3
  17. package/dist/RailList/index.js +2 -2
  18. package/dist/RichEditor/index.js +1 -1
  19. package/dist/TableCells/index.js +2 -2
  20. package/dist/TreeCanvas/TreeCanvas.d.ts +25 -2
  21. package/dist/TreeCanvas/index.js +2 -2
  22. package/dist/{chunk-R4LHYCZN.js → chunk-2AKVGQ73.js} +100 -6
  23. package/dist/{chunk-GVDV4X43.js → chunk-AKCIF6XN.js} +1 -1
  24. package/dist/{chunk-DQKNAQWN.js → chunk-D2KJ5GQC.js} +2 -2
  25. package/dist/{chunk-I2JRUQJ4.js → chunk-JKFA2F7J.js} +1 -1
  26. package/dist/{chunk-Q6QKY7EZ.js → chunk-KQFOPY2P.js} +1 -1
  27. package/dist/{chunk-ICRFVQH5.js → chunk-KUECTV2P.js} +1 -1
  28. package/dist/{chunk-CVNJ6VHK.js → chunk-MNVIIZQP.js} +38 -12
  29. package/dist/{chunk-556M2A4S.js → chunk-Q4JX6UO7.js} +27 -11
  30. package/dist/{chunk-7VBZDGOS.js → chunk-QM2QFKIA.js} +2 -2
  31. package/dist/{chunk-JZI7SIM6.js → chunk-RMGPZQVJ.js} +1 -1
  32. package/dist/generated/index.js +30 -30
  33. package/dist/index.js +30 -30
  34. package/dist/styles.css +15 -2
  35. package/package.json +3 -3
  36. package/dist/{Editor-2TWJE7OR.js → Editor-MEPTWBY5.js} +1 -1
  37. package/dist/{chunk-DL6Y7SVB.js → chunk-32QLSXKL.js} +1 -1
  38. package/dist/{chunk-XZB53C7U.js → chunk-4FKHPUVR.js} +1 -1
package/README.md CHANGED
@@ -208,6 +208,20 @@ places:
208
208
  - A surface that pans or zooms dispatches `LAYER_REPOSITION_EVENT` on its host
209
209
  when the content beneath it moves, and every panel anchored inside follows.
210
210
 
211
+ ## Changes in 0.129.0
212
+
213
+ ### A map's trunks, legend and zoom bar say what they draw
214
+
215
+ - **A trunk's count never stands on anything.** A count and a cluster's title both hold their size on screen while the gap between two bands shrinks with the zoom, so at the gap's middle a count stood on the lower clusters' titles, and two trunks leaving one cluster wrote their counts on each other. `GraphCanvas` now writes each count where it covers no title, card or other count: along its level run, at the middle of the gap, hung from the upper cluster or stood on the lower one, a trunk that drops straight down placed first. Where nowhere is clear, the count is not written and its trunk still is. `placeTrunkLabels` is that placement as a pure function, and `GraphTrunk.run` is the gap a trunk crosses.
216
+ - **The Runs on switch reads on while trunks are drawn.** It read off at rest, over the trunks, and pressing it drew every runs-on line. Each legend switch now says whether its family is drawn: Runs on is on by default and draws trunks, pressing it hides them, and each runs-on line is drawn for the entry a reader stands on. Without the chrome, a family still draws line by line.
217
+ - **Zoom out is held at the fit, and Zoom in at the ceiling**, each with its reason (`CanvasLabels.zoomOutHeld`, `zoomInHeld`). They stayed live and did nothing, since every zoom is clamped to the limits. They are held softly, so focus stays on them.
218
+
219
+ ### A link set inside a sentence is underlined
220
+
221
+ **A link set inside a sentence (`size="inherit"`) is underlined at rest**, in the `default` and `subtle` variants. Among other words its ink alone did not set it apart: the accent ink against secondary text is 1.18:1 in the dark palette, where running text needs 3:1 or a mark that is not colour. `quiet` and `plain` keep their own rules.
222
+
223
+ **Breaking:** with the chrome on, `support` in `families` draws trunks, never a line per entry, and the default `families` now holds `support`; `CanvasLabels` (and so `GraphCanvasLabels`) has two more fields, `zoomOutHeld` and `zoomInHeld`, which a full set of labels must give.
224
+
211
225
  ## Changes in 0.127.0
212
226
 
213
227
  ### A map opens fitted to its view
@@ -1,4 +1,4 @@
1
- export { ArtifactCard, ArtifactCardSkeleton, ArtifactPreviewGlyph } from '../chunk-XZB53C7U.js';
1
+ export { ArtifactCard, ArtifactCardSkeleton, ArtifactPreviewGlyph } from '../chunk-4FKHPUVR.js';
2
2
  import '../chunk-WFAJYBLX.js';
3
3
  import '../chunk-HF5L56YQ.js';
4
4
  import '../chunk-GBKBME7Q.js';
@@ -9,8 +9,8 @@ import '../chunk-475DOAWF.js';
9
9
  import '../chunk-WSIJDWUG.js';
10
10
  import '../chunk-W3A6NBUM.js';
11
11
  import '../chunk-KFTVPWG2.js';
12
- import '../chunk-DOY3KC6I.js';
13
12
  export { ARTIFACT_KINDS, ArtifactKindGlyph } from '../chunk-RSKW25Y5.js';
13
+ import '../chunk-DOY3KC6I.js';
14
14
  import '../chunk-ARZGEHWE.js';
15
15
  import '../chunk-XZY6S3UC.js';
16
16
  import '../chunk-NN44J7BP.js';
@@ -63,6 +63,8 @@
63
63
  * or zoomed, a resize keeps their view and only keeps the content
64
64
  * reachable. It is opt in because a screen that chooses its own views
65
65
  * after a fit (a chart held at a legible zoom) decides its own refits.
66
+ * The same "untouched" is what `restoreView` asks: a fit it gives back is
67
+ * the fit of the content as it stands then, never the old fit's transform.
66
68
  * - MOTION ONLY ON REQUEST. A fit, a zoom button or a reveal eases; a drag, a
67
69
  * pinch, a wheel and a relayout anchor never do, and under reduced motion
68
70
  * nothing does. An easing lasts as long as its transition: a clamp that
@@ -102,8 +104,18 @@ export interface CanvasHandle {
102
104
  zoomBy(factor: number): void;
103
105
  /** Zoom about the viewport centre to one scale, 1 being actual size, within the limits. */
104
106
  zoomTo(scale: number): void;
105
- /** Pan the least distance that brings a world rectangle into view. */
106
- reveal(target: CanvasRect): void;
107
+ /**
108
+ * Pan the least distance that brings a world rectangle into view, clear of
109
+ * the end bar, as a fit is (see [CanvasProps.overlayEnd]).
110
+ *
111
+ * `outside` is where a rectangle lying WHOLLY outside the view is brought:
112
+ * `edge`, the default, just inside the nearest edge, for a reader stepping
113
+ * to the next item; `centre`, the middle of the view at the same zoom, for a
114
+ * reader SENT to an item somewhere else, and that move travels rather than
115
+ * corrects. A rectangle partly in view moves the least distance either way.
116
+ * See [revealView].
117
+ */
118
+ reveal(target: CanvasRect, outside?: 'edge' | 'centre'): void;
107
119
  /** Keep a node still on screen across a relayout: see `anchorView`. */
108
120
  anchor(before: CanvasPoint, after: CanvasPoint): void;
109
121
  /**
@@ -138,7 +150,18 @@ export interface CanvasHandle {
138
150
  * Calling it twice keeps the first view, as [focusRegion] does.
139
151
  */
140
152
  rememberView(): void;
141
- /** Ease back to the view [focusRegion] left, if it has not been given back already. */
153
+ /**
154
+ * Ease back to the view [focusRegion] or [rememberView] left, if it has not
155
+ * been given back already.
156
+ *
157
+ * A FIT IS GIVEN BACK AS A FIT. Where the view left was the untouched fit (a
158
+ * fit nobody has moved since, as `refitOnResize` counts one), what comes
159
+ * back is the fit of the content as it stands NOW rather than the old fit's
160
+ * zoom and pan: a fit says "all of the content", and a surface that changed
161
+ * the content while it was open (a node added in it, a branch opened for
162
+ * it) and gave back the old transform cut the new content off at the edges.
163
+ * A view the reader moved is theirs, and comes back exactly.
164
+ */
142
165
  restoreView(): void;
143
166
  /** A world rectangle in viewport coordinates, for positioning an overlay. */
144
167
  screenRect(target: CanvasRect): CanvasRect;
@@ -165,6 +188,10 @@ export type CanvasCursor = 'hand' | 'pointer' | 'crosshair' | 'text';
165
188
  export interface CanvasLabels {
166
189
  zoomIn: string;
167
190
  zoomOut: string;
191
+ /** Why Zoom out is held at the fit, the farthest out a view goes. */
192
+ zoomOutHeld: string;
193
+ /** Why Zoom in is held at the ceiling, the farthest in a view goes. */
194
+ zoomInHeld: string;
168
195
  fit: string;
169
196
  /** The control that shows the content at actual size. */
170
197
  actualSize: string;
@@ -25,7 +25,9 @@
25
25
  * fit even at the smallest zoom it aligns to the TOP, where a tree's root
26
26
  * is, rather than centring the root off screen.
27
27
  * - A REVEAL MOVES AS LITTLE AS IT CAN: nothing when the target is already in
28
- * view, otherwise just enough to bring it inside the padding.
28
+ * view, otherwise just enough to bring it inside the padding. The one
29
+ * exception is asked for by name: a target a reader is SENT to that none of
30
+ * the view shows is drawn in its middle (see [revealView]).
29
31
  */
30
32
  export interface CanvasPoint {
31
33
  x: number;
@@ -189,8 +191,20 @@ export declare function clampPan(view: CanvasView, content: CanvasRect, viewport
189
191
  * screens wide, and a fit that stops at a quarter clips it on every side.
190
192
  */
191
193
  export declare function fitView(content: CanvasRect, viewport: CanvasSize, padding?: number, floor?: number): CanvasView;
192
- /** The smallest pan that brings world rectangle `target` inside the padded viewport. */
193
- export declare function revealView(view: CanvasView, target: CanvasRect, viewport: CanvasSize, padding?: number): CanvasView;
194
+ /**
195
+ * The smallest pan that brings world rectangle `target` inside the padded
196
+ * viewport, at the same zoom.
197
+ *
198
+ * `outside` is where a target lying WHOLLY outside the viewport is brought.
199
+ * `edge`, the default, is the least pan, which leaves it just inside the edge
200
+ * it came in by: right for a reader stepping to the next item, which is
201
+ * beside the one before. `centre` draws its middle on the viewport's middle:
202
+ * for a reader SENT to an item somewhere else (after an operation, an undo or
203
+ * a search), whom the least pan left against the edge with nothing of the
204
+ * content around it on that side. A target partly in view moves the least
205
+ * distance either way, and one in view does not move.
206
+ */
207
+ export declare function revealView(view: CanvasView, target: CanvasRect, viewport: CanvasSize, padding?: number, outside?: 'edge' | 'centre'): CanvasView;
194
208
  /**
195
209
  * The view that draws world point `after` where `before` was drawn.
196
210
  *
@@ -1,4 +1,4 @@
1
- export { CANVAS_COMPOSE_CONTEXT, CANVAS_FIT_MAX_ZOOM, CANVAS_FIT_PADDING, CANVAS_FOCUS_CONTEXT, CANVAS_MAX_ZOOM, CANVAS_MIN_ZOOM, CANVAS_PAN_MARGIN, CANVAS_PAN_STEP, CANVAS_REVEAL_PADDING, CANVAS_TAP_SLOP, CANVAS_WHEEL_LINE_PX, CANVAS_WHEEL_ZOOM_PER_PIXEL, CANVAS_ZOOM_CEILING, CANVAS_ZOOM_LIMITS, CANVAS_ZOOM_STEP, Canvas, IDENTITY_VIEW, ShortcutTip, anchorView, beyondSlop, clampPan, clampZoom, fitView, gridOf, panBy, pinchView, regionView, revealView, screenRect, toScreen, toWorld, wheelPixels, wheelZoomFactor, zoomAt, zoomLimits } from '../chunk-CVNJ6VHK.js';
1
+ export { CANVAS_COMPOSE_CONTEXT, CANVAS_FIT_MAX_ZOOM, CANVAS_FIT_PADDING, CANVAS_FOCUS_CONTEXT, CANVAS_MAX_ZOOM, CANVAS_MIN_ZOOM, CANVAS_PAN_MARGIN, CANVAS_PAN_STEP, CANVAS_REVEAL_PADDING, CANVAS_TAP_SLOP, CANVAS_WHEEL_LINE_PX, CANVAS_WHEEL_ZOOM_PER_PIXEL, CANVAS_ZOOM_CEILING, CANVAS_ZOOM_LIMITS, CANVAS_ZOOM_STEP, Canvas, IDENTITY_VIEW, ShortcutTip, anchorView, beyondSlop, clampPan, clampZoom, fitView, gridOf, panBy, pinchView, regionView, revealView, screenRect, toScreen, toWorld, wheelPixels, wheelZoomFactor, zoomAt, zoomLimits } from '../chunk-MNVIIZQP.js';
2
2
  import '../chunk-X4HBZSXA.js';
3
3
  import '../chunk-VBBLHS2Y.js';
4
4
  import '../chunk-M2M6ZD7P.js';
@@ -1,8 +1,8 @@
1
- export { BOARD_NAME_MIN_CHARS, CANVAS_BOARD_MAX_LIVE, CANVAS_BOARD_MIN_LIVE_WIDTH, CANVAS_BOARD_MIN_ZOOM, CANVAS_NOTE_COLORS, CanvasBoard, TITLE_GLYPH_EM, boardName, boardRoom, liveBoards, titleSize } from '../chunk-7VBZDGOS.js';
1
+ export { BOARD_NAME_MIN_CHARS, CANVAS_BOARD_MAX_LIVE, CANVAS_BOARD_MIN_LIVE_WIDTH, CANVAS_BOARD_MIN_ZOOM, CANVAS_NOTE_COLORS, CanvasBoard, TITLE_GLYPH_EM, boardName, boardRoom, liveBoards, titleSize } from '../chunk-QM2QFKIA.js';
2
2
  import '../chunk-YJPQJVRJ.js';
3
- import '../chunk-GVDV4X43.js';
3
+ import '../chunk-AKCIF6XN.js';
4
4
  import '../chunk-NPEI2QAN.js';
5
- import '../chunk-CVNJ6VHK.js';
5
+ import '../chunk-MNVIIZQP.js';
6
6
  import '../chunk-X4HBZSXA.js';
7
7
  import '../chunk-VBBLHS2Y.js';
8
8
  import '../chunk-M2M6ZD7P.js';
@@ -1,6 +1,6 @@
1
- export { CanvasToolbar, toolForKey } from '../chunk-GVDV4X43.js';
1
+ export { CanvasToolbar, toolForKey } from '../chunk-AKCIF6XN.js';
2
2
  import '../chunk-NPEI2QAN.js';
3
- import '../chunk-CVNJ6VHK.js';
3
+ import '../chunk-MNVIIZQP.js';
4
4
  import '../chunk-X4HBZSXA.js';
5
5
  import '../chunk-VBBLHS2Y.js';
6
6
  import '../chunk-M2M6ZD7P.js';
@@ -11,10 +11,12 @@
11
11
  * THREE FAMILIES OF LINE. `flow` is the path a request takes: drawn at rest,
12
12
  * with dashes moving along it that say which way it points (direction, never
13
13
  * volume). `support` is what something runs on: at rest it is one trunk per
14
- * pair of clusters, with its count. `context` is everything around (an
15
- * account, a repository, a monitor). The last two are drawn line by line for
16
- * the entry a reader stands on, or when the legend turns them on, which is
17
- * what keeps a few hundred entries from being a tangle.
14
+ * pair of clusters, with its count, never a line per entry. `context` is
15
+ * everything around (an account, a repository, a monitor), drawn when the
16
+ * legend turns it on. Each legend switch says whether its family is drawn, so
17
+ * one that reads on draws it and one that reads off draws none of it. The last
18
+ * two are drawn line by line for the entry a reader stands on, which is what
19
+ * keeps a few hundred entries from being a tangle.
18
20
  *
19
21
  * ONE LOOK, INSIDE THE WORLD ONLY. Outlined boxes on a fine grid, a ruled
20
22
  * glyph cell, square corners and mono labels are the drawing of clusters,
@@ -255,7 +257,11 @@ export interface GraphCanvasProps {
255
257
  renderCard?: ((id: string) => ReactNode) | undefined;
256
258
  /** Drawn over the map's lower edge, such as what is selected and what can be done with it. */
257
259
  dock?: ReactNode;
258
- /** The families of line drawn at rest, when the caller holds them. Calls alone unless named. */
260
+ /**
261
+ * The families of line drawn at rest, when the caller holds them: calls and
262
+ * what things run on unless named. With the chrome on, what things run on is
263
+ * drawn as trunks, one per pair of clusters; without it, line by line.
264
+ */
259
265
  families?: ReadonlySet<GraphEdgeFamily> | undefined;
260
266
  /** Called with the families drawn at rest whenever the legend switches one. */
261
267
  onFamiliesChange?: ((families: ReadonlySet<GraphEdgeFamily>) => void) | undefined;
@@ -1,7 +1,7 @@
1
1
  import './GraphCanvas.css';
2
2
  export { GRAPH_CANVAS_DETAIL_ZOOM, GRAPH_CANVAS_FIT_FLOOR, GRAPH_CANVAS_FLOW_LIMIT, GRAPH_CANVAS_NARROW_WIDTH, GRAPH_CANVAS_LABELS, GRAPH_CANVAS_FOCUS_ZOOM, GRAPH_CANVAS_TILE_ZOOM, GRAPH_EDGE_FAMILIES, GraphCanvas, graphDetail, graphFocusView, graphWindow, } from './GraphCanvas.js';
3
3
  export type { GraphAttention, GraphAttentionTone, GraphBand, GraphCanvasHandle, GraphCanvasLabels, GraphCanvasProps, GraphDetail, GraphEdge, GraphEdgeFamily, GraphGroup, GraphLane, GraphNode, GraphRelationText, GraphTrace, GraphWindow, } from './GraphCanvas.js';
4
- export { GRAPH_ORDER_SWEEPS, graphItemKey, graphTrunks, layoutGraph, routeGraphEdges } from './layout.js';
4
+ export { GRAPH_ORDER_SWEEPS, graphItemKey, graphTrunks, layoutGraph, placeTrunkLabels, routeGraphEdges } from './layout.js';
5
5
  export type { GraphBandPlaced, GraphGrid, GraphGroupPlaced, GraphItem, GraphItemKind, GraphLanePlaced, GraphLayout, GraphLayoutBand, GraphLayoutEdge, GraphLayoutGroup, GraphLayoutInput, GraphLayoutNode, GraphMetrics, GraphRoute, GraphStreet, GraphTrunk, } from './layout.js';
6
6
  export { graphNeighbourhood, graphReach } from './reach.js';
7
7
  export type { GraphReach, GraphTraceDirection } from './reach.js';
@@ -1,8 +1,8 @@
1
- export { GRAPH_CANVAS_DETAIL_ZOOM, GRAPH_CANVAS_FIT_FLOOR, GRAPH_CANVAS_FLOW_LIMIT, GRAPH_CANVAS_FOCUS_ZOOM, GRAPH_CANVAS_LABELS, GRAPH_CANVAS_NARROW_WIDTH, GRAPH_CANVAS_TILE_ZOOM, GRAPH_EDGE_FAMILIES, GRAPH_ORDER_SWEEPS, GraphCanvas, graphDetail, graphFocusView, graphItemKey, graphNeighbourhood, graphReach, graphStep, graphTrunks, graphWindow, layoutGraph, routeGraphEdges } from '../chunk-R4LHYCZN.js';
1
+ export { GRAPH_CANVAS_DETAIL_ZOOM, GRAPH_CANVAS_FIT_FLOOR, GRAPH_CANVAS_FLOW_LIMIT, GRAPH_CANVAS_FOCUS_ZOOM, GRAPH_CANVAS_LABELS, GRAPH_CANVAS_NARROW_WIDTH, GRAPH_CANVAS_TILE_ZOOM, GRAPH_EDGE_FAMILIES, GRAPH_ORDER_SWEEPS, GraphCanvas, graphDetail, graphFocusView, graphItemKey, graphNeighbourhood, graphReach, graphStep, graphTrunks, graphWindow, layoutGraph, placeTrunkLabels, routeGraphEdges } from '../chunk-2AKVGQ73.js';
2
2
  import '../chunk-MY374UUD.js';
3
3
  import '../chunk-3JLG6KRU.js';
4
4
  import '../chunk-L6HUVA33.js';
5
- import '../chunk-CVNJ6VHK.js';
5
+ import '../chunk-MNVIIZQP.js';
6
6
  import '../chunk-X4HBZSXA.js';
7
7
  import '../chunk-475DOAWF.js';
8
8
  import '../chunk-WSIJDWUG.js';
@@ -219,8 +219,21 @@ export interface GraphTrunk {
219
219
  /** How many edges it stands for. */
220
220
  count: number;
221
221
  d: string;
222
- /** Where its count is written: the middle of its run. */
222
+ /** The middle of its run: where its count is written while nothing is in the way there. */
223
223
  label: CanvasPoint;
224
+ /**
225
+ * The gap it crosses: from the upper cluster's foot (`top`) to the lower
226
+ * one's head (`bottom`), with the level run between them at `y`, from `x1`
227
+ * (under the upper cluster) to `x2` (over the lower one). Where its count may
228
+ * be written: see [placeTrunkLabels].
229
+ */
230
+ run: {
231
+ x1: number;
232
+ x2: number;
233
+ y: number;
234
+ top: number;
235
+ bottom: number;
236
+ };
224
237
  box: CanvasRect;
225
238
  }
226
239
  /**
@@ -229,3 +242,24 @@ export interface GraphTrunk {
229
242
  * between the bands where they do not. Edges inside one band have no trunk.
230
243
  */
231
244
  export declare function graphTrunks(layout: Pick<GraphLayout, 'laneById'>, edges: readonly GraphLayoutEdge[], laneOf: (node: string) => string | undefined): GraphTrunk[];
245
+ /**
246
+ * WHERE EACH TRUNK'S COUNT IS WRITTEN, or null where nowhere in its gap is
247
+ * clear. A count holds its size on screen, as the clusters' titles do, while
248
+ * the gap between two bands shrinks with the zoom, so at its middle a count
249
+ * came to stand on the lower clusters' titles, and two trunks leaving one
250
+ * cluster wrote their counts on each other. Each count is tried along its
251
+ * level run, the middle first, then just past either end of it, at the middle
252
+ * of the gap, hung from the upper cluster's foot, or stood on the lower one's
253
+ * head, and takes the first place that covers no title, no card (`obstacles`,
254
+ * in world units) and no count already placed: a trunk that drops straight
255
+ * down first, since it has one place across, then the largest counts. It may
256
+ * cross a cluster's outline, never what is drawn inside one. A count with nowhere clear is not
257
+ * written: its trunk still is, and the legend says what a trunk is.
258
+ *
259
+ * `sizes` is each count's box in world units, by trunk key, as it is drawn at
260
+ * the zoom the map stands at.
261
+ */
262
+ export declare function placeTrunkLabels(trunks: readonly GraphTrunk[], sizes: ReadonlyMap<string, {
263
+ width: number;
264
+ height: number;
265
+ }>, obstacles: readonly CanvasRect[]): Map<string, CanvasPoint | null>;
@@ -61,5 +61,10 @@ export interface LinkProps extends AnchorHTMLAttributes<HTMLAnchorElement> {
61
61
  * every surface and pressed row, so it is still found by colour and by its
62
62
  * place, and it keeps the focus ring. It draws no underline even on hover:
63
63
  * the ink stepping up to the accent is the signal that it is live.
64
+ *
65
+ * `size="inherit"` sets a link inside a sentence, and there a navigation or an
66
+ * identity is UNDERLINED AT REST: among other words its ink alone does not set
67
+ * it apart (the accent ink against secondary text is 1.18:1 in the dark
68
+ * palette, where running text asks 3:1 or a mark that is not colour).
64
69
  */
65
70
  export declare const Link: import("react").ForwardRefExoticComponent<LinkProps & import("react").RefAttributes<HTMLAnchorElement>>;
@@ -1,3 +1,3 @@
1
- export { Link } from '../chunk-JZI7SIM6.js';
1
+ export { Link } from '../chunk-RMGPZQVJ.js';
2
2
  import '../chunk-RRRK2KB6.js';
3
3
  import '../chunk-ODEQTPFM.js';
@@ -75,11 +75,24 @@
75
75
  font-size: var(--font-size-sm);
76
76
  }
77
77
 
78
- /* Set inside a sentence: the sentence's own size, whatever it is. */
78
+ /*
79
+ * Set inside a sentence: the sentence's own size, whatever it is, and
80
+ * UNDERLINED AT REST. Among other words its ink alone does not set it apart:
81
+ * the accent ink against secondary text is 1.18:1 in the dark palette, where a
82
+ * link in running text needs 3:1 against the words around it or a mark that is
83
+ * not colour. The underline is that mark, in every palette. A quiet reference
84
+ * keeps its own rule (never underlined), and a plain one its own ink.
85
+ */
79
86
  .crewlet-link--inherit {
80
87
  font-size: inherit;
81
88
  }
82
89
 
90
+ .crewlet-link--inherit:is(.crewlet-link--default, .crewlet-link--subtle) {
91
+ text-decoration: underline;
92
+ text-decoration-thickness: from-font;
93
+ text-underline-offset: 0.15em;
94
+ }
95
+
83
96
  /*
84
97
  * A caption-sized link takes the caption's SIZE and keeps the link's ink. It
85
98
  * is medium weight and does not wrap, because the thing it names (an event id,
@@ -1,5 +1,5 @@
1
- export { FactLine, ObjectHeader, SET_BY_VERBS, SetByLine } from '../chunk-ICRFVQH5.js';
2
- import '../chunk-JZI7SIM6.js';
1
+ export { FactLine, ObjectHeader, SET_BY_VERBS, SetByLine } from '../chunk-KUECTV2P.js';
2
+ import '../chunk-RMGPZQVJ.js';
3
3
  import '../chunk-475DOAWF.js';
4
4
  import '../chunk-WSIJDWUG.js';
5
5
  import '../chunk-RRRK2KB6.js';
@@ -1,6 +1,6 @@
1
- export { PropertyList } from '../chunk-DQKNAQWN.js';
2
- import '../chunk-ICRFVQH5.js';
3
- import '../chunk-JZI7SIM6.js';
1
+ export { PropertyList } from '../chunk-D2KJ5GQC.js';
2
+ import '../chunk-KUECTV2P.js';
3
+ import '../chunk-RMGPZQVJ.js';
4
4
  import '../chunk-LH4OF7FI.js';
5
5
  import '../chunk-WGLOH33S.js';
6
6
  import '../chunk-475DOAWF.js';
@@ -1,6 +1,6 @@
1
- export { RAIL_LIST_LABELS, RailList } from '../chunk-DL6Y7SVB.js';
2
- import '../chunk-6ZFQ6TAM.js';
1
+ export { RAIL_LIST_LABELS, RailList } from '../chunk-32QLSXKL.js';
3
2
  import '../chunk-SM2MM4DQ.js';
3
+ import '../chunk-6ZFQ6TAM.js';
4
4
  import '../chunk-6KWNXIDE.js';
5
5
  import '../chunk-KW7T23RT.js';
6
6
  import '../chunk-TODOBUXO.js';
@@ -1,4 +1,4 @@
1
- export { RichEditor, preloadRichEditor } from '../chunk-Q6QKY7EZ.js';
1
+ export { RichEditor, preloadRichEditor } from '../chunk-KQFOPY2P.js';
2
2
  export { RICH_EDITOR_LABELS, richEditorLabels } from '../chunk-2DMTW2Y3.js';
3
3
  import '../chunk-KOJPDCGQ.js';
4
4
  import '../chunk-KBZO4B33.js';
@@ -1,5 +1,5 @@
1
- export { TABLE_TAGS_CELL_LABELS, TableDateCell, TableEntityCell, TableKeyCell, TableNumberCell, TableStatusCell, TableTagsCell, TableTextCell, TableTwoLineCell } from '../chunk-I2JRUQJ4.js';
2
- import '../chunk-JZI7SIM6.js';
1
+ export { TABLE_TAGS_CELL_LABELS, TableDateCell, TableEntityCell, TableKeyCell, TableNumberCell, TableStatusCell, TableTagsCell, TableTextCell, TableTwoLineCell } from '../chunk-JKFA2F7J.js';
2
+ import '../chunk-RMGPZQVJ.js';
3
3
  import '../chunk-SJ3EUCFD.js';
4
4
  import '../chunk-GBKBME7Q.js';
5
5
  import '../chunk-WGLOH33S.js';
@@ -167,6 +167,19 @@ export interface TreeCardContext {
167
167
  * that promised these there would be a promise kept by doing nothing.
168
168
  */
169
169
  export interface TreeCanvasHandle extends TreeViewHandle {
170
+ /**
171
+ * Open every collapsed ancestor of a node, focus it, and bring it into view.
172
+ *
173
+ * A CALLER SENDING FOCUS IS SENDING THE READER SOMEWHERE: to the node an
174
+ * operation made or moved, to the one an undo or a search names. So a node
175
+ * that the view does not show at all is brought to the MIDDLE of the view,
176
+ * at the reader's zoom, with the chart around it on every side; the least
177
+ * pan left it against the edge it came in by, which after an add was the
178
+ * edge of the pane with nothing of the chart beyond it. A node partly in
179
+ * view moves the least distance, and one in view does not move. The tree's
180
+ * own arrow keys keep the least pan: a step lands beside the node before.
181
+ */
182
+ focusNode(id: string): void;
170
183
  /**
171
184
  * Ease onto one node's own card, remembering the view it left.
172
185
  *
@@ -202,9 +215,19 @@ export interface TreeCanvasHandle extends TreeViewHandle {
202
215
  * WHAT THE CHART DOES ABOUT IT. It opens `parent` if it is closed, eases onto
203
216
  * the ghost with the room a form needs rather than the room a label needs
204
217
  * ([CANVAS_COMPOSE_CONTEXT]), moves focus to the first control inside it, and
205
- * on Escape calls `onCancel`. When it goes, the view the reader left is given
206
- * back and focus returns to `parent`. Under `prefers-reduced-motion` every
218
+ * on Escape calls `onCancel`. When it goes, focus returns to `parent` and the
219
+ * view the reader left is given back. Under `prefers-reduced-motion` every
207
220
  * part of that still happens; only the animations do not.
221
+ *
222
+ * THE VIEW COMES BACK ON THE CHART THE COMPOSITION LEFT. An add ends with the
223
+ * node it made in `nodes` and the ghost gone, in one commit, and the new card
224
+ * is measured a frame later; the view is given back on the first layout that
225
+ * places it, not on the ghost's. A reader who had not moved the fit gets the
226
+ * fit of the chart as it now stands, with the new node and anything the
227
+ * composition opened for it inside; a reader who had moved the view gets it
228
+ * back exactly. A caller that then sends focus to the node it made
229
+ * (`focusNode`, as it does after any operation) has it brought to the middle
230
+ * of that view when the view does not show it.
208
231
  */
209
232
  export interface TreeComposing {
210
233
  /**
@@ -1,6 +1,6 @@
1
- export { TREE_ADD_MARK_MIN_ZOOM, TreeCanvas } from '../chunk-556M2A4S.js';
1
+ export { TREE_ADD_MARK_MIN_ZOOM, TreeCanvas } from '../chunk-Q4JX6UO7.js';
2
2
  import '../chunk-MY374UUD.js';
3
- import '../chunk-CVNJ6VHK.js';
3
+ import '../chunk-MNVIIZQP.js';
4
4
  import '../chunk-X4HBZSXA.js';
5
5
  import '../chunk-SK4BIFTG.js';
6
6
  import '../chunk-COS6LJ4K.js';
@@ -1,7 +1,7 @@
1
1
  import { useMeasuredSizes, isTypeAheadKey, typeAheadBuffer } from './chunk-MY374UUD.js';
2
2
  import { FullscreenToggle } from './chunk-3JLG6KRU.js';
3
3
  import { FilterChip } from './chunk-L6HUVA33.js';
4
- import { CANVAS_FIT_PADDING, Canvas } from './chunk-CVNJ6VHK.js';
4
+ import { CANVAS_FIT_PADDING, Canvas } from './chunk-MNVIIZQP.js';
5
5
  import { Text } from './chunk-475DOAWF.js';
6
6
  import { LayerHost } from './chunk-FIX72ZEC.js';
7
7
  import { VisuallyHidden } from './chunk-RRRK2KB6.js';
@@ -606,10 +606,56 @@ function graphTrunks(layout, edges, laneOf) {
606
606
  count,
607
607
  d: pathOf(points),
608
608
  label: { x: (x1 + x2) / 2, y: turn },
609
+ run: { x1, x2, y: turn, top: y1, bottom: y2 },
609
610
  box: boxOf(points)
610
611
  };
611
612
  });
612
613
  }
614
+ var LABEL_GAP = 4;
615
+ var ALONG = [0.5, 0.25, 0.75, 0, 1];
616
+ var ON_THE_CORNER = 8;
617
+ function placeTrunkLabels(trunks, sizes, obstacles) {
618
+ const out = /* @__PURE__ */ new Map();
619
+ const placed = [];
620
+ const free = (trunk) => trunk.run.x1 === trunk.run.x2 ? 0 : 1;
621
+ const order = [...trunks].sort((a, b) => free(a) - free(b) || b.count - a.count || byText(a.key, b.key));
622
+ for (const trunk of order) {
623
+ const size = sizes.get(trunk.key);
624
+ if (!size || size.width <= 0 || size.height <= 0) {
625
+ out.set(trunk.key, null);
626
+ continue;
627
+ }
628
+ const { x1, x2, y, top, bottom } = trunk.run;
629
+ const { width: w, height: h } = size;
630
+ const lo = Math.min(x1, x2);
631
+ const hi = Math.max(x1, x2);
632
+ const xs = [
633
+ ...x1 === x2 ? [x1] : ALONG.map((t) => x1 + (x2 - x1) * t),
634
+ lo - w / 2 + ON_THE_CORNER,
635
+ hi + w / 2 - ON_THE_CORNER
636
+ ];
637
+ const ys = [y, top + h / 2 + 1, bottom - h / 2 - 1];
638
+ const near = (box) => box.x < Math.max(x1, x2) + w && box.x + box.width > Math.min(x1, x2) - w && box.y < bottom + h && box.y + box.height > top - h;
639
+ const against = obstacles.filter(near);
640
+ let at = null;
641
+ for (const cx2 of xs) {
642
+ for (const cy of ys) {
643
+ const box = { x: cx2 - w / 2, y: cy - h / 2, width: w, height: h };
644
+ if (against.some((other) => overlaps(box, other, 0))) continue;
645
+ if (placed.some((other) => overlaps(box, other, LABEL_GAP))) continue;
646
+ at = { x: cx2, y: cy };
647
+ placed.push(box);
648
+ break;
649
+ }
650
+ if (at) break;
651
+ }
652
+ out.set(trunk.key, at);
653
+ }
654
+ return out;
655
+ }
656
+ function overlaps(a, b, gap) {
657
+ return a.x < b.x + b.width + gap && a.x + a.width + gap > b.x && a.y < b.y + b.height + gap && a.y + a.height + gap > b.y;
658
+ }
613
659
  function plan(key, from, to, edge, grid, columns, metrics) {
614
660
  const forward = to.col > from.col;
615
661
  const back = to.col < from.col;
@@ -977,6 +1023,8 @@ var relationWords = (list) => list.map((one) => `${one.relation ?? "depends on"}
977
1023
  var GRAPH_CANVAS_LABELS = {
978
1024
  zoomIn: "Zoom in",
979
1025
  zoomOut: "Zoom out",
1026
+ zoomOutHeld: "All of the map is in view",
1027
+ zoomInHeld: "Zoomed in as far as it goes",
980
1028
  fit: "Fit to view",
981
1029
  actualSize: "Zoom to 100%",
982
1030
  zoom: (percent) => `Zoom is ${percent} percent. Set a zoom level`,
@@ -1037,7 +1085,7 @@ var BAND_PROBE = "crewlet:graph-canvas-band";
1037
1085
  var PROBES = [CARD_PROBE, GAP_PROBE, PAD_PROBE, HEAD_PROBE, BAND_PROBE];
1038
1086
  var emptyProbe = (lane) => `crewlet:graph-canvas-empty:${lane}`;
1039
1087
  var NO_GROUPS = [];
1040
- var AT_REST = /* @__PURE__ */ new Set(["flow"]);
1088
+ var AT_REST = /* @__PURE__ */ new Set(["flow", "support"]);
1041
1089
  var FAMILY_RANK = { context: 0, support: 1, flow: 2 };
1042
1090
  var TONES = ["danger", "warning", "info"];
1043
1091
  var EDGE_STATES = ["dim", "rest", "lit"];
@@ -1099,7 +1147,13 @@ function GraphCanvas({
1099
1147
  },
1100
1148
  [shown, families, onFamiliesChange]
1101
1149
  );
1102
- const restEdges = useMemo(() => edges.filter((edge) => shown.has(edge.family ?? "flow")), [edges, shown]);
1150
+ const restEdges = useMemo(
1151
+ () => edges.filter((edge) => {
1152
+ const family = edge.family ?? "flow";
1153
+ return shown.has(family) && !(chrome && family === "support");
1154
+ }),
1155
+ [edges, shown, chrome]
1156
+ );
1103
1157
  const carrying = useMemo(() => edges.filter((edge) => (edge.family ?? "flow") !== "context"), [edges]);
1104
1158
  const groupOf = useCallback((id) => nodeById.get(id)?.group, [nodeById]);
1105
1159
  const [toggled, setToggled] = useState(() => /* @__PURE__ */ new Map());
@@ -1273,13 +1327,48 @@ function GraphCanvas({
1273
1327
  }, [layout, reach, edges, nodeDimmed, familyOf]);
1274
1328
  const laneOfNode = useCallback((id) => nodeById.get(id)?.lane, [nodeById]);
1275
1329
  const trunks = useMemo(() => {
1276
- if (!layout || !chrome || shown.has("support")) return [];
1330
+ if (!layout || !chrome || !shown.has("support")) return [];
1277
1331
  return graphTrunks(
1278
1332
  layout,
1279
1333
  edges.filter((edge) => edge.family === "support"),
1280
1334
  laneOfNode
1281
1335
  );
1282
1336
  }, [layout, chrome, shown, edges, laneOfNode]);
1337
+ const placeTrunksNow = useRef(() => {
1338
+ });
1339
+ placeTrunksNow.current = () => {
1340
+ const world2 = worldEl.current;
1341
+ if (!world2 || !layout || trunks.length === 0) return;
1342
+ const labels2 = [...world2.querySelectorAll(".crewlet-graph-canvas__trunk-label")];
1343
+ const sizes2 = /* @__PURE__ */ new Map();
1344
+ for (const el of labels2) sizes2.set(el.dataset.trunk ?? "", { width: el.offsetWidth, height: el.offsetHeight });
1345
+ if (labels2.every((el) => el.offsetWidth === 0)) return;
1346
+ const obstacles = [...layout.itemByKey.values()];
1347
+ const words = (el, x, y, centred) => {
1348
+ if (!(el instanceof HTMLElement) || el.offsetWidth === 0) return;
1349
+ const top = y + el.offsetTop - (centred ? el.offsetHeight / 2 : 0);
1350
+ obstacles.push({ x: x + el.offsetLeft, y: top, width: el.offsetWidth, height: el.offsetHeight });
1351
+ };
1352
+ for (const lane of layout.lanes) {
1353
+ const head = world2.querySelector(`.crewlet-graph-canvas__lane-head[data-lane="${CSS.escape(lane.id)}"]`);
1354
+ words(head?.firstElementChild ?? null, lane.head.x, lane.head.y, true);
1355
+ }
1356
+ for (const band of layout.bands) {
1357
+ if (!band.title) continue;
1358
+ const title = world2.querySelector(`.crewlet-graph-canvas__band-title[data-band="${CSS.escape(band.id)}"]`);
1359
+ words(title?.firstElementChild ?? null, band.title.x, band.title.y, false);
1360
+ }
1361
+ const at = placeTrunkLabels(trunks, sizes2, obstacles);
1362
+ for (const el of labels2) {
1363
+ const point2 = at.get(el.dataset.trunk ?? "");
1364
+ if (point2) {
1365
+ el.style.transform = `translate(${point2.x}px, ${point2.y}px) translate(-50%, -50%)`;
1366
+ el.style.removeProperty("visibility");
1367
+ } else {
1368
+ el.style.visibility = "hidden";
1369
+ }
1370
+ }
1371
+ };
1283
1372
  const relationsOf = useMemo(() => {
1284
1373
  const out = /* @__PURE__ */ new Map();
1285
1374
  const entry = (id) => {
@@ -1318,6 +1407,7 @@ function GraphCanvas({
1318
1407
  worldEl.current?.style.setProperty(ZOOM_PROPERTY, String(view.k));
1319
1408
  }
1320
1409
  placeCardNow.current();
1410
+ placeTrunksNow.current();
1321
1411
  const next = graphWindow(mountedNow.current, view, size);
1322
1412
  if (next !== mountedNow.current) setMounted(next);
1323
1413
  },
@@ -1353,6 +1443,7 @@ function GraphCanvas({
1353
1443
  el.style.transform = `translate(${Math.round(left)}px, ${Math.round(top)}px)`;
1354
1444
  };
1355
1445
  useLayoutEffect(() => placeCardNow.current());
1446
+ useLayoutEffect(() => placeTrunksNow.current(), [layout, trunks, mounted]);
1356
1447
  const root = useRef(null);
1357
1448
  const [sized, setSized] = useState(false);
1358
1449
  const [narrow, setNarrow] = useState(false);
@@ -1766,8 +1857,9 @@ function GraphCanvas({
1766
1857
  {
1767
1858
  className: "crewlet-graph-canvas__band-title",
1768
1859
  "aria-hidden": "true",
1860
+ "data-band": band.id,
1769
1861
  style: placedStyle(band.title),
1770
- children: bands[band.index].label
1862
+ children: /* @__PURE__ */ jsx("span", { children: bands[band.index].label })
1771
1863
  },
1772
1864
  band.id
1773
1865
  ) : null
@@ -1800,6 +1892,7 @@ function GraphCanvas({
1800
1892
  {
1801
1893
  className: "crewlet-graph-canvas__trunk-label",
1802
1894
  "aria-hidden": "true",
1895
+ "data-trunk": trunk.key,
1803
1896
  style: { transform: `translate(${trunk.label.x}px, ${trunk.label.y}px) translate(-50%, -50%)` },
1804
1897
  children: text.trunk(trunk.count)
1805
1898
  },
@@ -1812,6 +1905,7 @@ function GraphCanvas({
1812
1905
  {
1813
1906
  className: "crewlet-graph-canvas__lane-head",
1814
1907
  "aria-hidden": "true",
1908
+ "data-lane": lane.id,
1815
1909
  style: placedStyle(lane.head),
1816
1910
  children: /* @__PURE__ */ jsxs("span", { className: "crewlet-graph-canvas__lane-title", children: [
1817
1911
  /* @__PURE__ */ jsx("span", { className: "crewlet-graph-canvas__lane-label", children: laneOf.get(lane.id)?.label }),
@@ -2163,4 +2257,4 @@ function typeAhead(layout, from, text, nameOf) {
2163
2257
  return null;
2164
2258
  }
2165
2259
 
2166
- export { GRAPH_CANVAS_DETAIL_ZOOM, GRAPH_CANVAS_FIT_FLOOR, GRAPH_CANVAS_FLOW_LIMIT, GRAPH_CANVAS_FOCUS_ZOOM, GRAPH_CANVAS_LABELS, GRAPH_CANVAS_NARROW_WIDTH, GRAPH_CANVAS_TILE_ZOOM, GRAPH_EDGE_FAMILIES, GRAPH_ORDER_SWEEPS, GraphCanvas, graphDetail, graphFocusView, graphItemKey, graphNeighbourhood, graphReach, graphStep, graphTrunks, graphWindow, layoutGraph, routeGraphEdges };
2260
+ export { GRAPH_CANVAS_DETAIL_ZOOM, GRAPH_CANVAS_FIT_FLOOR, GRAPH_CANVAS_FLOW_LIMIT, GRAPH_CANVAS_FOCUS_ZOOM, GRAPH_CANVAS_LABELS, GRAPH_CANVAS_NARROW_WIDTH, GRAPH_CANVAS_TILE_ZOOM, GRAPH_EDGE_FAMILIES, GRAPH_ORDER_SWEEPS, GraphCanvas, graphDetail, graphFocusView, graphItemKey, graphNeighbourhood, graphReach, graphStep, graphTrunks, graphWindow, layoutGraph, placeTrunkLabels, routeGraphEdges };
@@ -1,5 +1,5 @@
1
1
  import { Toolbar } from './chunk-NPEI2QAN.js';
2
- import { ShortcutTip } from './chunk-CVNJ6VHK.js';
2
+ import { ShortcutTip } from './chunk-MNVIIZQP.js';
3
3
  import { IconButton } from './chunk-X5YI6E5X.js';
4
4
  import { cx } from './chunk-ODEQTPFM.js';
5
5
  import './CanvasToolbar-EM5EVZED.css';
@@ -1,5 +1,5 @@
1
- import { SetByLine } from './chunk-ICRFVQH5.js';
2
- import { Link } from './chunk-JZI7SIM6.js';
1
+ import { SetByLine } from './chunk-KUECTV2P.js';
2
+ import { Link } from './chunk-RMGPZQVJ.js';
3
3
  import { DescriptionList, DescriptionListItem } from './chunk-LH4OF7FI.js';
4
4
  import { EmptyValue } from './chunk-WGLOH33S.js';
5
5
  import { cx } from './chunk-ODEQTPFM.js';
@@ -1,4 +1,4 @@
1
- import { Link } from './chunk-JZI7SIM6.js';
1
+ import { Link } from './chunk-RMGPZQVJ.js';
2
2
  import { Tag } from './chunk-SJ3EUCFD.js';
3
3
  import { RelativeTime } from './chunk-GBKBME7Q.js';
4
4
  import { EmptyValue } from './chunk-WGLOH33S.js';