diff --git a/asset-manifest.json b/asset-manifest.json index 8835a19..ceb3095 100644 --- a/asset-manifest.json +++ b/asset-manifest.json @@ -1,15 +1,15 @@ { "files": { "main.css": "./static/css/main.04f1eb66.chunk.css", - "main.js": "./static/js/main.fd3735bf.chunk.js", - "main.js.map": "./static/js/main.fd3735bf.chunk.js.map", + "main.js": "./static/js/main.36df2529.chunk.js", + "main.js.map": "./static/js/main.36df2529.chunk.js.map", "runtime~main.js": "./static/js/runtime~main.d653cc00.js", "runtime~main.js.map": "./static/js/runtime~main.d653cc00.js.map", "static/css/2.4d5eed7a.chunk.css": "./static/css/2.4d5eed7a.chunk.css", "static/js/2.32a34140.chunk.js": "./static/js/2.32a34140.chunk.js", "static/js/2.32a34140.chunk.js.map": "./static/js/2.32a34140.chunk.js.map", "index.html": "./index.html", - "precache-manifest.01d93dd6a2e42e8d1e0c9afaddb15a87.js": "./precache-manifest.01d93dd6a2e42e8d1e0c9afaddb15a87.js", + "precache-manifest.7ac90456685372fa62acf14e66b1954b.js": "./precache-manifest.7ac90456685372fa62acf14e66b1954b.js", "service-worker.js": "./service-worker.js", "static/css/2.4d5eed7a.chunk.css.map": "./static/css/2.4d5eed7a.chunk.css.map", "static/css/main.04f1eb66.chunk.css.map": "./static/css/main.04f1eb66.chunk.css.map", diff --git a/index.html b/index.html index 9da8d93..7124eb3 100644 --- a/index.html +++ b/index.html @@ -1 +1 @@ -
\n
\n
\n
\n \n
\n version: {formatBuildDate(process.env.REACT_APP_GIT_TIME!)} (\n \n {process.env.REACT_APP_GIT_SHA}\n \n )\n
\n \n \n );\n}\n","import naturalSort from 'javascript-natural-sort';\nimport lunr from 'lunr';\nimport {GedcomData, pointerToId} from './gedcom_util';\nimport {GedcomEntry} from 'parse-gedcom';\n\nconst MAX_RESULTS = 8;\n\nexport interface SearchResult {\n id: string;\n indi: GedcomEntry;\n}\n\nexport interface SearchIndex {\n search(input: string): SearchResult[];\n}\n\n/** Removes accents from letters, e.g. ó->o, ę->e. */\nfunction normalize(input: string) {\n return input\n .toLocaleLowerCase()\n .normalize('NFD')\n .replace(/[\\u0300-\\u036f]/g, '')\n .replace(/\\u0142/g, 'l'); // Special case: ł is not affected by NFD.\n}\n\n/** Comparator to sort by score first, then by id. */\nfunction compare(a: lunr.Index.Result, b: lunr.Index.Result) {\n if (a.score !== b.score) {\n return b.score - a.score;\n }\n return naturalSort(a.ref, b.ref);\n}\n\n/** Returns all last names of all husbands as a space-separated string. */\nfunction getHusbandLastName(indi: GedcomEntry, gedcom: GedcomData): string {\n return indi.tree\n .filter((entry) => entry.tag === 'FAMS')\n .map((entry) => gedcom.fams[pointerToId(entry.data)])\n .filter((entry) => !!entry)\n .map((entry) => {\n const husband = entry.tree.find((entry) => entry.tag === 'HUSB');\n const husbandId = husband && pointerToId(husband.data);\n return (\n husbandId &&\n husbandId !== pointerToId(indi.pointer) &&\n gedcom.indis[husbandId]\n );\n })\n .filter((entry) => !!entry)\n .flatMap((husband) =>\n (husband as GedcomEntry).tree\n .filter((entry) => entry.tag === 'NAME')\n .map((entry) => {\n const names = entry.data.split('/');\n return names.length >= 2 ? names[1] : '';\n }),\n )\n .join(' ');\n}\n\nclass LunrSearchIndex implements SearchIndex {\n private index: lunr.Index | undefined;\n\n constructor(private gedcom: GedcomData) {}\n\n initialize() {\n const self = this;\n this.index = lunr(function() {\n this.ref('id');\n this.field('id');\n this.field('name', {boost: 10});\n this.field('normalizedName', {boost: 8});\n this.field('spouseLastName', {boost: 2});\n this.field('normalizedSpouseLastName', {boost: 2});\n\n for (let id in self.gedcom.indis) {\n const indi = self.gedcom.indis[id];\n const name = indi.tree\n .filter((entry) => entry.tag === 'NAME')\n .map((entry) => entry.data)\n .join(' ');\n const spouseLastName = getHusbandLastName(indi, self.gedcom);\n this.add({\n id,\n name,\n normalizedName: normalize(name),\n spouseLastName,\n normalizedSpouseLastName: normalize(spouseLastName),\n });\n }\n });\n }\n\n public search(input: string) {\n const query = input\n .split(' ')\n .filter((s) => !!s)\n .map((s) => `+${s}*`)\n .join(' ');\n const results = this.index!.search(query);\n return results\n .sort(compare)\n .slice(0, MAX_RESULTS)\n .map((result) => ({id: result.ref, indi: this.gedcom.indis[result.ref]}));\n }\n}\n\n/** Builds a search index from data. */\nexport function buildSearchIndex(gedcom: GedcomData): SearchIndex {\n const index = new LunrSearchIndex(gedcom);\n index.initialize();\n return index;\n}\n","import * as React from 'react';\nimport {GedcomEntry} from 'parse-gedcom';\nimport {InjectedIntl} from 'react-intl';\nimport {SearchResult} from './search_index';\nimport {translateDate} from './date_util';\n\nfunction getNameLine(result: SearchResult) {\n const nameTag = result.indi.tree.find((entry) => entry.tag === 'NAME');\n const name =\n nameTag &&\n nameTag.data\n .split('/')\n .filter((s) => !!s)\n .join(' ');\n if (result.id.length > 8) {\n return name;\n }\n return (\n <>\n {name} ({result.id})\n >\n );\n}\n\nfunction getDate(indi: GedcomEntry, tag: string, intl: InjectedIntl) {\n const eventEntry = indi.tree.find((entry) => entry.tag === tag);\n const dateEntry =\n eventEntry && eventEntry.tree.find((entry) => entry.tag === 'DATE');\n return (dateEntry && translateDate(dateEntry.data, intl)) || '';\n}\n\nfunction getDescriptionLine(indi: GedcomEntry, intl: InjectedIntl) {\n const birthDate = getDate(indi, 'BIRT', intl);\n const deathDate = getDate(indi, 'DEAT', intl);\n if (!deathDate) {\n return birthDate;\n }\n return `${birthDate} – ${deathDate}`;\n}\n\n/** Produces an object that is displayed in the Semantic UI Search results. */\nexport function displaySearchResult(result: SearchResult, intl: InjectedIntl) {\n return {\n id: result.id,\n key: result.id,\n title: getNameLine(result),\n description: getDescriptionLine(result.indi, intl),\n };\n}\n","import * as queryString from 'query-string';\nimport * as React from 'react';\nimport Cookies from 'js-cookie';\nimport debounce from 'debounce';\nimport md5 from 'md5';\nimport {analyticsEvent} from './analytics';\nimport {buildSearchIndex, SearchIndex} from './search_index';\nimport {displaySearchResult} from './search_util';\nimport {FormattedMessage, intlShape} from 'react-intl';\nimport {GedcomData} from './gedcom_util';\nimport {IndiInfo} from 'topola';\nimport {Link} from 'react-router-dom';\nimport {RouteComponentProps} from 'react-router-dom';\nimport {\n Header,\n Button,\n Icon,\n Menu,\n Modal,\n Input,\n Form,\n Dropdown,\n Search,\n SearchProps,\n SearchResultProps,\n} from 'semantic-ui-react';\n\nenum WikiTreeLoginState {\n UNKNOWN,\n NOT_LOGGED_IN,\n LOGGED_IN,\n}\n\n/** Menus and dialogs state. */\ninterface State {\n loadUrlDialogOpen: boolean;\n url?: string;\n wikiTreeLoginState: WikiTreeLoginState;\n wikiTreeLoginUsername?: string;\n searchResults: SearchResultProps[];\n}\n\ninterface EventHandlers {\n onSelection: (indiInfo: IndiInfo) => void;\n onPrint: () => void;\n onDownloadPdf: () => void;\n onDownloadPng: () => void;\n onDownloadSvg: () => void;\n}\n\ninterface Props {\n /** True if the application is currently showing a chart. */\n showingChart: boolean;\n /** Data used for the search index. */\n gedcom?: GedcomData;\n standalone: boolean;\n /** Whether to show the \"All relatives\" chart type in the menu. */\n allowAllRelativesChart: boolean;\n eventHandlers: EventHandlers;\n /** Whether to show the 'Log in to WikiTree' button. */\n showWikiTreeLogin: boolean;\n}\n\nfunction loadFileAsText(file: File): Promise{props.message}
\n{props.message}
\n\n Topola Genealogy Viewer does not support Internet Explorer. Please try a\n different browser.\n
,\n document.querySelector('#root'),\n );\n} else {\n ReactDOM.render(\n\n
\n
\n
\n \n
\n version: {formatBuildDate(process.env.REACT_APP_GIT_TIME!)} (\n \n {process.env.REACT_APP_GIT_SHA}\n \n )\n
\n \n \n );\n}\n","import naturalSort from 'javascript-natural-sort';\nimport lunr from 'lunr';\nimport {GedcomData, pointerToId} from './gedcom_util';\nimport {GedcomEntry} from 'parse-gedcom';\n\nconst MAX_RESULTS = 8;\n\nexport interface SearchResult {\n id: string;\n indi: GedcomEntry;\n}\n\nexport interface SearchIndex {\n search(input: string): SearchResult[];\n}\n\n/** Removes accents from letters, e.g. ó->o, ę->e. */\nfunction normalize(input: string) {\n return input\n .toLocaleLowerCase()\n .normalize('NFD')\n .replace(/[\\u0300-\\u036f]/g, '')\n .replace(/\\u0142/g, 'l'); // Special case: ł is not affected by NFD.\n}\n\n/** Comparator to sort by score first, then by id. */\nfunction compare(a: lunr.Index.Result, b: lunr.Index.Result) {\n if (a.score !== b.score) {\n return b.score - a.score;\n }\n return naturalSort(a.ref, b.ref);\n}\n\n/** Returns all last names of all husbands as a space-separated string. */\nfunction getHusbandLastName(indi: GedcomEntry, gedcom: GedcomData): string {\n return indi.tree\n .filter((entry) => entry.tag === 'FAMS')\n .map((entry) => gedcom.fams[pointerToId(entry.data)])\n .filter((entry) => !!entry)\n .map((entry) => {\n const husband = entry.tree.find((entry) => entry.tag === 'HUSB');\n const husbandId = husband && pointerToId(husband.data);\n return (\n husbandId &&\n husbandId !== pointerToId(indi.pointer) &&\n gedcom.indis[husbandId]\n );\n })\n .filter((entry) => !!entry)\n .flatMap((husband) =>\n (husband as GedcomEntry).tree\n .filter((entry) => entry.tag === 'NAME')\n .map((entry) => {\n const names = entry.data.split('/');\n return names.length >= 2 ? names[1] : '';\n }),\n )\n .join(' ');\n}\n\nclass LunrSearchIndex implements SearchIndex {\n private index: lunr.Index | undefined;\n\n constructor(private gedcom: GedcomData) {}\n\n initialize() {\n const self = this;\n this.index = lunr(function() {\n this.ref('id');\n this.field('id');\n this.field('name', {boost: 10});\n this.field('normalizedName', {boost: 8});\n this.field('spouseLastName', {boost: 2});\n this.field('normalizedSpouseLastName', {boost: 2});\n\n for (let id in self.gedcom.indis) {\n const indi = self.gedcom.indis[id];\n const name = indi.tree\n .filter((entry) => entry.tag === 'NAME')\n .map((entry) => entry.data)\n .join(' ');\n const spouseLastName = getHusbandLastName(indi, self.gedcom);\n this.add({\n id,\n name,\n normalizedName: normalize(name),\n spouseLastName,\n normalizedSpouseLastName: normalize(spouseLastName),\n });\n }\n });\n }\n\n public search(input: string) {\n const query = input\n .split(' ')\n .filter((s) => !!s)\n .map((s) => `+${s}*`)\n .join(' ');\n const results = this.index!.search(query);\n return results\n .sort(compare)\n .slice(0, MAX_RESULTS)\n .map((result) => ({id: result.ref, indi: this.gedcom.indis[result.ref]}));\n }\n}\n\n/** Builds a search index from data. */\nexport function buildSearchIndex(gedcom: GedcomData): SearchIndex {\n const index = new LunrSearchIndex(gedcom);\n index.initialize();\n return index;\n}\n","import * as React from 'react';\nimport {GedcomEntry} from 'parse-gedcom';\nimport {InjectedIntl} from 'react-intl';\nimport {SearchResult} from './search_index';\nimport {translateDate} from './date_util';\n\nfunction getNameLine(result: SearchResult) {\n const nameTag = result.indi.tree.find((entry) => entry.tag === 'NAME');\n const name =\n nameTag &&\n nameTag.data\n .split('/')\n .filter((s) => !!s)\n .join(' ');\n if (result.id.length > 8) {\n return name;\n }\n return (\n <>\n {name} ({result.id})\n >\n );\n}\n\nfunction getDate(indi: GedcomEntry, tag: string, intl: InjectedIntl) {\n const eventEntry = indi.tree.find((entry) => entry.tag === tag);\n const dateEntry =\n eventEntry && eventEntry.tree.find((entry) => entry.tag === 'DATE');\n return (dateEntry && translateDate(dateEntry.data, intl)) || '';\n}\n\nfunction getDescriptionLine(indi: GedcomEntry, intl: InjectedIntl) {\n const birthDate = getDate(indi, 'BIRT', intl);\n const deathDate = getDate(indi, 'DEAT', intl);\n if (!deathDate) {\n return birthDate;\n }\n return `${birthDate} – ${deathDate}`;\n}\n\n/** Produces an object that is displayed in the Semantic UI Search results. */\nexport function displaySearchResult(result: SearchResult, intl: InjectedIntl) {\n return {\n id: result.id,\n key: result.id,\n title: getNameLine(result),\n description: getDescriptionLine(result.indi, intl),\n };\n}\n","import * as queryString from 'query-string';\nimport * as React from 'react';\nimport Cookies from 'js-cookie';\nimport debounce from 'debounce';\nimport md5 from 'md5';\nimport {analyticsEvent} from './analytics';\nimport {buildSearchIndex, SearchIndex} from './search_index';\nimport {displaySearchResult} from './search_util';\nimport {FormattedMessage, intlShape} from 'react-intl';\nimport {GedcomData} from './gedcom_util';\nimport {IndiInfo} from 'topola';\nimport {Link} from 'react-router-dom';\nimport {RouteComponentProps} from 'react-router-dom';\nimport {\n Header,\n Button,\n Icon,\n Menu,\n Modal,\n Input,\n Form,\n Dropdown,\n Search,\n SearchProps,\n SearchResultProps,\n} from 'semantic-ui-react';\n\nenum WikiTreeLoginState {\n UNKNOWN,\n NOT_LOGGED_IN,\n LOGGED_IN,\n}\n\n/** Menus and dialogs state. */\ninterface State {\n loadUrlDialogOpen: boolean;\n url?: string;\n wikiTreeLoginState: WikiTreeLoginState;\n wikiTreeLoginUsername?: string;\n searchResults: SearchResultProps[];\n}\n\ninterface EventHandlers {\n onSelection: (indiInfo: IndiInfo) => void;\n onPrint: () => void;\n onDownloadPdf: () => void;\n onDownloadPng: () => void;\n onDownloadSvg: () => void;\n}\n\ninterface Props {\n /** True if the application is currently showing a chart. */\n showingChart: boolean;\n /** Data used for the search index. */\n gedcom?: GedcomData;\n standalone: boolean;\n /** Whether to show the \"All relatives\" chart type in the menu. */\n allowAllRelativesChart: boolean;\n eventHandlers: EventHandlers;\n /** Whether to show the 'Log in to WikiTree' button. */\n showWikiTreeLogin: boolean;\n}\n\nfunction loadFileAsText(file: File): Promise{props.message}
\n{props.message}
\n\n Topola Genealogy Viewer does not support Internet Explorer. Please try a\n different browser.\n
,\n document.querySelector('#root'),\n );\n} else {\n ReactDOM.render(\n