compasso 0.1.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/LICENSE +21 -0
- package/README.md +123 -0
- package/dist/chunk-5RRRE2GF.js +1125 -0
- package/dist/chunk-5RRRE2GF.js.map +1 -0
- package/dist/chunk-E456YKAJ.js +86 -0
- package/dist/chunk-E456YKAJ.js.map +1 -0
- package/dist/chunk-L5CYESBI.js +208 -0
- package/dist/chunk-L5CYESBI.js.map +1 -0
- package/dist/core/index.cjs +98 -0
- package/dist/core/index.cjs.map +1 -0
- package/dist/core/index.d.cts +36 -0
- package/dist/core/index.d.ts +36 -0
- package/dist/core/index.js +3 -0
- package/dist/core/index.js.map +1 -0
- package/dist/ecomap/index.cjs +287 -0
- package/dist/ecomap/index.cjs.map +1 -0
- package/dist/ecomap/index.d.cts +53 -0
- package/dist/ecomap/index.d.ts +53 -0
- package/dist/ecomap/index.js +4 -0
- package/dist/ecomap/index.js.map +1 -0
- package/dist/genogram/index.cjs +1222 -0
- package/dist/genogram/index.cjs.map +1 -0
- package/dist/genogram/index.d.cts +149 -0
- package/dist/genogram/index.d.ts +149 -0
- package/dist/genogram/index.js +4 -0
- package/dist/genogram/index.js.map +1 -0
- package/dist/index.cjs +1441 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +5 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.js +5 -0
- package/dist/index.js.map +1 -0
- package/dist/kinship-BARO5-qz.d.cts +115 -0
- package/dist/kinship-Bkf87Jhu.d.ts +115 -0
- package/dist/locales/pt-br.cjs +123 -0
- package/dist/locales/pt-br.cjs.map +1 -0
- package/dist/locales/pt-br.d.cts +11 -0
- package/dist/locales/pt-br.d.ts +11 -0
- package/dist/locales/pt-br.js +117 -0
- package/dist/locales/pt-br.js.map +1 -0
- package/dist/stroke-MQ427drt.d.cts +35 -0
- package/dist/stroke-MQ427drt.d.ts +35 -0
- package/package.json +72 -0
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
import { a as EdgeLineStyle } from './stroke-MQ427drt.js';
|
|
2
|
+
|
|
3
|
+
/** Sex marker for a genogram node (standard notation: square/circle/diamond). */
|
|
4
|
+
type PersonSex = "male" | "female" | "unknown";
|
|
5
|
+
/** A genogram node. `generation` is relative (0 = index person; negative = older). */
|
|
6
|
+
interface Person {
|
|
7
|
+
id: number;
|
|
8
|
+
label: string;
|
|
9
|
+
sex: PersonSex;
|
|
10
|
+
deceased: boolean;
|
|
11
|
+
generation: number | null;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* CLOSED status vocabulary for a declared union. Notable semantics:
|
|
15
|
+
* - "coparental": the two were NEVER a couple and have child(ren) together;
|
|
16
|
+
* - "unknown": a union was declared, but its type was not;
|
|
17
|
+
* - widowhood is NOT a status — death lives on Person.deceased and never
|
|
18
|
+
* alters the declared status;
|
|
19
|
+
* - no value for "not stated": the union simply is not passed in.
|
|
20
|
+
*/
|
|
21
|
+
declare const UNION_STATUSES: readonly ["married", "cohabiting", "dating", "separated", "divorced", "coparental", "unknown"];
|
|
22
|
+
type UnionStatus = (typeof UNION_STATUSES)[number];
|
|
23
|
+
/**
|
|
24
|
+
* A declared couple bond between two people. The pair is unordered and expected
|
|
25
|
+
* normalized to personAId < personBId with ONE union per pair (duplicates are the
|
|
26
|
+
* caller's to resolve). `quality` is the author's verbatim wording about the bond.
|
|
27
|
+
*/
|
|
28
|
+
interface Union {
|
|
29
|
+
id: number;
|
|
30
|
+
/** Always the smaller person id (normalized pair). */
|
|
31
|
+
personAId: number;
|
|
32
|
+
personBId: number;
|
|
33
|
+
status: UnionStatus;
|
|
34
|
+
quality: string | null;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* A declared parentage link: parent → child, one row PER DECLARED genitor (two
|
|
38
|
+
* genitors = two links, each individually stated — never promoted from a union).
|
|
39
|
+
*/
|
|
40
|
+
interface ParentLink {
|
|
41
|
+
id: number;
|
|
42
|
+
parentId: number;
|
|
43
|
+
childId: number;
|
|
44
|
+
quality: string | null;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* A typed free-text edge between two people. `type` and `quality` are verbatim
|
|
48
|
+
* labels. This carries NON-STRUCTURAL ties only (closeness, conflict…) — unions
|
|
49
|
+
* and parentage are first-class above.
|
|
50
|
+
*/
|
|
51
|
+
interface Relationship {
|
|
52
|
+
id: number;
|
|
53
|
+
fromPersonId: number;
|
|
54
|
+
toPersonId: number;
|
|
55
|
+
type: string;
|
|
56
|
+
quality: string | null;
|
|
57
|
+
}
|
|
58
|
+
/** Input to the genogram render pipeline. */
|
|
59
|
+
interface GenogramInput {
|
|
60
|
+
people: Person[];
|
|
61
|
+
unions: Union[];
|
|
62
|
+
parentLinks: ParentLink[];
|
|
63
|
+
relationships: Relationship[];
|
|
64
|
+
}
|
|
65
|
+
/** Node glyph shapes (standard notation: square = male, circle = female, diamond = unknown). */
|
|
66
|
+
type NodeShape = "square" | "circle" | "diamond";
|
|
67
|
+
|
|
68
|
+
/** Labels woven into element <title>s by the LAYOUT (verbatim-preserving). */
|
|
69
|
+
interface GenogramTitleLabels {
|
|
70
|
+
unionStatus: Record<UnionStatus, string>;
|
|
71
|
+
/** Title prefix for a parent→child descent ("parent of"). */
|
|
72
|
+
parentage: string;
|
|
73
|
+
}
|
|
74
|
+
declare const GENOGRAM_TITLE_LABELS_EN: GenogramTitleLabels;
|
|
75
|
+
/** Labels drawn by the SVG EMITTER (legend entries, accessibility text). */
|
|
76
|
+
interface GenogramSvgLabels {
|
|
77
|
+
shapes: Record<NodeShape, string>;
|
|
78
|
+
deceased: string;
|
|
79
|
+
bondStyles: Record<Exclude<EdgeLineStyle, "plain">, string>;
|
|
80
|
+
/** Legend label for the group of people with no drawn connection. */
|
|
81
|
+
isolated: string;
|
|
82
|
+
ariaLabel: string;
|
|
83
|
+
}
|
|
84
|
+
declare const GENOGRAM_SVG_LABELS_EN: GenogramSvgLabels;
|
|
85
|
+
|
|
86
|
+
type RelationshipMapClass = "derived" | "parentage" | "bond";
|
|
87
|
+
/**
|
|
88
|
+
* A pluggable kinship vocabulary. Tokens are diacritic-free, lowercase, matched WHOLE
|
|
89
|
+
* (so a token never matches inside another word) after splitting the type on
|
|
90
|
+
* non-alphanumerics ("half-brother" → ["half","brother"]). Checked DERIVED-first, so
|
|
91
|
+
* "brother on my father's side" reads as a sibling, never as a parent. These lists are
|
|
92
|
+
* closed and conservative — an unrecognized word stays a non-structural bond (the
|
|
93
|
+
* honest default). Locale packs (e.g. `compasso/locales/pt-br`) ship alternates.
|
|
94
|
+
*/
|
|
95
|
+
interface KinshipLexicon {
|
|
96
|
+
/** Kinship read from the tree (sibling/grandparent/uncle/cousin…): never a line. */
|
|
97
|
+
derived: ReadonlySet<string>;
|
|
98
|
+
/** Direct parentage words (mother/father/son…): promotable to a descent. */
|
|
99
|
+
parentage: ReadonlySet<string>;
|
|
100
|
+
/** Parentage words whose FROM endpoint is the CHILD — used only to orient a
|
|
101
|
+
* promotion when declared generations do not decide it. */
|
|
102
|
+
childWords: ReadonlySet<string>;
|
|
103
|
+
}
|
|
104
|
+
declare const KINSHIP_EN: KinshipLexicon;
|
|
105
|
+
/** Lowercase + accent-stripped tokens of a free-text relationship type. */
|
|
106
|
+
declare function relationshipTypeTokens(type: string): string[];
|
|
107
|
+
/**
|
|
108
|
+
* Classifies a free-text relationship `type` for the MAP. Pure + deterministic.
|
|
109
|
+
* Derived kinship is checked first so a compound like "brother on my father's side"
|
|
110
|
+
* is read as a sibling (derived), never promoted as a parent. The verbatim word is
|
|
111
|
+
* unaffected — this decides only whether the tie becomes a line, and which kind.
|
|
112
|
+
*/
|
|
113
|
+
declare function classifyRelationshipType(type: string, kinship?: KinshipLexicon): RelationshipMapClass;
|
|
114
|
+
|
|
115
|
+
export { GENOGRAM_SVG_LABELS_EN as G, KINSHIP_EN as K, type NodeShape as N, type ParentLink as P, type Relationship as R, UNION_STATUSES as U, GENOGRAM_TITLE_LABELS_EN as a, type GenogramInput as b, type GenogramSvgLabels as c, type GenogramTitleLabels as d, type KinshipLexicon as e, type Person as f, type PersonSex as g, type RelationshipMapClass as h, type Union as i, type UnionStatus as j, classifyRelationshipType as k, relationshipTypeTokens as r };
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
// src/locales/pt-br.ts
|
|
4
|
+
var QUALITY_LEXICON_PT_BR = {
|
|
5
|
+
buckets: [
|
|
6
|
+
{
|
|
7
|
+
style: "close",
|
|
8
|
+
needles: ["proxim", "unid", "carinh", "afet", "apeg", "amig", "harmoni", "saudavel"]
|
|
9
|
+
},
|
|
10
|
+
{
|
|
11
|
+
style: "distant",
|
|
12
|
+
needles: ["distant", "afast", "ausent", "frio", "fria", "separ"]
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
style: "conflict",
|
|
16
|
+
needles: ["conflit", "briga", "brig", "tens", "dificil", "hostil", "violen", "abusiv", "agressiv", "complicad"]
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
style: "cutoff",
|
|
20
|
+
needles: ["romp", "cortad", "sem contato", "corte"]
|
|
21
|
+
}
|
|
22
|
+
],
|
|
23
|
+
negations: ["nao", "nunca", "nem", "jamais"]
|
|
24
|
+
};
|
|
25
|
+
var KINSHIP_PT_BR = {
|
|
26
|
+
derived: /* @__PURE__ */ new Set([
|
|
27
|
+
"irmao",
|
|
28
|
+
"irma",
|
|
29
|
+
"irmaos",
|
|
30
|
+
"irmas",
|
|
31
|
+
"mano",
|
|
32
|
+
"mana",
|
|
33
|
+
"manos",
|
|
34
|
+
"manas",
|
|
35
|
+
"avo",
|
|
36
|
+
"avos",
|
|
37
|
+
"bisavo",
|
|
38
|
+
"bisava",
|
|
39
|
+
"bisavos",
|
|
40
|
+
"tataravo",
|
|
41
|
+
"neto",
|
|
42
|
+
"neta",
|
|
43
|
+
"netos",
|
|
44
|
+
"netas",
|
|
45
|
+
"bisneto",
|
|
46
|
+
"bisneta",
|
|
47
|
+
"bisnetos",
|
|
48
|
+
"bisnetas",
|
|
49
|
+
"tio",
|
|
50
|
+
"tia",
|
|
51
|
+
"tios",
|
|
52
|
+
"tias",
|
|
53
|
+
"primo",
|
|
54
|
+
"prima",
|
|
55
|
+
"primos",
|
|
56
|
+
"primas",
|
|
57
|
+
"sobrinho",
|
|
58
|
+
"sobrinha",
|
|
59
|
+
"sobrinhos",
|
|
60
|
+
"sobrinhas"
|
|
61
|
+
]),
|
|
62
|
+
parentage: /* @__PURE__ */ new Set([
|
|
63
|
+
"mae",
|
|
64
|
+
"maes",
|
|
65
|
+
"pai",
|
|
66
|
+
"pais",
|
|
67
|
+
"genitor",
|
|
68
|
+
"genitora",
|
|
69
|
+
"genitores",
|
|
70
|
+
"filho",
|
|
71
|
+
"filha",
|
|
72
|
+
"filhos",
|
|
73
|
+
"filhas"
|
|
74
|
+
]),
|
|
75
|
+
childWords: /* @__PURE__ */ new Set(["filho", "filha", "filhos", "filhas"])
|
|
76
|
+
};
|
|
77
|
+
var GENOGRAM_TITLE_LABELS_PT_BR = {
|
|
78
|
+
unionStatus: {
|
|
79
|
+
married: "casados",
|
|
80
|
+
cohabiting: "uni\xE3o est\xE1vel",
|
|
81
|
+
dating: "namoro",
|
|
82
|
+
separated: "separados",
|
|
83
|
+
divorced: "divorciados",
|
|
84
|
+
coparental: "co-pais (sem uni\xE3o)",
|
|
85
|
+
unknown: "uni\xE3o (tipo n\xE3o informado)"
|
|
86
|
+
},
|
|
87
|
+
parentage: "genitor(a) de"
|
|
88
|
+
};
|
|
89
|
+
var GENOGRAM_SVG_LABELS_PT_BR = {
|
|
90
|
+
shapes: {
|
|
91
|
+
square: "Homem",
|
|
92
|
+
circle: "Mulher",
|
|
93
|
+
diamond: "Sexo n\xE3o informado"
|
|
94
|
+
},
|
|
95
|
+
deceased: "Falecido(a)",
|
|
96
|
+
bondStyles: {
|
|
97
|
+
close: "Pr\xF3ximo",
|
|
98
|
+
distant: "Distante",
|
|
99
|
+
conflict: "Conflituoso",
|
|
100
|
+
cutoff: "Rompido (sem contato)"
|
|
101
|
+
},
|
|
102
|
+
isolated: "Sem ascend\xEAncia registrada",
|
|
103
|
+
ariaLabel: "Mapa da fam\xEDlia (genograma)"
|
|
104
|
+
};
|
|
105
|
+
var ECOMAP_LABELS_PT_BR = {
|
|
106
|
+
bondStyles: {
|
|
107
|
+
close: "Pr\xF3ximo",
|
|
108
|
+
distant: "Distante",
|
|
109
|
+
conflict: "Conflituoso",
|
|
110
|
+
cutoff: "Rompido (sem contato)"
|
|
111
|
+
},
|
|
112
|
+
neutralTie: "V\xEDnculo declarado",
|
|
113
|
+
direction: "Sentido declarado do v\xEDnculo",
|
|
114
|
+
ariaLabel: "Ecomapa"
|
|
115
|
+
};
|
|
116
|
+
|
|
117
|
+
exports.ECOMAP_LABELS_PT_BR = ECOMAP_LABELS_PT_BR;
|
|
118
|
+
exports.GENOGRAM_SVG_LABELS_PT_BR = GENOGRAM_SVG_LABELS_PT_BR;
|
|
119
|
+
exports.GENOGRAM_TITLE_LABELS_PT_BR = GENOGRAM_TITLE_LABELS_PT_BR;
|
|
120
|
+
exports.KINSHIP_PT_BR = KINSHIP_PT_BR;
|
|
121
|
+
exports.QUALITY_LEXICON_PT_BR = QUALITY_LEXICON_PT_BR;
|
|
122
|
+
//# sourceMappingURL=pt-br.cjs.map
|
|
123
|
+
//# sourceMappingURL=pt-br.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/locales/pt-br.ts"],"names":[],"mappings":";;;AAYO,IAAM,qBAAA,GAAwC;AAAA,EACnD,OAAA,EAAS;AAAA,IACP;AAAA,MACE,KAAA,EAAO,OAAA;AAAA,MACP,OAAA,EAAS,CAAC,QAAA,EAAU,MAAA,EAAQ,UAAU,MAAA,EAAQ,MAAA,EAAQ,MAAA,EAAQ,SAAA,EAAW,UAAU;AAAA,KACrF;AAAA,IACA;AAAA,MACE,KAAA,EAAO,SAAA;AAAA,MACP,SAA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cesContent":["// Brazilian Portuguese locale pack — lexicons + display vocabularies. Pass these into\n// the genogram/ecomap options to localize both the lexical matchers (quality words,\n// kinship words) and every human-readable string the diagrams emit.\n\nimport type { QualityLexicon } from \"../core\";\nimport type { KinshipLexicon } from \"../genogram/kinship\";\nimport type { GenogramSvgLabels, GenogramTitleLabels } from \"../genogram/labels\";\nimport type { EcomapLabels } from \"../ecomap/render\";\n\n// Needles are diacritic-free, lowercase substrings; the matcher's single-bucket rule\n// keeps competing signals honest. \"sem\" is deliberately NOT a negation: it is a\n// genuine cutoff signal (\"sem contato\").\nexport const QUALITY_LEXICON_PT_BR: QualityLexicon = {\n buckets: [\n {\n style: \"close\",\n needles: [\"proxim\", \"unid\", \"carinh\", \"afet\", \"apeg\", \"amig\", \"harmoni\", \"saudavel\"],\n },\n {\n style: \"distant\",\n needles: [\"distant\", \"afast\", \"ausent\", \"frio\", \"fria\", \"separ\"],\n },\n {\n style: \"conflict\",\n needles: [\"conflit\", \"briga\", \"brig\", \"tens\", \"dificil\", \"hostil\", \"violen\", \"abusiv\", \"agressiv\", \"complicad\"],\n },\n {\n style: \"cutoff\",\n needles: [\"romp\", \"cortad\", \"sem contato\", \"corte\"],\n },\n ],\n negations: [\"nao\", \"nunca\", \"nem\", \"jamais\"],\n};\n\n// Diacritic-free tokens matched WHOLE (\"meio-irmão\" → [\"meio\",\"irmao\"]; \"avó materna\" →\n// [\"avo\",\"materna\"]). Derived kinship is checked first, so \"irmão por parte de pai\"\n// reads as a sibling, never as a parent.\nexport const KINSHIP_PT_BR: KinshipLexicon = {\n derived: new Set([\n \"irmao\", \"irma\", \"irmaos\", \"irmas\", \"mano\", \"mana\", \"manos\", \"manas\",\n \"avo\", \"avos\", \"bisavo\", \"bisava\", \"bisavos\", \"tataravo\",\n \"neto\", \"neta\", \"netos\", \"netas\", \"bisneto\", \"bisneta\", \"bisnetos\", \"bisnetas\",\n \"tio\", \"tia\", \"tios\", \"tias\",\n \"primo\", \"prima\", \"primos\", \"primas\",\n \"sobrinho\", \"sobrinha\", \"sobrinhos\", \"sobrinhas\",\n ]),\n parentage: new Set([\n \"mae\", \"maes\", \"pai\", \"pais\", \"genitor\", \"genitora\", \"genitores\",\n \"filho\", \"filha\", \"filhos\", \"filhas\",\n ]),\n childWords: new Set([\"filho\", \"filha\", \"filhos\", \"filhas\"]),\n};\n\nexport const GENOGRAM_TITLE_LABELS_PT_BR: GenogramTitleLabels = {\n unionStatus: {\n married: \"casados\",\n cohabiting: \"união estável\",\n dating: \"namoro\",\n separated: \"separados\",\n divorced: \"divorciados\",\n coparental: \"co-pais (sem união)\",\n unknown: \"união (tipo não informado)\",\n },\n parentage: \"genitor(a) de\",\n};\n\nexport const GENOGRAM_SVG_LABELS_PT_BR: GenogramSvgLabels = {\n shapes: {\n square: \"Homem\",\n circle: \"Mulher\",\n diamond: \"Sexo não informado\",\n },\n deceased: \"Falecido(a)\",\n bondStyles: {\n close: \"Próximo\",\n distant: \"Distante\",\n conflict: \"Conflituoso\",\n cutoff: \"Rompido (sem contato)\",\n },\n isolated: \"Sem ascendência registrada\",\n ariaLabel: \"Mapa da família (genograma)\",\n};\n\nexport const ECOMAP_LABELS_PT_BR: EcomapLabels = {\n bondStyles: {\n close: \"Próximo\",\n distant: \"Distante\",\n conflict: \"Conflituoso\",\n cutoff: \"Rompido (sem contato)\",\n },\n neutralTie: \"Vínculo declarado\",\n direction: \"Sentido declarado do vínculo\",\n ariaLabel: \"Ecomapa\",\n};\n"]}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { c as QualityLexicon } from '../stroke-MQ427drt.cjs';
|
|
2
|
+
import { c as GenogramSvgLabels, d as GenogramTitleLabels, e as KinshipLexicon } from '../kinship-BARO5-qz.cjs';
|
|
3
|
+
import { EcomapLabels } from '../ecomap/index.cjs';
|
|
4
|
+
|
|
5
|
+
declare const QUALITY_LEXICON_PT_BR: QualityLexicon;
|
|
6
|
+
declare const KINSHIP_PT_BR: KinshipLexicon;
|
|
7
|
+
declare const GENOGRAM_TITLE_LABELS_PT_BR: GenogramTitleLabels;
|
|
8
|
+
declare const GENOGRAM_SVG_LABELS_PT_BR: GenogramSvgLabels;
|
|
9
|
+
declare const ECOMAP_LABELS_PT_BR: EcomapLabels;
|
|
10
|
+
|
|
11
|
+
export { ECOMAP_LABELS_PT_BR, GENOGRAM_SVG_LABELS_PT_BR, GENOGRAM_TITLE_LABELS_PT_BR, KINSHIP_PT_BR, QUALITY_LEXICON_PT_BR };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { c as QualityLexicon } from '../stroke-MQ427drt.js';
|
|
2
|
+
import { c as GenogramSvgLabels, d as GenogramTitleLabels, e as KinshipLexicon } from '../kinship-Bkf87Jhu.js';
|
|
3
|
+
import { EcomapLabels } from '../ecomap/index.js';
|
|
4
|
+
|
|
5
|
+
declare const QUALITY_LEXICON_PT_BR: QualityLexicon;
|
|
6
|
+
declare const KINSHIP_PT_BR: KinshipLexicon;
|
|
7
|
+
declare const GENOGRAM_TITLE_LABELS_PT_BR: GenogramTitleLabels;
|
|
8
|
+
declare const GENOGRAM_SVG_LABELS_PT_BR: GenogramSvgLabels;
|
|
9
|
+
declare const ECOMAP_LABELS_PT_BR: EcomapLabels;
|
|
10
|
+
|
|
11
|
+
export { ECOMAP_LABELS_PT_BR, GENOGRAM_SVG_LABELS_PT_BR, GENOGRAM_TITLE_LABELS_PT_BR, KINSHIP_PT_BR, QUALITY_LEXICON_PT_BR };
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
// src/locales/pt-br.ts
|
|
2
|
+
var QUALITY_LEXICON_PT_BR = {
|
|
3
|
+
buckets: [
|
|
4
|
+
{
|
|
5
|
+
style: "close",
|
|
6
|
+
needles: ["proxim", "unid", "carinh", "afet", "apeg", "amig", "harmoni", "saudavel"]
|
|
7
|
+
},
|
|
8
|
+
{
|
|
9
|
+
style: "distant",
|
|
10
|
+
needles: ["distant", "afast", "ausent", "frio", "fria", "separ"]
|
|
11
|
+
},
|
|
12
|
+
{
|
|
13
|
+
style: "conflict",
|
|
14
|
+
needles: ["conflit", "briga", "brig", "tens", "dificil", "hostil", "violen", "abusiv", "agressiv", "complicad"]
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
style: "cutoff",
|
|
18
|
+
needles: ["romp", "cortad", "sem contato", "corte"]
|
|
19
|
+
}
|
|
20
|
+
],
|
|
21
|
+
negations: ["nao", "nunca", "nem", "jamais"]
|
|
22
|
+
};
|
|
23
|
+
var KINSHIP_PT_BR = {
|
|
24
|
+
derived: /* @__PURE__ */ new Set([
|
|
25
|
+
"irmao",
|
|
26
|
+
"irma",
|
|
27
|
+
"irmaos",
|
|
28
|
+
"irmas",
|
|
29
|
+
"mano",
|
|
30
|
+
"mana",
|
|
31
|
+
"manos",
|
|
32
|
+
"manas",
|
|
33
|
+
"avo",
|
|
34
|
+
"avos",
|
|
35
|
+
"bisavo",
|
|
36
|
+
"bisava",
|
|
37
|
+
"bisavos",
|
|
38
|
+
"tataravo",
|
|
39
|
+
"neto",
|
|
40
|
+
"neta",
|
|
41
|
+
"netos",
|
|
42
|
+
"netas",
|
|
43
|
+
"bisneto",
|
|
44
|
+
"bisneta",
|
|
45
|
+
"bisnetos",
|
|
46
|
+
"bisnetas",
|
|
47
|
+
"tio",
|
|
48
|
+
"tia",
|
|
49
|
+
"tios",
|
|
50
|
+
"tias",
|
|
51
|
+
"primo",
|
|
52
|
+
"prima",
|
|
53
|
+
"primos",
|
|
54
|
+
"primas",
|
|
55
|
+
"sobrinho",
|
|
56
|
+
"sobrinha",
|
|
57
|
+
"sobrinhos",
|
|
58
|
+
"sobrinhas"
|
|
59
|
+
]),
|
|
60
|
+
parentage: /* @__PURE__ */ new Set([
|
|
61
|
+
"mae",
|
|
62
|
+
"maes",
|
|
63
|
+
"pai",
|
|
64
|
+
"pais",
|
|
65
|
+
"genitor",
|
|
66
|
+
"genitora",
|
|
67
|
+
"genitores",
|
|
68
|
+
"filho",
|
|
69
|
+
"filha",
|
|
70
|
+
"filhos",
|
|
71
|
+
"filhas"
|
|
72
|
+
]),
|
|
73
|
+
childWords: /* @__PURE__ */ new Set(["filho", "filha", "filhos", "filhas"])
|
|
74
|
+
};
|
|
75
|
+
var GENOGRAM_TITLE_LABELS_PT_BR = {
|
|
76
|
+
unionStatus: {
|
|
77
|
+
married: "casados",
|
|
78
|
+
cohabiting: "uni\xE3o est\xE1vel",
|
|
79
|
+
dating: "namoro",
|
|
80
|
+
separated: "separados",
|
|
81
|
+
divorced: "divorciados",
|
|
82
|
+
coparental: "co-pais (sem uni\xE3o)",
|
|
83
|
+
unknown: "uni\xE3o (tipo n\xE3o informado)"
|
|
84
|
+
},
|
|
85
|
+
parentage: "genitor(a) de"
|
|
86
|
+
};
|
|
87
|
+
var GENOGRAM_SVG_LABELS_PT_BR = {
|
|
88
|
+
shapes: {
|
|
89
|
+
square: "Homem",
|
|
90
|
+
circle: "Mulher",
|
|
91
|
+
diamond: "Sexo n\xE3o informado"
|
|
92
|
+
},
|
|
93
|
+
deceased: "Falecido(a)",
|
|
94
|
+
bondStyles: {
|
|
95
|
+
close: "Pr\xF3ximo",
|
|
96
|
+
distant: "Distante",
|
|
97
|
+
conflict: "Conflituoso",
|
|
98
|
+
cutoff: "Rompido (sem contato)"
|
|
99
|
+
},
|
|
100
|
+
isolated: "Sem ascend\xEAncia registrada",
|
|
101
|
+
ariaLabel: "Mapa da fam\xEDlia (genograma)"
|
|
102
|
+
};
|
|
103
|
+
var ECOMAP_LABELS_PT_BR = {
|
|
104
|
+
bondStyles: {
|
|
105
|
+
close: "Pr\xF3ximo",
|
|
106
|
+
distant: "Distante",
|
|
107
|
+
conflict: "Conflituoso",
|
|
108
|
+
cutoff: "Rompido (sem contato)"
|
|
109
|
+
},
|
|
110
|
+
neutralTie: "V\xEDnculo declarado",
|
|
111
|
+
direction: "Sentido declarado do v\xEDnculo",
|
|
112
|
+
ariaLabel: "Ecomapa"
|
|
113
|
+
};
|
|
114
|
+
|
|
115
|
+
export { ECOM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A,IACR,OAAA,EAAS;AAAA,GACX;AAAA,EACA,QAAA,EAAU,aAAA;AAAA,EACV,UAAA,EAAY;AAAA,IACV,KAAA,EAAO,YAAA;AAAA,IACP,OAAA,EAAS,UAAA;AAAA,IACT,QAAA,EAAU,aAAA;AAAA,IACV,MAAA,EAAQ;AAAA,GACV;AAAA,EACA,QAAA,EAAU,+BAAA;AAAA,EACV,SAAA,EAAW;AACb;AAEO,IAAM,mBAAA,GAAoC;AAAA,EAC/C,UAAA,EAAY;AAAA,IACV,KAAA,EAAO,YAAA;AAAA,IACP,OAAA,EAAS,UAAA;AAAA,IACT,QAAA,EAAU,aAAA;AAAA,IACV,MAAA,EAAQ;AAAA,GACV;AAAA,EACA,UAAA,EAAY,sBAAA;AAAA,EACZ,SAAA,EAAW,iCAAA;AAAA,EACX,SAAA,EAAW;AACb","file":"pt-br.js","sourcesContent":["// Brazilian Portuguese locale pack — lexicons + display vocabularies. Pass these into\n// the genogram/ecomap options to localize both the lexical matchers (quality words,\n// kinship words) and every human-readable string the diagrams emit.\n\nimport type { QualityLexicon } from \"../core\";\nimport type { KinshipLexicon } from \"../genogram/kinship\";\nimport type { GenogramSvgLabels, GenogramTitleLabels } from \"../genogram/labels\";\nimport type { EcomapLabels } from \"../ecomap/render\";\n\n// Needles are diacritic-free, lowercase substrings; the matcher's single-bucket rule\n// keeps competing signals honest. \"sem\" is deliberately NOT a negation: it is a\n// genuine cutoff signal (\"sem contato\").\nexport const QUALITY_LEXICON_PT_BR: QualityLexicon = {\n buckets: [\n {\n style: \"close\",\n needles: [\"proxim\", \"unid\", \"carinh\", \"afet\", \"apeg\", \"amig\", \"harmoni\", \"saudavel\"],\n },\n {\n style: \"distant\",\n needles: [\"distant\", \"afast\", \"ausent\", \"frio\", \"fria\", \"separ\"],\n },\n {\n style: \"conflict\",\n needles: [\"conflit\", \"briga\", \"brig\", \"tens\", \"dificil\", \"hostil\", \"violen\", \"abusiv\", \"agressiv\", \"complicad\"],\n },\n {\n style: \"cutoff\",\n needles: [\"romp\", \"cortad\", \"sem contato\", \"corte\"],\n },\n ],\n negations: [\"nao\", \"nunca\", \"nem\", \"jamais\"],\n};\n\n// Diacritic-free tokens matched WHOLE (\"meio-irmão\" → [\"meio\",\"irmao\"]; \"avó materna\" →\n// [\"avo\",\"materna\"]). Derived kinship is checked first, so \"irmão por parte de pai\"\n// reads as a sibling, never as a parent.\nexport const KINSHIP_PT_BR: KinshipLexicon = {\n derived: new Set([\n \"irmao\", \"irma\", \"irmaos\", \"irmas\", \"mano\", \"mana\", \"manos\", \"manas\",\n \"avo\", \"avos\", \"bisavo\", \"bisava\", \"bisavos\", \"tataravo\",\n \"neto\", \"neta\", \"netos\", \"netas\", \"bisneto\", \"bisneta\", \"bisnetos\", \"bisnetas\",\n \"tio\", \"tia\", \"tios\", \"tias\",\n \"primo\", \"prima\", \"primos\", \"primas\",\n \"sobrinho\", \"sobrinha\", \"sobrinhos\", \"sobrinhas\",\n ]),\n parentage: new Set([\n \"mae\", \"maes\", \"pai\", \"pais\", \"genitor\", \"genitora\", \"genitores\",\n \"filho\", \"filha\", \"filhos\", \"filhas\",\n ]),\n childWords: new Set([\"filho\", \"filha\", \"filhos\", \"filhas\"]),\n};\n\nexport const GENOGRAM_TITLE_LABELS_PT_BR: GenogramTitleLabels = {\n unionStatus: {\n married: \"casados\",\n cohabiting: \"união estável\",\n dating: \"namoro\",\n separated: \"separados\",\n divorced: \"divorciados\",\n coparental: \"co-pais (sem união)\",\n unknown: \"união (tipo não informado)\",\n },\n parentage: \"genitor(a) de\",\n};\n\nexport const GENOGRAM_SVG_LABELS_PT_BR: GenogramSvgLabels = {\n shapes: {\n square: \"Homem\",\n circle: \"Mulher\",\n diamond: \"Sexo não informado\",\n },\n deceased: \"Falecido(a)\",\n bondStyles: {\n close: \"Próximo\",\n distant: \"Distante\",\n conflict: \"Conflituoso\",\n cutoff: \"Rompido (sem contato)\",\n },\n isolated: \"Sem ascendência registrada\",\n ariaLabel: \"Mapa da família (genograma)\",\n};\n\nexport const ECOMAP_LABELS_PT_BR: EcomapLabels = {\n bondStyles: {\n close: \"Próximo\",\n distant: \"Distante\",\n conflict: \"Conflituoso\",\n cutoff: \"Rompido (sem contato)\",\n },\n neutralTie: \"Vínculo declarado\",\n direction: \"Sentido declarado do vínculo\",\n ariaLabel: \"Ecomapa\",\n};\n"]}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
type EdgeLineStyle = "plain" | "close" | "distant" | "conflict" | "cutoff";
|
|
2
|
+
/** Stroke attributes per style — shared by every renderer so SVG and PDF match. */
|
|
3
|
+
interface EdgeStroke {
|
|
4
|
+
width: number;
|
|
5
|
+
/** SVG dash array / PDF dash pattern as [dash, gap]; null = solid. */
|
|
6
|
+
dash: [number, number] | null;
|
|
7
|
+
opacity: number;
|
|
8
|
+
}
|
|
9
|
+
declare const EDGE_STROKE: Record<EdgeLineStyle, EdgeStroke>;
|
|
10
|
+
/**
|
|
11
|
+
* A pluggable lexicon mapping free-text quality words onto line styles. Needles are
|
|
12
|
+
* diacritic-free, lowercase substrings of the author's own words; `negations` are
|
|
13
|
+
* whole words that flip the meaning of the very word a needle would match ("not
|
|
14
|
+
* close"), so their presence makes the matcher abstain to "plain" rather than risk
|
|
15
|
+
* an inverted visual. Locale packs (e.g. `compasso/locales/pt-br`) ship alternates.
|
|
16
|
+
*/
|
|
17
|
+
interface QualityLexicon {
|
|
18
|
+
buckets: readonly {
|
|
19
|
+
style: Exclude<EdgeLineStyle, "plain">;
|
|
20
|
+
needles: readonly string[];
|
|
21
|
+
}[];
|
|
22
|
+
negations: readonly string[];
|
|
23
|
+
}
|
|
24
|
+
declare const QUALITY_LEXICON_EN: QualityLexicon;
|
|
25
|
+
/** Lowercase + strip diacritics so matching ignores accents. */
|
|
26
|
+
declare function normalizeText(text: string): string;
|
|
27
|
+
/**
|
|
28
|
+
* Maps a free-text relationship quality to a neutral line style. Deterministic and
|
|
29
|
+
* conservative: returns a specific style ONLY when exactly one lexical bucket matches;
|
|
30
|
+
* null/empty/ambiguous/negated/unknown all fall back to "plain". The caller still
|
|
31
|
+
* keeps the verbatim quality word, so nothing the author said is ever lost.
|
|
32
|
+
*/
|
|
33
|
+
declare function qualityLineStyle(quality: string | null, lexicon?: QualityLexicon): EdgeLineStyle;
|
|
34
|
+
|
|
35
|
+
export { EDGE_STROKE as E, QUALITY_LEXICON_EN as Q, type EdgeLineStyle as a, type EdgeStroke as b, type QualityLexicon as c, normalizeText as n, qualityLineStyle as q };
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
type EdgeLineStyle = "plain" | "close" | "distant" | "conflict" | "cutoff";
|
|
2
|
+
/** Stroke attributes per style — shared by every renderer so SVG and PDF match. */
|
|
3
|
+
interface EdgeStroke {
|
|
4
|
+
width: number;
|
|
5
|
+
/** SVG dash array / PDF dash pattern as [dash, gap]; null = solid. */
|
|
6
|
+
dash: [number, number] | null;
|
|
7
|
+
opacity: number;
|
|
8
|
+
}
|
|
9
|
+
declare const EDGE_STROKE: Record<EdgeLineStyle, EdgeStroke>;
|
|
10
|
+
/**
|
|
11
|
+
* A pluggable lexicon mapping free-text quality words onto line styles. Needles are
|
|
12
|
+
* diacritic-free, lowercase substrings of the author's own words; `negations` are
|
|
13
|
+
* whole words that flip the meaning of the very word a needle would match ("not
|
|
14
|
+
* close"), so their presence makes the matcher abstain to "plain" rather than risk
|
|
15
|
+
* an inverted visual. Locale packs (e.g. `compasso/locales/pt-br`) ship alternates.
|
|
16
|
+
*/
|
|
17
|
+
interface QualityLexicon {
|
|
18
|
+
buckets: readonly {
|
|
19
|
+
style: Exclude<EdgeLineStyle, "plain">;
|
|
20
|
+
needles: readonly string[];
|
|
21
|
+
}[];
|
|
22
|
+
negations: readonly string[];
|
|
23
|
+
}
|
|
24
|
+
declare const QUALITY_LEXICON_EN: QualityLexicon;
|
|
25
|
+
/** Lowercase + strip diacritics so matching ignores accents. */
|
|
26
|
+
declare function normalizeText(text: string): string;
|
|
27
|
+
/**
|
|
28
|
+
* Maps a free-text relationship quality to a neutral line style. Deterministic and
|
|
29
|
+
* conservative: returns a specific style ONLY when exactly one lexical bucket matches;
|
|
30
|
+
* null/empty/ambiguous/negated/unknown all fall back to "plain". The caller still
|
|
31
|
+
* keeps the verbatim quality word, so nothing the author said is ever lost.
|
|
32
|
+
*/
|
|
33
|
+
declare function qualityLineStyle(quality: string | null, lexicon?: QualityLexicon): EdgeLineStyle;
|
|
34
|
+
|
|
35
|
+
export { EDGE_STROKE as E, QUALITY_LEXICON_EN as Q, type EdgeLineStyle as a, type EdgeStroke as b, type QualityLexicon as c, normalizeText as n, qualityLineStyle as q };
|
package/package.json
ADDED
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "compasso",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Standards-faithful relational diagrams (genogram, ecomap) as pure SVG strings. Deterministic, zero dependencies, server-safe.",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"author": "Victor Canô",
|
|
7
|
+
"repository": {
|
|
8
|
+
"type": "git",
|
|
9
|
+
"url": "git+https://github.com/VictorCano/compasso.git"
|
|
10
|
+
},
|
|
11
|
+
"type": "module",
|
|
12
|
+
"sideEffects": false,
|
|
13
|
+
"main": "./dist/index.cjs",
|
|
14
|
+
"module": "./dist/index.js",
|
|
15
|
+
"types": "./dist/index.d.ts",
|
|
16
|
+
"exports": {
|
|
17
|
+
".": {
|
|
18
|
+
"types": "./dist/index.d.ts",
|
|
19
|
+
"import": "./dist/index.js",
|
|
20
|
+
"require": "./dist/index.cjs"
|
|
21
|
+
},
|
|
22
|
+
"./core": {
|
|
23
|
+
"types": "./dist/core/index.d.ts",
|
|
24
|
+
"import": "./dist/core/index.js",
|
|
25
|
+
"require": "./dist/core/index.cjs"
|
|
26
|
+
},
|
|
27
|
+
"./genogram": {
|
|
28
|
+
"types": "./dist/genogram/index.d.ts",
|
|
29
|
+
"import": "./dist/genogram/index.js",
|
|
30
|
+
"require": "./dist/genogram/index.cjs"
|
|
31
|
+
},
|
|
32
|
+
"./ecomap": {
|
|
33
|
+
"types": "./dist/ecomap/index.d.ts",
|
|
34
|
+
"import": "./dist/ecomap/index.js",
|
|
35
|
+
"require": "./dist/ecomap/index.cjs"
|
|
36
|
+
},
|
|
37
|
+
"./locales/pt-br": {
|
|
38
|
+
"types": "./dist/locales/pt-br.d.ts",
|
|
39
|
+
"import": "./dist/locales/pt-br.js",
|
|
40
|
+
"require": "./dist/locales/pt-br.cjs"
|
|
41
|
+
}
|
|
42
|
+
},
|
|
43
|
+
"files": [
|
|
44
|
+
"dist"
|
|
45
|
+
],
|
|
46
|
+
"scripts": {
|
|
47
|
+
"build": "tsup",
|
|
48
|
+
"test": "vitest run",
|
|
49
|
+
"test:watch": "vitest",
|
|
50
|
+
"typecheck": "tsc --noEmit",
|
|
51
|
+
"prepublishOnly": "pnpm typecheck && pnpm test && pnpm build"
|
|
52
|
+
},
|
|
53
|
+
"keywords": [
|
|
54
|
+
"genogram",
|
|
55
|
+
"ecomap",
|
|
56
|
+
"svg",
|
|
57
|
+
"diagram",
|
|
58
|
+
"mcgoldrick",
|
|
59
|
+
"family-systems",
|
|
60
|
+
"clinical"
|
|
61
|
+
],
|
|
62
|
+
"engines": {
|
|
63
|
+
"node": ">=18"
|
|
64
|
+
},
|
|
65
|
+
"packageManager": "pnpm@10.33.2",
|
|
66
|
+
"devDependencies": {
|
|
67
|
+
"@types/node": "^24",
|
|
68
|
+
"tsup": "^8",
|
|
69
|
+
"typescript": "^5",
|
|
70
|
+
"vitest": "4.1.8"
|
|
71
|
+
}
|
|
72
|
+
}
|