monowind 0.2.9 → 0.2.11
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/borders.d.ts +6 -6
- package/dist/borders.d.ts.map +1 -1
- package/dist/cdn.js +151 -86
- package/dist/cdn.js.map +1 -1
- package/dist/element.d.ts.map +1 -1
- package/dist/floats.d.ts +43 -0
- package/dist/floats.d.ts.map +1 -0
- package/dist/glyph-box.d.ts +12 -3
- package/dist/glyph-box.d.ts.map +1 -1
- package/dist/index.js +2088 -1401
- package/dist/index.js.map +1 -1
- package/dist/lattice.d.ts +28 -0
- package/dist/lattice.d.ts.map +1 -0
- package/dist/layout.d.ts +27 -6
- package/dist/layout.d.ts.map +1 -1
- package/dist/multicol.d.ts.map +1 -1
- package/dist/paint.d.ts.map +1 -1
- package/dist/plain-text.d.ts +11 -0
- package/dist/plain-text.d.ts.map +1 -1
- package/dist/pointer.d.ts +27 -8
- package/dist/pointer.d.ts.map +1 -1
- package/dist/positioning.d.ts.map +1 -1
- package/dist/render.d.ts +5 -0
- package/dist/render.d.ts.map +1 -1
- package/dist/selection.d.ts.map +1 -1
- package/dist/sticky.d.ts +32 -0
- package/dist/sticky.d.ts.map +1 -0
- package/dist/style.d.ts +7 -0
- package/dist/style.d.ts.map +1 -1
- package/dist/table.d.ts +1 -6
- package/dist/table.d.ts.map +1 -1
- package/dist/tree.d.ts +16 -9
- package/dist/tree.d.ts.map +1 -1
- package/dist/types.d.ts +81 -6
- package/dist/types.d.ts.map +1 -1
- package/dist/wrap.d.ts +5 -0
- package/dist/wrap.d.ts.map +1 -1
- package/package.json +3 -3
- package/src/styles.css +103 -36
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A collapsed table's border lattice (specs/table.md), resolved at
|
|
3
|
+
* paint (specs/sticky.md "Table parts stick"): layout's segments are
|
|
4
|
+
* placed with the shift of the row group, row, and cell they belong
|
|
5
|
+
* to — a shared line once per distinct shift, so a part takes its own
|
|
6
|
+
* lines along and its neighbours keep theirs — into an arms map, and
|
|
7
|
+
* each visible cell's glyph comes from what lands on it: a line where
|
|
8
|
+
* one segment runs, a junction where several meet. A part covers what
|
|
9
|
+
* it slid over; parts moving together merge where they meet.
|
|
10
|
+
*/
|
|
11
|
+
import type { BorderRun, BorderStyle, LayoutNode, TableLattice } from "./types.ts";
|
|
12
|
+
export declare const STYLE_RANK: Record<BorderStyle, number>;
|
|
13
|
+
/** The lattice's glyph runs, in table-local cells: the table's own, and
|
|
14
|
+
* each shifted part's (for the part's paint step). `visible` says
|
|
15
|
+
* whether a table-local cell reaches the grid. */
|
|
16
|
+
export declare function resolveLattice(table: LayoutNode, lattice: TableLattice, visible: (x: number, y: number) => boolean): {
|
|
17
|
+
runs: BorderRun[];
|
|
18
|
+
parts: Map<LayoutNode, BorderRun[]>;
|
|
19
|
+
};
|
|
20
|
+
/** The grid rows and columns a part covers — a cell's own, a row's or
|
|
21
|
+
* row group's cells' — or null for a part without cells. */
|
|
22
|
+
export declare function partExtent(lattice: TableLattice, part: LayoutNode): {
|
|
23
|
+
r0: number;
|
|
24
|
+
r1: number;
|
|
25
|
+
c0: number;
|
|
26
|
+
c1: number;
|
|
27
|
+
} | null;
|
|
28
|
+
//# sourceMappingURL=lattice.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lattice.d.ts","sourceRoot":"","sources":["../src/lattice.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAGH,OAAO,KAAK,EAAE,SAAS,EAAE,WAAW,EAAkB,UAAU,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAEnG,eAAO,MAAM,UAAU,EAAE,MAAM,CAAC,WAAW,EAAE,MAAM,CAKlD,CAAC;AAyHF;;kDAEkD;AAClD,wBAAgB,cAAc,CAC5B,KAAK,EAAE,UAAU,EACjB,OAAO,EAAE,YAAY,EACrB,OAAO,EAAE,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,KAAK,OAAO,GACzC;IAAE,IAAI,EAAE,SAAS,EAAE,CAAC;IAAC,KAAK,EAAE,GAAG,CAAC,UAAU,EAAE,SAAS,EAAE,CAAC,CAAA;CAAE,CA6L5D;AAID;4DAC4D;AAC5D,wBAAgB,UAAU,CACxB,OAAO,EAAE,YAAY,EACrB,IAAI,EAAE,UAAU,GACf;IAAE,EAAE,EAAE,MAAM,CAAC;IAAC,EAAE,EAAE,MAAM,CAAC;IAAC,EAAE,EAAE,MAAM,CAAC;IAAC,EAAE,EAAE,MAAM,CAAA;CAAE,GAAG,IAAI,CAe3D"}
|
package/dist/layout.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { LineSpan } from "./wrap.ts";
|
|
2
2
|
import type { TableData } from "./table.ts";
|
|
3
|
-
import type {
|
|
3
|
+
import type { FloatBox } from "./floats.ts";
|
|
4
|
+
import type { CellLength, CellStyle, LayoutNode, LineBand, NullableInsets, PerSide, Size, SizeLimit } from "./types.ts";
|
|
4
5
|
/**
|
|
5
6
|
* Core layout: the per-node sizing pipeline, block flow, and the shared
|
|
6
7
|
* sizing/intrinsic machinery. Flex lives in flex.ts, the positioning pass
|
|
@@ -18,6 +19,22 @@ export declare function layoutRoot(root: LayoutNode, availableWidth: number): {
|
|
|
18
19
|
};
|
|
19
20
|
/** absolute / fixed boxes are out of normal flow. */
|
|
20
21
|
export declare function isOutOfFlow(style: CellStyle): boolean;
|
|
22
|
+
/** A formatting-context root beside floats (specs/float.md): it steps
|
|
23
|
+
* aside from them as one box, where a text leaf or an empty box passes
|
|
24
|
+
* under with its lines shortened — a container of in-flow children, a
|
|
25
|
+
* non-block display (flex, grid, table, multicol), or an overflow other
|
|
26
|
+
* than visible (a scroll container, clipping, truncation), which CSS
|
|
27
|
+
* makes roots too. */
|
|
28
|
+
export declare function isFormattingContextRoot(node: LayoutNode): boolean;
|
|
29
|
+
/** The floats a leaf's lines wrap against (specs/float.md): its
|
|
30
|
+
* container's exclusion boxes and content width, and the leaf's
|
|
31
|
+
* border-box origin in that content box. */
|
|
32
|
+
export interface Intrusions {
|
|
33
|
+
boxes: FloatBox[];
|
|
34
|
+
contentWidth: number;
|
|
35
|
+
x: number;
|
|
36
|
+
y: number;
|
|
37
|
+
}
|
|
21
38
|
/** A containing block for absolute descendants, per CSS. */
|
|
22
39
|
export declare function isPositioned(style: CellStyle): boolean;
|
|
23
40
|
export type SizingMode = "fill" | "shrink";
|
|
@@ -52,21 +69,24 @@ export declare function layoutNode(node: LayoutNode, availableWidth: number, ava
|
|
|
52
69
|
right: boolean;
|
|
53
70
|
bottom: boolean;
|
|
54
71
|
};
|
|
55
|
-
}): void;
|
|
72
|
+
}, intrusions?: Intrusions): void;
|
|
56
73
|
export declare function clampSize(value: number, min: number, max: number | undefined): number;
|
|
57
74
|
/** A single-column text leaf's wrapped lines with their vertical
|
|
58
75
|
* geometry: `lineGap` rows between lines, per-line heights and text
|
|
59
76
|
* drops from leafLineMetrics (multicol leaves fragment through
|
|
60
77
|
* multicolLeafGeometry instead). Marker advances must be resolved. */
|
|
61
|
-
export declare function leafLineGeometry(node: LayoutNode, contentWidth: number): {
|
|
78
|
+
export declare function leafLineGeometry(node: LayoutNode, contentWidth: number, intrusions?: Intrusions): {
|
|
62
79
|
spans: LineSpan[];
|
|
63
80
|
lineY: number[];
|
|
64
81
|
textY: number[];
|
|
65
82
|
totalRows: number;
|
|
83
|
+
bands: LineBand[] | undefined;
|
|
66
84
|
};
|
|
85
|
+
type LineOpener = (index: number, closed: readonly LineSpan[]) => number;
|
|
67
86
|
/** A leaf's line spans: hard `<br>` lines under nowrap/pre, greedy
|
|
68
|
-
* word-wrap at the content width otherwise
|
|
69
|
-
|
|
87
|
+
* word-wrap at the content width otherwise — each line opened through
|
|
88
|
+
* `openLine` when given (a hard line takes its row's band too). */
|
|
89
|
+
export declare function leafLineSpans(node: LayoutNode, contentWidth: number, openLine?: LineOpener): LineSpan[];
|
|
70
90
|
/**
|
|
71
91
|
* Per-line height and text drop for a leaf's wrapped lines. Lines are one
|
|
72
92
|
* row tall unless an atomic inline box on the line is taller — the line
|
|
@@ -77,7 +97,7 @@ export declare function leafLineSpans(node: LayoutNode, contentWidth: number): L
|
|
|
77
97
|
* baseline are off-grid). Requires the leaf's inline boxes to be laid
|
|
78
98
|
* out already (their rect heights are read here).
|
|
79
99
|
*/
|
|
80
|
-
export declare function leafLineMetrics(node: LayoutNode, spans: LineSpan[]): {
|
|
100
|
+
export declare function leafLineMetrics(node: LayoutNode, spans: readonly LineSpan[]): {
|
|
81
101
|
heights: number[];
|
|
82
102
|
textOffsets: number[];
|
|
83
103
|
};
|
|
@@ -129,4 +149,5 @@ export declare function widthContribution(child: LayoutNode, kind: "min" | "max"
|
|
|
129
149
|
* and block/column containers take the widest child.
|
|
130
150
|
*/
|
|
131
151
|
export declare function minContentOuterWidth(node: LayoutNode, cache: IntrinsicCache): number;
|
|
152
|
+
export {};
|
|
132
153
|
//# sourceMappingURL=layout.d.ts.map
|
package/dist/layout.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"layout.d.ts","sourceRoot":"","sources":["../src/layout.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAkB1C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"layout.d.ts","sourceRoot":"","sources":["../src/layout.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAkB1C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAK5C,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,KAAK,EACV,UAAU,EACV,SAAS,EAET,UAAU,EACV,QAAQ,EAER,cAAc,EACd,OAAO,EACP,IAAI,EACJ,SAAS,EACV,MAAM,YAAY,CAAC;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AAE,MAAM,GAAG,SAAS,EAClC,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,MAAM,EACf,KAAK,EAAE,cAAc,GACpB,MAAM,CA2QR"}
|
package/dist/paint.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"paint.d.ts","sourceRoot":"","sources":["../src/paint.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAEjD,OAAO,KAAK,EAAe,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAElE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAoC7C,gDAAgD;AAChD,MAAM,MAAM,WAAW,GAAG,IAAI,CAAC,UAAU,EAAE,KAAK,GAAG,OAAO,CAAC,CAAC;AAE5D,MAAM,WAAW,YAAY;IAC3B,+DAA+D;IAC/D,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB,SAAS,CAAC,EAAE,aAAa,CAAC,WAAW,CAAC,CAAC;CACxC;AAQD;;0DAE0D;AAC1D,wBAAgB,SAAS,CACvB,IAAI,EAAE,UAAU,EAChB,MAAM,EAAE,WAAW,EACnB,OAAO,GAAE,YAAiB,GACzB,OAAO,CAgET;AAwBD,sEAAsE;AACtE,wBAAgB,WAAW,CAAC,MAAM,EAAE,WAAW,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAE7F;
|
|
1
|
+
{"version":3,"file":"paint.d.ts","sourceRoot":"","sources":["../src/paint.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAEjD,OAAO,KAAK,EAAe,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAElE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAoC7C,gDAAgD;AAChD,MAAM,MAAM,WAAW,GAAG,IAAI,CAAC,UAAU,EAAE,KAAK,GAAG,OAAO,CAAC,CAAC;AAE5D,MAAM,WAAW,YAAY;IAC3B,+DAA+D;IAC/D,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB,SAAS,CAAC,EAAE,aAAa,CAAC,WAAW,CAAC,CAAC;CACxC;AAQD;;0DAE0D;AAC1D,wBAAgB,SAAS,CACvB,IAAI,EAAE,UAAU,EAChB,MAAM,EAAE,WAAW,EACnB,OAAO,GAAE,YAAiB,GACzB,OAAO,CAgET;AAwBD,sEAAsE;AACtE,wBAAgB,WAAW,CAAC,MAAM,EAAE,WAAW,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAE7F;AA+DD;;0DAE0D;AAC1D,wBAAgB,YAAY,CAAC,MAAM,EAAE,WAAW,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,CAUlF"}
|
package/dist/plain-text.d.ts
CHANGED
|
@@ -78,6 +78,17 @@ export declare function applyCellPaint(paint: CellPaint, style: CSSStyleDeclarat
|
|
|
78
78
|
/** True when a segment carries no paint — the DOM adapter emits a bare
|
|
79
79
|
* text node for these instead of an empty <span>. */
|
|
80
80
|
export declare function isBarePaint(paint: CellPaint): boolean;
|
|
81
|
+
/** The cells a clipping container's content shows through, in
|
|
82
|
+
* absolute cells (specs/scrolling.md): its padding box on each
|
|
83
|
+
* clipping axis, the gutter excluded, unbounded on a visible axis;
|
|
84
|
+
* null for a container clipping neither. The paint culls ink here and
|
|
85
|
+
* hit-testing stops descending here. */
|
|
86
|
+
export declare function clipBounds(node: LayoutNode, absX: number, absY: number): {
|
|
87
|
+
x0: number;
|
|
88
|
+
y0: number;
|
|
89
|
+
x1: number;
|
|
90
|
+
y1: number;
|
|
91
|
+
} | null;
|
|
81
92
|
/** Whether a cell lies on one of a fragmented leaf's line boxes — the
|
|
82
93
|
* hit test for paragraph-flow multicol children, whose `localRect` is
|
|
83
94
|
* the shared container box (specs/multicol.md): each line covers its
|
package/dist/plain-text.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plain-text.d.ts","sourceRoot":"","sources":["../src/plain-text.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"plain-text.d.ts","sourceRoot":"","sources":["../src/plain-text.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAGnD;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,UAAU,GAAG,MAAM,CAIxD;AAED;;;uEAGuE;AACvE,MAAM,WAAW,SAAS;IACxB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;sEACkE;IAClE,eAAe,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACrC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B;;;sEAGkE;IAClE,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;6BAEyB;IACzB,QAAQ,CAAC,EAAE,IAAI,CAAC;CACjB;AAED;;;;;mCAKmC;AACnC,MAAM,WAAW,WAAY,SAAQ,SAAS;IAC5C,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,GAAG,CAAC,EAAE,IAAI,CAAC;CACZ;AAED;;+DAE+D;AAC/D,MAAM,WAAW,aAAa;IAC5B,KAAK,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,SAAS,GAAG,SAAS,KAAK,OAAO,CAAC;IAClF,SAAS,CAAC,EAAE,GAAG,CAAC,UAAU,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,M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,IAAI,CAef;AAED;;;;yCAIyC;AACzC,wBAAgB,kBAAkB,CAChC,IAAI,EAAE,UAAU,EAChB,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,GACX;IAAE,OAAO,EAAE,OAAO,CAAC;IAAC,IAAI,EAAE,IAAI,CAAA;CAAE,EAAE,CAkCpC;AAED;;;;;;4BAM4B;AAC5B,wBAAgB,iBAAiB,CAC/B,IAAI,EAAE,UAAU,EAChB,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,GACX;IAAE,CAAC,CAAC,EAAE,SAAS,CAAC;IAAC,CAAC,CAAC,EAAE,SAAS,CAAA;CAAE,CA8BlC;AAED;gCACgC;AAChC,MAAM,WAAW,SAAS;IACxB,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,EAAE,MAAM,CAAC;CACb;AAED;;;;wEAIwE;AACxE,wBAAgB,SAAS,CACvB,QAAQ,EAAE,MAAM,EAChB,IAAI,EAAE,MAAM,EACZ,GAAG,EAAE,MAAM,EACX,MAAM,EAAE,MAAM,GACb;IAAE,EAAE,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAA;CAAE,CAM7B"}
|
package/dist/pointer.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { LayoutNode } from "./types.ts";
|
|
1
|
+
import type { LayoutNode, Rect } from "./types.ts";
|
|
2
2
|
/**
|
|
3
3
|
* Cell hit-testing for the synthesized pointer states
|
|
4
4
|
* (specs/cell-model.md "Pointer states"): under select="grid" the
|
|
@@ -13,12 +13,17 @@ export interface HitEntry {
|
|
|
13
13
|
x: number;
|
|
14
14
|
y: number;
|
|
15
15
|
}
|
|
16
|
+
/** A node's hit rect in absolute cells (specs/scrolling.md
|
|
17
|
+
* "Hit-testing follows the ink"): its border box, grown to a text
|
|
18
|
+
* leaf's ink where an unwrapped line runs past it on a visible axis. */
|
|
19
|
+
export declare function hitRect(node: LayoutNode, x: number, y: number): Rect;
|
|
16
20
|
/** The nodes under a cell with their painted origins, outermost
|
|
17
|
-
* first: the innermost node whose
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
21
|
+
* first: the innermost node whose hit rect covers the cell, plus its
|
|
22
|
+
* ancestors — native :hover marks the whole chain, so the synthesized
|
|
23
|
+
* attribute does too. Overlapping siblings resolve to the TOPMOST in
|
|
24
|
+
* paint order (z-index, document-order ties), matching what the grid
|
|
25
|
+
* shows at that cell; the descent stops where a clipping container's
|
|
26
|
+
* paint does. */
|
|
22
27
|
export declare function hitStack(root: LayoutNode, col: number, row: number): HitEntry[];
|
|
23
28
|
/** Inside an `inert` subtree: absent for user interaction, as natively
|
|
24
29
|
* — no hover, no wheel routing, no thumb drag, no focus, no text
|
|
@@ -27,13 +32,27 @@ export declare function isInert(element: Element): boolean;
|
|
|
27
32
|
/** The hit stack's elements — what the synthesized states mark — cut
|
|
28
33
|
* at the first inert one, where native :hover stops too. */
|
|
29
34
|
export declare function hitChain(root: LayoutNode, col: number, row: number): Element[];
|
|
35
|
+
/** The cells a scroller moves toward a pointer past its box
|
|
36
|
+
* (specs/wide-characters.md "auto-scrolls"): the distance past each
|
|
37
|
+
* edge in whole cells, rounded up; zero on an axis the pointer is
|
|
38
|
+
* inside. */
|
|
39
|
+
export declare function scrollStep(box: Pick<DOMRectReadOnly, "left" | "top" | "right" | "bottom">, point: {
|
|
40
|
+
x: number;
|
|
41
|
+
y: number;
|
|
42
|
+
}, cell: {
|
|
43
|
+
width: number;
|
|
44
|
+
height: number;
|
|
45
|
+
}): {
|
|
46
|
+
x: number;
|
|
47
|
+
y: number;
|
|
48
|
+
};
|
|
30
49
|
/** The cells to try for the character nearest `(col, row)`, in the
|
|
31
50
|
* order the browser's closest-position rule would (specs/
|
|
32
51
|
* wide-characters.md): the cell itself, then its row leftward — a hit
|
|
33
52
|
* there is the point AFTER that character — and rightward (BEFORE it),
|
|
34
53
|
* then the rows above and below, farther out each step, an upper row
|
|
35
|
-
* from its end and a lower one from its start
|
|
36
|
-
*
|
|
54
|
+
* from its end and a lower one from its start, all inside a box of
|
|
55
|
+
* `width × height` cells the cell is clamped into. */
|
|
37
56
|
export declare function nearestCells(width: number, height: number, col: number, row: number): Generator<{
|
|
38
57
|
x: number;
|
|
39
58
|
y: number;
|
package/dist/pointer.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pointer.d.ts","sourceRoot":"","sources":["../src/pointer.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"pointer.d.ts","sourceRoot":"","sources":["../src/pointer.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAEnD;;;;;;GAMG;AAEH,MAAM,WAAW,QAAQ;IACvB,IAAI,EAAE,UAAU,CAAC;IACjB;4CACwC;IACxC,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX;AAED;;wEAEwE;AACxE,wBAAgB,OAAO,CAAC,IAAI,EAAE,UAAU,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,IAAI,CAUpE;AAED;;;;;;iBAMiB;AACjB,wBAAgB,QAAQ,CAAC,IAAI,EAAE,UAAU,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,QAAQ,EAAE,CA8B/E;AAMD;;gBAEgB;AAChB,wBAAgB,OAAO,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAGjD;AAED;4DAC4D;AAC5D,wBAAgB,QAAQ,CAAC,IAAI,EAAE,UAAU,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO,EAAE,CAQ9E;AAED;;;aAGa;AACb,wBAAgB,UAAU,CACxB,GAAG,EAAE,IAAI,CAAC,eAAe,EAAE,MAAM,GAAG,KAAK,GAAG,OAAO,GAAG,QAAQ,CAAC,EAC/D,KAAK,EAAE;IAAE,CAAC,EAAE,MAAM,CAAC;IAAC,CAAC,EAAE,MAAM,CAAA;CAAE,EAC/B,IAAI,EAAE;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,GACtC;IAAE,CAAC,EAAE,MAAM,CAAC;IAAC,CAAC,EAAE,MAAM,CAAA;CAAE,CAO1B;AAED;;;;;;sDAMsD;AACtD,wBAAiB,YAAY,CAC3B,KAAK,EAAE,MAAM,EACb,MAAM,EAAE,MAAM,EACd,GAAG,EAAE,MAAM,EACX,GAAG,EAAE,MAAM,GACV,SAAS,CAAC;IAAE,CAAC,EAAE,MAAM,CAAC;IAAC,CAAC,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,GAAG,OAAO,GAAG,KAAK,CAAA;CAAE,CAAC,CAWrE"}
|
|
@@ -1 +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;
|
|
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;AAoB1E,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"}
|
package/dist/render.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { StickyBox } from "./sticky.ts";
|
|
1
2
|
import type { LayoutNode } from "./types.ts";
|
|
2
3
|
/**
|
|
3
4
|
* Write geometry custom properties, quantized inline padding, and z-index
|
|
@@ -13,4 +14,8 @@ import type { LayoutNode } from "./types.ts";
|
|
|
13
14
|
* writes keep the popup up.
|
|
14
15
|
*/
|
|
15
16
|
export declare function render(root: LayoutNode): void;
|
|
17
|
+
/** The sticky shifts for the current scroll offsets (specs/sticky.md),
|
|
18
|
+
* written after the paint computes them: a box's as `--mw-sx`/`--mw-sy`
|
|
19
|
+
* beside its position, an inline element's as its inset properties. */
|
|
20
|
+
export declare function syncStickyVars(boxes: StickyBox[]): void;
|
|
16
21
|
//# sourceMappingURL=render.d.ts.map
|
package/dist/render.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"render.d.ts","sourceRoot":"","sources":["../src/render.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"render.d.ts","sourceRoot":"","sources":["../src/render.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAC7C,OAAO,KAAK,EAAE,UAAU,EAAW,MAAM,YAAY,CAAC;AAEtD;;;;;;;;;;;;GAYG;AACH,wBAAgB,MAAM,CAAC,IAAI,EAAE,UAAU,GAAG,IAAI,CAY7C;AAkID;;uEAEuE;AACvE,wBAAgB,cAAc,CAAC,KAAK,EAAE,SAAS,EAAE,GAAG,IAAI,CAoBvD"}
|
package/dist/selection.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"selection.d.ts","sourceRoot":"","sources":["../src/selection.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,UAAU,EAAE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AAC,IAAI,EAAE,UAAU,GAAG;IAAE,KAAK,EAAE,KAAK,CAAC;IAAC,GAAG,EAAE,KAAK,CAAA;CAAE,GAAG,IAAI,CA4BhF;AA2BD;uDACuD;AACvD,wBAAgB,UAAU,CAAC,IAAI,EAAE,UAAU,GAAG,OAAO,CAMpD;AAuDD;;;qCAGqC;AACrC,wBAAgB,MAAM,CAAC,IAAI,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,GAAG;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAA;CAAE,GAAG,IAAI,CAe7F"}
|
package/dist/sticky.d.ts
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Sticky positioning (specs/sticky.md): a box's paint-time shift from
|
|
3
|
+
* its scroll container's cell-quantized offset — css-position-3 §3.4
|
|
4
|
+
* in cells — computed for the sticky boxes the layout pass collected,
|
|
5
|
+
* each from its ancestor chain, and stored as `node.stickyShift` for
|
|
6
|
+
* the walks (paint, hit-testing, focus) to add where they add the
|
|
7
|
+
* box's own position. A sticky inline element's shift lands on its
|
|
8
|
+
* record for the leaf's cell walk the same way.
|
|
9
|
+
*/
|
|
10
|
+
import type { LayoutNode } from "./types.ts";
|
|
11
|
+
/** A span on one axis, in painted cells: `end` exclusive. */
|
|
12
|
+
export interface Span {
|
|
13
|
+
start: number;
|
|
14
|
+
end: number;
|
|
15
|
+
}
|
|
16
|
+
/** The shift on one axis: the box's start edge kept at or past the
|
|
17
|
+
* view's start inset and its end edge at or before the view's end
|
|
18
|
+
* inset, the start inset winning when both bind; then the box kept
|
|
19
|
+
* inside its block — none of the shift toward a side the box already
|
|
20
|
+
* crosses. Insets in cells, `null` for `auto`. */
|
|
21
|
+
export declare function stickyShiftAxis(box: Span, block: Span, view: Span, startInset: number | null, endInset: number | null): number;
|
|
22
|
+
/** A sticky box, or a leaf holding sticky inline elements, with its
|
|
23
|
+
* ancestors from the root down — gathered once per layout. */
|
|
24
|
+
export interface StickyBox {
|
|
25
|
+
node: LayoutNode;
|
|
26
|
+
ancestors: LayoutNode[];
|
|
27
|
+
}
|
|
28
|
+
export declare function collectStickyBoxes(root: LayoutNode): StickyBox[];
|
|
29
|
+
/** The shifts for the current scroll offsets, in document order so a
|
|
30
|
+
* parent's shift is known before its descendants'. */
|
|
31
|
+
export declare function applyStickyShifts(boxes: StickyBox[]): void;
|
|
32
|
+
//# sourceMappingURL=sticky.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sticky.d.ts","sourceRoot":"","sources":["../src/sticky.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAKH,OAAO,KAAK,EAAc,UAAU,EAAgB,MAAM,YAAY,CAAC;AAEvE,6DAA6D;AAC7D,MAAM,WAAW,IAAI;IACnB,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,EAAE,MAAM,CAAC;CACb;AAED;;;;kDAIkD;AAClD,wBAAgB,eAAe,CAC7B,GAAG,EAAE,IAAI,EACT,KAAK,EAAE,IAAI,EACX,IAAI,EAAE,IAAI,EACV,UAAU,EAAE,MAAM,GAAG,IAAI,EACzB,QAAQ,EAAE,MAAM,GAAG,IAAI,GACtB,MAAM,CASR;AAED;8DAC8D;AAC9D,MAAM,WAAW,SAAS;IACxB,IAAI,EAAE,UAAU,CAAC;IACjB,SAAS,EAAE,UAAU,EAAE,CAAC;CACzB;AAED,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,UAAU,GAAG,SAAS,EAAE,CAWhE;AAcD;sDACsD;AACtD,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,SAAS,EAAE,GAAG,IAAI,CAE1D"}
|
package/dist/style.d.ts
CHANGED
|
@@ -30,6 +30,13 @@ export declare function readTextStyle(el: Element, cs: CSSStyleDeclaration, root
|
|
|
30
30
|
* root's own letter-spacing is part of the cell, so only the excess over
|
|
31
31
|
* it (inherited by default) counts. */
|
|
32
32
|
export declare function trackingCells(letterSpacing: string, fontSizePx: number, rootLetterSpacingPx: number): number;
|
|
33
|
+
/** Empty rows between wrapped lines: floor(line-height ÷ font-size) − 1,
|
|
34
|
+
* never negative. Computed line-height is always px (or `normal`); the
|
|
35
|
+
* divisor is FONT-SIZE, not cell-height, so unitless ratios keep their
|
|
36
|
+
* CSS meaning (`leading-loose` = 2 → 2 rows per line, 1 gap) even when
|
|
37
|
+
* cell-height ≠ 1em (default `line-height: normal` on the root makes
|
|
38
|
+
* the cell ~1.15em). */
|
|
39
|
+
export declare function lineGapRows(lineHeight: string, fontSizePx: number): number;
|
|
33
40
|
/**
|
|
34
41
|
* Parse a computed `grid-template-columns` / `grid-template-rows` value
|
|
35
42
|
* (specs/grid.md). Expected on a NON-grid element (see the degrid read in
|
package/dist/style.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"style.d.ts","sourceRoot":"","sources":["../src/style.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAEV,QAAQ,EAIR,WAAW,EACX,SAAS,
|
|
1
|
+
{"version":3,"file":"style.d.ts","sourceRoot":"","sources":["../src/style.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAEV,QAAQ,EAIR,WAAW,EACX,SAAS,EAMT,SAAS,EAET,QAAQ,EACR,YAAY,EAUb,MAAM,YAAY,CAAC;AAEpB;;;;;;;;;;GAUG;AACH,wBAAgB,aAAa,CAC3B,EAAE,EAAE,OAAO,EACX,cAAc,EAAE,MAAM,EACtB,OAAO,CAAC,EAAE,WAAW,GACpB,SAAS,CAyQX;AA8BD;;;;iBAIiB;AACjB,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CASzD;AAmFD;;;qDAGqD;AACrD,wBAAgB,YAAY,CAAC,EAAE,EAAE,mBAAmB,GAAG,QAAQ,CAM9D;AAqED;6DAC6D;AAC7D,wBAAgB,aAAa,CAC3B,EAAE,EAAE,OAAO,EACX,EAAE,EAAE,mBAAmB,EACvB,cAAc,EAAE,MAAM,GACrB,IAAI,CACL,SAAS,EACP,YAAY,GACZ,SAAS,GACT,cAAc,GACd,oBAAoB,GACpB,kBAAkB,GAClB,WAAW,GACX,YAAY,CACf,CAkBA;AAqLD;;;uCAGuC;AACvC,wBAAgB,aAAa,CAC3B,aAAa,EAAE,MAAM,EACrB,UAAU,EAAE,MAAM,EAClB,mBAAmB,EAAE,MAAM,GAC1B,MAAM,CAKR;AAED;;;;;wBAKwB;AACxB,wBAAgB,WAAW,CAAC,UAAU,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,MAAM,CAK1E;AAygBD;;;;;;;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/table.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { IntrinsicCache } from "./layout.ts";
|
|
2
|
-
import type {
|
|
2
|
+
import type { Insets, LatticeSegment, LayoutNode } from "./types.ts";
|
|
3
3
|
/**
|
|
4
4
|
* Table layout (specs/table.md): CSS 2.1 §17 adapted to integer cells.
|
|
5
5
|
* Structure comes from `tableRole`s (computed display), spans from the
|
|
@@ -40,11 +40,6 @@ interface ColumnBounds {
|
|
|
40
40
|
/** Highest percent authored on the column's cells or its `<col>`. */
|
|
41
41
|
percent: (number | undefined)[];
|
|
42
42
|
}
|
|
43
|
-
interface LatticeSegment {
|
|
44
|
-
width: number;
|
|
45
|
-
style: BorderStyle;
|
|
46
|
-
color: string | undefined;
|
|
47
|
-
}
|
|
48
43
|
interface TableChrome {
|
|
49
44
|
collapsed: boolean;
|
|
50
45
|
/** Collapsed: per-line widths (columnCount + 1 / rowCount + 1); the
|
package/dist/table.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"table.d.ts","sourceRoot":"","sources":["../src/table.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"table.d.ts","sourceRoot":"","sources":["../src/table.ts"],"names":[],"mappings":"AAeA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAClD,OAAO,KAAK,EAAE,MAAM,EAAiB,cAAc,EAAE,UAAU,EAAgB,MAAM,YAAY,CAAC;AAElG;;;;;;GAMG;AAEH,UAAU,UAAU;IAClB,IAAI,EAAE,UAAU,CAAC;IACjB,iEAAiE;IACjE,OAAO,EAAE,UAAU,CAAC;IACpB,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,MAAM,CAAC;IACZ,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,UAAU,cAAc;IACtB,OAAO,EAAE,UAAU,GAAG,IAAI,CAAC;IAC3B,6EAA6E;IAC7E,IAAI,EAAE,UAAU,EAAE,CAAC;IACnB,+EAA+E;IAC/E,SAAS,EAAE,CAAC,UAAU,GAAG,IAAI,CAAC,EAAE,CAAC;IACjC;oDACgD;IAChD,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB,KAAK,EAAE,UAAU,EAAE,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;IACpB,qDAAqD;IACrD,QAAQ,EAAE,CAAC,MAAM,GAAG,SAAS,CAAC,EAAE,CAAC;IACjC,uDAAuD;IACvD,UAAU,EAAE,CAAC,MAAM,GAAG,SAAS,CAAC,EAAE,CAAC;IACnC,2EAA2E;IAC3E,MAAM,EAAE,UAAU,EAAE,CAAC;CACtB;AAwJD,UAAU,YAAY;IACpB,GAAG,EAAE,MAAM,EAAE,CAAC;IACd,GAAG,EAAE,MAAM,EAAE,CAAC;IACd,qEAAqE;IACrE,OAAO,EAAE,CAAC,MAAM,GAAG,SAAS,CAAC,EAAE,CAAC;CACjC;AA+LD,UAAU,WAAW;IACnB,SAAS,EAAE,OAAO,CAAC;IACnB;+DAC2D;IAC3D,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB;;wCAEoC;IACpC,SAAS,EAAE,CAAC,cAAc,GAAG,IAAI,CAAC,EAAE,EAAE,CAAC;IACvC,SAAS,EAAE,CAAC,cAAc,GAAG,IAAI,CAAC,EAAE,EAAE,CAAC;CACxC;AAuID,MAAM,WAAW,SAAS;IACxB,SAAS,EAAE,cAAc,CAAC;IAC1B,MAAM,EAAE,WAAW,CAAC;IACpB,MAAM,EAAE,YAAY,CAAC;IACrB,OAAO,EAAE,MAAM,CAAC;CACjB;AAkBD;;;gDAGgD;AAChD,wBAAgB,yBAAyB,CACvC,IAAI,EAAE,UAAU,EAChB,KAAK,EAAE,cAAc,GACpB;IAAE,GAAG,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAA;CAAE,CAS9B;AAED;;wDAEwD;AACxD,wBAAgB,mBAAmB,CACjC,IAAI,EAAE,UAAU,EAChB,cAAc,EAAE,MAAM,EACtB,KAAK,EAAE,cAAc,GACpB,MAAM,CAoCR;AAKD,wBAAgB,WAAW,CACzB,IAAI,EAAE,UAAU,EAChB,UAAU,EAAE,MAAM,EAClB,mBAAmB,EAAE,MAAM,GAAG,SAAS,EACvC,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,MAAM,EACf,KAAK,EAAE,cAAc,GACpB,MAAM,CA2OR"}
|
package/dist/tree.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { CellMetrics, LayoutNode } from "./types.ts";
|
|
1
|
+
import type { CellMetrics, CellStyle, LayoutNode } from "./types.ts";
|
|
2
2
|
/** Per-textarea content width in cells, captured by the host BEFORE
|
|
3
3
|
* the measuring attribute goes on — the engine's width rule is off
|
|
4
4
|
* during measuring, so `textarea.clientWidth` read then would reflect
|
|
@@ -20,8 +20,8 @@ export type TextareaWidths = Map<HTMLTextAreaElement, number>;
|
|
|
20
20
|
* (`<div>hello <span>world</span></div>`) participate in the wrap
|
|
21
21
|
* calculation and render correctly.
|
|
22
22
|
* - Elements with at least one in-flow block-level element child become
|
|
23
|
-
* **containers** and recurse
|
|
24
|
-
*
|
|
23
|
+
* **containers** and recurse; the text beside those children forms
|
|
24
|
+
* anonymous runs (`buildChildren`, specs/cell-model.md "Inline content").
|
|
25
25
|
* - The host follows the same rule through `buildRootLeaf`
|
|
26
26
|
* (specs/host-leaf.md).
|
|
27
27
|
*
|
|
@@ -29,17 +29,24 @@ export type TextareaWidths = Map<HTMLTextAreaElement, number>;
|
|
|
29
29
|
* tracking; absent in headless tests (see readCellStyle).
|
|
30
30
|
*/
|
|
31
31
|
export declare function buildTree(root: Element, rootFontSizePx: number, cellMetrics?: CellMetrics, textareaWidths?: TextareaWidths): LayoutNode | null;
|
|
32
|
+
/** A container's children in document order (specs/cell-model.md
|
|
33
|
+
* "Inline content"): each block-level element a node, and each maximal
|
|
34
|
+
* run of inline content between them — text, inline elements, atomic
|
|
35
|
+
* boxes, any out-of-flow element among them — an anonymous leaf in
|
|
36
|
+
* `runStyle`, the container's own text style unless given (the host's,
|
|
37
|
+
* specs/host-leaf.md). A stretch of nothing but whitespace and
|
|
38
|
+
* out-of-flow elements is no run: those elements are the container's
|
|
39
|
+
* own positioned children. */
|
|
40
|
+
export declare function buildChildren(container: Element, nodes: ChildNode[], rootFontSizePx: number, cellMetrics?: CellMetrics, textareaWidths?: TextareaWidths, runStyle?: CellStyle): LayoutNode[];
|
|
32
41
|
/** The host's own inline content as the ROOT leaf (specs/host-leaf.md):
|
|
33
42
|
* null when an element child is block-level (the host is a container)
|
|
34
43
|
* or there is no inline content at all (the empty root). The metrics
|
|
35
44
|
* probe is never part of the run. */
|
|
36
45
|
export declare function buildRootLeaf(host: Element, rootFontSizePx: number, cellMetrics?: CellMetrics, textareaWidths?: TextareaWidths): LayoutNode | null;
|
|
37
|
-
/**
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
* host-level path in element.ts. */
|
|
42
|
-
export declare const DIRECT_TEXT_DROPPED: string;
|
|
46
|
+
/** The style of the host's own text (specs/host-leaf.md): its text
|
|
47
|
+
* properties on no box, with no tracking or line gap — the host's
|
|
48
|
+
* letter-spacing and line-height are the cell. */
|
|
49
|
+
export declare function hostLeafStyle(host: Element, rootFontSizePx: number, metrics?: CellMetrics): CellStyle;
|
|
43
50
|
/** True for tags whose value/caret/selection are handled by the browser
|
|
44
51
|
* natively — the tree builder treats them as empty leaves. */
|
|
45
52
|
export declare function isFormControlTag(tag: string): boolean;
|
package/dist/tree.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tree.d.ts","sourceRoot":"","sources":["../src/tree.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"tree.d.ts","sourceRoot":"","sources":["../src/tree.ts"],"names":[],"mappings":"AAuBA,OAAO,KAAK,EAAE,WAAW,EAAE,SAAS,EAAiB,UAAU,EAAW,MAAM,YAAY,CAAC;AAE7F;;;;4DAI4D;AAC5D,MAAM,MAAM,cAAc,GAAG,GAAG,CAAC,mBAAmB,EAAE,MAAM,CAAC,CAAC;AAE9D;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAgB,SAAS,CACvB,IAAI,EAAE,OAAO,EACb,cAAc,EAAE,MAAM,EACtB,WAAW,CAAC,EAAE,WAAW,EACzB,cAAc,CAAC,EAAE,cAAc,GAC9B,UAAU,GAAG,IAAI,CAsCnB;AAED;;;;;;;8BAO8B;AAC9B,wBAAgB,aAAa,CAC3B,SAAS,EAAE,OAAO,EAClB,KAAK,EAAE,SAAS,EAAE,EAClB,cAAc,EAAE,MAAM,EACtB,WAAW,CAAC,EAAE,WAAW,EACzB,cAAc,CAAC,EAAE,cAAc,EAC/B,QAAQ,CAAC,EAAE,SAAS,GACnB,UAAU,EAAE,CA2Cd;AAuBD;;;qCAGqC;AACrC,wBAAgB,aAAa,CAC3B,IAAI,EAAE,OAAO,EACb,cAAc,EAAE,MAAM,EACtB,WAAW,CAAC,EAAE,WAAW,EACzB,cAAc,CAAC,EAAE,cAAc,GAC9B,UAAU,GAAG,IAAI,CAWnB;AAED;;kDAEkD;AAClD,wBAAgB,aAAa,CAC3B,IAAI,EAAE,OAAO,EACb,cAAc,EAAE,MAAM,EACtB,OAAO,CAAC,EAAE,WAAW,GACpB,SAAS,CAEX;AA+qBD;8DAC8D;AAC9D,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAErD"}
|
package/dist/types.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { BorderGlyphSet } from "./glyphs.ts";
|
|
1
2
|
export interface Rect {
|
|
2
3
|
x: number;
|
|
3
4
|
y: number;
|
|
@@ -70,6 +71,16 @@ export interface Overflow {
|
|
|
70
71
|
y: OverflowAxis;
|
|
71
72
|
}
|
|
72
73
|
export type Position = "static" | "relative" | "absolute" | "fixed" | "sticky";
|
|
74
|
+
/** `float` and `clear` (specs/float.md); `start`/`end` compute to the
|
|
75
|
+
* LTR side. */
|
|
76
|
+
export type Float = "none" | "left" | "right";
|
|
77
|
+
export type Clear = "none" | "left" | "right" | "both";
|
|
78
|
+
/** A leaf line's row and the cells floats leave it (specs/float.md). */
|
|
79
|
+
export interface LineBand {
|
|
80
|
+
row: number;
|
|
81
|
+
x: number;
|
|
82
|
+
width: number;
|
|
83
|
+
}
|
|
73
84
|
/** `nowrap` disables soft wrapping; `pre` additionally preserves the
|
|
74
85
|
* source's spaces and newlines (specs/cell-model.md). Everything else
|
|
75
86
|
* (`pre-wrap` included) behaves as `normal`. */
|
|
@@ -237,6 +248,37 @@ export interface BorderRun {
|
|
|
237
248
|
length: number;
|
|
238
249
|
color: string | undefined;
|
|
239
250
|
}
|
|
251
|
+
/** A collapsed lattice segment: the border that won one piece of a line. */
|
|
252
|
+
export interface LatticeSegment {
|
|
253
|
+
width: number;
|
|
254
|
+
style: BorderStyle;
|
|
255
|
+
color: string | undefined;
|
|
256
|
+
}
|
|
257
|
+
/** A collapsed table's border geometry (specs/table.md), resolved into
|
|
258
|
+
* glyphs at paint (lattice.ts) so a sticky part's lines follow it
|
|
259
|
+
* (specs/sticky.md): line thicknesses, the winning segment per line
|
|
260
|
+
* piece, the grid's cell geometry in table-local cells, and the placed
|
|
261
|
+
* cell at each grid position (spans repeated) with its row and group. */
|
|
262
|
+
export interface TableLattice {
|
|
263
|
+
vLines: number[];
|
|
264
|
+
hLines: number[];
|
|
265
|
+
vSegments: (LatticeSegment | null)[][];
|
|
266
|
+
hSegments: (LatticeSegment | null)[][];
|
|
267
|
+
widths: number[];
|
|
268
|
+
rowHeights: number[];
|
|
269
|
+
colX: number[];
|
|
270
|
+
rowY: number[];
|
|
271
|
+
contentLeft: number;
|
|
272
|
+
contentTop: number;
|
|
273
|
+
cells: ({
|
|
274
|
+
node: LayoutNode;
|
|
275
|
+
row: LayoutNode;
|
|
276
|
+
group: LayoutNode | null;
|
|
277
|
+
} | undefined)[][];
|
|
278
|
+
set: BorderGlyphSet | undefined;
|
|
279
|
+
/** The parts handed cells by the last paint, to clear on the next. */
|
|
280
|
+
handed?: LayoutNode[];
|
|
281
|
+
}
|
|
240
282
|
/** A gap-decoration rule (specs/gap-decorations.md), from the rule-*
|
|
241
283
|
* utilities' `--mw-rule-*` mirrors. `color` is always concrete:
|
|
242
284
|
* currentColor resolves to the container's computed color at read time,
|
|
@@ -336,6 +378,11 @@ export interface CellStyle {
|
|
|
336
378
|
/** See specs/positioning.md: fixed behaves as absolute anchored to the
|
|
337
379
|
* host; sticky behaves as relative until the scrolling milestone. */
|
|
338
380
|
position: Position;
|
|
381
|
+
/** specs/float.md: honored on the in-flow children of a block
|
|
382
|
+
* container, `none` on an out-of-flow box as CSS computes it. */
|
|
383
|
+
float: Float;
|
|
384
|
+
/** The floats a box moves below, in its own container (specs/float.md). */
|
|
385
|
+
clear: Clear;
|
|
339
386
|
/** `top/right/bottom/left`; `null` = `auto`. Percentages resolve against
|
|
340
387
|
* the containing block (width for left/right, height for top/bottom). */
|
|
341
388
|
insets: PerSide<CellLength | null>;
|
|
@@ -489,7 +536,7 @@ export interface LayoutNode {
|
|
|
489
536
|
* `inlineBoxesOf`, the one place that pairing is read. */
|
|
490
537
|
children: LayoutNode[];
|
|
491
538
|
/** The leaf's text run (inline descendants included, `<br>` as `\n`).
|
|
492
|
-
* Empty for containers
|
|
539
|
+
* Empty for containers, whose text lives in their anonymous runs. */
|
|
493
540
|
text: string;
|
|
494
541
|
intrinsicWidth: number;
|
|
495
542
|
intrinsicHeight: number;
|
|
@@ -536,6 +583,13 @@ export interface LayoutNode {
|
|
|
536
583
|
padLeft: number;
|
|
537
584
|
padRight: number;
|
|
538
585
|
insets: PerSide<number | null> | null;
|
|
586
|
+
/** A sticky element's insets, constraints for its shift
|
|
587
|
+
* (specs/sticky.md), and the shift for the current scroll offsets. */
|
|
588
|
+
sticky?: PerSide<number | null>;
|
|
589
|
+
stickyShift?: {
|
|
590
|
+
x: number;
|
|
591
|
+
y: number;
|
|
592
|
+
};
|
|
539
593
|
/** Paint-only styling mirrored into the grid (the browser's own
|
|
540
594
|
* ink is transparent-locked). `backgroundColor` fills the run's
|
|
541
595
|
* cells — how a focus-inverted inline link shows its highlight. */
|
|
@@ -578,16 +632,20 @@ export interface LayoutNode {
|
|
|
578
632
|
cols?: InheritedTracks | undefined;
|
|
579
633
|
rows?: InheritedTracks | undefined;
|
|
580
634
|
} | undefined;
|
|
581
|
-
/**
|
|
582
|
-
*
|
|
583
|
-
*
|
|
584
|
-
|
|
585
|
-
droppedText?: boolean;
|
|
635
|
+
/** An anonymous run (specs/cell-model.md "Inline content"): a
|
|
636
|
+
* container's inline content beside its block children, `source` the
|
|
637
|
+
* container, its DOM the run's own nodes (selection.ts `runNodes`). */
|
|
638
|
+
anonymous?: boolean;
|
|
586
639
|
/** Engine-generated glyph runs in this node's local coordinates
|
|
587
640
|
* (offset by its absolute position at paint time). Today: a collapsed
|
|
588
641
|
* table's border lattice; future producers (css-gaps rules,
|
|
589
642
|
* specs/gap-decorations.md) plug in here with no renderer changes. */
|
|
590
643
|
decorationRuns?: BorderRun[];
|
|
644
|
+
/** A collapsed table's border lattice, resolved at paint (lattice.ts). */
|
|
645
|
+
lattice?: TableLattice;
|
|
646
|
+
/** A sticky table part's lattice cells for this paint, in grid cells,
|
|
647
|
+
* handed over by its table to paint in the part's own turn. */
|
|
648
|
+
latticeRuns?: BorderRun[];
|
|
591
649
|
/** True on a node the table pass removed from rendering: misparented
|
|
592
650
|
* table content (no anonymous boxes — specs/table.md) and `<col>`/
|
|
593
651
|
* `<colgroup>` boxes (width carriers, never rendered). */
|
|
@@ -608,6 +666,11 @@ export interface LayoutNode {
|
|
|
608
666
|
width: number;
|
|
609
667
|
rows: number;
|
|
610
668
|
};
|
|
669
|
+
/** Per-line row, x, and usable width in the leaf's content box, the
|
|
670
|
+
* bands floats left its lines (specs/float.md) — written by the leaf
|
|
671
|
+
* pass beside floats, and what a later re-derivation of the leaf's
|
|
672
|
+
* lines (the paint's) wraps against. */
|
|
673
|
+
lineBands?: LineBand[];
|
|
611
674
|
/** Scroll geometry (specs/scrolling.md), written by layoutNode on
|
|
612
675
|
* containers with a scroll axis: content extent and the derived
|
|
613
676
|
* max offset, both in cells. Absent elsewhere. */
|
|
@@ -623,6 +686,13 @@ export interface LayoutNode {
|
|
|
623
686
|
x: number;
|
|
624
687
|
y: number;
|
|
625
688
|
};
|
|
689
|
+
/** A sticky box's shift for the current scroll offsets (specs/sticky.md),
|
|
690
|
+
* a paint-time input like `scroll`, added by every walk where it adds
|
|
691
|
+
* the box's own position; absent = none. */
|
|
692
|
+
stickyShift?: {
|
|
693
|
+
x: number;
|
|
694
|
+
y: number;
|
|
695
|
+
};
|
|
626
696
|
/** The gutter cells this container actually reserved — `scroll`
|
|
627
697
|
* axes always, `auto` axes only when content overflows (the layout
|
|
628
698
|
* second pass). Paint, hit-testing, and thumb drags read THIS, not
|
|
@@ -654,6 +724,11 @@ export interface LayoutNode {
|
|
|
654
724
|
* geometry forced like a laid-out element's. Carries the quantized
|
|
655
725
|
* native margins (`left` = the engine's cross offset). */
|
|
656
726
|
multicolFlowSpan?: NullableInsets;
|
|
727
|
+
/** A mixed block container's in-flow child (specs/cell-model.md
|
|
728
|
+
* "Inline content"): stays in the browser's flow, engine-sized, with
|
|
729
|
+
* these engine margins placing it where the engine did, so the
|
|
730
|
+
* container's anonymous runs sit natively on their rows. */
|
|
731
|
+
flow?: NullableInsets;
|
|
657
732
|
}
|
|
658
733
|
/** A multicol text leaf's per-line fragmentation. `lineY`/`textY` are
|
|
659
734
|
* COLUMN-local rows; `lineX` is the line's column's content-relative x.
|