monowind 0.2.10 → 0.2.12
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/README.md +38 -0
- package/dist/borders.d.ts +14 -6
- package/dist/borders.d.ts.map +1 -1
- package/dist/cdn.js +106 -55
- 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/glyphs.d.ts +29 -2
- package/dist/glyphs.d.ts.map +1 -1
- package/dist/index.js +2139 -1413
- 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.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/sticky.d.ts +32 -0
- package/dist/sticky.d.ts.map +1 -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.map +1 -1
- package/dist/types.d.ts +93 -1
- 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 +66 -15
package/dist/element.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"element.d.ts","sourceRoot":"","sources":["../src/element.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"element.d.ts","sourceRoot":"","sources":["../src/element.ts"],"names":[],"mappings":"AAkOA,QAAA,MAAM,eAAe,EAEhB,OAAO,WAAW,CAAC;AAExB,qBAAa,eAAgB,SAAQ,eAAe;;IAClD,MAAM,CAAC,kBAAkB,WAAuB;IA4IhD,cAsBC;IAkBD,iBAAiB,IAAI,IAAI,CAoGxB;IAED,oBAAoB,IAAI,IAAI,CA4C3B;IA0oCD,wBAAwB,CAAC,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,IAAI,EAAE,IAAI,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI,CA+B1F;IAED;;;;0DAIsD;IACtD,WAAW,IAAI,MAAM,CAIpB;CA8QF;AAED;+DAC+D;AAC/D,wBAAgB,cAAc,IAAI,IAAI,CAIrC;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,WAAW,EAAE,eAAe,CAAC;KAC9B;CACF;AAyDD;;;;;;;;;yDASyD;AACzD,wBAAgB,cAAc,CAC5B,EAAE,EAAE,MAAM,EACV,OAAO,EAAE,MAAM,EACf,QAAQ,EAAE,MAAM,EAChB,GAAG,EAAE,MAAM,EACX,IAAI,EAAE,MAAM,GACX,MAAM,CAMR"}
|
package/dist/floats.d.ts
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Float geometry (specs/float.md): the exclusion rectangles a block
|
|
3
|
+
* container's floats reserve, and the queries block layout makes of
|
|
4
|
+
* them — the usable span for a line box, where the next float lands,
|
|
5
|
+
* and how far `clear` pushes a box down. Pure rect math in the
|
|
6
|
+
* container's CONTENT-box cells; placement and native flow live in
|
|
7
|
+
* layout.ts.
|
|
8
|
+
*/
|
|
9
|
+
export interface FloatBox {
|
|
10
|
+
/** Margin box, in the container's content-box cells. */
|
|
11
|
+
x: number;
|
|
12
|
+
y: number;
|
|
13
|
+
width: number;
|
|
14
|
+
height: number;
|
|
15
|
+
side: "left" | "right";
|
|
16
|
+
}
|
|
17
|
+
/** The horizontal span left for a line box of `height` rows at row `y`:
|
|
18
|
+
* past the left floats it overlaps, short of the right ones. */
|
|
19
|
+
export declare function bandAt(boxes: FloatBox[], contentWidth: number, y: number, height?: number): {
|
|
20
|
+
x: number;
|
|
21
|
+
width: number;
|
|
22
|
+
};
|
|
23
|
+
/** Where a float of this margin-box size lands (CSS 2.1 §9.5.1): the
|
|
24
|
+
* first fit from the flow cursor, never above an earlier float's top. */
|
|
25
|
+
export declare function placeFloat(boxes: FloatBox[], contentWidth: number, side: "left" | "right", top: number, width: number, height: number): {
|
|
26
|
+
x: number;
|
|
27
|
+
y: number;
|
|
28
|
+
};
|
|
29
|
+
/** The first row from `top` whose band holds a box of this margin-box
|
|
30
|
+
* size — that row, else the first float bottom below it that does —
|
|
31
|
+
* and the box's x at the band's `side`. A box wider than every band
|
|
32
|
+
* starts at the last candidate's edge and overflows, per CSS. */
|
|
33
|
+
export declare function firstFit(boxes: FloatBox[], contentWidth: number, side: "left" | "right", top: number, width: number, height: number): {
|
|
34
|
+
x: number;
|
|
35
|
+
y: number;
|
|
36
|
+
};
|
|
37
|
+
/** The row a `clear` box starts at: below the margin boxes of the floats
|
|
38
|
+
* it names, when they reach past the flow cursor. */
|
|
39
|
+
export declare function clearanceBelow(boxes: FloatBox[], clear: "none" | "left" | "right" | "both", y: number): number;
|
|
40
|
+
/** The lowest float bottom, or zero: a container contains its floats
|
|
41
|
+
* (specs/float.md), so its content height reaches here. */
|
|
42
|
+
export declare function floatsBottom(boxes: FloatBox[]): number;
|
|
43
|
+
//# sourceMappingURL=floats.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"floats.d.ts","sourceRoot":"","sources":["../src/floats.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,MAAM,WAAW,QAAQ;IACvB,wDAAwD;IACxD,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB;AAED;gEACgE;AAChE,wBAAgB,MAAM,CACpB,KAAK,EAAE,QAAQ,EAAE,EACjB,YAAY,EAAE,MAAM,EACpB,CAAC,EAAE,MAAM,EACT,MAAM,SAAI,GACT;IAAE,CAAC,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAS9B;AAED;yEACyE;AACzE,wBAAgB,UAAU,CACxB,KAAK,EAAE,QAAQ,EAAE,EACjB,YAAY,EAAE,MAAM,EACpB,IAAI,EAAE,MAAM,GAAG,OAAO,EACtB,GAAG,EAAE,MAAM,EACX,KAAK,EAAE,MAAM,EACb,MAAM,EAAE,MAAM,GACb;IAAE,CAAC,EAAE,MAAM,CAAC;IAAC,CAAC,EAAE,MAAM,CAAA;CAAE,CAI1B;AAED;;;iEAGiE;AACjE,wBAAgB,QAAQ,CACtB,KAAK,EAAE,QAAQ,EAAE,EACjB,YAAY,EAAE,MAAM,EACpB,IAAI,EAAE,MAAM,GAAG,OAAO,EACtB,GAAG,EAAE,MAAM,EACX,KAAK,EAAE,MAAM,EACb,MAAM,EAAE,MAAM,GACb;IAAE,CAAC,EAAE,MAAM,CAAC;IAAC,CAAC,EAAE,MAAM,CAAA;CAAE,CAU1B;AAED;qDACqD;AACrD,wBAAgB,cAAc,CAC5B,KAAK,EAAE,QAAQ,EAAE,EACjB,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,MAAM,EACzC,CAAC,EAAE,MAAM,GACR,MAAM,CAQR;AAED;2DAC2D;AAC3D,wBAAgB,YAAY,CAAC,KAAK,EAAE,QAAQ,EAAE,GAAG,MAAM,CAEtD"}
|
package/dist/glyphs.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { BorderStyle } from "./types.ts";
|
|
1
|
+
import type { BorderStyle, CornerRole } from "./types.ts";
|
|
2
2
|
/**
|
|
3
3
|
* Border glyph sets (specs/theming.md): the rendering vocabulary
|
|
4
4
|
* border STYLES resolve through — what the themed "hardware" can
|
|
@@ -39,6 +39,23 @@ export interface GlyphTable {
|
|
|
39
39
|
qrFull?: string;
|
|
40
40
|
qrUpper?: string;
|
|
41
41
|
qrLower?: string;
|
|
42
|
+
/** Shadow shades from a box's shadow core outward (specs/box-shadow.md);
|
|
43
|
+
* `█ ▓ ▒ ░` by default. */
|
|
44
|
+
shadow?: string[];
|
|
45
|
+
/** Corner glyphs by border radius (specs/cell-model.md "Borders:
|
|
46
|
+
* glyph mapping"): a corner draws the registration nearest its
|
|
47
|
+
* radius, the plain corner counting at 0. Registering `rounded`
|
|
48
|
+
* (even empty) or a plain corner replaces the defaults' arcs. */
|
|
49
|
+
rounded?: CornerBand[];
|
|
50
|
+
}
|
|
51
|
+
/** Corner glyphs registered for a radius, in cells; every corner
|
|
52
|
+
* optional. */
|
|
53
|
+
export interface CornerBand {
|
|
54
|
+
radius: number;
|
|
55
|
+
tl?: string;
|
|
56
|
+
tr?: string;
|
|
57
|
+
bl?: string;
|
|
58
|
+
br?: string;
|
|
42
59
|
}
|
|
43
60
|
export type BorderGlyphSet = Partial<Record<BorderStyle, GlyphTable>>;
|
|
44
61
|
/** Register (or last-wins replace, with a warning) a glyph set.
|
|
@@ -51,11 +68,21 @@ export declare function registerBorderGlyphs(name: string, set: BorderGlyphSet):
|
|
|
51
68
|
export declare function glyphSetFor(name: string | null | undefined): BorderGlyphSet | undefined;
|
|
52
69
|
/** Host subscription to registrations; returns the unsubscriber. */
|
|
53
70
|
export declare function onGlyphRegistryChange(listener: () => void): () => void;
|
|
71
|
+
/** A corner's glyph for its radius: the registration nearest it,
|
|
72
|
+
* ties to the larger radius — `plain` at 0, and the set's `rounded`
|
|
73
|
+
* bands, or the defaults' for a style the set leaves untouched. */
|
|
74
|
+
export declare function cornerGlyph(style: BorderStyle, role: CornerRole, radius: number, plain: string, set?: BorderGlyphSet): string;
|
|
75
|
+
/** A table's glyph roles: every field but the corner bands and the
|
|
76
|
+
* shadow ramp. */
|
|
77
|
+
export type GlyphRole = Exclude<keyof GlyphTable, "rounded" | "shadow">;
|
|
54
78
|
/** The role a junction bitmask (up 8 / down 4 / left 2 / right 1)
|
|
55
79
|
* plays — stubs (≤1 arm per axis alone) read as plain lines. */
|
|
56
|
-
export declare function junctionRole(mask: number):
|
|
80
|
+
export declare function junctionRole(mask: number): GlyphRole | null;
|
|
57
81
|
export declare const LIGHT_JUNCTIONS: string[];
|
|
58
82
|
export declare const DOUBLE_JUNCTIONS: string[];
|
|
83
|
+
/** The shade ramp of a box's shadows through the owner's set — a
|
|
84
|
+
* solid-table role, core outward (specs/box-shadow.md). */
|
|
85
|
+
export declare function shadowRamp(set: BorderGlyphSet | undefined): string[];
|
|
59
86
|
/** Gutter ink through the owner's set — solid-table roles, defaults
|
|
60
87
|
* `░` / `█` (specs/scrolling.md). */
|
|
61
88
|
export declare function scrollGlyphs(set: BorderGlyphSet | undefined): {
|
package/dist/glyphs.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"glyphs.d.ts","sourceRoot":"","sources":["../src/glyphs.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"glyphs.d.ts","sourceRoot":"","sources":["../src/glyphs.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAE1D;;;;;;;;;GASG;AAEH;;2BAE2B;AAC3B,MAAM,WAAW,UAAU;IACzB,CAAC,CAAC,EAAE,MAAM,CAAC;IACX,CAAC,CAAC,EAAE,MAAM,CAAC;IACX,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,kCAAkC;IAClC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,oCAAoC;IACpC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,iCAAiC;IACjC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,kCAAkC;IAClC,QAAQ,CAAC,EAAE,M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