@nowline/layout 0.0.0-dev.20260601071750.g04bdff9

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 (193) hide show
  1. package/LICENSE +190 -0
  2. package/README.md +103 -0
  3. package/dist/band-scale.d.ts +56 -0
  4. package/dist/band-scale.d.ts.map +1 -0
  5. package/dist/band-scale.js +86 -0
  6. package/dist/band-scale.js.map +1 -0
  7. package/dist/calendar.d.ts +79 -0
  8. package/dist/calendar.d.ts.map +1 -0
  9. package/dist/calendar.js +210 -0
  10. package/dist/calendar.js.map +1 -0
  11. package/dist/capacity.d.ts +72 -0
  12. package/dist/capacity.d.ts.map +1 -0
  13. package/dist/capacity.js +163 -0
  14. package/dist/capacity.js.map +1 -0
  15. package/dist/dsl-utils.d.ts +5 -0
  16. package/dist/dsl-utils.d.ts.map +1 -0
  17. package/dist/dsl-utils.js +28 -0
  18. package/dist/dsl-utils.js.map +1 -0
  19. package/dist/edge-routing.d.ts +89 -0
  20. package/dist/edge-routing.d.ts.map +1 -0
  21. package/dist/edge-routing.js +435 -0
  22. package/dist/edge-routing.js.map +1 -0
  23. package/dist/frame-tab-geometry.d.ts +78 -0
  24. package/dist/frame-tab-geometry.d.ts.map +1 -0
  25. package/dist/frame-tab-geometry.js +115 -0
  26. package/dist/frame-tab-geometry.js.map +1 -0
  27. package/dist/header-card-geometry.d.ts +29 -0
  28. package/dist/header-card-geometry.d.ts.map +1 -0
  29. package/dist/header-card-geometry.js +41 -0
  30. package/dist/header-card-geometry.js.map +1 -0
  31. package/dist/i18n.d.ts +48 -0
  32. package/dist/i18n.d.ts.map +1 -0
  33. package/dist/i18n.js +114 -0
  34. package/dist/i18n.js.map +1 -0
  35. package/dist/include-chrome-geometry.d.ts +86 -0
  36. package/dist/include-chrome-geometry.d.ts.map +1 -0
  37. package/dist/include-chrome-geometry.js +104 -0
  38. package/dist/include-chrome-geometry.js.map +1 -0
  39. package/dist/index.d.ts +11 -0
  40. package/dist/index.d.ts.map +1 -0
  41. package/dist/index.js +10 -0
  42. package/dist/index.js.map +1 -0
  43. package/dist/inline-date-pin-geometry.d.ts +46 -0
  44. package/dist/inline-date-pin-geometry.d.ts.map +1 -0
  45. package/dist/inline-date-pin-geometry.js +149 -0
  46. package/dist/inline-date-pin-geometry.js.map +1 -0
  47. package/dist/item-bar-geometry.d.ts +157 -0
  48. package/dist/item-bar-geometry.d.ts.map +1 -0
  49. package/dist/item-bar-geometry.js +214 -0
  50. package/dist/item-bar-geometry.js.map +1 -0
  51. package/dist/lane-utilization.d.ts +90 -0
  52. package/dist/lane-utilization.d.ts.map +1 -0
  53. package/dist/lane-utilization.js +206 -0
  54. package/dist/lane-utilization.js.map +1 -0
  55. package/dist/layout-context.d.ts +143 -0
  56. package/dist/layout-context.d.ts.map +1 -0
  57. package/dist/layout-context.js +8 -0
  58. package/dist/layout-context.js.map +1 -0
  59. package/dist/layout.d.ts +18 -0
  60. package/dist/layout.d.ts.map +1 -0
  61. package/dist/layout.js +1298 -0
  62. package/dist/layout.js.map +1 -0
  63. package/dist/nodes/anchor-node.d.ts +16 -0
  64. package/dist/nodes/anchor-node.d.ts.map +1 -0
  65. package/dist/nodes/anchor-node.js +68 -0
  66. package/dist/nodes/anchor-node.js.map +1 -0
  67. package/dist/nodes/footnote-node.d.ts +10 -0
  68. package/dist/nodes/footnote-node.d.ts.map +1 -0
  69. package/dist/nodes/footnote-node.js +41 -0
  70. package/dist/nodes/footnote-node.js.map +1 -0
  71. package/dist/nodes/group-node.d.ts +29 -0
  72. package/dist/nodes/group-node.d.ts.map +1 -0
  73. package/dist/nodes/group-node.js +195 -0
  74. package/dist/nodes/group-node.js.map +1 -0
  75. package/dist/nodes/include-node.d.ts +16 -0
  76. package/dist/nodes/include-node.d.ts.map +1 -0
  77. package/dist/nodes/include-node.js +117 -0
  78. package/dist/nodes/include-node.js.map +1 -0
  79. package/dist/nodes/item-node.d.ts +51 -0
  80. package/dist/nodes/item-node.d.ts.map +1 -0
  81. package/dist/nodes/item-node.js +108 -0
  82. package/dist/nodes/item-node.js.map +1 -0
  83. package/dist/nodes/marker-geometry.d.ts +22 -0
  84. package/dist/nodes/marker-geometry.d.ts.map +1 -0
  85. package/dist/nodes/marker-geometry.js +38 -0
  86. package/dist/nodes/marker-geometry.js.map +1 -0
  87. package/dist/nodes/milestone-node.d.ts +48 -0
  88. package/dist/nodes/milestone-node.d.ts.map +1 -0
  89. package/dist/nodes/milestone-node.js +210 -0
  90. package/dist/nodes/milestone-node.js.map +1 -0
  91. package/dist/nodes/parallel-node.d.ts +21 -0
  92. package/dist/nodes/parallel-node.d.ts.map +1 -0
  93. package/dist/nodes/parallel-node.js +88 -0
  94. package/dist/nodes/parallel-node.js.map +1 -0
  95. package/dist/nodes/roadmap-node.d.ts +76 -0
  96. package/dist/nodes/roadmap-node.d.ts.map +1 -0
  97. package/dist/nodes/roadmap-node.js +788 -0
  98. package/dist/nodes/roadmap-node.js.map +1 -0
  99. package/dist/nodes/swimlane-node.d.ts +38 -0
  100. package/dist/nodes/swimlane-node.d.ts.map +1 -0
  101. package/dist/nodes/swimlane-node.js +308 -0
  102. package/dist/nodes/swimlane-node.js.map +1 -0
  103. package/dist/renderable.d.ts +44 -0
  104. package/dist/renderable.d.ts.map +1 -0
  105. package/dist/renderable.js +21 -0
  106. package/dist/renderable.js.map +1 -0
  107. package/dist/row-packer.d.ts +125 -0
  108. package/dist/row-packer.d.ts.map +1 -0
  109. package/dist/row-packer.js +169 -0
  110. package/dist/row-packer.js.map +1 -0
  111. package/dist/style-resolution.d.ts +14 -0
  112. package/dist/style-resolution.d.ts.map +1 -0
  113. package/dist/style-resolution.js +191 -0
  114. package/dist/style-resolution.js.map +1 -0
  115. package/dist/themes/dark.d.ts +4 -0
  116. package/dist/themes/dark.d.ts.map +1 -0
  117. package/dist/themes/dark.js +241 -0
  118. package/dist/themes/dark.js.map +1 -0
  119. package/dist/themes/grayscale.d.ts +4 -0
  120. package/dist/themes/grayscale.d.ts.map +1 -0
  121. package/dist/themes/grayscale.js +237 -0
  122. package/dist/themes/grayscale.js.map +1 -0
  123. package/dist/themes/index.d.ts +19 -0
  124. package/dist/themes/index.d.ts.map +1 -0
  125. package/dist/themes/index.js +57 -0
  126. package/dist/themes/index.js.map +1 -0
  127. package/dist/themes/light.d.ts +4 -0
  128. package/dist/themes/light.d.ts.map +1 -0
  129. package/dist/themes/light.js +248 -0
  130. package/dist/themes/light.js.map +1 -0
  131. package/dist/themes/shape.d.ts +194 -0
  132. package/dist/themes/shape.d.ts.map +1 -0
  133. package/dist/themes/shape.js +6 -0
  134. package/dist/themes/shape.js.map +1 -0
  135. package/dist/themes/shared.d.ts +145 -0
  136. package/dist/themes/shared.d.ts.map +1 -0
  137. package/dist/themes/shared.js +310 -0
  138. package/dist/themes/shared.js.map +1 -0
  139. package/dist/time-scale.d.ts +39 -0
  140. package/dist/time-scale.d.ts.map +1 -0
  141. package/dist/time-scale.js +62 -0
  142. package/dist/time-scale.js.map +1 -0
  143. package/dist/types.d.ts +516 -0
  144. package/dist/types.d.ts.map +1 -0
  145. package/dist/types.js +6 -0
  146. package/dist/types.js.map +1 -0
  147. package/dist/view-preset.d.ts +23 -0
  148. package/dist/view-preset.d.ts.map +1 -0
  149. package/dist/view-preset.js +146 -0
  150. package/dist/view-preset.js.map +1 -0
  151. package/dist/working-calendar.d.ts +14 -0
  152. package/dist/working-calendar.d.ts.map +1 -0
  153. package/dist/working-calendar.js +74 -0
  154. package/dist/working-calendar.js.map +1 -0
  155. package/package.json +43 -0
  156. package/src/band-scale.ts +115 -0
  157. package/src/calendar.ts +244 -0
  158. package/src/capacity.ts +191 -0
  159. package/src/dsl-utils.ts +30 -0
  160. package/src/edge-routing.ts +550 -0
  161. package/src/frame-tab-geometry.ts +165 -0
  162. package/src/header-card-geometry.ts +48 -0
  163. package/src/i18n.ts +124 -0
  164. package/src/include-chrome-geometry.ts +156 -0
  165. package/src/index.ts +118 -0
  166. package/src/inline-date-pin-geometry.ts +196 -0
  167. package/src/item-bar-geometry.ts +271 -0
  168. package/src/lane-utilization.ts +259 -0
  169. package/src/layout-context.ts +182 -0
  170. package/src/layout.ts +1530 -0
  171. package/src/nodes/anchor-node.ts +77 -0
  172. package/src/nodes/footnote-node.ts +60 -0
  173. package/src/nodes/group-node.ts +260 -0
  174. package/src/nodes/include-node.ts +168 -0
  175. package/src/nodes/item-node.ts +171 -0
  176. package/src/nodes/marker-geometry.ts +43 -0
  177. package/src/nodes/milestone-node.ts +263 -0
  178. package/src/nodes/parallel-node.ts +110 -0
  179. package/src/nodes/roadmap-node.ts +957 -0
  180. package/src/nodes/swimlane-node.ts +423 -0
  181. package/src/renderable.ts +68 -0
  182. package/src/row-packer.ts +271 -0
  183. package/src/style-resolution.ts +243 -0
  184. package/src/themes/dark.ts +244 -0
  185. package/src/themes/grayscale.ts +240 -0
  186. package/src/themes/index.ts +66 -0
  187. package/src/themes/light.ts +251 -0
  188. package/src/themes/shape.ts +230 -0
  189. package/src/themes/shared.ts +369 -0
  190. package/src/time-scale.ts +78 -0
  191. package/src/types.ts +641 -0
  192. package/src/view-preset.ts +180 -0
  193. package/src/working-calendar.ts +91 -0
@@ -0,0 +1,516 @@
1
+ export type SizeBucket = 'none' | 'xs' | 'sm' | 'md' | 'lg' | 'xl' | 'full';
2
+ export type ShadowKind = 'none' | 'subtle' | 'soft' | 'hard';
3
+ export type BorderKind = 'solid' | 'dashed' | 'dotted';
4
+ export type FontFamily = 'sans' | 'serif' | 'mono';
5
+ export type FontWeight = 'thin' | 'light' | 'normal' | 'bold';
6
+ export type BracketKind = 'none' | 'solid' | 'dashed';
7
+ export type HeaderPosition = 'beside' | 'above';
8
+ export type TimelinePosition = 'top' | 'bottom' | 'both';
9
+ export type StatusKind = 'planned' | 'in-progress' | 'done' | 'at-risk' | 'blocked' | 'neutral';
10
+ export interface ResolvedStyle {
11
+ bg: string;
12
+ fg: string;
13
+ text: string;
14
+ border: BorderKind;
15
+ icon: string;
16
+ shadow: ShadowKind;
17
+ font: FontFamily;
18
+ weight: FontWeight;
19
+ italic: boolean;
20
+ textSize: SizeBucket;
21
+ padding: SizeBucket;
22
+ spacing: SizeBucket;
23
+ headerHeight: SizeBucket;
24
+ cornerRadius: SizeBucket;
25
+ bracket: BracketKind;
26
+ headerPosition: HeaderPosition;
27
+ /**
28
+ * Glyph used as the suffix on capacity numbers (`5×`, `5 [person]`, etc.).
29
+ * Stores the raw value as the author wrote it: a built-in icon name
30
+ * (`'multiplier'`, `'person'`, ...), a custom symbol id declared via
31
+ * `symbol` in config, or an inline Unicode literal (`'💰'`). The renderer
32
+ * resolves built-in vs custom vs literal at paint time using
33
+ * `ResolvedConfig.symbols` and the `BUILTIN_CAPACITY_ICONS` set.
34
+ * Default `'multiplier'`.
35
+ */
36
+ capacityIcon: string;
37
+ timelinePosition: TimelinePosition;
38
+ minorGrid: boolean;
39
+ }
40
+ export interface BoundingBox {
41
+ x: number;
42
+ y: number;
43
+ width: number;
44
+ height: number;
45
+ }
46
+ /**
47
+ * Calendar-resolved view of a `size NAME ["TITLE"] effort:LITERAL`
48
+ * declaration. Built once per layout from the AST `SizeDeclaration`s
49
+ * collected by the include-resolver and the active calendar (which
50
+ * decides how many days a literal like `2w` maps to). Items reference
51
+ * these via `LayoutContext.sizes` rather than walking the AST +
52
+ * calendar each time they need an effort.
53
+ *
54
+ * `effortLiteral` keeps the raw literal so callers can show the size's
55
+ * effort string (`"2w"`) on tooltips without re-formatting from
56
+ * `effortDays`.
57
+ *
58
+ * `title` is the optional author-provided display label. The on-bar
59
+ * size chip prefers `title` when present, falling back to `name` (the
60
+ * id) verbatim — both rendered with the case the author typed. See
61
+ * specs/rendering.md § Item size chip.
62
+ */
63
+ export interface ResolvedSize {
64
+ name: string;
65
+ title?: string;
66
+ effortDays: number;
67
+ effortLiteral: string;
68
+ }
69
+ export interface Point {
70
+ x: number;
71
+ y: number;
72
+ }
73
+ export interface PositionedLogo {
74
+ box: BoundingBox;
75
+ assetRef?: string;
76
+ }
77
+ export interface PositionedHeader {
78
+ box: BoundingBox;
79
+ position: HeaderPosition;
80
+ title: string;
81
+ author?: string;
82
+ titleLines: string[];
83
+ authorLines: string[];
84
+ cardBox: BoundingBox;
85
+ logo?: PositionedLogo;
86
+ style: ResolvedStyle;
87
+ attributionBox: BoundingBox;
88
+ }
89
+ export interface PositionedTick {
90
+ x: number;
91
+ labelX?: number;
92
+ label?: string;
93
+ major: boolean;
94
+ }
95
+ export interface PositionedTimelineScale {
96
+ box: BoundingBox;
97
+ ticks: PositionedTick[];
98
+ pixelsPerDay: number;
99
+ originX: number;
100
+ startDate: Date;
101
+ endDate: Date;
102
+ labelStyle: ResolvedStyle;
103
+ pillRowHeight: number;
104
+ tickPanelY: number;
105
+ tickPanelHeight: number;
106
+ markerRow: {
107
+ y: number;
108
+ height: number;
109
+ collisionY: number;
110
+ };
111
+ bottomTickPanelY?: number;
112
+ bottomTickPanelHeight?: number;
113
+ minorGrid: boolean;
114
+ }
115
+ /**
116
+ * How the now-pill is positioned relative to the now-line.
117
+ *
118
+ * - `center` — pill centered on the line (default). Used when both
119
+ * edges have at least `NOW_PILL_WIDTH_PX/2` of clearance from the
120
+ * chart's left/right edges.
121
+ * - `flag-right` — line at the pill's left edge, pill extends to the
122
+ * right with the right side rounded and the label left-aligned.
123
+ * Used when the line lands close enough to `chartLeftX` that a
124
+ * centered pill would overlap the header card / canvas left edge.
125
+ * - `flag-left` — line at the pill's right edge, pill extends to the
126
+ * left with the left side rounded and the label right-aligned.
127
+ * Used when the line lands close enough to `chartRightX` that a
128
+ * centered pill would clip past the canvas right edge.
129
+ *
130
+ * In both flag modes the squared edge IS the now-line, so the pill
131
+ * visually anchors to the line without growing the canvas.
132
+ */
133
+ export type NowPillMode = 'center' | 'flag-right' | 'flag-left';
134
+ export interface PositionedNowline {
135
+ x: number;
136
+ topY: number;
137
+ bottomY: number;
138
+ pillTopY: number;
139
+ /** How the pill aligns to the line (see `NowPillMode`). */
140
+ pillMode: NowPillMode;
141
+ /**
142
+ * Locale-resolved string painted inside the pill (`'now'` for `en-US`,
143
+ * `'maint.'` for `fr`). Layout owns the locale lookup; the renderer
144
+ * just paints the string. See `packages/layout/src/i18n.ts`.
145
+ */
146
+ label: string;
147
+ /**
148
+ * Width (px) of the pill. Floored at `NOW_PILL_WIDTH_PX` so en-US
149
+ * (`'now'`) keeps its byte-stable 36 px footprint; longer locale
150
+ * strings (e.g. `'maint.'` for fr) grow the pill to fit instead of
151
+ * clipping. Computed in `buildNowline` from `estimateTextWidth(label)`.
152
+ */
153
+ pillWidth: number;
154
+ style: ResolvedStyle;
155
+ }
156
+ /**
157
+ * One inline-date pin (`after:DATE` / `before:DATE`) attached to an entity.
158
+ * The renderer paints a small calendar glyph at `glyphTopLeft` with side
159
+ * length `glyphSize`, fills with the entity's resolved meta color, and emits
160
+ * a `<title>` child carrying `isoDate` for native browser tooltips. There is
161
+ * no inline date caption — see specs/rendering.md "Inline-date glyph".
162
+ *
163
+ * `side` decides which corner the glyph belongs in (top-LEFT for `after`,
164
+ * top-RIGHT for `before`). The validator enforces "at most one inline date
165
+ * per direction" so `inlineDatePins` carries 0..2 entries.
166
+ *
167
+ * `spilled === true` means the entity (item bar) was too narrow to host the
168
+ * glyph inside its decoration row, so `glyphTopLeft` points at the spill
169
+ * column outside the bar instead. Group and parallel containers never spill;
170
+ * they always have room for the glyph in their bounding box.
171
+ */
172
+ export interface InlineDatePin {
173
+ side: 'after' | 'before';
174
+ isoDate: string;
175
+ glyphTopLeft: Point;
176
+ glyphSize: number;
177
+ spilled: boolean;
178
+ }
179
+ export interface PositionedItem {
180
+ kind: 'item';
181
+ id?: string;
182
+ title: string;
183
+ box: BoundingBox;
184
+ status: StatusKind;
185
+ progressFraction: number;
186
+ footnoteIndicators: number[];
187
+ labelChips: PositionedLabelChip[];
188
+ /** Inline-date pins attached to this item (`after:DATE` / `before:DATE`).
189
+ * Empty (or undefined) when the item has no inline-date pins. See
190
+ * `InlineDatePin` and specs/rendering.md "Inline-date glyph". */
191
+ inlineDatePins?: InlineDatePin[];
192
+ /** True when the chip row's natural total width exceeded the bar's
193
+ * effective inner width and the whole row spilled past the bar's
194
+ * right edge. The chips' `box.x` already reflects the spilled
195
+ * position; this flag exists for the row-packer to reserve the
196
+ * spilled extent and for the renderer / debug overlays to know
197
+ * the row sits outside the bar's painted footprint. */
198
+ chipsOutside: boolean;
199
+ /** Logical right x reached by the chip row, INCLUDING the chips
200
+ * whether painted inside or outside the bar. Equals the start x
201
+ * when there are no chips. The row-packer's spill reservation
202
+ * uses this to grow the chart canvas / bump siblings. */
203
+ chipsRightX: number;
204
+ linkIcon?: LinkIconKind;
205
+ linkHref?: string;
206
+ hasOverflow: boolean;
207
+ overflowBox?: BoundingBox;
208
+ overflowAnchorId?: string;
209
+ owner?: string;
210
+ description?: string;
211
+ metaText?: string;
212
+ textSpills: boolean;
213
+ /** True when the bar is too narrow to host the status dot inside
214
+ * with its full inset (`MIN_BAR_WIDTH_FOR_DOT_PX`). The dot
215
+ * renders in the spill column to the right of the bar instead
216
+ * of overshooting the bar's left edge. */
217
+ dotSpills: boolean;
218
+ /** True when the bar is too narrow to host the link-icon tile
219
+ * inside without colliding with the status dot column
220
+ * (`MIN_BAR_WIDTH_FOR_LINK_AND_DOT_PX`). The icon spills out and
221
+ * renders ahead of the (also-spilled) title so the icon stays
222
+ * visually attached to the title text. Implies `textSpills`. */
223
+ iconSpills: boolean;
224
+ /** True when the bar is too narrow to host the footnote
225
+ * superscript at its inset-right position. The indicator(s)
226
+ * render in the spill column trailing the title text instead
227
+ * of at the bar's upper-right corner. */
228
+ footnoteSpills: boolean;
229
+ /** Pre-computed x positions for the spilled decorations. `null`
230
+ * when the matching `*Spills` flag is false (decoration stays
231
+ * inside the bar at its inset-anchored position). */
232
+ dotSpillCx: number | null;
233
+ iconSpillX: number | null;
234
+ /** First footnote indicator's left edge in the spill column.
235
+ * Subsequent indicators walk right by `ITEM_FOOTNOTE_INDICATOR_STEP_PX`. */
236
+ footnoteSpillStartX: number | null;
237
+ /** Right edge of the spilled-decoration cluster (inclusive of
238
+ * spilled title and footnote glyphs). Used by the row-packer
239
+ * to size the row's spill reservation so the next chained item
240
+ * doesn't land underneath. */
241
+ decorationsRightX: number;
242
+ /**
243
+ * Capacity suffix data when the item declares `capacity:N`. Null when
244
+ * the item has no capacity, the value is non-positive, or the resolved
245
+ * `capacity-icon` is `none` and no number should render either way.
246
+ *
247
+ * Renders alongside the item's `metaText` (or stand-alone when no meta
248
+ * is present) per specs/rendering.md § Item capacity suffix. The `text`
249
+ * is the formatted number (`'5'`, `'0.5'`, `'1.25'`); `icon` tells the
250
+ * renderer which glyph to draw and whether to use the SVG library, the
251
+ * `×` text node, or an inline literal.
252
+ */
253
+ capacity: PositionedCapacity | null;
254
+ /**
255
+ * Resolved size when the item declared `size:NAME`. Null when the item
256
+ * sized itself with a literal `duration:` or didn't declare a size at
257
+ * all. Used by the renderer for the size chip on the meta line (m6) and
258
+ * by the layout for capacity-aware duration derivation (m5).
259
+ */
260
+ size: ResolvedSize | null;
261
+ style: ResolvedStyle;
262
+ }
263
+ /**
264
+ * Positioned capacity suffix shared by `PositionedItem` and (in m7) the lane
265
+ * frame-tab badge. The shape stays small and serializable: a formatted number
266
+ * string plus a discriminated union for the glyph. The renderer paints both.
267
+ *
268
+ * `icon === null` means the resolved `capacity-icon` was `'none'` — render
269
+ * the bare number with no glyph or separator.
270
+ */
271
+ export interface PositionedCapacity {
272
+ /** Numeric capacity, post-percent-sugar conversion (e.g. `50%` → 0.5). */
273
+ value: number;
274
+ /** Display string per spec number-formatting rules (`'5'`, `'0.5'`). */
275
+ text: string;
276
+ /** Resolved glyph instruction, or `null` when the icon is `'none'`. */
277
+ icon: ResolvedCapacityIconRef | null;
278
+ }
279
+ /**
280
+ * Renderer-facing capacity-icon reference. Mirrors the layout-internal
281
+ * `ResolvedCapacityIcon` from `capacity.ts` but lives in the shared
282
+ * positioned-model types so the renderer can read it without importing
283
+ * layout internals.
284
+ */
285
+ export type ResolvedCapacityIconRef = {
286
+ kind: 'builtin';
287
+ name: 'multiplier' | 'person' | 'people' | 'points' | 'time';
288
+ } | {
289
+ kind: 'literal';
290
+ text: string;
291
+ };
292
+ export type LinkIconKind = 'linear' | 'github' | 'jira' | 'generic' | 'none';
293
+ export interface PositionedLabelChip {
294
+ text: string;
295
+ style: ResolvedStyle;
296
+ box: BoundingBox;
297
+ }
298
+ export interface PositionedGroup {
299
+ kind: 'group';
300
+ id?: string;
301
+ title?: string;
302
+ box: BoundingBox;
303
+ children: PositionedTrackChild[];
304
+ /** Inline-date pins attached to this group (`after:DATE` / `before:DATE`).
305
+ * See `InlineDatePin` and specs/rendering.md "Inline-date glyph". */
306
+ inlineDatePins?: InlineDatePin[];
307
+ style: ResolvedStyle;
308
+ }
309
+ export interface PositionedParallel {
310
+ kind: 'parallel';
311
+ id?: string;
312
+ title?: string;
313
+ box: BoundingBox;
314
+ children: PositionedTrackChild[];
315
+ /** Inline-date pins attached to this parallel (`after:DATE` / `before:DATE`).
316
+ * See `InlineDatePin` and specs/rendering.md "Inline-date glyph". */
317
+ inlineDatePins?: InlineDatePin[];
318
+ style: ResolvedStyle;
319
+ }
320
+ export type PositionedTrackChild = PositionedItem | PositionedParallel | PositionedGroup;
321
+ export interface PositionedSwimlane {
322
+ id?: string;
323
+ title: string;
324
+ box: BoundingBox;
325
+ bandIndex: number;
326
+ children: PositionedTrackChild[];
327
+ nested: PositionedSwimlane[];
328
+ style: ResolvedStyle;
329
+ owner?: string;
330
+ footnoteIndicators: number[];
331
+ /**
332
+ * Lane-level capacity badge data when the swimlane declares
333
+ * `capacity:N`. Null when no capacity is set or the value parses to
334
+ * zero. The renderer paints the badge inside the frame tab after the
335
+ * owner badge (or after the lane title when no owner is present),
336
+ * per specs/rendering.md § Lane capacity badge. m8 (overload sweep)
337
+ * also reads `value` to compute load against item capacities.
338
+ *
339
+ * `capacity-icon:none` resolves to `icon: null` here (just the bare
340
+ * number renders, no glyph) but the badge still appears. Authors who
341
+ * want the badge fully hidden simply omit `capacity:`.
342
+ */
343
+ capacity: PositionedCapacity | null;
344
+ /**
345
+ * Tri-state utilization underline data when the lane declares
346
+ * `capacity:` AND has at least one item contributing load AND has not
347
+ * opted out of every color band via `utilization-*-at:none`. Null
348
+ * otherwise — the renderer paints no underline.
349
+ *
350
+ * Computed in m12 by `computeLaneUtilization` (see
351
+ * `lane-utilization.ts`) per specs/rendering.md § Lane utilization
352
+ * underline. The renderer paints one rectangle per coalesced segment
353
+ * along the bottom edge of the band, colored from the resolved theme's
354
+ * `swimlane.utilizationOk` / `…Warn` / `…Over` tokens.
355
+ */
356
+ utilization: PositionedLaneUtilization | null;
357
+ }
358
+ /**
359
+ * One classification for a lane utilization segment. `green` includes the
360
+ * zero-load case so the underline reads as a continuous health bar; the spec
361
+ * intentionally avoids a separate "idle" color.
362
+ */
363
+ export type UtilizationClassification = 'green' | 'yellow' | 'red';
364
+ /**
365
+ * One half-open `[startX, endX)` segment of the lane's utilization underline,
366
+ * pre-classified for the renderer. Adjacent same-classification segments are
367
+ * coalesced upstream so the renderer paints one rectangle per visible color
368
+ * band rather than per event boundary.
369
+ *
370
+ * `load` is the absolute concurrent capacity at this segment (sum of active
371
+ * items' `capacity:` values). Useful for tooltips and debug overlays; the
372
+ * paint color is determined by `classification` alone.
373
+ */
374
+ export interface PositionedUtilizationSegment {
375
+ startX: number;
376
+ endX: number;
377
+ load: number;
378
+ classification: UtilizationClassification;
379
+ }
380
+ /**
381
+ * Resolved utilization model for a swimlane. Carries the segment list plus
382
+ * the resolved thresholds and capacity so downstream consumers (renderer,
383
+ * tooltips, exporters) can describe the model without re-resolving config.
384
+ *
385
+ * `warnFraction` / `overFraction`: each is either a positive fraction of
386
+ * `capacityValue` (the lane paints that color band when load reaches the
387
+ * fraction) or `null` to mean "this color band is opted out via
388
+ * `utilization-*-at:none`".
389
+ */
390
+ export interface PositionedLaneUtilization {
391
+ segments: PositionedUtilizationSegment[];
392
+ capacityValue: number;
393
+ warnFraction: number | null;
394
+ overFraction: number | null;
395
+ }
396
+ export interface PositionedAnchor {
397
+ id?: string;
398
+ title: string;
399
+ center: Point;
400
+ radius: number;
401
+ style: ResolvedStyle;
402
+ predecessorPoints: Point[];
403
+ cutTopY: number;
404
+ cutBottomY: number;
405
+ bumpedUp: boolean;
406
+ labelBox: BoundingBox;
407
+ labelSide: 'left' | 'right';
408
+ }
409
+ export interface PositionedMilestone {
410
+ id?: string;
411
+ title: string;
412
+ center: Point;
413
+ radius: number;
414
+ fixed: boolean;
415
+ slackArrows?: Array<{
416
+ x: number;
417
+ y: number;
418
+ }>;
419
+ isOverrun: boolean;
420
+ style: ResolvedStyle;
421
+ cutTopY: number;
422
+ cutBottomY: number;
423
+ labelBox: BoundingBox;
424
+ labelSide: 'left' | 'right';
425
+ }
426
+ /**
427
+ * Result of packing a marker-row entity (anchor or milestone) into the
428
+ * dynamic row stack. `rowIndex == 0` is the in-row baseline; positive
429
+ * indices push the diamond DOWN by `step` px each. The label box is
430
+ * absolute and already accounts for left/right side flipping when the
431
+ * preferred side would overflow the chart.
432
+ */
433
+ export interface MarkerRowPlacement {
434
+ rowIndex: number;
435
+ centerY: number;
436
+ labelBox: BoundingBox;
437
+ labelSide: 'left' | 'right';
438
+ }
439
+ /**
440
+ * Horizontal corridor occupied by a milestone's slack arrow. Sits at
441
+ * the slack predecessor's row Y, running from the predecessor's right
442
+ * edge to the milestone's column. Items whose natural placement would
443
+ * intersect this band must drop to a row whose Y does not match `y`,
444
+ * so the arrow has clear horizontal space to travel.
445
+ */
446
+ export interface SlackCorridor {
447
+ xStart: number;
448
+ xEnd: number;
449
+ y: number;
450
+ slackPredId: string;
451
+ milestoneId: string;
452
+ }
453
+ export interface PositionedDependencyEdge {
454
+ fromId: string;
455
+ toId: string;
456
+ waypoints: Point[];
457
+ /**
458
+ * - `normal` — orthogonal arrow drawn AFTER swimlane / item /
459
+ * marker fills so it sits on top of lane bands.
460
+ * - `overflow` — currently unused at construction; reserved for the
461
+ * red `before:` overrun annotation arrow.
462
+ * - `underBar` — channel router could not find a clear vertical
463
+ * gutter between the source and target columns; the arrow's
464
+ * vertical leg crosses one or more item bars. The renderer paints
465
+ * these edges BEFORE bar fills with a thinner stroke so the bar
466
+ * stays the visual foreground.
467
+ */
468
+ kind: 'normal' | 'overflow' | 'underBar';
469
+ style: ResolvedStyle;
470
+ }
471
+ export interface PositionedFootnoteIndicator {
472
+ number: number;
473
+ hostItemId: string;
474
+ style: ResolvedStyle;
475
+ }
476
+ export interface PositionedFootnoteArea {
477
+ box: BoundingBox;
478
+ entries: PositionedFootnoteEntry[];
479
+ }
480
+ export interface PositionedFootnoteEntry {
481
+ number: number;
482
+ title: string;
483
+ description?: string;
484
+ style: ResolvedStyle;
485
+ }
486
+ export interface PositionedIncludeRegion {
487
+ sourcePath: string;
488
+ label: string;
489
+ box: BoundingBox;
490
+ nestedSwimlanes: PositionedSwimlane[];
491
+ style: ResolvedStyle;
492
+ }
493
+ export interface PositionedRoadmap {
494
+ width: number;
495
+ height: number;
496
+ theme: import('./themes/index.js').ThemeName;
497
+ /**
498
+ * Resolved palette — every color the renderer reads. m2.5d moved
499
+ * theme resolution into the layout side, so the renderer no longer
500
+ * branches on `theme === 'dark'`. The `theme` field above stays for
501
+ * `data-theme` SVG attribution; all color decisions read `palette`.
502
+ */
503
+ palette: import('./themes/index.js').Theme;
504
+ backgroundColor: string;
505
+ header: PositionedHeader;
506
+ timeline: PositionedTimelineScale;
507
+ nowline: PositionedNowline | null;
508
+ swimlanes: PositionedSwimlane[];
509
+ anchors: PositionedAnchor[];
510
+ milestones: PositionedMilestone[];
511
+ edges: PositionedDependencyEdge[];
512
+ footnotes: PositionedFootnoteArea;
513
+ includes: PositionedIncludeRegion[];
514
+ chartBox: BoundingBox;
515
+ }
516
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAKA,MAAM,MAAM,UAAU,GAAG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E,MAAM,CAAC;IACf,UAAU,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE,aAAa,CAAC;CACxB;AAED,MAAM,WAAW,sBAAsB;IACnC,GAAG,EAAE,WAAW,CAAC;IACjB,OAAO,EAAE,uBAAuB,EAAE,CAAC;CACtC;AAED,MAAM,WAAW,uBAAuB;IACpC,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,KAAK,EAAE,aAAa,CAAC;CACxB;AAED,MAAM,WAAW,uBAAuB;IACpC,UAAU,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,EAAE,WAAW,CAAC;IAIjB,eAAe,EAAE,kBAAkB,EAAE,CAAC;IACtC,KAAK,EAAE,aAAa,CAAC;CACxB;AAGD,MAAM,WAAW,iBAAiB;IAC9B,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,OAAO,mBAAmB,EAAE,SAAS,CAAC;IAC7C;;;;;OAKG;IACH,OAAO,EAAE,OAAO,mBAAmB,EAAE,KAAK,CAAC;IAC3C,eAAe,EAAE,MAAM,CAAC;IACxB,MAAM,EAAE,gBAAgB,CAAC;IACzB,QAAQ,EAAE,uBAAuB,CAAC;IAClC,OAAO,EAAE,iBAAiB,GAAG,IAAI,CAAC;IAClC,SAAS,EAAE,kBAAkB,EAAE,CAAC;IAChC,OAAO,EAAE,gBAAgB,EAAE,CAAC;IAC5B,UAAU,EAAE,mBAAmB,EAAE,CAAC;IAClC,KAAK,EAAE,wBAAwB,EAAE,CAAC;IAClC,SAAS,EAAE,sBAAsB,CAAC;IAClC,QAAQ,EAAE,uBAAuB,EAAE,CAAC;IAEpC,QAAQ,EAAE,WAAW,CAAC;CACzB"}
package/dist/types.js ADDED
@@ -0,0 +1,6 @@
1
+ // Positioned-model types. One type per entity in specs/rendering.md §
2
+ // The Positioned Model. Coordinates are in SVG user units with origin at
3
+ // top-left. All colors in `ResolvedStyle` are concrete hex strings baked
4
+ // in by style-resolution; the renderer is palette-dumb.
5
+ export {};
6
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,sEAAsE;AACtE,yEAAyE;AACzE,yEAAyE;AACzE,wDAAwD"}
@@ -0,0 +1,23 @@
1
+ import type { NowlineFile, ScaleBlock } from '@nowline/core';
2
+ import type { TimeScale } from './time-scale.js';
3
+ import type { PositionedTick } from './types.js';
4
+ import type { WorkingCalendar } from './working-calendar.js';
5
+ export type ScaleUnit = 'days' | 'weeks' | 'months' | 'quarters' | 'years';
6
+ export interface ViewPreset {
7
+ /** Tick stride unit (each tick is one `unit` apart). */
8
+ unit: ScaleUnit;
9
+ /** Show a label every N ticks (1 = every tick gets a label). */
10
+ labelEvery: number;
11
+ /** Pixels per `1 unit` worth of working days. */
12
+ pixelsPerUnit: number;
13
+ }
14
+ export type ScaleConfig = ViewPreset;
15
+ export declare function resolveScale(file: NowlineFile, scaleBlock: ScaleBlock | undefined): ViewPreset;
16
+ /**
17
+ * Build header ticks for the chart. The ith tick sits at
18
+ * `originX + i * stridePx`. The last tick is rendered (so the chart
19
+ * has a closing edge) but its label is suppressed because there's no
20
+ * following column.
21
+ */
22
+ export declare function buildHeaderTicks(scale: TimeScale, preset: ViewPreset, calendar: WorkingCalendar, locale?: string): PositionedTick[];
23
+ //# sourceMappingURL=view-preset.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"view-preset.d.ts","sourceRoot":"","sources":["../src/view-preset.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAI7D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AACjD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AACjD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAE7D,MAAM,MAAM,SAAS,GAAG,MAAM,GAAG,OAAO,GAAG,QAAQ,GAAG,UAAU,GAAG,OAAO,CAAC;AAE3E,MAAM,WAAW,UAAU;IACvB,wDAAwD;IACxD,IAAI,EAAE,SAAS,CAAC;IAChB,gEAAgE;IAChE,UAAU,EAAE,MAAM,CAAC;IACnB,iDAAiD;IACjD,aAAa,EAAE,MAAM,CAAC;CACzB;AAKD,MAAM,MAAM,WAAW,GAAG,UAAU,CAAC;AAMrC,wBAAgB,YAAY,CAAC,IAAI,EAAE,WAAW,EAAE,UAAU,EAAE,UAAU,GAAG,SAAS,GAAG,UAAU,CAoE9F;AAmBD;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAC5B,KAAK,EAAE,SAAS,EAChB,MAAM,EAAE,UAAU,EAClB,QAAQ,EAAE,eAAe,EACzB,MAAM,GAAE,MAAuB,GAChC,cAAc,EAAE,CAsBlB"}