schematex 0.9.14 → 0.9.16
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/dist/ai/ai-sdk.cjs +8 -8
- package/dist/ai/ai-sdk.js +3 -3
- package/dist/ai/index.cjs +17 -17
- package/dist/ai/index.js +4 -4
- package/dist/browser.cjs +9 -9
- package/dist/browser.js +3 -3
- package/dist/{chunk-2PRNDY5I.js → chunk-HER5AMAO.js} +3 -3
- package/dist/{chunk-2PRNDY5I.js.map → chunk-HER5AMAO.js.map} +1 -1
- package/dist/{chunk-JG5CVYXC.js → chunk-KTZQRWXK.js} +64 -14
- package/dist/chunk-KTZQRWXK.js.map +1 -0
- package/dist/{chunk-KWY52MLQ.js → chunk-LXQQNNOT.js} +21 -6
- package/dist/chunk-LXQQNNOT.js.map +1 -0
- package/dist/{chunk-CYBBBBMZ.cjs → chunk-PG7TOHPZ.cjs} +21 -6
- package/dist/chunk-PG7TOHPZ.cjs.map +1 -0
- package/dist/{chunk-7ZABGRZZ.cjs → chunk-PYXBTTM4.cjs} +5 -5
- package/dist/{chunk-7ZABGRZZ.cjs.map → chunk-PYXBTTM4.cjs.map} +1 -1
- package/dist/{chunk-V5TY3N2W.cjs → chunk-W3N7EYSK.cjs} +65 -15
- package/dist/chunk-W3N7EYSK.cjs.map +1 -0
- package/dist/diagrams/genogram/index.cjs +8 -8
- package/dist/diagrams/genogram/index.js +1 -1
- package/dist/index.cjs +39 -39
- package/dist/index.js +3 -3
- package/dist/react.cjs +3 -3
- package/dist/react.js +2 -2
- package/package.json +1 -1
- package/dist/chunk-CYBBBBMZ.cjs.map +0 -1
- package/dist/chunk-JG5CVYXC.js.map +0 -1
- package/dist/chunk-KWY52MLQ.js.map +0 -1
- package/dist/chunk-V5TY3N2W.cjs.map +0 -1
|
@@ -19,6 +19,8 @@ var ParseError = class extends Error {
|
|
|
19
19
|
};
|
|
20
20
|
var COUPLE_OPS = [
|
|
21
21
|
{ token: "~/~", type: "cohabiting-ended" },
|
|
22
|
+
{ token: "~x~", type: "divorced" },
|
|
23
|
+
// the form the grammar advertises; `-x-` is the ASCII alias
|
|
22
24
|
{ token: "-//", type: "separated" },
|
|
23
25
|
// alias for -/-
|
|
24
26
|
{ token: "-x-", type: "divorced" },
|
|
@@ -35,6 +37,16 @@ var VALID_STATUS = /* @__PURE__ */ new Set([
|
|
|
35
37
|
"miscarriage",
|
|
36
38
|
"abortion"
|
|
37
39
|
]);
|
|
40
|
+
var STATUS_ALIASES = {
|
|
41
|
+
stillbirth: "stillborn",
|
|
42
|
+
stillbirths: "stillborn",
|
|
43
|
+
miscarried: "miscarriage",
|
|
44
|
+
miscarry: "miscarriage",
|
|
45
|
+
aborted: "abortion",
|
|
46
|
+
dead: "deceased",
|
|
47
|
+
died: "deceased",
|
|
48
|
+
decd: "deceased"
|
|
49
|
+
};
|
|
38
50
|
var SPECIAL_CHILD_PROPS = /* @__PURE__ */ new Set([
|
|
39
51
|
"adopted",
|
|
40
52
|
"foster",
|
|
@@ -454,8 +466,8 @@ function buildIndividual(id, propsStr, lineNum, lineText) {
|
|
|
454
466
|
const tokenLower = token.toLowerCase();
|
|
455
467
|
if (VALID_SEX.has(tokenLower)) {
|
|
456
468
|
individual.sex = tokenLower;
|
|
457
|
-
} else if (VALID_STATUS.has(tokenLower)) {
|
|
458
|
-
individual.status = tokenLower;
|
|
469
|
+
} else if (VALID_STATUS.has(tokenLower) || STATUS_ALIASES[tokenLower]) {
|
|
470
|
+
individual.status = STATUS_ALIASES[tokenLower] ?? tokenLower;
|
|
459
471
|
} else if (tokenLower === "index") {
|
|
460
472
|
if (!individual.markers) individual.markers = [];
|
|
461
473
|
individual.markers.push("index-person");
|
|
@@ -465,6 +477,8 @@ function buildIndividual(id, propsStr, lineNum, lineText) {
|
|
|
465
477
|
if (!individual.label || individual.label === id) individual.label = "?";
|
|
466
478
|
} else if (SPECIAL_CHILD_PROPS.has(tokenLower) || tokenLower === "guardian") {
|
|
467
479
|
continue;
|
|
480
|
+
} else if (/^\d{1,3}$/.test(tokenLower)) {
|
|
481
|
+
individual.age = parseInt(token, 10);
|
|
468
482
|
} else if (/^\d{4}$/.test(tokenLower)) {
|
|
469
483
|
if (individual.birthYear !== void 0) {
|
|
470
484
|
individual.deathYear = parseInt(token, 10);
|
|
@@ -551,7 +565,7 @@ function parseConditions(raw, lineNum, lineText) {
|
|
|
551
565
|
const parts = raw.split("+").map((s) => s.trim());
|
|
552
566
|
const conditions = [];
|
|
553
567
|
for (const part of parts) {
|
|
554
|
-
const match = part.match(/^([
|
|
568
|
+
const match = part.match(/^([^(]+)\(([^)]+)\)$/);
|
|
555
569
|
if (!match) {
|
|
556
570
|
throw new ParseError(
|
|
557
571
|
`Invalid condition format '${part}'. Expected: name(fill) or name(fill, #color)`,
|
|
@@ -560,7 +574,8 @@ function parseConditions(raw, lineNum, lineText) {
|
|
|
560
574
|
lineText
|
|
561
575
|
);
|
|
562
576
|
}
|
|
563
|
-
const
|
|
577
|
+
const label = match[1].trim();
|
|
578
|
+
const innerRaw = match[2];
|
|
564
579
|
const innerParts = innerRaw.split(",").map((s) => s.trim());
|
|
565
580
|
const fill = innerParts[0];
|
|
566
581
|
const color = innerParts[1];
|
|
@@ -2729,5 +2744,5 @@ var genogram = {
|
|
|
2729
2744
|
};
|
|
2730
2745
|
|
|
2731
2746
|
export { ParseError, genogram, getRequiredDefs, layoutGenogram, parseGenogram, renderGenogram, renderIndividualSymbol };
|
|
2732
|
-
//# sourceMappingURL=chunk-
|
|
2733
|
-
//# sourceMappingURL=chunk-
|
|
2747
|
+
//# sourceMappingURL=chunk-LXQQNNOT.js.map
|
|
2748
|
+
//# sourceMappingURL=chunk-LXQQNNOT.js.map
|