compasso 0.4.0 → 0.5.0
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 +115 -5
- package/dist/{chunk-ZBDABVIO.js → chunk-2NDET6O5.js} +3 -3
- package/dist/{chunk-ZBDABVIO.js.map → chunk-2NDET6O5.js.map} +1 -1
- package/dist/{chunk-Q6DVTCXD.js → chunk-3RGYLVTN.js} +18 -6
- package/dist/chunk-3RGYLVTN.js.map +1 -0
- package/dist/chunk-BM7UJBK5.js +680 -0
- package/dist/chunk-BM7UJBK5.js.map +1 -0
- package/dist/chunk-DVLWT565.js +372 -0
- package/dist/chunk-DVLWT565.js.map +1 -0
- package/dist/{chunk-F47C6ZEB.js → chunk-JBDA7E2O.js} +3 -3
- package/dist/{chunk-F47C6ZEB.js.map → chunk-JBDA7E2O.js.map} +1 -1
- package/dist/chunk-MIJTBYX2.js +982 -0
- package/dist/chunk-MIJTBYX2.js.map +1 -0
- package/dist/{chunk-JP4N42AY.js → chunk-PJHLWSGD.js} +3 -3
- package/dist/{chunk-JP4N42AY.js.map → chunk-PJHLWSGD.js.map} +1 -1
- package/dist/{chunk-LRHHUJFZ.js → chunk-RDH4XHA2.js} +3 -3
- package/dist/{chunk-LRHHUJFZ.js.map → chunk-RDH4XHA2.js.map} +1 -1
- package/dist/{chunk-UJVU7B44.js → chunk-WEHUSHVI.js} +31 -51
- package/dist/chunk-WEHUSHVI.js.map +1 -0
- package/dist/{chunk-RWPGGWO5.js → chunk-Z66YUOUM.js} +34 -10
- package/dist/chunk-Z66YUOUM.js.map +1 -0
- package/dist/core/index.cjs +247 -0
- package/dist/core/index.cjs.map +1 -1
- package/dist/core/index.d.cts +94 -2
- package/dist/core/index.d.ts +94 -2
- package/dist/core/index.js +1 -1
- package/dist/ecomap/index.cjs +34 -11
- package/dist/ecomap/index.cjs.map +1 -1
- package/dist/ecomap/index.d.cts +12 -0
- package/dist/ecomap/index.d.ts +12 -0
- package/dist/ecomap/index.js +2 -2
- package/dist/fault-tree/index.d.cts +2 -2
- package/dist/fault-tree/index.d.ts +2 -2
- package/dist/fault-tree/index.js +2 -2
- package/dist/fishbone/index.js +2 -2
- package/dist/genogram/index.cjs +57 -7
- package/dist/genogram/index.cjs.map +1 -1
- package/dist/genogram/index.d.cts +22 -6
- package/dist/genogram/index.d.ts +22 -6
- package/dist/genogram/index.js +2 -2
- package/dist/geometry-P-XGqGe7.d.cts +8 -0
- package/dist/geometry-P-XGqGe7.d.ts +8 -0
- package/dist/grid-BMgUSly1.d.cts +79 -0
- package/dist/grid-BMgUSly1.d.ts +79 -0
- package/dist/index.cjs +2360 -395
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +14 -7
- package/dist/index.d.ts +14 -7
- package/dist/index.js +10 -8
- package/dist/{kinship-DqEklrDN.d.ts → kinship-BF90HyyS.d.ts} +1 -1
- package/dist/{kinship-Dy_ijjJV.d.cts → kinship-BOUss5cT.d.cts} +1 -1
- package/dist/{labels-RtFw9tX1.d.cts → labels-B0aOMbHy.d.cts} +12 -0
- package/dist/{labels-RtFw9tX1.d.ts → labels-B0aOMbHy.d.ts} +12 -0
- package/dist/labels-Br8yjc3C.d.cts +29 -0
- package/dist/labels-Br8yjc3C.d.ts +29 -0
- package/dist/{labels-DNqRkWuI.d.ts → labels-CuLbFyrz.d.ts} +1 -1
- package/dist/labels-D1v1RWZd.d.cts +97 -0
- package/dist/labels-D1v1RWZd.d.ts +97 -0
- package/dist/{labels-CBQ_3Ec9.d.cts → labels-DhQe7I8m.d.cts} +1 -1
- package/dist/layered-DmZluAqe.d.cts +72 -0
- package/dist/layered-DmZluAqe.d.ts +72 -0
- package/dist/locales/pt-br.cjs +53 -0
- package/dist/locales/pt-br.cjs.map +1 -1
- package/dist/locales/pt-br.d.cts +11 -5
- package/dist/locales/pt-br.d.ts +11 -5
- package/dist/locales/pt-br.js +50 -1
- package/dist/locales/pt-br.js.map +1 -1
- package/dist/org-chart/index.cjs +138 -94
- package/dist/org-chart/index.cjs.map +1 -1
- package/dist/org-chart/index.d.cts +24 -33
- package/dist/org-chart/index.d.ts +24 -33
- package/dist/org-chart/index.js +2 -2
- package/dist/pedigree/index.d.cts +6 -6
- package/dist/pedigree/index.d.ts +6 -6
- package/dist/pedigree/index.js +2 -2
- package/dist/phylo/index.d.cts +2 -2
- package/dist/phylo/index.d.ts +2 -2
- package/dist/phylo/index.js +2 -2
- package/dist/prisma/index.cjs +882 -0
- package/dist/prisma/index.cjs.map +1 -0
- package/dist/prisma/index.d.cts +174 -0
- package/dist/prisma/index.d.ts +174 -0
- package/dist/prisma/index.js +4 -0
- package/dist/prisma/index.js.map +1 -0
- package/dist/{text-DuO_PwYw.d.cts → text-DDVzpwPZ.d.cts} +1 -8
- package/dist/{text-DuO_PwYw.d.ts → text-DDVzpwPZ.d.ts} +1 -8
- package/dist/{types-BnMG7TCd.d.cts → types-jE2fdM1t.d.cts} +8 -0
- package/dist/{types-BnMG7TCd.d.ts → types-jE2fdM1t.d.ts} +8 -0
- package/dist/uml/index.cjs +1214 -0
- package/dist/uml/index.cjs.map +1 -0
- package/dist/uml/index.d.cts +189 -0
- package/dist/uml/index.d.ts +189 -0
- package/dist/uml/index.js +4 -0
- package/dist/uml/index.js.map +1 -0
- package/package.json +28 -2
- package/dist/chunk-O3BT2O42.js +0 -145
- package/dist/chunk-O3BT2O42.js.map +0 -1
- package/dist/chunk-Q6DVTCXD.js.map +0 -1
- package/dist/chunk-RWPGGWO5.js.map +0 -1
- package/dist/chunk-UJVU7B44.js.map +0 -1
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { N as NodeShape, a as Person, c as Union, P as ParentLink, R as Relationship, d as UnionStatus, G as GenogramInput } from '../types-
|
|
2
|
-
export { b as PersonSex, U as UNION_STATUSES } from '../types-
|
|
3
|
-
import { d as KinshipLexicon, c as GenogramTitleLabels, b as GenogramSvgLabels } from '../kinship-
|
|
4
|
-
export { G as GENOGRAM_SVG_LABELS_EN, a as GENOGRAM_TITLE_LABELS_EN, K as KINSHIP_EN, R as RelationshipMapClass, e as classifyRelationshipType, r as relationshipTypeTokens } from '../kinship-
|
|
5
|
-
import { P as Point } from '../
|
|
6
|
-
export { C as CHAR_W, e as estimateTextWidth, w as wrapLabel } from '../text-DuO_PwYw.cjs';
|
|
1
|
+
import { N as NodeShape, a as Person, c as Union, P as ParentLink, R as Relationship, d as UnionStatus, G as GenogramInput } from '../types-jE2fdM1t.cjs';
|
|
2
|
+
export { b as PersonSex, U as UNION_STATUSES } from '../types-jE2fdM1t.cjs';
|
|
3
|
+
import { d as KinshipLexicon, c as GenogramTitleLabels, b as GenogramSvgLabels } from '../kinship-BOUss5cT.cjs';
|
|
4
|
+
export { G as GENOGRAM_SVG_LABELS_EN, a as GENOGRAM_TITLE_LABELS_EN, K as KINSHIP_EN, R as RelationshipMapClass, e as classifyRelationshipType, r as relationshipTypeTokens } from '../kinship-BOUss5cT.cjs';
|
|
5
|
+
import { P as Point } from '../geometry-P-XGqGe7.cjs';
|
|
7
6
|
import { a as EdgeLineStyle, c as QualityLexicon } from '../stroke-MQ427drt.cjs';
|
|
8
7
|
export { E as EDGE_STROKE, b as EdgeStroke, q as qualityLineStyle } from '../stroke-MQ427drt.cjs';
|
|
8
|
+
export { C as CHAR_W, e as estimateTextWidth, w as wrapLabel } from '../text-DDVzpwPZ.cjs';
|
|
9
9
|
export { x as xmlEscape } from '../xml-DDae1eUr.cjs';
|
|
10
10
|
|
|
11
11
|
declare const NODE_SIZE = 56;
|
|
@@ -37,6 +37,8 @@ interface GenogramNode {
|
|
|
37
37
|
label: string;
|
|
38
38
|
shape: NodeShape;
|
|
39
39
|
deceased: boolean;
|
|
40
|
+
/** Caller-declared: this node was annotated. Mirrors Person.annotated — never interpreted. */
|
|
41
|
+
annotated: boolean;
|
|
40
42
|
/** Center of the node. */
|
|
41
43
|
cx: number;
|
|
42
44
|
cy: number;
|
|
@@ -64,6 +66,8 @@ interface GenogramElement {
|
|
|
64
66
|
lineStyle: EdgeLineStyle;
|
|
65
67
|
unionStyle?: UnionEdgeStyle;
|
|
66
68
|
dotted?: boolean;
|
|
69
|
+
/** Caller-declared: this edge was annotated. Propagated from the source input row(s). */
|
|
70
|
+
annotated: boolean;
|
|
67
71
|
}
|
|
68
72
|
interface GenogramLayout {
|
|
69
73
|
width: number;
|
|
@@ -109,6 +113,12 @@ interface GenogramSvgOptions {
|
|
|
109
113
|
legend?: boolean;
|
|
110
114
|
/** Display vocabulary (legend/accessibility) — English default; see locale packs. */
|
|
111
115
|
labels?: GenogramSvgLabels;
|
|
116
|
+
/**
|
|
117
|
+
* Legend label for annotated elements. When provided AND at least one element or node is
|
|
118
|
+
* annotated, a legend row is added (used-keys-only). The library supplies no default —
|
|
119
|
+
* the caller owns the wording (domain-agnostic).
|
|
120
|
+
*/
|
|
121
|
+
annotationLabel?: string;
|
|
112
122
|
}
|
|
113
123
|
/**
|
|
114
124
|
* Emits a self-contained SVG for a computed genogram layout. Pure + deterministic.
|
|
@@ -135,6 +145,12 @@ interface GenogramRenderOptions extends GenogramLayoutOptions {
|
|
|
135
145
|
legend?: boolean;
|
|
136
146
|
/** Display vocabulary for the emitter (legend/accessibility) — English default. */
|
|
137
147
|
svgLabels?: GenogramSvgLabels;
|
|
148
|
+
/**
|
|
149
|
+
* Verbatim legend label for caller-declared `annotated` people/unions/parentage/bonds.
|
|
150
|
+
* When set AND something is annotated, a legend row with the marker glyph + this label is
|
|
151
|
+
* added. compasso never supplies a default — the caller owns the wording (domain-specific).
|
|
152
|
+
*/
|
|
153
|
+
annotationLabel?: string;
|
|
138
154
|
}
|
|
139
155
|
interface GenogramRenderResult {
|
|
140
156
|
/** Self-contained SVG (numeric width/height + matching viewBox — PDF-embedder safe). */
|
package/dist/genogram/index.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { N as NodeShape, a as Person, c as Union, P as ParentLink, R as Relationship, d as UnionStatus, G as GenogramInput } from '../types-
|
|
2
|
-
export { b as PersonSex, U as UNION_STATUSES } from '../types-
|
|
3
|
-
import { d as KinshipLexicon, c as GenogramTitleLabels, b as GenogramSvgLabels } from '../kinship-
|
|
4
|
-
export { G as GENOGRAM_SVG_LABELS_EN, a as GENOGRAM_TITLE_LABELS_EN, K as KINSHIP_EN, R as RelationshipMapClass, e as classifyRelationshipType, r as relationshipTypeTokens } from '../kinship-
|
|
5
|
-
import { P as Point } from '../
|
|
6
|
-
export { C as CHAR_W, e as estimateTextWidth, w as wrapLabel } from '../text-DuO_PwYw.js';
|
|
1
|
+
import { N as NodeShape, a as Person, c as Union, P as ParentLink, R as Relationship, d as UnionStatus, G as GenogramInput } from '../types-jE2fdM1t.js';
|
|
2
|
+
export { b as PersonSex, U as UNION_STATUSES } from '../types-jE2fdM1t.js';
|
|
3
|
+
import { d as KinshipLexicon, c as GenogramTitleLabels, b as GenogramSvgLabels } from '../kinship-BF90HyyS.js';
|
|
4
|
+
export { G as GENOGRAM_SVG_LABELS_EN, a as GENOGRAM_TITLE_LABELS_EN, K as KINSHIP_EN, R as RelationshipMapClass, e as classifyRelationshipType, r as relationshipTypeTokens } from '../kinship-BF90HyyS.js';
|
|
5
|
+
import { P as Point } from '../geometry-P-XGqGe7.js';
|
|
7
6
|
import { a as EdgeLineStyle, c as QualityLexicon } from '../stroke-MQ427drt.js';
|
|
8
7
|
export { E as EDGE_STROKE, b as EdgeStroke, q as qualityLineStyle } from '../stroke-MQ427drt.js';
|
|
8
|
+
export { C as CHAR_W, e as estimateTextWidth, w as wrapLabel } from '../text-DDVzpwPZ.js';
|
|
9
9
|
export { x as xmlEscape } from '../xml-DDae1eUr.js';
|
|
10
10
|
|
|
11
11
|
declare const NODE_SIZE = 56;
|
|
@@ -37,6 +37,8 @@ interface GenogramNode {
|
|
|
37
37
|
label: string;
|
|
38
38
|
shape: NodeShape;
|
|
39
39
|
deceased: boolean;
|
|
40
|
+
/** Caller-declared: this node was annotated. Mirrors Person.annotated — never interpreted. */
|
|
41
|
+
annotated: boolean;
|
|
40
42
|
/** Center of the node. */
|
|
41
43
|
cx: number;
|
|
42
44
|
cy: number;
|
|
@@ -64,6 +66,8 @@ interface GenogramElement {
|
|
|
64
66
|
lineStyle: EdgeLineStyle;
|
|
65
67
|
unionStyle?: UnionEdgeStyle;
|
|
66
68
|
dotted?: boolean;
|
|
69
|
+
/** Caller-declared: this edge was annotated. Propagated from the source input row(s). */
|
|
70
|
+
annotated: boolean;
|
|
67
71
|
}
|
|
68
72
|
interface GenogramLayout {
|
|
69
73
|
width: number;
|
|
@@ -109,6 +113,12 @@ interface GenogramSvgOptions {
|
|
|
109
113
|
legend?: boolean;
|
|
110
114
|
/** Display vocabulary (legend/accessibility) — English default; see locale packs. */
|
|
111
115
|
labels?: GenogramSvgLabels;
|
|
116
|
+
/**
|
|
117
|
+
* Legend label for annotated elements. When provided AND at least one element or node is
|
|
118
|
+
* annotated, a legend row is added (used-keys-only). The library supplies no default —
|
|
119
|
+
* the caller owns the wording (domain-agnostic).
|
|
120
|
+
*/
|
|
121
|
+
annotationLabel?: string;
|
|
112
122
|
}
|
|
113
123
|
/**
|
|
114
124
|
* Emits a self-contained SVG for a computed genogram layout. Pure + deterministic.
|
|
@@ -135,6 +145,12 @@ interface GenogramRenderOptions extends GenogramLayoutOptions {
|
|
|
135
145
|
legend?: boolean;
|
|
136
146
|
/** Display vocabulary for the emitter (legend/accessibility) — English default. */
|
|
137
147
|
svgLabels?: GenogramSvgLabels;
|
|
148
|
+
/**
|
|
149
|
+
* Verbatim legend label for caller-declared `annotated` people/unions/parentage/bonds.
|
|
150
|
+
* When set AND something is annotated, a legend row with the marker glyph + this label is
|
|
151
|
+
* added. compasso never supplies a default — the caller owns the wording (domain-specific).
|
|
152
|
+
*/
|
|
153
|
+
annotationLabel?: string;
|
|
138
154
|
}
|
|
139
155
|
interface GenogramRenderResult {
|
|
140
156
|
/** Self-contained SVG (numeric width/height + matching viewBox — PDF-embedder safe). */
|
package/dist/genogram/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { EDGE_FONT, GENOGRAM_SVG_LABELS_EN, GENOGRAM_TITLE_LABELS_EN, KINSHIP_EN, LABEL_FONT, LABEL_LINE_H, NODE_SIZE, PARENT_REL_ID_BASE, PROMOTED_REL_ID_BASE, UNION_NOTATION, UNION_REL_ID_BASE, UNION_STATUSES, classifyRelationshipType, computeGenogramLayout, genogramLayoutSvg, genogramSvg, latestUnionPerPair, relationshipTypeTokens } from '../chunk-
|
|
2
|
-
export { CHAR_W, EDGE_STROKE, estimateTextWidth, qualityLineStyle, wrapLabel, xmlEscape } from '../chunk-
|
|
1
|
+
export { EDGE_FONT, GENOGRAM_SVG_LABELS_EN, GENOGRAM_TITLE_LABELS_EN, KINSHIP_EN, LABEL_FONT, LABEL_LINE_H, NODE_SIZE, PARENT_REL_ID_BASE, PROMOTED_REL_ID_BASE, UNION_NOTATION, UNION_REL_ID_BASE, UNION_STATUSES, classifyRelationshipType, computeGenogramLayout, genogramLayoutSvg, genogramSvg, latestUnionPerPair, relationshipTypeTokens } from '../chunk-Z66YUOUM.js';
|
|
2
|
+
export { CHAR_W, EDGE_STROKE, estimateTextWidth, qualityLineStyle, wrapLabel, xmlEscape } from '../chunk-DVLWT565.js';
|
|
3
3
|
//# sourceMappingURL=index.js.map
|
|
4
4
|
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
interface CompartmentMetrics {
|
|
2
|
+
/** Shared box width (all compartments share straight vertical sides). */
|
|
3
|
+
boxW: number;
|
|
4
|
+
/** Total box height (sum of all compartment heights). */
|
|
5
|
+
boxH: number;
|
|
6
|
+
/** Per-compartment row info: the line strings, the y of the compartment's
|
|
7
|
+
* first-line baseline region (top of the padY region above the first line),
|
|
8
|
+
* and the font size carried through. */
|
|
9
|
+
rows: {
|
|
10
|
+
lines: string[];
|
|
11
|
+
top: number;
|
|
12
|
+
font: number;
|
|
13
|
+
}[];
|
|
14
|
+
/** Y-coordinates of internal horizontal dividers (one between each pair of
|
|
15
|
+
* consecutive compartments). Length = compartments.length - 1. */
|
|
16
|
+
dividerYs: number[];
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Measures a multi-compartment UML-style box.
|
|
20
|
+
*
|
|
21
|
+
* @param compartments Ordered list of compartments (top→bottom). Each carries
|
|
22
|
+
* its pre-wrapped `lines` and the `font` size for those lines.
|
|
23
|
+
* An EMPTY compartment (`lines.length === 0`) still reserves one blank row of
|
|
24
|
+
* `lineH` height so the abstract-class empty-operations divider is always drawn.
|
|
25
|
+
* @param opts
|
|
26
|
+
* - padX Horizontal padding inside the box (applied left + right).
|
|
27
|
+
* - padY Vertical padding above the first line and below the last line of
|
|
28
|
+
* each compartment.
|
|
29
|
+
* - lineH Height of a single line (applies to every compartment uniformly).
|
|
30
|
+
* - minW Minimum box width (shared across all compartments).
|
|
31
|
+
* - sepPad Reserved for future per-separator padding; currently unused in
|
|
32
|
+
* geometry (dividers are flush horizontal rules) but accepted in the
|
|
33
|
+
* signature per the brief contract.
|
|
34
|
+
*/
|
|
35
|
+
declare function measureCompartmentBox(compartments: {
|
|
36
|
+
lines: string[];
|
|
37
|
+
font: number;
|
|
38
|
+
}[], opts: {
|
|
39
|
+
padX: number;
|
|
40
|
+
padY: number;
|
|
41
|
+
lineH: number;
|
|
42
|
+
minW: number;
|
|
43
|
+
sepPad: number;
|
|
44
|
+
}): CompartmentMetrics;
|
|
45
|
+
|
|
46
|
+
interface GridCell {
|
|
47
|
+
col: number;
|
|
48
|
+
row: number;
|
|
49
|
+
w: number;
|
|
50
|
+
h: number;
|
|
51
|
+
}
|
|
52
|
+
interface GridResult {
|
|
53
|
+
/** Center x of each cell (parallel to the input cells array). */
|
|
54
|
+
cellX: number[];
|
|
55
|
+
/** Center y of each cell (parallel to the input cells array). */
|
|
56
|
+
cellY: number[];
|
|
57
|
+
/** Width of each column (index = column index, 0 … maxCol). */
|
|
58
|
+
colW: number[];
|
|
59
|
+
/** Height of each row (index = row index, 0 … maxRow). */
|
|
60
|
+
rowH: number[];
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Packs a set of cells into a declared 2-D grid.
|
|
64
|
+
*
|
|
65
|
+
* @param cells Each cell declares its (col, row) position and its own (w, h).
|
|
66
|
+
* Multiple cells may share a column or row; no two cells may share BOTH
|
|
67
|
+
* col and row (undefined behaviour — first-write wins for column/row maxima).
|
|
68
|
+
* Columns and rows are identified by non-negative integer indices. Sparse
|
|
69
|
+
* grids (gaps in column or row numbering) are legal; the skipped indices
|
|
70
|
+
* get width/height 0 and contribute zero extent.
|
|
71
|
+
* @param gaps colGap: horizontal gutter between adjacent columns;
|
|
72
|
+
* rowGap: vertical gutter between adjacent rows.
|
|
73
|
+
*/
|
|
74
|
+
declare function packGrid(cells: GridCell[], gaps: {
|
|
75
|
+
colGap: number;
|
|
76
|
+
rowGap: number;
|
|
77
|
+
}): GridResult;
|
|
78
|
+
|
|
79
|
+
export { type CompartmentMetrics as C, type GridCell as G, type GridResult as a, measureCompartmentBox as m, packGrid as p };
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
interface CompartmentMetrics {
|
|
2
|
+
/** Shared box width (all compartments share straight vertical sides). */
|
|
3
|
+
boxW: number;
|
|
4
|
+
/** Total box height (sum of all compartment heights). */
|
|
5
|
+
boxH: number;
|
|
6
|
+
/** Per-compartment row info: the line strings, the y of the compartment's
|
|
7
|
+
* first-line baseline region (top of the padY region above the first line),
|
|
8
|
+
* and the font size carried through. */
|
|
9
|
+
rows: {
|
|
10
|
+
lines: string[];
|
|
11
|
+
top: number;
|
|
12
|
+
font: number;
|
|
13
|
+
}[];
|
|
14
|
+
/** Y-coordinates of internal horizontal dividers (one between each pair of
|
|
15
|
+
* consecutive compartments). Length = compartments.length - 1. */
|
|
16
|
+
dividerYs: number[];
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Measures a multi-compartment UML-style box.
|
|
20
|
+
*
|
|
21
|
+
* @param compartments Ordered list of compartments (top→bottom). Each carries
|
|
22
|
+
* its pre-wrapped `lines` and the `font` size for those lines.
|
|
23
|
+
* An EMPTY compartment (`lines.length === 0`) still reserves one blank row of
|
|
24
|
+
* `lineH` height so the abstract-class empty-operations divider is always drawn.
|
|
25
|
+
* @param opts
|
|
26
|
+
* - padX Horizontal padding inside the box (applied left + right).
|
|
27
|
+
* - padY Vertical padding above the first line and below the last line of
|
|
28
|
+
* each compartment.
|
|
29
|
+
* - lineH Height of a single line (applies to every compartment uniformly).
|
|
30
|
+
* - minW Minimum box width (shared across all compartments).
|
|
31
|
+
* - sepPad Reserved for future per-separator padding; currently unused in
|
|
32
|
+
* geometry (dividers are flush horizontal rules) but accepted in the
|
|
33
|
+
* signature per the brief contract.
|
|
34
|
+
*/
|
|
35
|
+
declare function measureCompartmentBox(compartments: {
|
|
36
|
+
lines: string[];
|
|
37
|
+
font: number;
|
|
38
|
+
}[], opts: {
|
|
39
|
+
padX: number;
|
|
40
|
+
padY: number;
|
|
41
|
+
lineH: number;
|
|
42
|
+
minW: number;
|
|
43
|
+
sepPad: number;
|
|
44
|
+
}): CompartmentMetrics;
|
|
45
|
+
|
|
46
|
+
interface GridCell {
|
|
47
|
+
col: number;
|
|
48
|
+
row: number;
|
|
49
|
+
w: number;
|
|
50
|
+
h: number;
|
|
51
|
+
}
|
|
52
|
+
interface GridResult {
|
|
53
|
+
/** Center x of each cell (parallel to the input cells array). */
|
|
54
|
+
cellX: number[];
|
|
55
|
+
/** Center y of each cell (parallel to the input cells array). */
|
|
56
|
+
cellY: number[];
|
|
57
|
+
/** Width of each column (index = column index, 0 … maxCol). */
|
|
58
|
+
colW: number[];
|
|
59
|
+
/** Height of each row (index = row index, 0 … maxRow). */
|
|
60
|
+
rowH: number[];
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Packs a set of cells into a declared 2-D grid.
|
|
64
|
+
*
|
|
65
|
+
* @param cells Each cell declares its (col, row) position and its own (w, h).
|
|
66
|
+
* Multiple cells may share a column or row; no two cells may share BOTH
|
|
67
|
+
* col and row (undefined behaviour — first-write wins for column/row maxima).
|
|
68
|
+
* Columns and rows are identified by non-negative integer indices. Sparse
|
|
69
|
+
* grids (gaps in column or row numbering) are legal; the skipped indices
|
|
70
|
+
* get width/height 0 and contribute zero extent.
|
|
71
|
+
* @param gaps colGap: horizontal gutter between adjacent columns;
|
|
72
|
+
* rowGap: vertical gutter between adjacent rows.
|
|
73
|
+
*/
|
|
74
|
+
declare function packGrid(cells: GridCell[], gaps: {
|
|
75
|
+
colGap: number;
|
|
76
|
+
rowGap: number;
|
|
77
|
+
}): GridResult;
|
|
78
|
+
|
|
79
|
+
export { type CompartmentMetrics as C, type GridCell as G, type GridResult as a, measureCompartmentBox as m, packGrid as p };
|