monowind 0.2.7 → 0.2.8
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 +12 -4
- package/dist/cdn.js +69 -80
- package/dist/cdn.js.map +1 -1
- package/dist/element.d.ts.map +1 -1
- package/dist/glyph-box.d.ts +35 -0
- package/dist/glyph-box.d.ts.map +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1553 -1225
- package/dist/index.js.map +1 -1
- package/dist/layout.d.ts.map +1 -1
- package/dist/multicol.d.ts.map +1 -1
- package/dist/paint.d.ts +15 -1
- package/dist/paint.d.ts.map +1 -1
- package/dist/plain-text.d.ts +31 -3
- package/dist/plain-text.d.ts.map +1 -1
- package/dist/pointer.d.ts +12 -0
- package/dist/pointer.d.ts.map +1 -1
- package/dist/render.d.ts.map +1 -1
- package/dist/selection.d.ts +8 -0
- package/dist/selection.d.ts.map +1 -1
- package/dist/tree.d.ts.map +1 -1
- package/dist/width.d.ts +22 -0
- package/dist/width.d.ts.map +1 -0
- package/dist/wrap.d.ts +1 -1
- package/dist/wrap.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/styles.css +27 -40
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":"AA2KA,QAAA,MAAM,eAAe,EAEhB,OAAO,WAAW,CAAC;AAExB,qBAAa,eAAgB,SAAQ,eAAe;;IAClD,MAAM,CAAC,kBAAkB,WAAuB;IAyHhD,cAsBC;IAED,iBAAiB,IAAI,IAAI,CAmGxB;IAED,oBAAoB,IAAI,IAAI,CAyC3B;IAmgCD,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;CA+PF;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;AA+CD;;;;;;;;;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"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type { CellPaint } from "./plain-text.ts";
|
|
2
|
+
/**
|
|
3
|
+
* Which clusters the grid's font draws off their cell count, and how
|
|
4
|
+
* to fit them (specs/wide-characters.md "The grid stays on its cells
|
|
5
|
+
* in any font"): each distinct non-ASCII cluster is measured once per
|
|
6
|
+
* font — family, size, weight, and style — with canvas `measureText`.
|
|
7
|
+
* A mismatch is painted in a box of exactly its cells, the glyph
|
|
8
|
+
* scaled to fill the box, capped so its ink stays inside the row and
|
|
9
|
+
* the box. Without a canvas (headless tests) nothing is boxed.
|
|
10
|
+
*/
|
|
11
|
+
export declare class GlyphBoxes {
|
|
12
|
+
#private;
|
|
13
|
+
/** The grid's font and cell; a change forgets every measurement. */
|
|
14
|
+
configure(font: {
|
|
15
|
+
style: string;
|
|
16
|
+
weight: string;
|
|
17
|
+
size: string;
|
|
18
|
+
family: string;
|
|
19
|
+
}, cell: {
|
|
20
|
+
width: number;
|
|
21
|
+
height: number;
|
|
22
|
+
letterSpacing: number;
|
|
23
|
+
}): void;
|
|
24
|
+
/** Forget every measurement: a font finished loading, so the same
|
|
25
|
+
* cluster may draw differently now (the fallback's measurements would
|
|
26
|
+
* otherwise stay cached under the same font name). */
|
|
27
|
+
invalidate(): void;
|
|
28
|
+
/** The box for a cluster painted with `paint`, or null when the font
|
|
29
|
+
* draws it at `cells` cells within 0.01 cell. Nothing is cached while
|
|
30
|
+
* fonts are still loading. */
|
|
31
|
+
box(cluster: string, cells: number, paint?: CellPaint): {
|
|
32
|
+
scale: number;
|
|
33
|
+
} | null;
|
|
34
|
+
}
|
|
35
|
+
//# sourceMappingURL=glyph-box.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"glyph-box.d.ts","sourceRoot":"","sources":["../src/glyph-box.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAEjD;;;;;;;;GAQG;AACH,qBAAa,UAAU;;IAMrB,oEAAoE;IACpE,SAAS,CACP,IAAI,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,EACrE,IAAI,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAC;QAAC,aAAa,EAAE,MAAM,CAAA;KAAE,GAC7D,IAAI,CAaN;IAED;;0DAEsD;IACtD,UAAU,IAAI,IAAI,CAEjB;IAED;;kCAE8B;IAC9B,GAAG,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,SAAS,GAAG;QAAE,KAAK,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI,CAc/E;CAkCF"}
|
package/dist/index.d.ts
CHANGED
|
@@ -5,5 +5,6 @@ export { invalidateLeaves, registerLeafRenderer } from "./leaf.ts";
|
|
|
5
5
|
export type { LeafContent, LeafPaint, LeafRegistration, LeafRun } from "./leaf.ts";
|
|
6
6
|
export { renderPlainText } from "./plain-text.ts";
|
|
7
7
|
export { wrapLines } from "./wrap.ts";
|
|
8
|
+
export { clusterAdvances, clusterWidth, graphemes, textCells } from "./width.ts";
|
|
8
9
|
export { multicolLines } from "./multicol.ts";
|
|
9
10
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAC/D,OAAO,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AACnD,YAAY,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAC9D,OAAO,EAAE,gBAAgB,EAAE,oBAAoB,EAAE,MAAM,WAAW,CAAC;AACnE,YAAY,EAAE,WAAW,EAAE,SAAS,EAAE,gBAAgB,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACnF,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AACtC,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAC/D,OAAO,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AACnD,YAAY,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAC9D,OAAO,EAAE,gBAAgB,EAAE,oBAAoB,EAAE,MAAM,WAAW,CAAC;AACnE,YAAY,EAAE,WAAW,EAAE,SAAS,EAAE,gBAAgB,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACnF,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AACtC,OAAO,EAAE,eAAe,EAAE,YAAY,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AACjF,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC"}
|