monowind 0.1.4 → 0.1.6

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 CHANGED
@@ -1,4 +1,4 @@
1
- import type { BorderRun, BorderStyle, CellStyle, GapRule, Insets, LayoutNode, PerSide, Rect } from "./types.ts";
1
+ import type { RuleBreak, RuleVisibilityItems, BorderRun, BorderStyle, CellStyle, GapRule, Insets, LayoutNode, PerSide, Rect } from "./types.ts";
2
2
  export type { BorderRun } from "./types.ts";
3
3
  /**
4
4
  * Emit runs of border glyphs for the box's engine-allocated border cells.
@@ -14,11 +14,12 @@ export declare function collectBorderRuns(style: CellStyle, box: Rect, out: Bord
14
14
  /** Where CSS applies `z-index`: positioned elements and flex/grid
15
15
  * items; inert on static block-flow children. */
16
16
  export declare function zIndexApplies(child: LayoutNode, parent: LayoutNode): boolean;
17
- /** Children in paint order: stable-sorted by effective z-index,
18
- * document order breaking ties mirrored by both renderers so
19
- * decorations and plain text agree with browser stacking at overlaps (a
20
- * simplified model: no stacking contexts, negative z still paints over
21
- * the parent's own glyphs). */
17
+ /** Children in paint order (CSS 2.1 Appendix E, no floats or stacking
18
+ * contexts negative z still paints over the parent): non-positioned
19
+ * block, then non-positioned inline, then positioned (asc z-index).
20
+ * Stable within a bucket, so DOM order breaks ties. Bucketed instead
21
+ * of full-sorted so the common case (single bucket, no z-index) is
22
+ * allocation-free. */
22
23
  export declare function paintOrderedChildren(node: LayoutNode): LayoutNode[];
23
24
  /** A style's straight line glyph, for lattice segments. */
24
25
  export declare function lineGlyph(style: BorderStyle, axis: "h" | "v"): string;
@@ -30,13 +31,41 @@ export declare function lineGlyph(style: BorderStyle, axis: "h" | "v"): string;
30
31
  export declare function junctionGlyph(style: BorderStyle, up: boolean, down: boolean, left: boolean, right: boolean): string;
31
32
  /** One gap band a rule may occupy: `bandStart`/`bandSize` across the
32
33
  * band's axis (x for a vertical rule), `start`/`end` along it. All in
33
- * content-box cells. */
34
+ * content-box cells. A `half` endpoint is an overlap-join extension
35
+ * tip: its ink reaches only the end cell's centerline, so meeting
36
+ * rules connect there (`┘`) instead of crossing past each other. */
34
37
  export interface RuleSegment {
35
38
  bandStart: number;
36
39
  bandSize: number;
37
40
  start: number;
38
41
  end: number;
42
+ startHalf?: boolean;
43
+ endHalf?: boolean;
39
44
  }
45
+ /** One cross-axis strip of a gap band: the cells beside a crossing
46
+ * track, `[start, end)` along the band, with what borders it. */
47
+ export interface GapStrip {
48
+ start: number;
49
+ end: number;
50
+ /** An item spans ACROSS the gap here — the gap doesn't exist. */
51
+ spanned: boolean;
52
+ /** The cells on either side of the gap hold items. */
53
+ beforeOccupied: boolean;
54
+ afterOccupied: boolean;
55
+ }
56
+ export interface GapSegment {
57
+ start: number;
58
+ end: number;
59
+ startHalf?: boolean;
60
+ endHalf?: boolean;
61
+ }
62
+ /**
63
+ * Split one gap band into painted segments (specs/gap-decorations.md
64
+ * "Segments", probed in Chromium 151): track strips kept per spanning
65
+ * occupancy and rule-visibility-items, crossing-gap strips joined per
66
+ * rule-break, contiguous runs merged, endpoints retracted by the inset.
67
+ */
68
+ export declare function ruleBandSegments(strips: GapStrip[], ruleBreak: RuleBreak, visibility: RuleVisibilityItems, inset: number | "overlap-join"): GapSegment[];
40
69
  export interface GapRuleContext {
41
70
  ruleX: GapRule | null;
42
71
  ruleY: GapRule | null;
@@ -1 +1 @@
1
- {"version":3,"file":"borders.d.ts","sourceRoot":"","sources":["../src/borders.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,SAAS,EACT,WAAW,EACX,SAAS,EACT,OAAO,EACP,MAAM,EACN,UAAU,EACV,OAAO,EACP,IAAI,EACL,MAAM,YAAY,CAAC;AAEpB,YAAY,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAkB5C;;;;;;;;;GASG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,SAAS,EAAE,GAAG,EAAE,IAAI,EAAE,GAAG,EAAE,SAAS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