schematex 0.9.15 → 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-LXM32NGV.js → chunk-HER5AMAO.js} +3 -3
- package/dist/{chunk-LXM32NGV.js.map → chunk-HER5AMAO.js.map} +1 -1
- package/dist/{chunk-F72IQZ6O.js → chunk-KTZQRWXK.js} +3 -3
- package/dist/{chunk-F72IQZ6O.js.map → chunk-KTZQRWXK.js.map} +1 -1
- 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-3VKMRHBU.cjs → chunk-PYXBTTM4.cjs} +5 -5
- package/dist/{chunk-3VKMRHBU.cjs.map → chunk-PYXBTTM4.cjs.map} +1 -1
- package/dist/{chunk-O4XRVW3R.cjs → chunk-W3N7EYSK.cjs} +4 -4
- package/dist/{chunk-O4XRVW3R.cjs.map → chunk-W3N7EYSK.cjs.map} +1 -1
- 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-KWY52MLQ.js.map +0 -1
|
@@ -21,6 +21,8 @@ var ParseError = class extends Error {
|
|
|
21
21
|
};
|
|
22
22
|
var COUPLE_OPS = [
|
|
23
23
|
{ token: "~/~", type: "cohabiting-ended" },
|
|
24
|
+
{ token: "~x~", type: "divorced" },
|
|
25
|
+
// the form the grammar advertises; `-x-` is the ASCII alias
|
|
24
26
|
{ token: "-//", type: "separated" },
|
|
25
27
|
// alias for -/-
|
|
26
28
|
{ token: "-x-", type: "divorced" },
|
|
@@ -37,6 +39,16 @@ var VALID_STATUS = /* @__PURE__ */ new Set([
|
|
|
37
39
|
"miscarriage",
|
|
38
40
|
"abortion"
|
|
39
41
|
]);
|
|
42
|
+
var STATUS_ALIASES = {
|
|
43
|
+
stillbirth: "stillborn",
|
|
44
|
+
stillbirths: "stillborn",
|
|
45
|
+
miscarried: "miscarriage",
|
|
46
|
+
miscarry: "miscarriage",
|
|
47
|
+
aborted: "abortion",
|
|
48
|
+
dead: "deceased",
|
|
49
|
+
died: "deceased",
|
|
50
|
+
decd: "deceased"
|
|
51
|
+
};
|
|
40
52
|
var SPECIAL_CHILD_PROPS = /* @__PURE__ */ new Set([
|
|
41
53
|
"adopted",
|
|
42
54
|
"foster",
|
|
@@ -456,8 +468,8 @@ function buildIndividual(id, propsStr, lineNum, lineText) {
|
|
|
456
468
|
const tokenLower = token.toLowerCase();
|
|
457
469
|
if (VALID_SEX.has(tokenLower)) {
|
|
458
470
|
individual.sex = tokenLower;
|
|
459
|
-
} else if (VALID_STATUS.has(tokenLower)) {
|
|
460
|
-
individual.status = tokenLower;
|
|
471
|
+
} else if (VALID_STATUS.has(tokenLower) || STATUS_ALIASES[tokenLower]) {
|
|
472
|
+
individual.status = STATUS_ALIASES[tokenLower] ?? tokenLower;
|
|
461
473
|
} else if (tokenLower === "index") {
|
|
462
474
|
if (!individual.markers) individual.markers = [];
|
|
463
475
|
individual.markers.push("index-person");
|
|
@@ -467,6 +479,8 @@ function buildIndividual(id, propsStr, lineNum, lineText) {
|
|
|
467
479
|
if (!individual.label || individual.label === id) individual.label = "?";
|
|
468
480
|
} else if (SPECIAL_CHILD_PROPS.has(tokenLower) || tokenLower === "guardian") {
|
|
469
481
|
continue;
|
|
482
|
+
} else if (/^\d{1,3}$/.test(tokenLower)) {
|
|
483
|
+
individual.age = parseInt(token, 10);
|
|
470
484
|
} else if (/^\d{4}$/.test(tokenLower)) {
|
|
471
485
|
if (individual.birthYear !== void 0) {
|
|
472
486
|
individual.deathYear = parseInt(token, 10);
|
|
@@ -553,7 +567,7 @@ function parseConditions(raw, lineNum, lineText) {
|
|
|
553
567
|
const parts = raw.split("+").map((s) => s.trim());
|
|
554
568
|
const conditions = [];
|
|
555
569
|
for (const part of parts) {
|
|
556
|
-
const match = part.match(/^([
|
|
570
|
+
const match = part.match(/^([^(]+)\(([^)]+)\)$/);
|
|
557
571
|
if (!match) {
|
|
558
572
|
throw new ParseError(
|
|
559
573
|
`Invalid condition format '${part}'. Expected: name(fill) or name(fill, #color)`,
|
|
@@ -562,7 +576,8 @@ function parseConditions(raw, lineNum, lineText) {
|
|
|
562
576
|
lineText
|
|
563
577
|
);
|
|
564
578
|
}
|
|
565
|
-
const
|
|
579
|
+
const label = match[1].trim();
|
|
580
|
+
const innerRaw = match[2];
|
|
566
581
|
const innerParts = innerRaw.split(",").map((s) => s.trim());
|
|
567
582
|
const fill = innerParts[0];
|
|
568
583
|
const color = innerParts[1];
|
|
@@ -2737,5 +2752,5 @@ exports.layoutGenogram = layoutGenogram;
|
|
|
2737
2752
|
exports.parseGenogram = parseGenogram;
|
|
2738
2753
|
exports.renderGenogram = renderGenogram;
|
|
2739
2754
|
exports.renderIndividualSymbol = renderIndividualSymbol;
|
|
2740
|
-
//# sourceMappingURL=chunk-
|
|
2741
|
-
//# sourceMappingURL=chunk-
|
|
2755
|
+
//# sourceMappingURL=chunk-PG7TOHPZ.cjs.map
|
|
2756
|
+
//# sourceMappingURL=chunk-PG7TOHPZ.cjs.map
|