compasso 0.4.1 → 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.
Files changed (84) hide show
  1. package/README.md +86 -5
  2. package/dist/{chunk-WJYYBGZW.js → chunk-2NDET6O5.js} +3 -3
  3. package/dist/{chunk-WJYYBGZW.js.map → chunk-2NDET6O5.js.map} +1 -1
  4. package/dist/{chunk-LR7BXUWM.js → chunk-3RGYLVTN.js} +3 -3
  5. package/dist/{chunk-LR7BXUWM.js.map → chunk-3RGYLVTN.js.map} +1 -1
  6. package/dist/chunk-BM7UJBK5.js +680 -0
  7. package/dist/chunk-BM7UJBK5.js.map +1 -0
  8. package/dist/chunk-DVLWT565.js +372 -0
  9. package/dist/chunk-DVLWT565.js.map +1 -0
  10. package/dist/{chunk-IPE7JZO5.js → chunk-JBDA7E2O.js} +3 -3
  11. package/dist/{chunk-IPE7JZO5.js.map → chunk-JBDA7E2O.js.map} +1 -1
  12. package/dist/chunk-MIJTBYX2.js +982 -0
  13. package/dist/chunk-MIJTBYX2.js.map +1 -0
  14. package/dist/{chunk-PGUMLTIM.js → chunk-PJHLWSGD.js} +3 -3
  15. package/dist/{chunk-PGUMLTIM.js.map → chunk-PJHLWSGD.js.map} +1 -1
  16. package/dist/{chunk-M4WA6ME7.js → chunk-RDH4XHA2.js} +3 -3
  17. package/dist/{chunk-M4WA6ME7.js.map → chunk-RDH4XHA2.js.map} +1 -1
  18. package/dist/{chunk-TAE2UB7D.js → chunk-WEHUSHVI.js} +4 -40
  19. package/dist/chunk-WEHUSHVI.js.map +1 -0
  20. package/dist/{chunk-FYBABYC7.js → chunk-Z66YUOUM.js} +3 -3
  21. package/dist/{chunk-FYBABYC7.js.map → chunk-Z66YUOUM.js.map} +1 -1
  22. package/dist/core/index.cjs +217 -0
  23. package/dist/core/index.cjs.map +1 -1
  24. package/dist/core/index.d.cts +79 -3
  25. package/dist/core/index.d.ts +79 -3
  26. package/dist/core/index.js +1 -1
  27. package/dist/ecomap/index.js +2 -2
  28. package/dist/fault-tree/index.d.cts +2 -2
  29. package/dist/fault-tree/index.d.ts +2 -2
  30. package/dist/fault-tree/index.js +2 -2
  31. package/dist/fishbone/index.js +2 -2
  32. package/dist/genogram/index.d.cts +2 -2
  33. package/dist/genogram/index.d.ts +2 -2
  34. package/dist/genogram/index.js +2 -2
  35. package/dist/geometry-P-XGqGe7.d.cts +8 -0
  36. package/dist/geometry-P-XGqGe7.d.ts +8 -0
  37. package/dist/grid-BMgUSly1.d.cts +79 -0
  38. package/dist/grid-BMgUSly1.d.ts +79 -0
  39. package/dist/index.cjs +2263 -380
  40. package/dist/index.cjs.map +1 -1
  41. package/dist/index.d.cts +10 -3
  42. package/dist/index.d.ts +10 -3
  43. package/dist/index.js +10 -8
  44. package/dist/labels-Br8yjc3C.d.cts +29 -0
  45. package/dist/labels-Br8yjc3C.d.ts +29 -0
  46. package/dist/labels-D1v1RWZd.d.cts +97 -0
  47. package/dist/labels-D1v1RWZd.d.ts +97 -0
  48. package/dist/layered-DmZluAqe.d.cts +72 -0
  49. package/dist/layered-DmZluAqe.d.ts +72 -0
  50. package/dist/locales/pt-br.cjs +53 -0
  51. package/dist/locales/pt-br.cjs.map +1 -1
  52. package/dist/locales/pt-br.d.cts +7 -1
  53. package/dist/locales/pt-br.d.ts +7 -1
  54. package/dist/locales/pt-br.js +50 -1
  55. package/dist/locales/pt-br.js.map +1 -1
  56. package/dist/org-chart/index.cjs +38 -36
  57. package/dist/org-chart/index.cjs.map +1 -1
  58. package/dist/org-chart/index.d.cts +5 -31
  59. package/dist/org-chart/index.d.ts +5 -31
  60. package/dist/org-chart/index.js +2 -2
  61. package/dist/pedigree/index.d.cts +2 -2
  62. package/dist/pedigree/index.d.ts +2 -2
  63. package/dist/pedigree/index.js +2 -2
  64. package/dist/phylo/index.d.cts +2 -2
  65. package/dist/phylo/index.d.ts +2 -2
  66. package/dist/phylo/index.js +2 -2
  67. package/dist/prisma/index.cjs +882 -0
  68. package/dist/prisma/index.cjs.map +1 -0
  69. package/dist/prisma/index.d.cts +174 -0
  70. package/dist/prisma/index.d.ts +174 -0
  71. package/dist/prisma/index.js +4 -0
  72. package/dist/prisma/index.js.map +1 -0
  73. package/dist/{text-DuO_PwYw.d.cts → text-DDVzpwPZ.d.cts} +1 -8
  74. package/dist/{text-DuO_PwYw.d.ts → text-DDVzpwPZ.d.ts} +1 -8
  75. package/dist/uml/index.cjs +1214 -0
  76. package/dist/uml/index.cjs.map +1 -0
  77. package/dist/uml/index.d.cts +189 -0
  78. package/dist/uml/index.d.ts +189 -0
  79. package/dist/uml/index.js +4 -0
  80. package/dist/uml/index.js.map +1 -0
  81. package/package.json +28 -2
  82. package/dist/chunk-SD4NTRBM.js +0 -171
  83. package/dist/chunk-SD4NTRBM.js.map +0 -1
  84. package/dist/chunk-TAE2UB7D.js.map +0 -1
@@ -1,7 +1,7 @@
1
1
  import { f as FaultTreeInput, i as GateType, d as FaultTreeEventKind, h as FaultTreeTitleLabels, g as FaultTreeSvgLabels } from '../labels-CYbM5XV7.cjs';
2
2
  export { A as AndGate, F as FAULT_TREE_EVENT_KINDS, a as FAULT_TREE_SVG_LABELS_EN, b as FAULT_TREE_TITLE_LABELS_EN, c as FaultTreeEvent, e as FaultTreeGate, G as GATE_TYPES, I as InhibitGate, O as OrGate, V as VoteGate, X as XorGate } from '../labels-CYbM5XV7.cjs';
3
- import { P as Point } from '../text-DuO_PwYw.cjs';
4
- export { e as estimateTextWidth } from '../text-DuO_PwYw.cjs';
3
+ import { P as Point } from '../geometry-P-XGqGe7.cjs';
4
+ export { e as estimateTextWidth } from '../text-DDVzpwPZ.cjs';
5
5
 
6
6
  /** Stable machine-readable issue codes (kebab-case; part of the public contract). */
7
7
  type FaultTreeIssueCode = "duplicate-id" | "top-not-intermediate" | "top-as-input" | "gate-on-non-intermediate" | "transfer-with-gate" | "event-with-two-gates" | "event-without-gate" | "intermediate-reused" | "unknown-input" | "conditioning-as-input" | "inhibit-condition" | "gate-arity" | "vote-threshold" | "unreachable-event" | "cycle";
@@ -1,7 +1,7 @@
1
1
  import { f as FaultTreeInput, i as GateType, d as FaultTreeEventKind, h as FaultTreeTitleLabels, g as FaultTreeSvgLabels } from '../labels-CYbM5XV7.js';
2
2
  export { A as AndGate, F as FAULT_TREE_EVENT_KINDS, a as FAULT_TREE_SVG_LABELS_EN, b as FAULT_TREE_TITLE_LABELS_EN, c as FaultTreeEvent, e as FaultTreeGate, G as GATE_TYPES, I as InhibitGate, O as OrGate, V as VoteGate, X as XorGate } from '../labels-CYbM5XV7.js';
3
- import { P as Point } from '../text-DuO_PwYw.js';
4
- export { e as estimateTextWidth } from '../text-DuO_PwYw.js';
3
+ import { P as Point } from '../geometry-P-XGqGe7.js';
4
+ export { e as estimateTextWidth } from '../text-DDVzpwPZ.js';
5
5
 
6
6
  /** Stable machine-readable issue codes (kebab-case; part of the public contract). */
7
7
  type FaultTreeIssueCode = "duplicate-id" | "top-not-intermediate" | "top-as-input" | "gate-on-non-intermediate" | "transfer-with-gate" | "event-with-two-gates" | "event-without-gate" | "intermediate-reused" | "unknown-input" | "conditioning-as-input" | "inhibit-condition" | "gate-arity" | "vote-threshold" | "unreachable-event" | "cycle";
@@ -1,4 +1,4 @@
1
- export { CODE_FONT, FAULT_TREE_EVENT_KINDS, FAULT_TREE_SVG_LABELS_EN, FAULT_TREE_TITLE_LABELS_EN, FT_BUS_ID_BASE, FT_CONDITION_ID_BASE, FT_DROP_ID_BASE, FT_LABEL_FONT, FT_LABEL_LINE_H, FT_RISER_ID_BASE, FT_STEM_ID_BASE, FaultTreeValidationError, GATE_TYPES, LABEL_GAP, computeFaultTreeLayout, faultTreeIssues, faultTreeLayoutSvg, faultTreeSvg, validateFaultTree } from '../chunk-M4WA6ME7.js';
2
- export { estimateTextWidth } from '../chunk-SD4NTRBM.js';
1
+ export { CODE_FONT, FAULT_TREE_EVENT_KINDS, FAULT_TREE_SVG_LABELS_EN, FAULT_TREE_TITLE_LABELS_EN, FT_BUS_ID_BASE, FT_CONDITION_ID_BASE, FT_DROP_ID_BASE, FT_LABEL_FONT, FT_LABEL_LINE_H, FT_RISER_ID_BASE, FT_STEM_ID_BASE, FaultTreeValidationError, GATE_TYPES, LABEL_GAP, computeFaultTreeLayout, faultTreeIssues, faultTreeLayoutSvg, faultTreeSvg, validateFaultTree } from '../chunk-RDH4XHA2.js';
2
+ export { estimateTextWidth } from '../chunk-DVLWT565.js';
3
3
  //# sourceMappingURL=index.js.map
4
4
  //# sourceMappingURL=index.js.map
@@ -1,4 +1,4 @@
1
- export { FISHBONE_LABELS_EN, FishboneValidationError, fishboneSvg } from '../chunk-WJYYBGZW.js';
2
- import '../chunk-SD4NTRBM.js';
1
+ export { FISHBONE_LABELS_EN, FishboneValidationError, fishboneSvg } from '../chunk-2NDET6O5.js';
2
+ import '../chunk-DVLWT565.js';
3
3
  //# sourceMappingURL=index.js.map
4
4
  //# sourceMappingURL=index.js.map
@@ -2,10 +2,10 @@ import { N as NodeShape, a as Person, c as Union, P as ParentLink, R as Relation
2
2
  export { b as PersonSex, U as UNION_STATUSES } from '../types-jE2fdM1t.cjs';
3
3
  import { d as KinshipLexicon, c as GenogramTitleLabels, b as GenogramSvgLabels } from '../kinship-BOUss5cT.cjs';
4
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 '../text-DuO_PwYw.cjs';
6
- export { C as CHAR_W, e as estimateTextWidth, w as wrapLabel } from '../text-DuO_PwYw.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;
@@ -2,10 +2,10 @@ import { N as NodeShape, a as Person, c as Union, P as ParentLink, R as Relation
2
2
  export { b as PersonSex, U as UNION_STATUSES } from '../types-jE2fdM1t.js';
3
3
  import { d as KinshipLexicon, c as GenogramTitleLabels, b as GenogramSvgLabels } from '../kinship-BF90HyyS.js';
4
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 '../text-DuO_PwYw.js';
6
- export { C as CHAR_W, e as estimateTextWidth, w as wrapLabel } from '../text-DuO_PwYw.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;
@@ -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-FYBABYC7.js';
2
- export { CHAR_W, EDGE_STROKE, estimateTextWidth, qualityLineStyle, wrapLabel, xmlEscape } from '../chunk-SD4NTRBM.js';
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,8 @@
1
+ interface Point {
2
+ x: number;
3
+ y: number;
4
+ }
5
+ /** "M x y L x y …" path data from a polyline. */
6
+ declare function pathData(points: Point[]): string;
7
+
8
+ export { type Point as P, pathData as p };
@@ -0,0 +1,8 @@
1
+ interface Point {
2
+ x: number;
3
+ y: number;
4
+ }
5
+ /** "M x y L x y …" path data from a polyline. */
6
+ declare function pathData(points: Point[]): string;
7
+
8
+ export { type Point as P, pathData 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 };
@@ -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 };