monowind 0.1.0 → 0.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/layout.d.ts CHANGED
@@ -1,4 +1,13 @@
1
- import type { LayoutNode } from "./types.ts";
1
+ import type { LineSpan } from "./wrap.ts";
2
+ import type { CellLength, CellStyle, LayoutNode, NullableInsets, PerSide, Size, SizeLimit } from "./types.ts";
3
+ /**
4
+ * Core layout: the per-node sizing pipeline, block flow, and the shared
5
+ * sizing/intrinsic machinery. Flex lives in flex.ts, the positioning pass
6
+ * in positioning.ts, each mirroring its spec file. The modules are
7
+ * mutually recursive (children lay out through layoutNode), so the import
8
+ * cycle between them is deliberate — safe because they contain only
9
+ * hoisted function declarations with no top-level cross-module execution.
10
+ */
2
11
  /**
3
12
  * Layout entry point: mutates localRect on the root and each descendant.
4
13
  * Coordinates are parent-relative (root's rect is at 0,0).
@@ -6,31 +15,73 @@ import type { LayoutNode } from "./types.ts";
6
15
  export declare function layoutRoot(root: LayoutNode, availableWidth: number): {
7
16
  height: number;
8
17
  };
18
+ /** absolute / fixed boxes are out of normal flow. */
19
+ export declare function isOutOfFlow(style: CellStyle): boolean;
20
+ /** A containing block for absolute descendants, per CSS. */
21
+ export declare function isPositioned(style: CellStyle): boolean;
22
+ export type SizingMode = "fill" | "shrink";
23
+ export interface IntrinsicCache {
24
+ maxContent: WeakMap<LayoutNode, number>;
25
+ minContent: WeakMap<LayoutNode, number>;
26
+ /** Grid containers compute both intrinsic widths in one placement +
27
+ * sizing pass — cached here so the min and max lookups share it. */
28
+ gridIntrinsic: WeakMap<LayoutNode, {
29
+ min: number;
30
+ max: number;
31
+ }>;
32
+ }
33
+ export declare function makeIntrinsicCache(): IntrinsicCache;
9
34
  /**
10
- * Resolve flex main-axis sizes per CSS Flexbox §9.7 ("Resolving Flexible
11
- * Lengths"), adapted to integers: distribute free space proportionally to
12
- * grow factors (or shrink weights = base × shrink), clamp each result to the
13
- * item's own min/max, FREEZE the items whose clamp fired, and redistribute
14
- * among the restrepeating until nothing new violates. Without the
15
- * redistribution rounds, an item clamped up to `min-w-*` would keep space
16
- * its neighbors were already told they could use, and boxes would overlap.
17
- *
18
- * `min`/`max` are outer main sizes in cells, already resolved from percent.
19
- * When clamps bind, the returned sizes may sum to less or more than
20
- * `available` — that's CSS (`justify-content` sees the underfill; overflow
21
- * handles the excess).
35
+ * `forced` carries flex-assigned ("used") sizes from a parent flex pass
36
+ * they are authoritative and skip resolution/clamping entirely (the flex
37
+ * loop already applied min/max). With sizes forced, `availableWidth` stays
38
+ * the CONTAINING BLOCK's content width, which percent padding, margins,
39
+ * and min/max resolve against never the assigned size itself.
22
40
  */
23
- export declare function resolveFlexMainAxis(items: ReadonlyArray<{
24
- intrinsic: number;
25
- grow: number;
26
- shrink: number;
27
- min?: number | undefined;
28
- max?: number | undefined;
29
- }>, available: number): number[];
41
+ export declare function layoutNode(node: LayoutNode, availableWidth: number, availableHeight: number | undefined, parentX: number, parentY: number, widthMode: SizingMode, cache: IntrinsicCache, forced?: {
42
+ width?: number | undefined;
43
+ height?: number | undefined;
44
+ }): void;
45
+ export declare function clampSize(value: number, min: number, max: number | undefined): number;
46
+ /**
47
+ * A text leaf's wrapped lines with their vertical geometry. Lines are one
48
+ * row tall unless an atomic inline box on the line is taller — the line
49
+ * grows to the tallest box (per CSS line-box growth), and later lines
50
+ * shift down. `lineGap` rows separate lines as usual. Requires the leaf's
51
+ * inline boxes to be laid out already (their rect heights are read here);
52
+ * marker advances must be resolved.
53
+ */
54
+ export declare function leafLineGeometry(node: LayoutNode, contentWidth: number): {
55
+ spans: LineSpan[];
56
+ lineY: number[];
57
+ totalRows: number;
58
+ };
59
+ /** Resolve a spacing length to cells against its containing-block basis.
60
+ * An indefinite basis (percent gap in an unbounded axis) resolves to 0. */
61
+ export declare function resolveLength(length: CellLength, basis: number | undefined): number;
62
+ /** Resolve all four margin sides (preserving `auto` as null) against the
63
+ * parent's content width — the CSS basis for every side. */
64
+ export declare function resolveMargin(margin: PerSide<CellLength | null>, basis: number): NullableInsets;
65
+ /** Resolve a height limit to cells: percent needs a definite available
66
+ * size; intrinsic keywords behave as "no constraint" on heights. `"auto"`
67
+ * resolves to none here (0 in block flow) — flex main-axis code
68
+ * substitutes the item's content-based automatic minimum itself. */
69
+ export declare function resolveLimit(limit: SizeLimit | "auto" | undefined, available: number | undefined): number | undefined;
70
+ /** Resolve a WIDTH limit to cells — like resolveLimit, but intrinsic
71
+ * keywords (`max-w-max` = max-content, …) resolve against the node's
72
+ * content. */
73
+ export declare function resolveWidthLimit(limit: SizeLimit | "auto" | undefined, available: number, node: LayoutNode, cache: IntrinsicCache): number | undefined;
74
+ /** Resolve a definite Size against an available extent (`auto` falls back
75
+ * to max-content — callers handle the auto/fill distinction themselves). */
76
+ export declare function resolveSizeAgainst(size: Size, available: number, node: LayoutNode, cache: IntrinsicCache): number;
77
+ /** Max-content intrinsic outer width (border + padding + unwrapped content). */
78
+ export declare function intrinsicOuterWidth(node: LayoutNode, cache: IntrinsicCache): number;
30
79
  /**
31
- * Distribute `total` integer units across N slots proportionally to `weights`,
32
- * with the remainder (from flooring) given to the slots with the largest
33
- * fractional part — deterministic, document order for ties.
80
+ * Min-content intrinsic outer width: the narrowest the box can get without
81
+ * overflow. For a text leaf that's the longest unbreakable unit — a word
82
+ * under normal wrapping, a whole hard line under `nowrap`. A nowrap flex
83
+ * row sums its items (they sit side by side no matter what); wrapping rows
84
+ * and block/column containers take the widest child.
34
85
  */
35
- export declare function distributeInteger(weights: number[], total: number): number[];
86
+ export declare function minContentOuterWidth(node: LayoutNode, cache: IntrinsicCache): number;
36
87
  //# sourceMappingURL=layout.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"layout.d.ts","sourceRoot":"","sources":["../src/layout.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAIV,UAAU,EAIX,MAAM,YAAY,CAAC;AAEpB;;;GAGG;AACH,wBAAgB,UAAU,CAAC,IAAI,EAA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S,GAAG,MAAM,GAAG,SAAS,EACrC,SAAS,EAAE,MAAM,GAAG,SAAS,GAC5B,MAAM,GAAG,SAAS,CAIpB;AAED;;cAEc;AACd,wBAAgB,iBAAiB,CAC/B,KAAK,EAAE,SAAS,GAAG,MAAM,GAAG,SAAS,EACrC,SAAS,EAAE,MAAM,EACjB,IAAI,EAAE,UAAU,EAChB,KAAK,EAAE,cAAc,GACpB,MAAM,GAAG,SAAS,CAKpB;AA8GD;4EAC4E;AAC5E,wBAAgB,kBAAkB,CAChC,IAAI,EAAE,IAAI,EACV,SAAS,EAAE,MAAM,EACjB,IAAI,EAAE,UAAU,EAChB,KAAK,EAAE,cAAc,GACpB,MAAM,CAkBR;AAED,gFAAgF;AAChF,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,UAAU,EAAE,KAAK,EAAE,cAAc,GAAG,MAAM,CAanF;AAaD;;;;;;GAMG;AACH,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,UAAU,EAAE,KAAK,EAAE,cAAc,GAAG,MAAM,CAapF"}
package/dist/metrics.d.ts CHANGED
@@ -5,7 +5,15 @@ export declare function roundHalfAwayFromZero(value: number): number;
5
5
  export declare function pxToCells(px: number, rootFontSizePx: number): number;
6
6
  /** Convert a percentage of an integer container to whole cells, ties away from zero. */
7
7
  export declare function percentToCells(percent: number, containerCells: number): number;
8
- /** Measure the width of a monospace character and the line-box height. */
9
- export declare function measureCellMetrics(host: HTMLElement): CellMetrics;
8
+ /** Measure the root's cell from the host's PERSISTENT shadow probe (100
9
+ * "M"s inheriting the host's font): the advance of a monospace character
10
+ * (with the root's own letter-spacing) and the line-box height. Root
11
+ * leading/tracking thus size the grid; descendants' are quantized to it
12
+ * (specs/cell-model.md). The probe must be long-lived: a throwaway node
13
+ * created at measure time can transiently resolve the FALLBACK font even
14
+ * after the real font has loaded (observed on CI Chromium), whereas a
15
+ * persistent node is re-font-matched by the same machinery as real
16
+ * content. */
17
+ export declare function measureCellMetrics(host: HTMLElement, probe: HTMLElement): CellMetrics;
10
18
  export declare function getRootFontSizePx(): number;
11
19
  //# sourceMappingURL=metrics.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"metrics.d.ts","sourceRoot":"","sources":["../src/metrics.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAE9C,+EAA+E;AAC/E,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAG3D;AAED,uFAAuF;AACvF,wBAAgB,SAAS,CAAC,EAAE,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,GAAG,MAAM,CAGpE;AAED,wFAAwF;AACxF,wBAAgB,cAAc,CAAC,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,GAAG,MAAM,CAE9E;AAED,0EAA0E;AAC1E,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,WAAW,GAAG,WAAW,CAejE;AAED,wBAAgB,iBAAiB,IAAI,MAAM,CAE1C"}
1
+ {"version":3,"file":"metrics.d.ts","sourceRoot":"","sources":["../src/metrics.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAE9C,+EAA+E;AAC/E,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAG3D;AAED,uFAAuF;AACvF,wBAAgB,SAAS,CAAC,EAAE,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,GAAG,MAAM,CAGpE;AAED,wFAAwF;AACxF,wBAAgB,cAAc,CAAC,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,GAAG,MAAM,CAE9E;AAED;;;;;;;;cAQc;AACd,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,WAAW,EAAE,KAAK,EAAE,WAAW,GAAG,WAAW,CAIrF;AAED,wBAAgB,iBAAiB,IAAI,MAAM,CAE1C"}
@@ -0,0 +1,10 @@
1
+ import type { IntrinsicCache } from "./layout.ts";
2
+ import type { LayoutNode } from "./types.ts";
3
+ interface Frame {
4
+ node: LayoutNode;
5
+ absX: number;
6
+ absY: number;
7
+ }
8
+ export declare function walkPositioned(node: LayoutNode, absX: number, absY: number, ancestors: Frame[], cache: IntrinsicCache): void;
9
+ export {};
10
+ //# sourceMappingURL=positioning.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"positioning.d.ts","sourceRoot":"","sources":["../src/positioning.ts"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAElD,OAAO,KAAK,EAAyB,UAAU,EAAQ,MAAM,YAAY,CAAC;AAmB1E,UAAU,KAAK;IACb,IAAI,EAAE,UAAU,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;CACd;AAED,wBAAgB,cAAc,CAC5B,IAAI,EAAE,UAAU,EAChB,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,EACZ,SAAS,EAAE,KAAK,EAAE,EAClB,KAAK,EAAE,cAAc,GACpB,IAAI,CA0CN"}
@@ -1 +1 @@
1
- {"version":3,"file":"render.d.ts","sourceRoot":"","sources":["../src/render.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAU,UAAU,EAAQ,MAAM,YAAY,CAAC;AAE3D;;;;;GAKG;AACH,wBAAgB,MAAM,CAAC,IAAI,EAAE,UAAU,EAAE,eAAe,EAAE,WAAW,GAAG,IAAI,CAI3E"}
1
+ {"version":3,"file":"render.d.ts","sourceRoot":"","sources":["../src/render.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,UAAU,EAAW,MAAM,YAAY,CAAC;AAEtD;;;;;GAKG;AACH,wBAAgB,MAAM,CAAC,IAAI,EAAE,UAAU,EAAE,eAAe,EAAE,WAAW,GAAG,IAAI,CAc3E"}
package/dist/style.d.ts CHANGED
@@ -1,10 +1,40 @@
1
- import type { CellStyle } from "./types.ts";
1
+ import type { CellMetrics, CellStyle, GridAreas, GridLine, GridTemplate } from "./types.ts";
2
2
  /**
3
3
  * Read the interpreted CellStyle for an element from its computed CSS.
4
4
  *
5
5
  * The host must have the `measuring` attribute set while this runs so the
6
6
  * engine's own geometry rules (from styles.css) don't feed their outputs back
7
7
  * into what we read.
8
+ *
9
+ * `metrics` (the host's measured cell) is the basis for leading and
10
+ * tracking; absent in headless tests, where the cell height defaults to
11
+ * the font size and the root letter-spacing to 0.
12
+ */
13
+ export declare function readCellStyle(el: Element, rootFontSizePx: number, metrics?: CellMetrics): CellStyle;
14
+ /** Extra cells after each character: floor((letter-spacing − root
15
+ * letter-spacing) ÷ 0.025em), never negative (specs/cell-model.md). The
16
+ * root's own letter-spacing is part of the cell, so only the excess over
17
+ * it (inherited by default) counts. */
18
+ export declare function trackingCells(letterSpacing: string, fontSizePx: number, rootLetterSpacingPx: number): number;
19
+ /**
20
+ * Parse a computed `grid-template-columns` / `grid-template-rows` value
21
+ * (specs/grid.md). Expected on a NON-grid element (see the degrid read in
22
+ * readCellStyle), so the authored structure survives: lengths are computed
23
+ * to px, but `fr`, `minmax()`, and `repeat()` keep their form. Fixed
24
+ * repeats expand here; `auto-fill` / `auto-fit` stay symbolic for layout.
25
+ * Line names would appear in `[bracket]` groups — deferred, dropped.
26
+ */
27
+ export declare function parseTrackTemplate(value: string, rootFontSizePx: number): GridTemplate;
28
+ /**
29
+ * Parse `grid-template-areas` (specs/grid.md): one quoted string per row,
30
+ * whitespace-separated cell tokens, `.` (any run of dots) for an empty
31
+ * cell. Per CSS the whole value is invalid — and reads as `none` — when
32
+ * rows have different lengths or a name's cells don't form one
33
+ * filled-in rectangle.
8
34
  */
9
- export declare function readCellStyle(el: Element, rootFontSizePx: number): CellStyle;
35
+ export declare function parseGridTemplateAreas(value: string): GridAreas | null;
36
+ /** Parse a `grid-column-start`-family longhand: `auto`, an integer line
37
+ * (possibly negative), `span <n>`, or the named forms — `foo`, `<n> foo`,
38
+ * `span foo`, `span <n> foo` (specs/grid.md "Named lines and areas"). */
39
+ export declare function parseGridLine(value: string): GridLine;
10
40
  //# sourceMappingURL=style.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"style.d.ts","sourceRoot":"","sources":["../src/style.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAIV,SAAS,EAMV,MAAM,YAAY,CAAC;AAEpB;;;;;;GAMG;AACH,wBAAgB,aAAa,CAAC,EAAE,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,GAAG,SAAS,CAkF5E"}
1
+ {"version":3,"file":"style.d.ts","sourceRoot":"","sources":["../src/style.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAIV,WAAW,EACX,SAAS,EAGT,SAAS,EAET,QAAQ,EACR,YAAY,EASb,MAAM,YAAY,CAAC;AAEpB;;;;;;;;;;GAUG;AACH,wBAAgB,aAAa,CAC3B,EAAE,EAAE,OAAO,EACX,cAAc,EAAE,MAAM,EACtB,OAAO,CAAC,EAAE,WAAW,GACpB,SAAS,CA4JX;AAuHD;;;uCAGuC;AACvC,wBAAgB,aAAa,CAC3B,aAAa,EAAE,MAAM,EACrB,UAAU,EAAE,MAAM,EAClB,mBAAmB,EAAE,MAAM,GAC1B,MAAM,CAKR;AAsLD;;;;;;;GAOG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,GAAG,YAAY,CAsDtF;AAgCD;;;;;;GAMG;AACH,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,GAAG,IAAI,CAoCtE;AA8GD;;yEAEyE;AACzE,wBAAgB,aAAa,CAAC,KAAK,EAAE,MAAM,GAAG,QAAQ,CA0BrD"}
package/dist/tree.d.ts CHANGED
@@ -1,20 +1,24 @@
1
- import type { LayoutNode } from "./types.ts";
1
+ import type { CellMetrics, LayoutNode } from "./types.ts";
2
2
  /**
3
3
  * Build a LayoutNode tree from an element subtree.
4
4
  *
5
- * Rules:
6
- * - Elements with computed `display: none` are skipped entirely.
7
- * - An element becomes a **leaf** if it has no element children, or if all
8
- * its element children have computed `display: inline`/`inline-*`/`contents`
9
- * (they're part of the inline text flow, not laid out separately). The
10
- * leaf's `text` is the element's combined `textContent`, so text nodes
11
- * interleaved with inline elements (`<div>hello <span>world</span></div>`)
12
- * participate in the wrap calculation and render correctly.
13
- * - Elements with at least one block-level element child become **containers**
14
- * and recurse. Direct text nodes on containers (uncommon in utility-first
15
- * markup) are not laid out — CSS creates anonymous inline boxes for them,
16
- * but our absolutely-positioned children escape that flow. This is
17
- * documented as a deviation in specs/cell-model.md.
5
+ * Rules (specs/cell-model.md "Inline detection"):
6
+ * - Elements with computed `display: none` are skipped entirely (their
7
+ * text never joins a run).
8
+ * - An element is a **leaf** when it has no IN-FLOW block-level element
9
+ * children: in-flow inline children (computed `inline`/`inline-*`/
10
+ * `contents`) are part of the text run, and out-of-flow children
11
+ * (absolute/fixed blockified per CSS) hang off the leaf as layout
12
+ * nodes for the positioning pass. The leaf's `text` is its combined
13
+ * in-flow text, so text nodes interleaved with inline elements
14
+ * (`<div>hello <span>world</span></div>`) participate in the wrap
15
+ * calculation and render correctly.
16
+ * - Elements with at least one in-flow block-level element child become
17
+ * **containers** and recurse. Direct text nodes on containers (uncommon
18
+ * in utility-first markup) are not laid out — a documented deviation.
19
+ *
20
+ * `cellMetrics` (measured by the host) is the basis for leading and
21
+ * tracking; absent in headless tests (see readCellStyle).
18
22
  */
19
- export declare function buildTree(root: Element, rootFontSizePx: number): LayoutNode | null;
23
+ export declare function buildTree(root: Element, rootFontSizePx: number, cellMetrics?: CellMetrics): LayoutNode | null;
20
24
  //# sourceMappingURL=tree.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"tree.d.ts","sourceRoot":"","sources":["../src/tree.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAE7C;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,SAAS,CAAC,IAAI,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,GAAG,UAAU,GAAG,IAAI,CA8ClF"}
1
+ {"version":3,"file":"tree.d.ts","sourceRoot":"","sources":["../src/tree.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,WAAW,EAAE,UAAU,EAAW,MAAM,YAAY,CAAC;AAEnE;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,SAAS,CACvB,IAAI,EAAE,OAAO,EACb,cAAc,EAAE,MAAM,EACtB,WAAW,CAAC,EAAE,WAAW,GACxB,UAAU,GAAG,IAAI,CAsEnB"}
package/dist/types.d.ts CHANGED
@@ -41,12 +41,24 @@ export type Size = {
41
41
  export type Display = "block" | "flex" | "grid" | "none";
42
42
  export type FlexDirection = "row" | "column";
43
43
  export type FlexWrap = "nowrap" | "wrap";
44
- export type JustifyContent = "start" | "center" | "end" | "space-between" | "space-around" | "space-evenly";
44
+ export type JustifyContent = "start" | "center" | "end" | "space-between" | "space-around" | "space-evenly"
45
+ /** CSS `normal` / `stretch`. In flex both behave as `start` (per
46
+ * css-align); in grid they stretch auto-sized tracks over leftover space
47
+ * (CSS Grid §11.8) and otherwise behave as `start`. */
48
+ | "stretch";
45
49
  export type AlignItems = "start" | "center" | "end" | "stretch";
50
+ /** Multi-line cross distribution (`content-*`); `stretch` (the CSS
51
+ * default `normal`) grows flex lines / grid tracks instead of offsetting
52
+ * them. */
53
+ export type AlignContent = JustifyContent;
46
54
  export type AlignSelf = "auto" | "start" | "center" | "end" | "stretch";
47
55
  export type BorderStyle = "solid" | "double" | "dashed" | "dotted";
48
56
  export type Overflow = "visible" | "clip";
49
- export type WhiteSpace = "normal" | "nowrap";
57
+ export type Position = "static" | "relative" | "absolute" | "fixed" | "sticky";
58
+ /** `nowrap` disables soft wrapping; `pre` additionally preserves the
59
+ * source's spaces and newlines (specs/cell-model.md). Everything else
60
+ * (`pre-wrap` included) behaves as `normal`. */
61
+ export type WhiteSpace = "normal" | "nowrap" | "pre";
50
62
  /** A length in whole cells, or a percentage kept symbolic until layout.
51
63
  * Percentages resolve against the CSS-appropriate basis at layout time:
52
64
  * the available extent for min/max (`max-w-full` = 100%), the containing
@@ -55,7 +67,123 @@ export type WhiteSpace = "normal" | "nowrap";
55
67
  export type CellLength = number | {
56
68
  percent: number;
57
69
  };
70
+ /** A min/max constraint: a CellLength, or an intrinsic sizing keyword
71
+ * (`max-w-max` = `max-width: max-content`, …). Keywords are honored on
72
+ * width limits and behave as "no constraint" on height limits (content
73
+ * height already is the intrinsic height). */
74
+ export type SizeLimit = CellLength | "min-content" | "max-content" | "fit-content";
58
75
  export type TextOverflow = "clip" | "ellipsis";
76
+ /** One bound of a grid track size (specs/grid.md). `fr` is only valid as a
77
+ * max (the reader normalizes bare `<n>fr` to `minmax(auto, <n>fr)`, per
78
+ * CSS); percent resolves against the container's content box in the
79
+ * track's axis (indefinite axis → treated as `auto`). */
80
+ export type TrackBreadth = {
81
+ kind: "cells";
82
+ value: number;
83
+ } | {
84
+ kind: "percent";
85
+ value: number;
86
+ } | {
87
+ kind: "fr";
88
+ value: number;
89
+ } | {
90
+ kind: "auto";
91
+ } | {
92
+ kind: "min-content";
93
+ } | {
94
+ kind: "max-content";
95
+ }
96
+ /** `min()` / `max()` over fixed breadths — the canonical responsive
97
+ * auto-fill pattern `minmax(min(8rem, 100%), 1fr)`. Resolvable only
98
+ * when every argument is (a percent argument needs a definite axis);
99
+ * otherwise the whole function behaves as `auto`. `calc()` arithmetic
100
+ * stays unsupported (specs/grid.md deviations). */
101
+ | {
102
+ kind: "math";
103
+ fn: "min" | "max";
104
+ args: TrackBreadth[];
105
+ };
106
+ /** A grid track as a normalized minmax pair — every track-size form reads
107
+ * as one (`8rem` → minmax(cells, cells), `1fr` → minmax(auto, fr), …). */
108
+ export interface TrackSize {
109
+ min: TrackBreadth;
110
+ max: TrackBreadth;
111
+ }
112
+ /** A parsed `grid-template-columns` / `grid-template-rows`. Fixed repeats
113
+ * are expanded at read time; an `auto-fill` / `auto-fit` repetition stays
114
+ * symbolic (`autoRepeat`, spliced in at `tracks[autoRepeat.index]`) and
115
+ * resolves its count at layout time against the definite axis size. */
116
+ export type GridTemplate = {
117
+ kind: "none";
118
+ } | {
119
+ kind: "subgrid";
120
+ } | {
121
+ kind: "tracks";
122
+ tracks: TrackSize[];
123
+ /** `[name …]` groups: `lineNames[i]` names line i (0 … tracks.length).
124
+ * Absent when the template names no lines. */
125
+ lineNames?: string[][];
126
+ autoRepeat?: {
127
+ index: number;
128
+ tracks: TrackSize[];
129
+ /** Names inside the repetition (tracks.length + 1 entries); the
130
+ * edge groups merge with neighbors at every iteration boundary. */
131
+ lineNames?: string[][];
132
+ /** Names authored just before the `repeat()` — they attach to the
133
+ * first repeated line once the count is known. */
134
+ leadingNames?: string[];
135
+ mode: "auto-fill" | "auto-fit";
136
+ };
137
+ };
138
+ /** One side of a grid item's placement (`grid-column-start`, …): a line
139
+ * number (negative counts from the explicit grid's end, per CSS), a span
140
+ * (optionally counting only lines with a name), a named line (`foo`, or
141
+ * `<n> foo` — `nth` absent for the bare form, whose area-edge lookup
142
+ * comes first, specs/grid.md), or auto. */
143
+ export type GridLine = {
144
+ kind: "auto";
145
+ } | {
146
+ kind: "line";
147
+ value: number;
148
+ } | {
149
+ kind: "span";
150
+ value: number;
151
+ name?: string;
152
+ } | {
153
+ kind: "name";
154
+ name: string;
155
+ nth?: number;
156
+ };
157
+ /** A named area from `grid-template-areas`, as 0-based line indices
158
+ * (`colEnd` / `rowEnd` exclusive of the last cell's track). */
159
+ export interface GridArea {
160
+ colStart: number;
161
+ colEnd: number;
162
+ rowStart: number;
163
+ rowEnd: number;
164
+ }
165
+ /** `grid-template-areas`: the row/column count it defines and its
166
+ * (rectangular) named areas. */
167
+ export interface GridAreas {
168
+ columns: number;
169
+ rows: number;
170
+ areas: Map<string, GridArea>;
171
+ }
172
+ export interface GridAutoFlow {
173
+ direction: "row" | "column";
174
+ dense: boolean;
175
+ }
176
+ /** Tracks a subgrid inherits from its parent grid in a subgridded axis
177
+ * (specs/grid.md), projected into the subgrid's CONTENT-box coordinates:
178
+ * the first and last tracks are shrunk by the subgrid's own margin,
179
+ * border, and padding on that side, so its items still land on the
180
+ * parent's lines. `gap` is the parent's gutter. */
181
+ export interface InheritedTracks {
182
+ positions: number[];
183
+ sizes: number[];
184
+ gapBefore: number[];
185
+ gap: number;
186
+ }
59
187
  /** One value per box edge (border style, border color, …). */
60
188
  export interface PerSide<T> {
61
189
  top: T;
@@ -82,30 +210,69 @@ export interface CellStyle {
82
210
  /** CSS `order` — flex items sort by it (stable, document order ties). */
83
211
  order: number;
84
212
  justifyContent: JustifyContent;
213
+ /** Flex: multi-line (wrap-enabled) containers only, per CSS. Grid: row
214
+ * track distribution. */
215
+ alignContent: AlignContent;
85
216
  alignItems: AlignItems;
86
217
  alignSelf: AlignSelf;
218
+ /** Grid container inline-axis item alignment (`justify-items`); the CSS
219
+ * default `normal` behaves as `stretch` in grid. */
220
+ justifyItems: AlignItems;
221
+ /** Grid item inline-axis self-alignment override (`justify-self`). */
222
+ justifySelf: AlignSelf;
223
+ /** Parsed track templates (specs/grid.md). `none` for non-grid elements. */
224
+ gridTemplateColumns: GridTemplate;
225
+ gridTemplateRows: GridTemplate;
226
+ /** Sizes for implicit tracks (`grid-auto-columns` / `grid-auto-rows`),
227
+ * cycled across the implicit tracks in each axis. Never empty — the CSS
228
+ * initial value is a single `auto`. */
229
+ gridAutoColumns: TrackSize[];
230
+ gridAutoRows: TrackSize[];
231
+ gridAutoFlow: GridAutoFlow;
232
+ /** Parsed `grid-template-areas`; `null` for `none` or an invalid value
233
+ * (per CSS the whole property then doesn't apply). */
234
+ gridTemplateAreas: GridAreas | null;
235
+ /** Grid item placement longhands. `auto` on non-grid-item elements. */
236
+ gridColumnStart: GridLine;
237
+ gridColumnEnd: GridLine;
238
+ gridRowStart: GridLine;
239
+ gridRowEnd: GridLine;
87
240
  width: Size | undefined;
88
241
  height: Size | undefined;
89
242
  /** `"auto"` is CSS `min-width/height: auto`: 0 in block flow, but a flex
90
243
  * item's automatic minimum (its min-content size, when overflow is
91
244
  * visible) on the flex main axis — the reason text in a flex row stops
92
245
  * shrinking instead of vanishing, and why `min-w-0` exists. */
93
- minWidth: CellLength | "auto";
94
- minHeight: CellLength | "auto";
95
- maxWidth: CellLength | undefined;
96
- maxHeight: CellLength | undefined;
246
+ minWidth: SizeLimit | "auto";
247
+ minHeight: SizeLimit | "auto";
248
+ maxWidth: SizeLimit | undefined;
249
+ maxHeight: SizeLimit | undefined;
97
250
  padding: PerSide<CellLength>;
98
251
  /** `null` = `auto`. Percentages resolve against the parent's content
99
252
  * width where the margin is consumed. */
100
253
  margin: PerSide<CellLength | null>;
254
+ /** See specs/positioning.md: fixed behaves as absolute anchored to the
255
+ * host; sticky behaves as relative until the scrolling milestone. */
256
+ position: Position;
257
+ /** `top/right/bottom/left`; `null` = `auto`. Percentages resolve against
258
+ * the containing block (width for left/right, height for top/bottom). */
259
+ insets: PerSide<CellLength | null>;
101
260
  gapX: CellLength;
102
261
  gapY: CellLength;
103
262
  border: Insets;
104
263
  borderStyle: PerSide<BorderStyle>;
105
264
  borderColor: PerSide<string | undefined>;
106
265
  overflow: Overflow;
107
- /** `nowrap` disables soft wrapping (hard `<br>` breaks still apply). */
108
266
  whiteSpace: WhiteSpace;
267
+ /** CSS `tab-size` in cells — tab stops for preserved (`pre`) text,
268
+ * expanded by the tree builder from each hard line's start. */
269
+ tabSize: number;
270
+ /** Empty rows between wrapped lines (`leading-*` re-quantized to the
271
+ * grid: rows per line − 1). See specs/cell-model.md. */
272
+ lineGap: number;
273
+ /** Extra cells after every character (`tracking-*` re-quantized:
274
+ * floor((letter-spacing − root letter-spacing) ÷ 0.025em)). */
275
+ tracking: number;
109
276
  /** Paint-only: with `nowrap` + clipping, the browser draws the ellipsis.
110
277
  * The engine only needs it for the ASCII renderer's mirror of that. */
111
278
  textOverflow: TextOverflow;
@@ -126,13 +293,82 @@ export interface LayoutNode {
126
293
  source: Element;
127
294
  style: CellStyle;
128
295
  children: LayoutNode[];
129
- /** Raw text content of the element's direct text nodes (leaves only). Empty
130
- * for pure containers. May coexist with child element nodes when the
131
- * element has mixed text+element children. */
296
+ /** The leaf's text run (inline descendants included, `<br>` as `\n`).
297
+ * Empty for containers their direct text nodes are not laid out. */
132
298
  text: string;
133
299
  intrinsicWidth: number;
134
300
  intrinsicHeight: number;
135
301
  localRect: Rect;
302
+ /** Where an out-of-flow (absolute) box would have sat in normal flow —
303
+ * its CSS "static position", parent-relative, recorded by the parent's
304
+ * flow pass and consumed by the absolute-positioning pass for inset-less
305
+ * axes. Flex parents record the container's content box plus alignment
306
+ * so the "as if sole flex item" rule can apply once the box is sized. */
307
+ staticSlot?: {
308
+ kind: "block";
309
+ x: number;
310
+ y: number;
311
+ } | {
312
+ kind: "flex";
313
+ direction: FlexDirection;
314
+ originX: number;
315
+ originY: number;
316
+ innerWidth: number;
317
+ innerHeight: number;
318
+ }
319
+ /** Grid parents (specs/grid.md §10.1): `area` is the child's grid
320
+ * area (its containing block when the grid container is positioned)
321
+ * and `staticArea` the sole-item area for inset-less axes — both
322
+ * parent-relative border-box rects. */
323
+ | {
324
+ kind: "grid";
325
+ area: Rect;
326
+ staticArea: Rect;
327
+ };
328
+ /** Per-character cell advances for tracked leaf text (`1 + tracking` of
329
+ * the character's innermost element, specs/cell-model.md); absent when
330
+ * every character is a plain 1-cell advance. */
331
+ advances?: number[];
332
+ /** Inline descendants of a leaf. The renderer writes each one's grid
333
+ * tracking, its quantized horizontal padding (the run reserves the
334
+ * cells as INLINE_PAD markers; the browser applies the same cells as
335
+ * real padding via engine-owned vars), and — for the positioned ones —
336
+ * its relative insets rewritten to whole cells (specs/positioning.md);
337
+ * `null` insets = not positioned. */
338
+ inlineElements?: {
339
+ element: Element;
340
+ tracking: number;
341
+ padLeft: number;
342
+ padRight: number;
343
+ insets: PerSide<number | null> | null;
344
+ }[];
345
+ /** True on an atomic inline-level box (`inline-flex`/`inline-block`/
346
+ * `inline-grid`) riding its parent leaf's text run as a single
347
+ * unbreakable unit: the leaf's run holds an OBJECT REPLACEMENT
348
+ * CHARACTER (U+FFFC) for it whose advance is the box's laid-out width.
349
+ * The box stays IN FLOW in the browser (sized to whole cells by the
350
+ * companion stylesheet) so the browser's own line layout places it —
351
+ * engine and browser agree because both treat it as an atomic unit of
352
+ * the same width (specs/cell-model.md). */
353
+ inlineBox?: boolean;
354
+ /** Set by a grid parent on a child whose template is `subgrid` in at
355
+ * least one axis: the child's span in each axis (its explicit track
356
+ * count there — placement clamps to it) and, once the parent has sized
357
+ * that axis, the inherited tracks. Rows arrive in the parent's second
358
+ * pass: the first pass lays the subgrid out provisionally (its own
359
+ * items' heights feed the parent's row sizing). Absent on everything
360
+ * else — a `subgrid` template then behaves as `none`, per CSS. */
361
+ subgrid?: {
362
+ colSpan: number;
363
+ rowSpan: number;
364
+ cols?: InheritedTracks | undefined;
365
+ rows?: InheritedTracks | undefined;
366
+ } | undefined;
367
+ /** True on a container whose direct text nodes were dropped (mixed
368
+ * text + in-flow block children — cell-model deviation). The renderer
369
+ * hides that text and warns instead of letting the browser paint it
370
+ * unpositioned. */
371
+ droppedText?: boolean;
136
372
  /** Outer height before min/max clamping — written by layoutNode; the
137
373
  * column flex algorithm's base main size (CSS distributes from unclamped
138
374
  * bases; limits apply via its freeze loop). */
@@ -142,10 +378,17 @@ export interface LayoutNode {
142
378
  * layout knows); the renderers read this, never `style.padding`. */
143
379
  resolvedPadding: Insets;
144
380
  }
381
+ /** The root's cell, in px: width = glyph advance + the root's
382
+ * letter-spacing, height = the root's line box (specs/cell-model.md).
383
+ * `letterSpacing` is the root's, kept so descendant tracking can be read
384
+ * relative to it. */
145
385
  export interface CellMetrics {
146
386
  width: number;
147
387
  height: number;
388
+ letterSpacing: number;
148
389
  }
149
390
  export declare function defaultCellStyle(): CellStyle;
150
391
  export declare function zeroInsets(): Insets;
392
+ /** The CSS initial implicit-track size: `minmax(auto, auto)`. */
393
+ export declare function autoTrack(): TrackSize;
151
394
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