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/README.md
CHANGED
|
@@ -111,11 +111,49 @@ registerBorderGlyphs("stars", { solid: { tl: "✧", tr: "✧", bl: "✧", br: "
|
|
|
111
111
|
}
|
|
112
112
|
```
|
|
113
113
|
|
|
114
|
+
A set can also register corner glyphs by `border-radius` — a corner
|
|
115
|
+
draws the registration nearest its radius in cells, the plain corner
|
|
116
|
+
counting at 0 (the defaults round light-line corners to `╭ ╮ ╰ ╯`
|
|
117
|
+
from `rounded-xs` up) — and the shade ramp box shadows step through,
|
|
118
|
+
densest first (default `█ ▓ ▒ ░`):
|
|
119
|
+
|
|
120
|
+
```js
|
|
121
|
+
registerBorderGlyphs("soft", {
|
|
122
|
+
solid: {
|
|
123
|
+
rounded: [{ radius: 2, tl: "◜", tr: "◝", bl: "◟", br: "◞" }],
|
|
124
|
+
shadow: ["▓", "▒", "░", "·"],
|
|
125
|
+
},
|
|
126
|
+
});
|
|
127
|
+
```
|
|
128
|
+
|
|
114
129
|
Borders, blocks, and scrollbars tile in any font: where a font draws
|
|
115
130
|
its box-drawing or block glyphs shorter than the row (Menlo and SF
|
|
116
131
|
Mono do, and any font under a taller `leading-*`), the grid fits them
|
|
117
132
|
to it, so rows never show a seam.
|
|
118
133
|
|
|
134
|
+
## Shadows and rounded corners
|
|
135
|
+
|
|
136
|
+
`shadow-*` paints a box's silhouette behind it in shade glyphs from
|
|
137
|
+
the glyph set: offsets in whole cells (a `4px` offset is one cell, the
|
|
138
|
+
classic DOS shadow), blur as rings that fade outward, spread in cells,
|
|
139
|
+
a translucent color as a lighter shade leaning on the theme's
|
|
140
|
+
foreground. Tailwind's presets are pixel recipes, and their blur and
|
|
141
|
+
spread convert on the spacing scale (4px to a cell), so `shadow-2xl`
|
|
142
|
+
is a six-ring halo. For presets tuned to the grid, redefine them in
|
|
143
|
+
your Tailwind theme:
|
|
144
|
+
|
|
145
|
+
```css
|
|
146
|
+
@theme {
|
|
147
|
+
--shadow-sm: 4px 4px 0 0 rgb(0 0 0 / 0.1);
|
|
148
|
+
--shadow-md: 4px 4px 8px 0 rgb(0 0 0 / 0.1);
|
|
149
|
+
--shadow-lg: 4px 4px 16px 0 rgb(0 0 0 / 0.1);
|
|
150
|
+
}
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
`rounded-*` picks the corner glyphs a set registers nearest the radius
|
|
154
|
+
— the defaults' `╭ ╮ ╰ ╯` for light-line borders — while double
|
|
155
|
+
borders stay square.
|
|
156
|
+
|
|
119
157
|
## Companion packages
|
|
120
158
|
|
|
121
159
|
The core is self-contained; these are optional:
|
package/dist/borders.d.ts
CHANGED
|
@@ -12,18 +12,26 @@ export type { BorderRun } from "./types.ts";
|
|
|
12
12
|
* only vertical/horizontal runs and skip corners that would overlap.
|
|
13
13
|
*/
|
|
14
14
|
export declare function collectBorderRuns(style: CellStyle, box: Rect, out: BorderRun[]): void;
|
|
15
|
+
/**
|
|
16
|
+
* Emit a box's outer shadows (specs/box-shadow.md): each the border box
|
|
17
|
+
* moved by its offsets and grown by its spread, blurred into
|
|
18
|
+
* `round(blur / 2)` rings of the owner's shade ramp fading outward,
|
|
19
|
+
* the cells under the box left out — the last declared first, so the
|
|
20
|
+
* first paints on top.
|
|
21
|
+
*/
|
|
22
|
+
export declare function collectShadowRuns(style: CellStyle, box: Rect, out: BorderRun[]): void;
|
|
15
23
|
/** Whether the child paints in the positioned step (Appendix E step
|
|
16
24
|
* 8+): positioned elements, and flex/grid items with an explicit
|
|
17
25
|
* z-index (z-index applies there per CSS, but `auto` items paint as
|
|
18
26
|
* normal flow, steps 4-7 — source order only decides among them,
|
|
19
27
|
* never over a positioned sibling). */
|
|
20
28
|
export declare function paintsInPositionedStep(child: LayoutNode, parent: LayoutNode): boolean;
|
|
21
|
-
/** Children in paint order (CSS 2.1 Appendix E,
|
|
22
|
-
*
|
|
23
|
-
* then non-positioned inline, then positioned with z-index >=
|
|
24
|
-
* auto (asc, auto counts as 0). Stable within a bucket, so DOM
|
|
25
|
-
* breaks ties. Bucketed instead of full-sorted so the common
|
|
26
|
-
* (single bucket, no z-index) is allocation-free. */
|
|
29
|
+
/** Children in paint order (CSS 2.1 Appendix E, sibling stacking
|
|
30
|
+
* only): negative z-index (asc), then non-positioned block, then
|
|
31
|
+
* floats, then non-positioned inline, then positioned with z-index >=
|
|
32
|
+
* 0 or auto (asc, auto counts as 0). Stable within a bucket, so DOM
|
|
33
|
+
* order breaks ties. Bucketed instead of full-sorted so the common
|
|
34
|
+
* case (single bucket, no z-index) is allocation-free. */
|
|
27
35
|
export declare function paintOrderedChildren(node: LayoutNode): LayoutNode[];
|
|
28
36
|
/** A style's straight line glyph, for lattice segments. */
|
|
29
37
|
export declare function lineGlyph(style: BorderStyle, axis: "h" | "v", set?: BorderGlyphSet): string;
|
package/dist/borders.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"borders.d.ts","sourceRoot":"","sources":["../src/borders.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"borders.d.ts","sourceRoot":"","sources":["../src/borders.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAClD,OAAO,KAAK,EACV,SAAS,EACT,mBAAmB,EACnB,SAAS,EACT,WAAW,EACX,SAAS,EAET,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,EAAE,GAAG,IAAI,CAmCrF;AAED;;;;;;GAMG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,SAAS,EAAE,GAAG,EAAE,IAAI,EAAE,GAAG,EAAE,SAAS,EAAE,GAAG,IAAI,CAuCrF;AAqHD;;;;uCAIuC;AACvC,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,UAAU,EAAE,MAAM,EAAE,UAAU,GAAG,OAAO,CAMrF;AAED;;;;;0DAK0D;AAC1D,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,UAAU,GAAG,UAAU,EAAE,CA+BnE;AAED,2DAA2D;AAC3D,wBAAgB,SAAS,CAAC,KAAK,EAAE,WAAW,EAAE,IAAI,EAAE,GAAG,GAAG,GAAG,EAAE,GAAG,CAAC,EAAE,cAAc,GAAG,MAAM,CAG3F;AAED;;;;;6BAK6B;AAC7B,wBAAgB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