@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,29 @@
1
+ /** Horizontal padding (px) inside the card from edge to text. */
2
+ export declare const HEADER_CARD_PADDING_X = 16;
3
+ /**
4
+ * Top padding (px) — measured to the BASELINE of the first title
5
+ * line. Larger than a typical "padding top" because it includes the
6
+ * cap-to-baseline distance for the 16 pt title font.
7
+ */
8
+ export declare const HEADER_CARD_PADDING_TOP = 26;
9
+ /**
10
+ * Bottom padding (px) below the descender of the last text line.
11
+ * Symmetric-feeling visual padding (smaller than `PADDING_TOP` since
12
+ * top includes the cap-to-baseline distance).
13
+ */
14
+ export declare const HEADER_CARD_PADDING_BOTTOM = 14;
15
+ /** Baseline-to-baseline spacing between consecutive title lines. */
16
+ export declare const HEADER_TITLE_LINE_HEIGHT_PX = 20;
17
+ /** Baseline-to-baseline spacing between consecutive author lines. */
18
+ export declare const HEADER_AUTHOR_LINE_HEIGHT_PX = 14;
19
+ /**
20
+ * Vertical gap (px) between the LAST title baseline and the FIRST
21
+ * author baseline. Larger than a normal line height because it spans
22
+ * the title's descender + the author's cap height.
23
+ */
24
+ export declare const HEADER_TITLE_TO_AUTHOR_GAP_PX = 18;
25
+ /** Font size (px) of the title text. */
26
+ export declare const HEADER_TITLE_FONT_SIZE_PX = 16;
27
+ /** Font size (px) of the author text (subtitle). */
28
+ export declare const HEADER_AUTHOR_FONT_SIZE_PX = 11;
29
+ //# sourceMappingURL=header-card-geometry.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"header-card-geometry.d.ts","sourceRoot":"","sources":["../src/header-card-geometry.ts"],"names":[],"mappings":"AAaA,iEAAiE;AACjE,eAAO,MAAM,qBAAqB,KAAK,CAAC;AAExC;;;;GAIG;AACH,eAAO,MAAM,uBAAuB,KAAK,CAAC;AAE1C;;;;GAIG;AACH,eAAO,MAAM,0BAA0B,KAAK,CAAC;AAE7C,oEAAoE;AACpE,eAAO,MAAM,2BAA2B,KAAK,CAAC;AAE9C,qEAAqE;AACrE,eAAO,MAAM,4BAA4B,KAAK,CAAC;AAE/C;;;;GAIG;AACH,eAAO,MAAM,6BAA6B,KAAK,CAAC;AAEhD,wCAAwC;AACxC,eAAO,MAAM,yBAAyB,KAAK,CAAC;AAE5C,oDAAoD;AACpD,eAAO,MAAM,0BAA0B,KAAK,CAAC"}
@@ -0,0 +1,41 @@
1
+ // Header card geometry — sizing and text-stack metrics for the
2
+ // "header card" that sits beside the timeline (title + author block).
3
+ //
4
+ // Layout owns the card *size* (computed up-front in `sizeBesideHeader`
5
+ // from wrapped title/author text). The renderer paints the rectangle +
6
+ // text using the *same* paddings, line heights, and font sizes so the
7
+ // card is laid out and drawn consistently.
8
+ //
9
+ // Bumping any of these constants changes the visible size of the
10
+ // header card and the position of every text line inside it. Always
11
+ // keep the layout's `sizeBesideHeader` and the renderer's
12
+ // `renderHeader` aligned by going through this module.
13
+ /** Horizontal padding (px) inside the card from edge to text. */
14
+ export const HEADER_CARD_PADDING_X = 16;
15
+ /**
16
+ * Top padding (px) — measured to the BASELINE of the first title
17
+ * line. Larger than a typical "padding top" because it includes the
18
+ * cap-to-baseline distance for the 16 pt title font.
19
+ */
20
+ export const HEADER_CARD_PADDING_TOP = 26;
21
+ /**
22
+ * Bottom padding (px) below the descender of the last text line.
23
+ * Symmetric-feeling visual padding (smaller than `PADDING_TOP` since
24
+ * top includes the cap-to-baseline distance).
25
+ */
26
+ export const HEADER_CARD_PADDING_BOTTOM = 14;
27
+ /** Baseline-to-baseline spacing between consecutive title lines. */
28
+ export const HEADER_TITLE_LINE_HEIGHT_PX = 20;
29
+ /** Baseline-to-baseline spacing between consecutive author lines. */
30
+ export const HEADER_AUTHOR_LINE_HEIGHT_PX = 14;
31
+ /**
32
+ * Vertical gap (px) between the LAST title baseline and the FIRST
33
+ * author baseline. Larger than a normal line height because it spans
34
+ * the title's descender + the author's cap height.
35
+ */
36
+ export const HEADER_TITLE_TO_AUTHOR_GAP_PX = 18;
37
+ /** Font size (px) of the title text. */
38
+ export const HEADER_TITLE_FONT_SIZE_PX = 16;
39
+ /** Font size (px) of the author text (subtitle). */
40
+ export const HEADER_AUTHOR_FONT_SIZE_PX = 11;
41
+ //# sourceMappingURL=header-card-geometry.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"header-card-geometry.js","sourceRoot":"","sources":["../src/header-card-geometry.ts"],"names":[],"mappings":"AAAA,+DAA+D;AAC/D,sEAAsE;AACtE,EAAE;AACF,uEAAuE;AACvE,uEAAuE;AACvE,sEAAsE;AACtE,2CAA2C;AAC3C,EAAE;AACF,iEAAiE;AACjE,oEAAoE;AACpE,0DAA0D;AAC1D,uDAAuD;AAEvD,iEAAiE;AACjE,MAAM,CAAC,MAAM,qBAAqB,GAAG,EAAE,CAAC;AAExC;;;;GAIG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAG,EAAE,CAAC;AAE1C;;;;GAIG;AACH,MAAM,CAAC,MAAM,0BAA0B,GAAG,EAAE,CAAC;AAE7C,oEAAoE;AACpE,MAAM,CAAC,MAAM,2BAA2B,GAAG,EAAE,CAAC;AAE9C,qEAAqE;AACrE,MAAM,CAAC,MAAM,4BAA4B,GAAG,EAAE,CAAC;AAE/C;;;;GAIG;AACH,MAAM,CAAC,MAAM,6BAA6B,GAAG,EAAE,CAAC;AAEhD,wCAAwC;AACxC,MAAM,CAAC,MAAM,yBAAyB,GAAG,EAAE,CAAC;AAE5C,oDAAoD;AACpD,MAAM,CAAC,MAAM,0BAA0B,GAAG,EAAE,CAAC"}
package/dist/i18n.d.ts ADDED
@@ -0,0 +1,48 @@
1
+ export declare const DEFAULT_LOCALE = "en-US";
2
+ export interface LocaleStrings {
3
+ /** Short label painted inside the now-line pill. Sized for ~3-6 chars. */
4
+ nowLabel: string;
5
+ /** Prefix used when the timeline scale is quarters (e.g. `Q1 2026` / `T1 2026`). */
6
+ quarterPrefix: string;
7
+ }
8
+ /**
9
+ * Resolve the effective locale for the rendered artifact.
10
+ *
11
+ * Precedence (highest wins):
12
+ * 1. `directiveLocale` — `nowline v1 locale:fr-CA` from the file itself.
13
+ * The file is the artifact; its declared locale is authoritative the
14
+ * same way `<html lang="fr">` is on a web page or `:lang:` is in
15
+ * AsciiDoc. This guarantees cross-machine determinism: a French
16
+ * roadmap renders French even when invoked from a US-locale shell.
17
+ * 2. `override` — the CLI `--locale` flag plus env-var fallback,
18
+ * already resolved by the CLI before calling layout. Used only when
19
+ * the file declines to declare its own locale.
20
+ * 3. `DEFAULT_LOCALE` (`en-US`).
21
+ *
22
+ * Returns the input string verbatim — callers downstream walk the BCP-47
23
+ * fallback chain to find string entries.
24
+ *
25
+ * Note: the operator's locale (CLI flag / env vars) controls a separate,
26
+ * independent chain for terminal output (validator diagnostics, --help,
27
+ * verbose logs). See `specs/localization.md` for the two-chain model.
28
+ */
29
+ export declare function resolveLocale(override: string | undefined, directiveLocale: string | undefined): string;
30
+ /**
31
+ * Look up a locale's chrome strings, walking the BCP-47 tree until a
32
+ * value is found. The walk strips the trailing `-SUBTAG` and retries:
33
+ * `fr-CA → fr → en-US`
34
+ * `fr-BE → fr → en-US` (no fr-BE bundle yet — works for free)
35
+ * `de-AT → de → en-US` (no de bundles yet — falls all the way through)
36
+ *
37
+ * Always returns a fully-populated `LocaleStrings` because the `en-US`
38
+ * root has every key.
39
+ */
40
+ export declare function localeStrings(locale: string): LocaleStrings;
41
+ /**
42
+ * BCP-47 fallback chain for a locale tag. Strips trailing `-SUBTAG`s
43
+ * one at a time until a primary subtag remains, then appends the root
44
+ * locale. Case-normalized to lowercase primary + uppercase region so
45
+ * lookups are stable regardless of input casing.
46
+ */
47
+ export declare function fallbackChain(locale: string): string[];
48
+ //# sourceMappingURL=i18n.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"i18n.d.ts","sourceRoot":"","sources":["../src/i18n.ts"],"names":[],"mappings":"AAUA,eAAO,MAAM,cAAc,UAAU,CAAC;AAEtC,MAAM,WAAW,aAAa;IAC1B,0EAA0E;IAC1E,QAAQ,EAAE,MAAM,CAAC;IACjB,oFAAoF;IACpF,aAAa,EAAE,MAAM,CAAC;CACzB;AAyBD;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,aAAa,CACzB,QAAQ,EAAE,MAAM,GAAG,SAAS,EAC5B,eAAe,EAAE,MAAM,GAAG,SAAS,GACpC,MAAM,CAER;AAED;;;;;;;;;GASG;AACH,wBAAgB,aAAa,CAAC,MAAM,EAAE,MAAM,GAAG,aAAa,CAa3D;AAED;;;;;GAKG;AACH,wBAAgB,aAAa,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,CAWtD"}
package/dist/i18n.js ADDED
@@ -0,0 +1,114 @@
1
+ // Locale-aware strings used by the layout pipeline. Owns three things:
2
+ // - The BCP-47 fallback chain (`fr-CA → fr → en-US`).
3
+ // - A small message table for chrome strings the renderer paints
4
+ // directly (now-pill, quarter prefix).
5
+ // - The locale token passed to `Intl.DateTimeFormat` for axis labels.
6
+ //
7
+ // Today the table is inline; m-loc-d / m-loc-e (per `specs/localization.md`)
8
+ // will move this to a proper `messages.<locale>.ts` bundle layout. The
9
+ // shape here is deliberately minimal so that swap is mechanical.
10
+ export const DEFAULT_LOCALE = 'en-US';
11
+ // Bundle entries keyed by language tag. The fallback chain strips the
12
+ // trailing `-SUBTAG` and retries; a missing key in a child bundle falls
13
+ // through to the parent. `en-US` is the root.
14
+ //
15
+ // Region overlays (fr-CA, fr-FR) are intentionally omitted: at launch they
16
+ // have nothing region-specific to override. Empty overlays are a feature,
17
+ // not a bug — they exist as a contract for future divergence. See
18
+ // `specs/localization.md` § "Locale resolution".
19
+ const BUNDLES = {
20
+ 'en-US': {
21
+ nowLabel: 'now',
22
+ quarterPrefix: 'Q',
23
+ },
24
+ fr: {
25
+ // Short form of "maintenant"; keeps the pill compact while staying
26
+ // correct French. The full word is too wide for the ~3-6 char pill
27
+ // budget without geometry work (tracked in m-loc-c).
28
+ nowLabel: 'maint.',
29
+ // `T` for trimestre — the standard French business convention.
30
+ quarterPrefix: 'T',
31
+ },
32
+ };
33
+ /**
34
+ * Resolve the effective locale for the rendered artifact.
35
+ *
36
+ * Precedence (highest wins):
37
+ * 1. `directiveLocale` — `nowline v1 locale:fr-CA` from the file itself.
38
+ * The file is the artifact; its declared locale is authoritative the
39
+ * same way `<html lang="fr">` is on a web page or `:lang:` is in
40
+ * AsciiDoc. This guarantees cross-machine determinism: a French
41
+ * roadmap renders French even when invoked from a US-locale shell.
42
+ * 2. `override` — the CLI `--locale` flag plus env-var fallback,
43
+ * already resolved by the CLI before calling layout. Used only when
44
+ * the file declines to declare its own locale.
45
+ * 3. `DEFAULT_LOCALE` (`en-US`).
46
+ *
47
+ * Returns the input string verbatim — callers downstream walk the BCP-47
48
+ * fallback chain to find string entries.
49
+ *
50
+ * Note: the operator's locale (CLI flag / env vars) controls a separate,
51
+ * independent chain for terminal output (validator diagnostics, --help,
52
+ * verbose logs). See `specs/localization.md` for the two-chain model.
53
+ */
54
+ export function resolveLocale(override, directiveLocale) {
55
+ return directiveLocale ?? override ?? DEFAULT_LOCALE;
56
+ }
57
+ /**
58
+ * Look up a locale's chrome strings, walking the BCP-47 tree until a
59
+ * value is found. The walk strips the trailing `-SUBTAG` and retries:
60
+ * `fr-CA → fr → en-US`
61
+ * `fr-BE → fr → en-US` (no fr-BE bundle yet — works for free)
62
+ * `de-AT → de → en-US` (no de bundles yet — falls all the way through)
63
+ *
64
+ * Always returns a fully-populated `LocaleStrings` because the `en-US`
65
+ * root has every key.
66
+ */
67
+ export function localeStrings(locale) {
68
+ const result = {};
69
+ for (const tag of fallbackChain(locale)) {
70
+ const bundle = BUNDLES[tag];
71
+ if (!bundle)
72
+ continue;
73
+ for (const key of Object.keys(bundle)) {
74
+ if (result[key] === undefined && bundle[key] !== undefined) {
75
+ result[key] = bundle[key];
76
+ }
77
+ }
78
+ }
79
+ // The root bundle (`en-US`) is always populated, so this cast is safe.
80
+ return result;
81
+ }
82
+ /**
83
+ * BCP-47 fallback chain for a locale tag. Strips trailing `-SUBTAG`s
84
+ * one at a time until a primary subtag remains, then appends the root
85
+ * locale. Case-normalized to lowercase primary + uppercase region so
86
+ * lookups are stable regardless of input casing.
87
+ */
88
+ export function fallbackChain(locale) {
89
+ const chain = [];
90
+ let current = normalizeTag(locale);
91
+ while (current.length > 0) {
92
+ if (!chain.includes(current))
93
+ chain.push(current);
94
+ const dash = current.lastIndexOf('-');
95
+ if (dash <= 0)
96
+ break;
97
+ current = current.slice(0, dash);
98
+ }
99
+ if (!chain.includes(DEFAULT_LOCALE))
100
+ chain.push(DEFAULT_LOCALE);
101
+ return chain;
102
+ }
103
+ function normalizeTag(locale) {
104
+ const parts = locale.split('-');
105
+ return parts
106
+ .map((part, index) => {
107
+ if (index === 0)
108
+ return part.toLowerCase();
109
+ // Region subtag: 2 letters → upper-case; 3 digits → keep as-is.
110
+ return /^[a-zA-Z]{2}$/.test(part) ? part.toUpperCase() : part;
111
+ })
112
+ .join('-');
113
+ }
114
+ //# sourceMappingURL=i18n.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"i18n.js","sourceRoot":"","sources":["../src/i18n.ts"],"names":[],"mappings":"AAAA,uEAAuE;AACvE,wDAAwD;AACxD,mEAAmE;AACnE,2CAA2C;AAC3C,wEAAwE;AACxE,EAAE;AACF,6EAA6E;AAC7E,uEAAuE;AACvE,iEAAiE;AAEjE,MAAM,CAAC,MAAM,cAAc,GAAG,OAAO,CAAC;AAStC,sEAAsE;AACtE,wEAAwE;AACxE,8CAA8C;AAC9C,EAAE;AACF,2EAA2E;AAC3E,0EAA0E;AAC1E,kEAAkE;AAClE,iDAAiD;AACjD,MAAM,OAAO,GAA2C;IACpD,OAAO,EAAE;QACL,QAAQ,EAAE,KAAK;QACf,aAAa,EAAE,GAAG;KACrB;IACD,EAAE,EAAE;QACA,mEAAmE;QACnE,mEAAmE;QACnE,qDAAqD;QACrD,QAAQ,EAAE,QAAQ;QAClB,+DAA+D;QAC/D,aAAa,EAAE,GAAG;KACrB;CACJ,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAM,UAAU,aAAa,CACzB,QAA4B,EAC5B,eAAmC;IAEnC,OAAO,eAAe,IAAI,QAAQ,IAAI,cAAc,CAAC;AACzD,CAAC;AAED;;;;;;;;;GASG;AACH,MAAM,UAAU,aAAa,CAAC,MAAc;IACxC,MAAM,MAAM,GAA2B,EAAE,CAAC;IAC1C,KAAK,MAAM,GAAG,IAAI,aAAa,CAAC,MAAM,CAAC,EAAE,CAAC;QACtC,MAAM,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC;QAC5B,IAAI,CAAC,MAAM;YAAE,SAAS;QACtB,KAAK,MAAM,GAAG,IAAI,MAAM,CAAC,IAAI,CAAC,MAAM,CAA4B,EAAE,CAAC;YAC/D,IAAI,MAAM,CAAC,GAAG,CAAC,KAAK,SAAS,IAAI,MAAM,CAAC,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G,CAAC,CAAC;AACnB,CAAC"}
@@ -0,0 +1,86 @@
1
+ /**
2
+ * Horizontal offset (px) from the include region's bounding-box left
3
+ * edge to the label tab's left edge. Equals the region's outer pad
4
+ * (8 px from `renderIncludeRegion`) plus a 16 px tab inset that keeps
5
+ * the chiclet visually anchored inside the dashed bracket rather than
6
+ * straddling its rounded corner.
7
+ */
8
+ export declare const INCLUDE_CHROME_OFFSET_FROM_BOX_PX = 24;
9
+ /** Horizontal inset (px) from the tab's left edge to the label text. */
10
+ export declare const INCLUDE_CHROME_TAB_LEFT_INSET_PX = 10;
11
+ /**
12
+ * Horizontal inset (px) from the label text's right edge to the tab's
13
+ * right edge. Same as the left inset so the label appears optically
14
+ * centered inside its chiclet.
15
+ */
16
+ export declare const INCLUDE_CHROME_TAB_RIGHT_INSET_PX = 10;
17
+ /**
18
+ * Px-per-char for the label rendered at 11 pt 600w in `FONT_STACK.sans`.
19
+ * Calibrated against system-ui at 11 pt bold (~5.8 px/char actual);
20
+ * 6.0 leaves a small safety margin without producing wide right
21
+ * whitespace inside the chiclet.
22
+ */
23
+ export declare const INCLUDE_CHROME_TAB_LABEL_PER_CHAR_PX = 6;
24
+ /**
25
+ * Minimum total chiclet width (px). A floor so tiny labels still
26
+ * produce a chip wide enough to read; the badge/source bookmark sit
27
+ * outside the chiclet so they never push it past this minimum.
28
+ */
29
+ export declare const INCLUDE_CHROME_TAB_MIN_WIDTH_PX = 60;
30
+ /** Gap (px) between the chiclet's right edge and the content badge. */
31
+ export declare const INCLUDE_CHROME_BADGE_GAP_PX = 6;
32
+ /** Square content-badge tile size (px). */
33
+ export declare const INCLUDE_CHROME_BADGE_SIZE_PX = 18;
34
+ /** Gap (px) between the badge's right edge and the source-path text. */
35
+ export declare const INCLUDE_CHROME_SOURCE_GAP_PX = 6;
36
+ /**
37
+ * Px-per-char for the source-path rendered at 9 pt in `FONT_STACK.mono`.
38
+ * Calibrated against ui-monospace at 9 pt regular (~5.4 px/char actual);
39
+ * 5.5 leaves a small safety margin so the halo never clips the path.
40
+ */
41
+ export declare const INCLUDE_CHROME_SOURCE_PER_CHAR_PX = 5.5;
42
+ /**
43
+ * Halo padding (px) on each side of the source-path text. The halo
44
+ * masks the dashed bracket border that runs through the text's
45
+ * baseline so the path stays legible.
46
+ */
47
+ export declare const INCLUDE_CHROME_SOURCE_HALO_PAD_PX = 3;
48
+ export interface IncludeChromeGeometry {
49
+ /** Estimated rendered width (px) of the label text, no min-clamp. */
50
+ labelTextWidth: number;
51
+ /** Estimated rendered width (px) of the source-path text; 0 when no source. */
52
+ sourceTextWidth: number;
53
+ /** Left X (canvas px) of the chiclet rectangle. */
54
+ tabX: number;
55
+ /** Total chiclet width (px), with min-width floor applied. */
56
+ tabWidth: number;
57
+ /** Canvas X (px) where the label text is painted (left-anchored). */
58
+ tabLabelX: number;
59
+ /** Left X (canvas px) of the content-badge tile; 0 when no badge. */
60
+ badgeX: number;
61
+ /** Square content-badge tile size (px); mirrors `INCLUDE_CHROME_BADGE_SIZE_PX`. */
62
+ badgeSize: number;
63
+ /** Left X (canvas px) of the source-path halo rect; 0 when no source. */
64
+ sourceHaloX: number;
65
+ /** Width (px) of the source-path halo rect; 0 when no source. */
66
+ sourceHaloWidth: number;
67
+ /** Canvas X (px) where the source-path text is painted (left-anchored); 0 when no source. */
68
+ sourceTextX: number;
69
+ /**
70
+ * Right edge (canvas px) of the entire chrome strip — used by the
71
+ * layout to size the include region's bounding box so the dashed
72
+ * bracket always encloses its own chrome. Equals the badge's right
73
+ * edge when no source is present, or the halo's right edge when
74
+ * one is.
75
+ */
76
+ chromeRightX: number;
77
+ }
78
+ /**
79
+ * Single source of truth for the include-region chrome's geometry.
80
+ *
81
+ * `boxX` is the left edge of the include region's bounding box in
82
+ * canvas px. `label` is the chiclet text; `sourcePath` is the
83
+ * breadcrumb beside the badge (pass `''` to omit the bookmark).
84
+ */
85
+ export declare function includeChromeGeometry(boxX: number, label: string, sourcePath: string): IncludeChromeGeometry;
86
+ //# sourceMappingURL=include-chrome-geometry.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"include-chrome-geometry.d.ts","sourceRoot":"","sources":["../src/include-chrome-geometry.ts"],"names":[],"mappings":"AAiBA;;;;;;GAMG;AACH,eAAO,MAAM,iCAAiC,KAAK,CAAC;AAEpD,wEAAwE;AACxE,eAAO,MAAM,gCAAgC,KAAK,CAAC;AACnD;;;;GAIG;AACH,eAAO,MAAM,iCAAiC,KAAK,CAAC;AAEpD;;;;;GAKG;AACH,eAAO,MAAM,oCAAoC,IAAI,CAAC;AAEtD;;;;GAIG;AACH,eAAO,MAAM,+BAA+B,KAAK,CAAC;AAElD,uEAAuE;AACvE,eAAO,MAAM,2BAA2B,IAAI,CAAC;AAC7C,2CAA2C;AAC3C,eAAO,MAAM,4BAA4B,KAAK,CAAC;AAE/C,wEAAwE;AACxE,eAAO,MAAM,4BAA4B,IAAI,CAAC;AAC9C;;;;GAIG;AACH,eAAO,MAAM,iCAAiC,MAAM,CAAC;AACrD;;;;GAIG;AACH,eAAO,MAAM,iCAAiC,IAAI,CAAC;AAEnD,MAAM,WAAW,qBAAqB;IAClC,qEAAqE;IACrE,cAAc,EAAE,MAAM,CAAC;IACvB,+EAA+E;IAC/E,eAAe,EAAE,MAAM,CAAC;IAExB,mDAAmD;IACnD,IAAI,EAAE,MAAM,CAAC;IACb,8DAA8D;IAC9D,QAAQ,EAAE,MAAM,CAAC;IACjB,qEAAqE;IACrE,SAAS,EAAE,MAAM,CAAC;IAElB,qEAAqE;IACrE,MAAM,EAAE,MAAM,CAAC;IACf,mFAAmF;IACnF,SAAS,EAAE,MAAM,CAAC;IAElB,yEAAyE;IACzE,WAAW,EAAE,MAAM,CAAC;IACpB,iEAAiE;IACjE,eAAe,EAAE,MAAM,CAAC;IACxB,6FAA6F;IAC7F,WAAW,EAAE,MAAM,CAAC;IAEpB;;;;;;OAMG;IACH,YAAY,EAAE,MAAM,CAAC;CACxB;AAED;;;;;;GAMG;AACH,wBAAgB,qBAAqB,CACjC,IAAI,EAAE,MAAM,EACZ,KAAK,EAAE,MAAM,EACb,UAAU,EAAE,MAAM,GACnB,qBAAqB,CAuCvB"}
@@ -0,0 +1,104 @@
1
+ // Include-region chrome geometry — the label tab + content badge +
2
+ // source-path bookmark that float across the top edge of an isolated
3
+ // `include {}` region's dashed bracket. Both the layout (which needs
4
+ // to know the chrome's right edge to shrink-wrap the bracket) and the
5
+ // renderer (which paints each element) call `includeChromeGeometry`,
6
+ // so the painted footprint and the layout's reserved footprint stay
7
+ // in sync. Mirrors `frameTabGeometry`'s "compute placement X for each
8
+ // element + derive total width from the cursor" model.
9
+ //
10
+ // Layout order, left → right:
11
+ //
12
+ // [LEFT_INSET] tab(LABEL) (BADGE_GAP) badge (SOURCE_GAP) [HALO_PAD] source [HALO_PAD]
13
+ //
14
+ // The badge and source-path are optional in spirit but always present
15
+ // for current `include` regions; the helper passes `0` widths through
16
+ // cleanly should that ever change.
17
+ /**
18
+ * Horizontal offset (px) from the include region's bounding-box left
19
+ * edge to the label tab's left edge. Equals the region's outer pad
20
+ * (8 px from `renderIncludeRegion`) plus a 16 px tab inset that keeps
21
+ * the chiclet visually anchored inside the dashed bracket rather than
22
+ * straddling its rounded corner.
23
+ */
24
+ export const INCLUDE_CHROME_OFFSET_FROM_BOX_PX = 24;
25
+ /** Horizontal inset (px) from the tab's left edge to the label text. */
26
+ export const INCLUDE_CHROME_TAB_LEFT_INSET_PX = 10;
27
+ /**
28
+ * Horizontal inset (px) from the label text's right edge to the tab's
29
+ * right edge. Same as the left inset so the label appears optically
30
+ * centered inside its chiclet.
31
+ */
32
+ export const INCLUDE_CHROME_TAB_RIGHT_INSET_PX = 10;
33
+ /**
34
+ * Px-per-char for the label rendered at 11 pt 600w in `FONT_STACK.sans`.
35
+ * Calibrated against system-ui at 11 pt bold (~5.8 px/char actual);
36
+ * 6.0 leaves a small safety margin without producing wide right
37
+ * whitespace inside the chiclet.
38
+ */
39
+ export const INCLUDE_CHROME_TAB_LABEL_PER_CHAR_PX = 6;
40
+ /**
41
+ * Minimum total chiclet width (px). A floor so tiny labels still
42
+ * produce a chip wide enough to read; the badge/source bookmark sit
43
+ * outside the chiclet so they never push it past this minimum.
44
+ */
45
+ export const INCLUDE_CHROME_TAB_MIN_WIDTH_PX = 60;
46
+ /** Gap (px) between the chiclet's right edge and the content badge. */
47
+ export const INCLUDE_CHROME_BADGE_GAP_PX = 6;
48
+ /** Square content-badge tile size (px). */
49
+ export const INCLUDE_CHROME_BADGE_SIZE_PX = 18;
50
+ /** Gap (px) between the badge's right edge and the source-path text. */
51
+ export const INCLUDE_CHROME_SOURCE_GAP_PX = 6;
52
+ /**
53
+ * Px-per-char for the source-path rendered at 9 pt in `FONT_STACK.mono`.
54
+ * Calibrated against ui-monospace at 9 pt regular (~5.4 px/char actual);
55
+ * 5.5 leaves a small safety margin so the halo never clips the path.
56
+ */
57
+ export const INCLUDE_CHROME_SOURCE_PER_CHAR_PX = 5.5;
58
+ /**
59
+ * Halo padding (px) on each side of the source-path text. The halo
60
+ * masks the dashed bracket border that runs through the text's
61
+ * baseline so the path stays legible.
62
+ */
63
+ export const INCLUDE_CHROME_SOURCE_HALO_PAD_PX = 3;
64
+ /**
65
+ * Single source of truth for the include-region chrome's geometry.
66
+ *
67
+ * `boxX` is the left edge of the include region's bounding box in
68
+ * canvas px. `label` is the chiclet text; `sourcePath` is the
69
+ * breadcrumb beside the badge (pass `''` to omit the bookmark).
70
+ */
71
+ export function includeChromeGeometry(boxX, label, sourcePath) {
72
+ const tabX = boxX + INCLUDE_CHROME_OFFSET_FROM_BOX_PX;
73
+ const tabLabelX = tabX + INCLUDE_CHROME_TAB_LEFT_INSET_PX;
74
+ const labelTextWidth = label.length * INCLUDE_CHROME_TAB_LABEL_PER_CHAR_PX;
75
+ const tabWidth = Math.max(INCLUDE_CHROME_TAB_MIN_WIDTH_PX, labelTextWidth + INCLUDE_CHROME_TAB_LEFT_INSET_PX + INCLUDE_CHROME_TAB_RIGHT_INSET_PX);
76
+ const badgeX = tabX + tabWidth + INCLUDE_CHROME_BADGE_GAP_PX;
77
+ const badgeRightX = badgeX + INCLUDE_CHROME_BADGE_SIZE_PX;
78
+ let sourceTextWidth = 0;
79
+ let sourceTextX = 0;
80
+ let sourceHaloX = 0;
81
+ let sourceHaloWidth = 0;
82
+ let chromeRightX = badgeRightX;
83
+ if (sourcePath) {
84
+ sourceTextX = badgeRightX + INCLUDE_CHROME_SOURCE_GAP_PX;
85
+ sourceTextWidth = sourcePath.length * INCLUDE_CHROME_SOURCE_PER_CHAR_PX;
86
+ sourceHaloX = sourceTextX - INCLUDE_CHROME_SOURCE_HALO_PAD_PX;
87
+ sourceHaloWidth = sourceTextWidth + INCLUDE_CHROME_SOURCE_HALO_PAD_PX * 2;
88
+ chromeRightX = sourceHaloX + sourceHaloWidth;
89
+ }
90
+ return {
91
+ labelTextWidth,
92
+ sourceTextWidth,
93
+ tabX,
94
+ tabWidth,
95
+ tabLabelX,
96
+ badgeX,
97
+ badgeSize: INCLUDE_CHROME_BADGE_SIZE_PX,
98
+ sourceHaloX,
99
+ sourceHaloWidth,
100
+ sourceTextX,
101
+ chromeRightX,
102
+ };
103
+ }
104
+ //# sourceMappingURL=include-chrome-geometry.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"include-chrome-geometry.js","sourceRoot":"","sources":["../src/include-chrome-geometry.ts"],"names":[],"mappings":"AAAA,mEAAmE;AACnE,qEAAqE;AACrE,qEAAqE;AACrE,sEAAsE;AACtE,qEAAqE;AACrE,oEAAoE;AACpE,sEAAsE;AACtE,uDAAuD;AACvD,EAAE;AACF,8BAA8B;AAC9B,EAAE;AACF,wFAAwF;AACxF,EAAE;AACF,sEAAsE;AACtE,sEAAsE;AACtE,mCAAmC;AAEnC;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,iCAAiC,GAAG,EAAE,CAAC;AAEpD,wEAAwE;AACxE,MAAM,CAAC,MAAM,gCAAgC,GAAG,EAAE,CAAC;AACnD;;;;GAIG;A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A4B,CAAC;QACzD,eAAe,GAAG,UAAU,CAAC,MAAM,GAAG,iCAAiC,CAAC;QACxE,WAAW,GAAG,WAAW,GAAG,iCAAiC,CAAC;QAC9D,eAAe,GAAG,eAAe,GAAG,iCAAiC,GAAG,CAAC,CAAC;QAC1E,YAAY,GAAG,WAAW,GAAG,eAAe,CAAC;IACjD,CAAC;IAED,OAAO;QACH,cAAc;QACd,eAAe;QACf,IAAI;QACJ,QAAQ;QACR,SAAS;QACT,MAAM;QACN,SAAS,EAAE,4BAA4B;QACvC,WAAW;QACX,eAAe;QACf,WAAW;QACX,YAAY;KACf,CAAC;AACN,CAAC"}
@@ -0,0 +1,11 @@
1
+ export { estimateCapacitySuffixWidth, formatCapacityNumber, parseCapacityValue, type ResolvedCapacityIcon, resolveCapacityIcon, } from './capacity.js';
2
+ export { FRAME_TAB_INNER_GAP_PX, FRAME_TAB_LEFT_INSET_PX, FRAME_TAB_MIN_WIDTH_PX, FRAME_TAB_OFFSET_FROM_BOX_PX, FRAME_TAB_OWNER_PX_PER_CHAR, FRAME_TAB_RIGHT_INSET_PX, FRAME_TAB_TITLE_PX_PER_CHAR, type FrameTabGeometry, frameTabGeometry, } from './frame-tab-geometry.js';
3
+ export { HEADER_AUTHOR_FONT_SIZE_PX, HEADER_AUTHOR_LINE_HEIGHT_PX, HEADER_CARD_PADDING_BOTTOM, HEADER_CARD_PADDING_TOP, HEADER_CARD_PADDING_X, HEADER_TITLE_FONT_SIZE_PX, HEADER_TITLE_LINE_HEIGHT_PX, HEADER_TITLE_TO_AUTHOR_GAP_PX, } from './header-card-geometry.js';
4
+ export { INCLUDE_CHROME_BADGE_GAP_PX, INCLUDE_CHROME_BADGE_SIZE_PX, INCLUDE_CHROME_OFFSET_FROM_BOX_PX, INCLUDE_CHROME_SOURCE_GAP_PX, INCLUDE_CHROME_SOURCE_HALO_PAD_PX, INCLUDE_CHROME_SOURCE_PER_CHAR_PX, INCLUDE_CHROME_TAB_LABEL_PER_CHAR_PX, INCLUDE_CHROME_TAB_LEFT_INSET_PX, INCLUDE_CHROME_TAB_MIN_WIDTH_PX, INCLUDE_CHROME_TAB_RIGHT_INSET_PX, type IncludeChromeGeometry, includeChromeGeometry, } from './include-chrome-geometry.js';
5
+ export { ITEM_CAPTION_INSET_X_PX, ITEM_CAPTION_META_BASELINE_OFFSET_PX, ITEM_CAPTION_META_FONT_SIZE_PX, ITEM_CAPTION_SPILL_GAP_PX, ITEM_CAPTION_TITLE_BASELINE_OFFSET_PX, ITEM_CAPTION_TITLE_FONT_SIZE_PX, ITEM_DECORATION_SPILL_GAP_PX, ITEM_FOOTNOTE_INDICATOR_BASELINE_OFFSET_PX, ITEM_FOOTNOTE_INDICATOR_INSET_RIGHT_PX, ITEM_FOOTNOTE_INDICATOR_STEP_PX, ITEM_LINK_ICON_INSET_PX, ITEM_LINK_ICON_TILE_SIZE_PX, ITEM_STATUS_DOT_INSET_RIGHT_PX, ITEM_STATUS_DOT_INSET_TOP_PX, ITEM_STATUS_DOT_RADIUS_PX, LABEL_CHIP_GAP_ABOVE_PROGRESS_STRIP_PX, LABEL_CHIP_GAP_BETWEEN_PX, LABEL_CHIP_HEIGHT_PX, MIN_BAR_WIDTH_FOR_DOT_PX, MIN_BAR_WIDTH_FOR_FOOTNOTE_PX, MIN_BAR_WIDTH_FOR_LINK_AND_DOT_PX, } from './item-bar-geometry.js';
6
+ export type { LayoutOptions, LayoutResult } from './layout.js';
7
+ export { layoutRoadmap } from './layout.js';
8
+ export { darkTheme, grayscaleTheme, lightTheme, normalizeThemeName, type Theme, type ThemeName, themes, } from './themes/index.js';
9
+ export { ACCENT_DASH_PATTERN, ATTRIBUTION_BAR_LOGICAL_WIDTH, ATTRIBUTION_BAR_LOGICAL_X, ATTRIBUTION_INE_LOGICAL_X, ATTRIBUTION_LINK, ATTRIBUTION_NOW_LOGICAL_X, ATTRIBUTION_PREFIX_FONT_SIZE, ATTRIBUTION_SCALE, ATTRIBUTION_TEXT, ATTRIBUTION_WORDMARK_FONT_SIZE, CORNER_RADIUS_PX, EDGE_CORNER_RADIUS, FONT_STACK, FOOTNOTE_HEADER_BASELINE_OFFSET_PX, FOOTNOTE_HEADER_HEIGHT_PX, FOOTNOTE_PANEL_PADDING_PX, FOOTNOTE_ROW_HEIGHT, FRAME_TAB_HEIGHT_PX, FRAME_TAB_LABEL_BASELINE_OFFSET_PX, GROUP_BOTTOM_PAD_PX, GROUP_BRACKET_LABEL_OVERHANG_PX, GROUP_TITLE_TAB_CHAR_WIDTH_PX, GROUP_TITLE_TAB_GUTTER_PX, GROUP_TITLE_TAB_HEIGHT_PX, GROUP_TITLE_TAB_LABEL_BASELINE_OFFSET_PX, GROUP_TITLE_TAB_LABEL_FONT_SIZE_PX, GROUP_TITLE_TAB_PAD_X_PX, NOW_PILL_CORNER_RADIUS_PX, NOW_PILL_HEIGHT_PX, NOW_PILL_LABEL_BASELINE_OFFSET_PX, NOW_PILL_LABEL_FONT_SIZE_PX, NOW_PILL_LABEL_INSET_X_PX, NOW_PILL_WIDTH_PX, NOWLINE_STROKE_WIDTH_PX, PROGRESS_STRIP_HEIGHT_PX, TEXT_SIZE_PX, TIMELINE_TICK_LABEL_BASELINE_OFFSET_PX, TIMELINE_TICK_PANEL_HEIGHT_PX, TRACK_BLOCK_TAIL_GUTTER_PX, } from './themes/shared.js';
10
+ export * from './types.js';
11
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,2BAA2B,EAC3B,oBAAoB,EACpB,kBAAkB,EAClB,KAAK,oBAAoB,EACzB,mBAAmB,GACtB,MAAM,eAAe,CAAC;AACvB,OAAO,EACH,sBAAsB,EACtB,uBAAuB,EACvB,sBAAsB,EACtB,4BAA4B,EAC5B,2BAA2B,EAC3B,wBAAwB,EACxB,2BAA2B,EAC3B,KAAK,gBAAgB,EACrB,gBAAgB,GACnB,MAAM,yBAAyB,CAA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ACnB,mBAAmB,EACnB,kCAAkC,EAClC,mBAAmB,EACnB,+BAA+B,EAC/B,6BAA6B,EAC7B,yBAAyB,EACzB,yBAAyB,EACzB,wCAAwC,EACxC,kCAAkC,EAClC,wBAAwB,EACxB,yBAAyB,EACzB,kBAAkB,EAClB,iCAAiC,EACjC,2BAA2B,EAC3B,yBAAyB,EACzB,iBAAiB,EACjB,uBAAuB,EACvB,wBAAwB,EACxB,YAAY,EACZ,sCAAsC,EACtC,6BAA6B,EAC7B,0BAA0B,GAC7B,MAAM,oBAAoB,CAAC;AAC5B,cAAc,YAAY,CAAC"}
package/dist/index.js ADDED
@@ -0,0 +1,10 @@
1
+ export { estimateCapacitySuffixWidth, formatCapacityNumber, parseCapacityValue, resolveCapacityIcon, } from './capacity.js';
2
+ export { FRAME_TAB_INNER_GAP_PX, FRAME_TAB_LEFT_INSET_PX, FRAME_TAB_MIN_WIDTH_PX, FRAME_TAB_OFFSET_FROM_BOX_PX, FRAME_TAB_OWNER_PX_PER_CHAR, FRAME_TAB_RIGHT_INSET_PX, FRAME_TAB_TITLE_PX_PER_CHAR, frameTabGeometry, } from './frame-tab-geometry.js';
3
+ export { HEADER_AUTHOR_FONT_SIZE_PX, HEADER_AUTHOR_LINE_HEIGHT_PX, HEADER_CARD_PADDING_BOTTOM, HEADER_CARD_PADDING_TOP, HEADER_CARD_PADDING_X, HEADER_TITLE_FONT_SIZE_PX, HEADER_TITLE_LINE_HEIGHT_PX, HEADER_TITLE_TO_AUTHOR_GAP_PX, } from './header-card-geometry.js';
4
+ export { INCLUDE_CHROME_BADGE_GAP_PX, INCLUDE_CHROME_BADGE_SIZE_PX, INCLUDE_CHROME_OFFSET_FROM_BOX_PX, INCLUDE_CHROME_SOURCE_GAP_PX, INCLUDE_CHROME_SOURCE_HALO_PAD_PX, INCLUDE_CHROME_SOURCE_PER_CHAR_PX, INCLUDE_CHROME_TAB_LABEL_PER_CHAR_PX, INCLUDE_CHROME_TAB_LEFT_INSET_PX, INCLUDE_CHROME_TAB_MIN_WIDTH_PX, INCLUDE_CHROME_TAB_RIGHT_INSET_PX, includeChromeGeometry, } from './include-chrome-geometry.js';
5
+ export { ITEM_CAPTION_INSET_X_PX, ITEM_CAPTION_META_BASELINE_OFFSET_PX, ITEM_CAPTION_META_FONT_SIZE_PX, ITEM_CAPTION_SPILL_GAP_PX, ITEM_CAPTION_TITLE_BASELINE_OFFSET_PX, ITEM_CAPTION_TITLE_FONT_SIZE_PX, ITEM_DECORATION_SPILL_GAP_PX, ITEM_FOOTNOTE_INDICATOR_BASELINE_OFFSET_PX, ITEM_FOOTNOTE_INDICATOR_INSET_RIGHT_PX, ITEM_FOOTNOTE_INDICATOR_STEP_PX, ITEM_LINK_ICON_INSET_PX, ITEM_LINK_ICON_TILE_SIZE_PX, ITEM_STATUS_DOT_INSET_RIGHT_PX, ITEM_STATUS_DOT_INSET_TOP_PX, ITEM_STATUS_DOT_RADIUS_PX, LABEL_CHIP_GAP_ABOVE_PROGRESS_STRIP_PX, LABEL_CHIP_GAP_BETWEEN_PX, LABEL_CHIP_HEIGHT_PX, MIN_BAR_WIDTH_FOR_DOT_PX, MIN_BAR_WIDTH_FOR_FOOTNOTE_PX, MIN_BAR_WIDTH_FOR_LINK_AND_DOT_PX, } from './item-bar-geometry.js';
6
+ export { layoutRoadmap } from './layout.js';
7
+ export { darkTheme, grayscaleTheme, lightTheme, normalizeThemeName, themes, } from './themes/index.js';
8
+ export { ACCENT_DASH_PATTERN, ATTRIBUTION_BAR_LOGICAL_WIDTH, ATTRIBUTION_BAR_LOGICAL_X, ATTRIBUTION_INE_LOGICAL_X, ATTRIBUTION_LINK, ATTRIBUTION_NOW_LOGICAL_X, ATTRIBUTION_PREFIX_FONT_SIZE, ATTRIBUTION_SCALE, ATTRIBUTION_TEXT, ATTRIBUTION_WORDMARK_FONT_SIZE, CORNER_RADIUS_PX, EDGE_CORNER_RADIUS, FONT_STACK, FOOTNOTE_HEADER_BASELINE_OFFSET_PX, FOOTNOTE_HEADER_HEIGHT_PX, FOOTNOTE_PANEL_PADDING_PX, FOOTNOTE_ROW_HEIGHT, FRAME_TAB_HEIGHT_PX, FRAME_TAB_LABEL_BASELINE_OFFSET_PX, GROUP_BOTTOM_PAD_PX, GROUP_BRACKET_LABEL_OVERHANG_PX, GROUP_TITLE_TAB_CHAR_WIDTH_PX, GROUP_TITLE_TAB_GUTTER_PX, GROUP_TITLE_TAB_HEIGHT_PX, GROUP_TITLE_TAB_LABEL_BASELINE_OFFSET_PX, GROUP_TITLE_TAB_LABEL_FONT_SIZE_PX, GROUP_TITLE_TAB_PAD_X_PX, NOW_PILL_CORNER_RADIUS_PX, NOW_PILL_HEIGHT_PX, NOW_PILL_LABEL_BASELINE_OFFSET_PX, NOW_PILL_LABEL_FONT_SIZE_PX, NOW_PILL_LABEL_INSET_X_PX, NOW_PILL_WIDTH_PX, NOWLINE_STROKE_WIDTH_PX, PROGRESS_STRIP_HEIGHT_PX, TEXT_SIZE_PX, TIMELINE_TICK_LABEL_BASELINE_OFFSET_PX, TIMELINE_TICK_PANEL_HEIGHT_PX, TRACK_BLOCK_TAIL_GUTTER_PX, } from './themes/shared.js';
9
+ export * from './types.js';
10
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,2BAA2B,EAC3B,oBAAoB,EACpB,kBAAkB,EAElB,mBAAmB,GACtB,MAAM,eAAe,CAAC;AACvB,OAAO,EACH,sBAAsB,EACtB,uBAAuB,EACvB,sBAAsB,EACtB,4BAA4B,EAC5B,2BAA2B,EAC3B,wBAAwB,EACxB,2BAA2B,EAE3B,gBAAgB,GACnB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EACH,0BAA0B,EAC1B,4BAA4B,EAC5B,0BAA0B,EAC1B,uBAAuB,EACvB,qBAAqB,EACrB,yBAAyB,EACzB,2BAA2B,EAC3B,6BAA6B,GAChC,MAAM,2BAA2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xB,YAAY,EACZ,sCAAsC,EACtC,6BAA6B,EAC7B,0BAA0B,GAC7B,MAAM,oBAAoB,CAAC;AAC5B,cAAc,YAAY,CAAC"}
@@ -0,0 +1,46 @@
1
+ import type { BoundingBox, InlineDatePin } from './types.js';
2
+ export interface ItemInlineDatePinInputs {
3
+ box: BoundingBox;
4
+ /** ISO date string from `after:DATE`, or undefined when no inline `after`. */
5
+ afterDate: string | undefined;
6
+ /** ISO date string from `before:DATE`, or undefined when no inline `before`. */
7
+ beforeDate: string | undefined;
8
+ hasLinkIcon: boolean;
9
+ /** Number of footnote indicators rendered in the bar's top-RIGHT cluster. */
10
+ footnoteCount: number;
11
+ }
12
+ /**
13
+ * Compute inline-date pin glyph placements for an item bar. Returns an
14
+ * empty array when neither `afterDate` nor `beforeDate` is set.
15
+ *
16
+ * Item bars participate in the narrow-bar spill family — when the bar is
17
+ * narrower than `MIN_BAR_WIDTH_FOR_INLINE_DATE_PX`, the `before:` glyph
18
+ * spills RIGHT of the bar (joining the status-dot / footnote spill
19
+ * column) and the `after:` glyph spills LEFT of the bar's leading edge
20
+ * so the side semantics stay readable.
21
+ */
22
+ export declare function computeItemInlineDatePins(opts: ItemInlineDatePinInputs): InlineDatePin[];
23
+ export interface ContainerInlineDatePinInputs {
24
+ /** Bounding box that anchors the glyph corners. For styled groups and
25
+ * bracketed parallels this is the visible box; for unstyled groups
26
+ * and bare parallels it is the logical bounding box (leftmost child
27
+ * start, rightmost child end, top of the highest child row). */
28
+ box: BoundingBox;
29
+ afterDate: string | undefined;
30
+ beforeDate: string | undefined;
31
+ }
32
+ /**
33
+ * Compute inline-date pin glyph placements for a container (group or
34
+ * parallel). The glyphs sit flush to the box's top-LEFT (`after`) and
35
+ * top-RIGHT (`before`) corners with the standard inset; containers
36
+ * never spill (they always have room for a 12 px tile in their own
37
+ * top-decoration row).
38
+ */
39
+ export declare function computeContainerInlineDatePins(opts: ContainerInlineDatePinInputs): InlineDatePin[];
40
+ /**
41
+ * Returns the first ISO date literal in `values`, or undefined when none
42
+ * is present. The validator enforces "at most one inline date per
43
+ * direction" so this lookup is unambiguous.
44
+ */
45
+ export declare function pickInlineDate(values: readonly string[]): string | undefined;
46
+ //# sourceMappingURL=inline-date-pin-geometry.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"inline-date-pin-geometry.d.ts","sourceRoot":"","sources":["../src/inline-date-pin-geometry.ts"],"names":[],"mappings":"AAwCA,OAAO,KAAK,EAAE,WAAW,EAAE,aAAa,EAAS,MAAM,YAAY,CAAC;AAEpE,MAAM,WAAW,uBAAuB;IACpC,GAAG,EAAE,WAAW,CAAC;IACjB,8EAA8E;IAC9E,SAAS,EAAE,MAAM,GAAG,SAAS,CAAC;IAC9B,gFAAgF;IAChF,UAAU,EAAE,MAAM,GAAG,SAAS,CAAC;IAC/B,WAAW,EAAE,OAAO,CAAC;IACrB,6EAA6E;IAC7E,aAAa,EAAE,MAAM,CAAC;CACzB;AAED;;;;;;;;;GASG;AACH,wBAAgB,yBAAyB,CAAC,IAAI,EAAE,uBAAuB,GAAG,aAAa,EAAE,CAmExF;AAED,MAAM,WAAW,4BAA4B;IACzC;;;qEAGiE;IACjE,GAAG,EAAE,WAAW,CAAC;IACjB,SAAS,EAAE,MAAM,GAAG,SAAS,CAAC;IAC9B,UAAU,EAAE,MAAM,GAAG,SAAS,CAAC;CAClC;AAED;;;;;;GAMG;AACH,wBAAgB,8BAA8B,CAC1C,IAAI,EAAE,4BAA4B,GACnC,aAAa,EAAE,CAgCjB;AAED;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,MAAM,EAAE,SAAS,MAAM,EAAE,GAAG,MAAM,GAAG,SAAS,CAK5E"}