@treeviz/gedcom-parser 1.0.20 → 1.0.21
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/classes/index.d.ts +1 -1
- package/dist/classes/index.js +105 -45
- package/dist/cli/index.js +105 -45
- package/dist/constants/index.d.ts +1 -1
- package/dist/constants/index.js +104 -44
- package/dist/factories/index.d.ts +2 -2
- package/dist/factories/index.js +104 -44
- package/dist/{index-DOapi7nN.d.ts → index-BPEVN_DY.d.ts} +9 -1
- package/dist/index.d.ts +3 -3
- package/dist/index.js +105 -45
- package/dist/interfaces/index.d.ts +1 -1
- package/dist/kinship-translator/index.d.ts +2 -2
- package/dist/kinship-translator/index.js +104 -44
- package/dist/{place-parser-CIplmmDd.d.ts → place-parser-CM0TJFj8.d.ts} +1 -1
- package/dist/place-translator-CRiaOO9v.d.ts +88 -0
- package/dist/structures/index.d.ts +2 -2
- package/dist/types/index.d.ts +1 -1
- package/dist/utils/index.d.ts +14 -86
- package/dist/utils/index.js +106 -46
- package/package.json +1 -1
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import { l as Settings, ak as GedComType, M as MultiTag, ao as Common, t as IdType, bl as IDateStructure, aj as FamType, az as CommonDate, a1 as IndiType, n as IndiKey, J as NestedGroup, aP as Individuals } from './index-BPEVN_DY.js';
|
|
2
|
+
|
|
3
|
+
declare const GedcomTree: {
|
|
4
|
+
parse: (content: string, options?: {
|
|
5
|
+
settings?: Settings;
|
|
6
|
+
}) => any;
|
|
7
|
+
parseHierarchy: (content: string, options?: {
|
|
8
|
+
settings?: Settings;
|
|
9
|
+
}) => {
|
|
10
|
+
gedcom: GedComType;
|
|
11
|
+
raw: string;
|
|
12
|
+
};
|
|
13
|
+
addToList: (id: string, type: MultiTag, common: Common, prev: Common) => void;
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
declare const create: (gedcom: GedComType, type: MultiTag, id?: string, nodes?: {
|
|
17
|
+
mainNode?: Common;
|
|
18
|
+
curNode?: Common;
|
|
19
|
+
prevNode?: Common;
|
|
20
|
+
}) => {
|
|
21
|
+
prevNode: Common<string, IdType>;
|
|
22
|
+
curNode: Common<string, IdType>;
|
|
23
|
+
mainNode: Common<string, IdType>;
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
declare const ACCEPTED_DATE_FORMATS: string[];
|
|
27
|
+
declare const ACCEPTED_DATE_FORMATS_REGEX: RegExp;
|
|
28
|
+
declare const commonDateFormatter: (date?: IDateStructure["DATE"], format?: string, prefix?: string) => string;
|
|
29
|
+
declare const noteDateFormatter: (date?: IDateStructure["DATE"], format?: string, prefix?: string, shortNote?: boolean, showNote?: boolean) => string;
|
|
30
|
+
declare const marriageDateFormatter: (fam?: FamType, showDays?: boolean, showPlaces?: boolean, shortNote?: boolean, showNote?: boolean, showDisplayTextIfNoDate?: boolean, showAllEvents?: boolean, dateFormatPattern?: string) => {
|
|
31
|
+
marriages?: string[];
|
|
32
|
+
marriagePlaces?: string[];
|
|
33
|
+
rawArray: CommonDate[];
|
|
34
|
+
inArray: string[];
|
|
35
|
+
inOrder: string;
|
|
36
|
+
places: string[];
|
|
37
|
+
marriage: string[];
|
|
38
|
+
};
|
|
39
|
+
declare const dateFormatter: (indi?: IndiType, showMarriages?: boolean, showDays?: boolean, showPlaces?: boolean, shortNote?: boolean, showNote?: boolean, isOnStage?: (key: IndiKey) => boolean, showAllEvents?: boolean, dateFormatPattern?: string) => {
|
|
40
|
+
births?: string[];
|
|
41
|
+
birthPlaces?: string[];
|
|
42
|
+
deaths?: string[];
|
|
43
|
+
deathPlaces?: string[];
|
|
44
|
+
marriages?: string[];
|
|
45
|
+
marriagePlaces?: string[];
|
|
46
|
+
birthPlace?: string;
|
|
47
|
+
deathPlace?: string;
|
|
48
|
+
inArray: string[];
|
|
49
|
+
inOrder: string;
|
|
50
|
+
places: string[];
|
|
51
|
+
birth: string;
|
|
52
|
+
marriage: string[];
|
|
53
|
+
death: string;
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
declare const getAllProp: <T>(indi?: IndiType, prop?: MultiTag) => T[];
|
|
57
|
+
|
|
58
|
+
declare const getFamilyWith: (person1: IndiType, person2?: IndiKey, famType?: "FAMS" | "FAMC") => FamType | undefined;
|
|
59
|
+
|
|
60
|
+
declare const isDevelopment: () => boolean;
|
|
61
|
+
declare const getVersion: () => string;
|
|
62
|
+
declare const getName: () => string;
|
|
63
|
+
|
|
64
|
+
declare const getRawSize: (raw?: string) => number;
|
|
65
|
+
|
|
66
|
+
declare const implemented: (type: string, ...args: any[]) => void;
|
|
67
|
+
declare const notImplemented: (type: string, ...args: any[]) => void;
|
|
68
|
+
|
|
69
|
+
declare const nameFormatter: (indiName?: IndiType | string, settings?: Partial<Settings>, letterOnAll?: boolean, indi?: IndiType, debug?: 3) => {
|
|
70
|
+
suffix: string;
|
|
71
|
+
givenname: string;
|
|
72
|
+
surname: string;
|
|
73
|
+
inOrder: [string, string, string];
|
|
74
|
+
letter: string;
|
|
75
|
+
};
|
|
76
|
+
|
|
77
|
+
declare const setNestedGroup: (obj: NestedGroup, key: string | string[], value: Individuals, uniqueCounting?: boolean) => void;
|
|
78
|
+
|
|
79
|
+
declare const ordinalize: (n: number) => string;
|
|
80
|
+
declare const hungarianOrdinalize: (n: number) => string;
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* Place translator stub for gedcom-parser
|
|
84
|
+
* This is a minimal no-op implementation - consumer apps can implement translation if needed
|
|
85
|
+
*/
|
|
86
|
+
declare const placeTranslator: (place: string | string[]) => string;
|
|
87
|
+
|
|
88
|
+
export { ACCEPTED_DATE_FORMATS as A, GedcomTree as G, ACCEPTED_DATE_FORMATS_REGEX as a, commonDateFormatter as b, create as c, dateFormatter as d, getAllProp as e, getFamilyWith as f, getRawSize as g, getVersion as h, isDevelopment as i, getName as j, implemented as k, notImplemented as l, marriageDateFormatter as m, noteDateFormatter as n, nameFormatter as o, ordinalize as p, hungarianOrdinalize as q, placeTranslator as r, setNestedGroup as s };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ao as Common,
|
|
2
|
-
export {
|
|
1
|
+
import { ao as Common, bx as INoteStructure, bA as ISourceCitationStructure } from '../index-BPEVN_DY.js';
|
|
2
|
+
export { bh as IAddress, bi as IAssociation, bj as IChangeDate, bk as ICreationDate, bl as IDate, bm as IEventDetail, bm as IEventDetailStructure, bn as IFamily, bo as IGedcomStructure, br as IIndividual, bq as IIndividualEvent, bp as IIndividualEventDetail, br as IIndividualStructure, bs as ILdsOrdinanceDetail, bt as ILdsSpouseSealing, bu as IMarriageDate, bv as IMultimediaLink, bw as INonEvent, by as IPlace, bz as IRepository, bC as ISource, bB as ISourceRepositoryCitation } from '../index-BPEVN_DY.js';
|
|
3
3
|
import 'date-fns';
|
|
4
4
|
|
|
5
5
|
interface IPersonalNamePiecesStructure extends Common {
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { m as ConvertType, F as FamKey, x as Filter, w as FilterIterator, D as Group, G as GroupDefinition, H as GroupIterator, E as GroupMarker, t as IdType, n as IndiKey, V as LinkedPersons, v as ListTag, M as MultiTag, K as NameOrder, J as NestedGroup, N as NonStandard, O as ObjeKey, A as Order, z as OrderDefinition, B as OrderIterator, X as PartnerType, Q as PlaceOrder, Y as Range, W as RelationType, o as RepoKey, y as RequiredFilter, l as Settings, q as SourKey, r as SubmKey, u as Tag, T as TagKey, U as UnknownKey } from '../index-
|
|
1
|
+
export { m as ConvertType, F as FamKey, x as Filter, w as FilterIterator, D as Group, G as GroupDefinition, H as GroupIterator, E as GroupMarker, t as IdType, n as IndiKey, V as LinkedPersons, v as ListTag, M as MultiTag, K as NameOrder, J as NestedGroup, N as NonStandard, O as ObjeKey, A as Order, z as OrderDefinition, B as OrderIterator, X as PartnerType, Q as PlaceOrder, Y as Range, W as RelationType, o as RepoKey, y as RequiredFilter, l as Settings, q as SourKey, r as SubmKey, u as Tag, T as TagKey, U as UnknownKey } from '../index-BPEVN_DY.js';
|
|
2
2
|
import 'date-fns';
|
|
3
3
|
|
|
4
4
|
interface AncestryMedia {
|
package/dist/utils/index.d.ts
CHANGED
|
@@ -1,91 +1,19 @@
|
|
|
1
|
-
export { C as CacheRelatives, I as ICacheManager, P as PlaceParts, g as getPlaceParts, p as pathCache, a as relativesCache, r as resetRelativesCache } from '../place-parser-
|
|
2
|
-
|
|
3
|
-
export {
|
|
1
|
+
export { C as CacheRelatives, I as ICacheManager, P as PlaceParts, g as getPlaceParts, p as pathCache, a as relativesCache, r as resetRelativesCache } from '../place-parser-CM0TJFj8.js';
|
|
2
|
+
export { A as ACCEPTED_DATE_FORMATS, a as ACCEPTED_DATE_FORMATS_REGEX, G as GedcomTree, b as commonDateFormatter, c as create, d as dateFormatter, e as getAllProp, f as getFamilyWith, j as getName, g as getRawSize, h as getVersion, q as hungarianOrdinalize, k as implemented, i as isDevelopment, m as marriageDateFormatter, o as nameFormatter, l as notImplemented, n as noteDateFormatter, p as ordinalize, r as placeTranslator, s as setNestedGroup } from '../place-translator-CRiaOO9v.js';
|
|
3
|
+
export { bD as Place, bE as PlaceType, P as PrimitiveRange, R as Range, S as SplitResult, h as extractSeparationYears, e as extractSplitPoints, d as findMatchingRangeForSplitRange, f as fromTuple, g as generateSplitRanges, bF as getPlaces, i as inRange, a as isIntersectedRange, b as isRangeContained, p as parseRangeBounds, c as splitOverlappingRanges, s as splitRange } from '../index-BPEVN_DY.js';
|
|
4
4
|
import 'date-fns';
|
|
5
5
|
|
|
6
|
-
declare const GedcomTree: {
|
|
7
|
-
parse: (content: string, options?: {
|
|
8
|
-
settings?: Settings;
|
|
9
|
-
}) => any;
|
|
10
|
-
parseHierarchy: (content: string, options?: {
|
|
11
|
-
settings?: Settings;
|
|
12
|
-
}) => {
|
|
13
|
-
gedcom: GedComType;
|
|
14
|
-
raw: string;
|
|
15
|
-
};
|
|
16
|
-
addToList: (id: string, type: MultiTag, common: Common, prev: Common) => void;
|
|
17
|
-
};
|
|
18
|
-
|
|
19
|
-
declare const create: (gedcom: GedComType, type: MultiTag, id?: string, nodes?: {
|
|
20
|
-
mainNode?: Common;
|
|
21
|
-
curNode?: Common;
|
|
22
|
-
prevNode?: Common;
|
|
23
|
-
}) => {
|
|
24
|
-
prevNode: Common<string, IdType>;
|
|
25
|
-
curNode: Common<string, IdType>;
|
|
26
|
-
mainNode: Common<string, IdType>;
|
|
27
|
-
};
|
|
28
|
-
|
|
29
|
-
declare const ACCEPTED_DATE_FORMATS: string[];
|
|
30
|
-
declare const ACCEPTED_DATE_FORMATS_REGEX: RegExp;
|
|
31
|
-
declare const commonDateFormatter: (date?: IDateStructure["DATE"], format?: string, prefix?: string) => string;
|
|
32
|
-
declare const noteDateFormatter: (date?: IDateStructure["DATE"], format?: string, prefix?: string, shortNote?: boolean, showNote?: boolean) => string;
|
|
33
|
-
declare const marriageDateFormatter: (fam?: FamType, showDays?: boolean, showPlaces?: boolean, shortNote?: boolean, showNote?: boolean, showDisplayTextIfNoDate?: boolean, showAllEvents?: boolean, dateFormatPattern?: string) => {
|
|
34
|
-
marriages?: string[];
|
|
35
|
-
marriagePlaces?: string[];
|
|
36
|
-
rawArray: CommonDate[];
|
|
37
|
-
inArray: string[];
|
|
38
|
-
inOrder: string;
|
|
39
|
-
places: string[];
|
|
40
|
-
marriage: string[];
|
|
41
|
-
};
|
|
42
|
-
declare const dateFormatter: (indi?: IndiType, showMarriages?: boolean, showDays?: boolean, showPlaces?: boolean, shortNote?: boolean, showNote?: boolean, isOnStage?: (key: IndiKey) => boolean, showAllEvents?: boolean, dateFormatPattern?: string) => {
|
|
43
|
-
births?: string[];
|
|
44
|
-
birthPlaces?: string[];
|
|
45
|
-
deaths?: string[];
|
|
46
|
-
deathPlaces?: string[];
|
|
47
|
-
marriages?: string[];
|
|
48
|
-
marriagePlaces?: string[];
|
|
49
|
-
birthPlace?: string;
|
|
50
|
-
deathPlace?: string;
|
|
51
|
-
inArray: string[];
|
|
52
|
-
inOrder: string;
|
|
53
|
-
places: string[];
|
|
54
|
-
birth: string;
|
|
55
|
-
marriage: string[];
|
|
56
|
-
death: string;
|
|
57
|
-
};
|
|
58
|
-
|
|
59
|
-
declare const getAllProp: <T>(indi?: IndiType, prop?: MultiTag) => T[];
|
|
60
|
-
|
|
61
|
-
declare const getFamilyWith: (person1: IndiType, person2?: IndiKey, famType?: "FAMS" | "FAMC") => FamType | undefined;
|
|
62
|
-
|
|
63
|
-
declare const isDevelopment: () => boolean;
|
|
64
|
-
declare const getVersion: () => string;
|
|
65
|
-
declare const getName: () => string;
|
|
66
|
-
|
|
67
|
-
declare const getRawSize: (raw?: string) => number;
|
|
68
|
-
|
|
69
|
-
declare const implemented: (type: string, ...args: any[]) => void;
|
|
70
|
-
declare const notImplemented: (type: string, ...args: any[]) => void;
|
|
71
|
-
|
|
72
|
-
declare const nameFormatter: (indiName?: IndiType | string, settings?: Partial<Settings>, letterOnAll?: boolean, indi?: IndiType, debug?: 3) => {
|
|
73
|
-
suffix: string;
|
|
74
|
-
givenname: string;
|
|
75
|
-
surname: string;
|
|
76
|
-
inOrder: [string, string, string];
|
|
77
|
-
letter: string;
|
|
78
|
-
};
|
|
79
|
-
|
|
80
|
-
declare const setNestedGroup: (obj: NestedGroup, key: string | string[], value: Individuals, uniqueCounting?: boolean) => void;
|
|
81
|
-
|
|
82
|
-
declare const ordinalize: (n: number) => string;
|
|
83
|
-
declare const hungarianOrdinalize: (n: number) => string;
|
|
84
|
-
|
|
85
6
|
/**
|
|
86
|
-
*
|
|
87
|
-
*
|
|
7
|
+
* Get file extension from filename
|
|
8
|
+
* @param filename - The filename to extract extension from
|
|
9
|
+
* @returns File extension without the dot, or empty string if no extension
|
|
10
|
+
*/
|
|
11
|
+
declare const getFileExtension: (filename: string) => string;
|
|
12
|
+
/**
|
|
13
|
+
* Check if a file format is an image format
|
|
14
|
+
* @param format - The file format/extension to check
|
|
15
|
+
* @returns true if the format is a supported image format
|
|
88
16
|
*/
|
|
89
|
-
declare const
|
|
17
|
+
declare const isImageFormat: (format: string) => boolean;
|
|
90
18
|
|
|
91
|
-
export {
|
|
19
|
+
export { getFileExtension, isImageFormat };
|
package/dist/utils/index.js
CHANGED
|
@@ -1503,6 +1503,27 @@ var implemented = (type, ...args) => {
|
|
|
1503
1503
|
var notImplemented = (type, ...args) => {
|
|
1504
1504
|
console.error(`[Not Implemented] ${type}`, ...args);
|
|
1505
1505
|
};
|
|
1506
|
+
|
|
1507
|
+
// src/utils/media-utils.ts
|
|
1508
|
+
var getFileExtension = (filename) => {
|
|
1509
|
+
const match = filename.match(/\.([^.]+)$/);
|
|
1510
|
+
return match ? match[1] : "";
|
|
1511
|
+
};
|
|
1512
|
+
var isImageFormat = (format2) => {
|
|
1513
|
+
if (!format2) return false;
|
|
1514
|
+
const imageFormats = [
|
|
1515
|
+
"jpg",
|
|
1516
|
+
"jpeg",
|
|
1517
|
+
"png",
|
|
1518
|
+
"gif",
|
|
1519
|
+
"bmp",
|
|
1520
|
+
"webp",
|
|
1521
|
+
"svg",
|
|
1522
|
+
"tiff",
|
|
1523
|
+
"tif"
|
|
1524
|
+
];
|
|
1525
|
+
return imageFormats.includes(format2.toLowerCase());
|
|
1526
|
+
};
|
|
1506
1527
|
var uniqueItemsCache = /* @__PURE__ */ new WeakMap();
|
|
1507
1528
|
var setNestedGroup = (obj, key, value, uniqueCounting = true) => {
|
|
1508
1529
|
const parts = Array.isArray(key) ? key : key.split(/,\s*/);
|
|
@@ -2718,54 +2739,62 @@ var Indi = class extends Common {
|
|
|
2718
2739
|
}
|
|
2719
2740
|
async ancestryMedia(namespace) {
|
|
2720
2741
|
const list = {};
|
|
2721
|
-
const
|
|
2742
|
+
const objeList = this.get("OBJE")?.toList();
|
|
2722
2743
|
const www = this._gedcom?.HEAD?.SOUR?.CORP?.WWW?.value;
|
|
2723
2744
|
const tree = this.getAncestryTreeId();
|
|
2724
|
-
|
|
2725
|
-
|
|
2726
|
-
|
|
2727
|
-
|
|
2728
|
-
|
|
2729
|
-
|
|
2730
|
-
|
|
2731
|
-
|
|
2732
|
-
|
|
2733
|
-
let url = obje?.get("FILE")?.toValue();
|
|
2734
|
-
const title = obje?.get("TITL")?.toValue() ?? "";
|
|
2735
|
-
const type = obje?.get("FORM")?.toValue() ?? "raw";
|
|
2736
|
-
const imgId = clone || mser;
|
|
2737
|
-
if (!www || !tree || !this.id) {
|
|
2738
|
-
return;
|
|
2739
|
-
}
|
|
2740
|
-
if (!namespace && !url) {
|
|
2741
|
-
try {
|
|
2742
|
-
const mediaDetailsResponse = await fetch(
|
|
2743
|
-
`https://www.ancestry.com/api/media/viewer/v2/trees/${tree}/media?id=${media}`
|
|
2744
|
-
);
|
|
2745
|
-
const mediaDetails = await mediaDetailsResponse.json();
|
|
2746
|
-
if (mediaDetails.url) {
|
|
2747
|
-
url = `${mediaDetails.url}&imageQuality=hq`;
|
|
2745
|
+
if (objeList) {
|
|
2746
|
+
await Promise.all(
|
|
2747
|
+
objeList.map(async (objeRef) => {
|
|
2748
|
+
const key = objeRef?.id;
|
|
2749
|
+
const obje = objeRef?.standardizeMedia(
|
|
2750
|
+
namespace,
|
|
2751
|
+
true,
|
|
2752
|
+
(ns, iId) => {
|
|
2753
|
+
return ns && iId ? `https://mediasvc.ancestry.com/v2/image/namespaces/${ns}/media/${iId}?client=trees-mediaservice&imageQuality=hq` : void 0;
|
|
2748
2754
|
}
|
|
2749
|
-
|
|
2755
|
+
);
|
|
2756
|
+
const isPrimary = obje?.get("_PRIM")?.toValue() === "Y";
|
|
2757
|
+
const media = obje?.RIN?.value;
|
|
2758
|
+
const clone = obje?.get("_CLON._OID")?.toValue();
|
|
2759
|
+
const mser = obje?.get("_MSER._LKID")?.toValue();
|
|
2760
|
+
let url = obje?.get("FILE")?.toValue();
|
|
2761
|
+
const title = obje?.get("TITL")?.toValue() ?? "";
|
|
2762
|
+
const type = obje?.get("FORM")?.toValue() ?? "raw";
|
|
2763
|
+
const imgId = clone || mser;
|
|
2764
|
+
if (!www || !tree || !this.id) {
|
|
2765
|
+
return;
|
|
2750
2766
|
}
|
|
2751
|
-
|
|
2752
|
-
|
|
2753
|
-
|
|
2754
|
-
|
|
2755
|
-
|
|
2756
|
-
|
|
2757
|
-
|
|
2758
|
-
|
|
2759
|
-
|
|
2760
|
-
|
|
2761
|
-
|
|
2762
|
-
url
|
|
2763
|
-
|
|
2764
|
-
|
|
2765
|
-
|
|
2766
|
-
|
|
2767
|
-
|
|
2768
|
-
|
|
2767
|
+
if (!namespace && !url) {
|
|
2768
|
+
try {
|
|
2769
|
+
const mediaDetailsResponse = await fetch(
|
|
2770
|
+
`https://www.ancestry.com/api/media/viewer/v2/trees/${tree}/media?id=${media}`
|
|
2771
|
+
);
|
|
2772
|
+
const mediaDetails = await mediaDetailsResponse.json();
|
|
2773
|
+
if (mediaDetails.url) {
|
|
2774
|
+
url = `${mediaDetails.url}&imageQuality=hq`;
|
|
2775
|
+
}
|
|
2776
|
+
} catch (_e) {
|
|
2777
|
+
}
|
|
2778
|
+
url = url || `https://${www}/mediaui-viewer/tree/${tree}/media/${media}`;
|
|
2779
|
+
}
|
|
2780
|
+
if (url && imgId) {
|
|
2781
|
+
const id = `${tree}-${this.id}-${imgId}`;
|
|
2782
|
+
list[id] = {
|
|
2783
|
+
key,
|
|
2784
|
+
isPrimary,
|
|
2785
|
+
id,
|
|
2786
|
+
tree,
|
|
2787
|
+
imgId,
|
|
2788
|
+
person: this.id,
|
|
2789
|
+
title,
|
|
2790
|
+
url,
|
|
2791
|
+
contentType: type,
|
|
2792
|
+
downloadName: `${this.id.replaceAll("@", "")}_${this.toNaturalName().replaceAll(" ", "-") || ""}_${(title || key.replaceAll("@", "").toString()).replaceAll(" ", "-")}`
|
|
2793
|
+
};
|
|
2794
|
+
}
|
|
2795
|
+
})
|
|
2796
|
+
);
|
|
2797
|
+
}
|
|
2769
2798
|
return list;
|
|
2770
2799
|
}
|
|
2771
2800
|
myheritageLink(poolId = 0) {
|
|
@@ -2803,6 +2832,7 @@ var Indi = class extends Common {
|
|
|
2803
2832
|
if (url && imgId) {
|
|
2804
2833
|
const id = `${tree}-${this.id}-${imgId}`;
|
|
2805
2834
|
list[id] = {
|
|
2835
|
+
isPrimary: false,
|
|
2806
2836
|
key,
|
|
2807
2837
|
id,
|
|
2808
2838
|
tree,
|
|
@@ -2912,6 +2942,36 @@ var Indi = class extends Common {
|
|
|
2912
2942
|
}
|
|
2913
2943
|
return void 0;
|
|
2914
2944
|
}
|
|
2945
|
+
async getProfilePicture(namespace) {
|
|
2946
|
+
const mediaList = await this.multimedia(namespace);
|
|
2947
|
+
if (!mediaList) {
|
|
2948
|
+
return void 0;
|
|
2949
|
+
}
|
|
2950
|
+
const mediaArray = Object.values(mediaList);
|
|
2951
|
+
const primaryMedia = mediaArray.find(
|
|
2952
|
+
(media) => media.isPrimary && isImageFormat(media.contentType || getFileExtension(media.url))
|
|
2953
|
+
);
|
|
2954
|
+
if (primaryMedia) {
|
|
2955
|
+
return {
|
|
2956
|
+
file: primaryMedia.url,
|
|
2957
|
+
form: primaryMedia.contentType,
|
|
2958
|
+
title: primaryMedia.title,
|
|
2959
|
+
isPrimary: true
|
|
2960
|
+
};
|
|
2961
|
+
}
|
|
2962
|
+
const secondaryMedia = mediaArray.find(
|
|
2963
|
+
(media) => isImageFormat(media.contentType || getFileExtension(media.url))
|
|
2964
|
+
);
|
|
2965
|
+
if (secondaryMedia) {
|
|
2966
|
+
return {
|
|
2967
|
+
file: secondaryMedia.url,
|
|
2968
|
+
form: secondaryMedia.contentType,
|
|
2969
|
+
title: secondaryMedia.title,
|
|
2970
|
+
isPrimary: false
|
|
2971
|
+
};
|
|
2972
|
+
}
|
|
2973
|
+
return void 0;
|
|
2974
|
+
}
|
|
2915
2975
|
link(poolId) {
|
|
2916
2976
|
if (this?.isAncestry()) {
|
|
2917
2977
|
return this.ancestryLink();
|
|
@@ -6045,7 +6105,7 @@ var isCommonDate = (value) => {
|
|
|
6045
6105
|
// package.json
|
|
6046
6106
|
var package_default = {
|
|
6047
6107
|
name: "@treeviz/gedcom-parser",
|
|
6048
|
-
version: "1.0.
|
|
6108
|
+
version: "1.0.21"};
|
|
6049
6109
|
|
|
6050
6110
|
// src/utils/get-product-details.ts
|
|
6051
6111
|
var isDevelopment = () => {
|
|
@@ -7026,4 +7086,4 @@ if (isDev) {
|
|
|
7026
7086
|
}
|
|
7027
7087
|
var parser_default = GedcomTree;
|
|
7028
7088
|
|
|
7029
|
-
export { ACCEPTED_DATE_FORMATS, ACCEPTED_DATE_FORMATS_REGEX, parser_default as GedcomTree, PlaceType, commonDateFormatter, create, dateFormatter, extractSeparationYears, extractSplitPoints, findMatchingRangeForSplitRange, fromTuple, generateSplitRanges, getAllProp, getFamilyWith, getName, getPlaceParts, getPlaces, getRawSize, getVersion, hungarianOrdinalize, implemented, inRange, isDevelopment, isIntersectedRange, isRangeContained, marriageDateFormatter, nameFormatter, notImplemented, noteDateFormatter, ordinalize, parseRangeBounds, pathCache, placeTranslator, relativesCache, resetRelativesCache, setNestedGroup, splitOverlappingRanges, splitRange };
|
|
7089
|
+
export { ACCEPTED_DATE_FORMATS, ACCEPTED_DATE_FORMATS_REGEX, parser_default as GedcomTree, PlaceType, commonDateFormatter, create, dateFormatter, extractSeparationYears, extractSplitPoints, findMatchingRangeForSplitRange, fromTuple, generateSplitRanges, getAllProp, getFamilyWith, getFileExtension, getName, getPlaceParts, getPlaces, getRawSize, getVersion, hungarianOrdinalize, implemented, inRange, isDevelopment, isImageFormat, isIntersectedRange, isRangeContained, marriageDateFormatter, nameFormatter, notImplemented, noteDateFormatter, ordinalize, parseRangeBounds, pathCache, placeTranslator, relativesCache, resetRelativesCache, setNestedGroup, splitOverlappingRanges, splitRange };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@treeviz/gedcom-parser",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.21",
|
|
4
4
|
"description": "Lightweight, pluggable GEDCOM parser for JavaScript/TypeScript with optional caching and place matching. Zero browser dependencies.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|