col-browser 2.6.3 → 2.6.5
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/es/chunks/{Distributions-Byhvu1wv.js → Distributions-CvS4r1hC.js} +333 -313
- package/es/chunks/Distributions-CvS4r1hC.js.map +1 -0
- package/es/chunks/enumeration-nKPV2qHV.js +28 -0
- package/es/chunks/{enumeration-CsrJrIIR.js.map → enumeration-nKPV2qHV.js.map} +1 -1
- package/es/col-browser.css +1 -1
- package/es/search.js +1 -1
- package/es/sourceDataset.js +1 -1
- package/es/taxon.js +478 -421
- package/es/taxon.js.map +1 -1
- package/es/taxonDistribution.js +1 -1
- package/package.json +1 -1
- package/umd/col-browser.js +108 -16
- package/umd/col-browser.js.map +1 -1
- package/umd/col-browser.min.js +4 -4
- package/umd/col-browser.min.js.map +1 -1
- package/umd/main.css +48 -0
- package/es/chunks/Distributions-Byhvu1wv.js.map +0 -1
- package/es/chunks/enumeration-CsrJrIIR.js +0 -24
package/es/taxonDistribution.js
CHANGED
|
@@ -4,7 +4,7 @@ import { useState as a, useEffect as D } from "react";
|
|
|
4
4
|
import { s as T, c as s, R as g, b as k } from "./chunks/router-CssZk5qZ.js";
|
|
5
5
|
import { c as l } from "./chunks/config--bs_09I6.js";
|
|
6
6
|
import { Row as v, Col as w, Spin as A } from "antd";
|
|
7
|
-
import { D as C } from "./chunks/Distributions-
|
|
7
|
+
import { D as C } from "./chunks/Distributions-CvS4r1hC.js";
|
|
8
8
|
const E = ({
|
|
9
9
|
taxonId: o,
|
|
10
10
|
datasetKey: i,
|
package/package.json
CHANGED
package/umd/col-browser.js
CHANGED
|
@@ -69871,6 +69871,10 @@ html body {
|
|
|
69871
69871
|
"nomstatus",
|
|
69872
69872
|
(data) => data.reduce((a, c) => (a[c.name] = c, a), {})
|
|
69873
69873
|
);
|
|
69874
|
+
const getIdentifierScopeVocab = () => cachedVocab(
|
|
69875
|
+
"identifier-scope",
|
|
69876
|
+
(data) => data.reduce((a, c) => (a[c.scope] = c, a), {})
|
|
69877
|
+
);
|
|
69874
69878
|
const token = "%[a-f0-9]{2}";
|
|
69875
69879
|
const singleMatcher = new RegExp("(" + token + ")|([^%]+?)", "gi");
|
|
69876
69880
|
const multiMatcher = new RegExp("(" + token + ")+", "gi");
|
|
@@ -74973,6 +74977,22 @@ html body {
|
|
|
74973
74977
|
return /* @__PURE__ */ jsxRuntimeExports.jsx(Row, { className: classes.formItem, children: /* @__PURE__ */ jsxRuntimeExports.jsx(Col, { span: 24, className: marginSize, children: getValue2() }) });
|
|
74974
74978
|
};
|
|
74975
74979
|
const BorderedListItem$1 = withWidth()(createWithStyles(styles$2)(BorderedListItem));
|
|
74980
|
+
const DOI_PREFIX_RE = /^(doi:|https?:\/\/(dx\.)?doi\.org\/)/i;
|
|
74981
|
+
const referenceHref = (reference) => {
|
|
74982
|
+
const csl = reference == null ? void 0 : reference.csl;
|
|
74983
|
+
if (csl == null ? void 0 : csl.URL) return csl.URL;
|
|
74984
|
+
if (csl == null ? void 0 : csl.DOI) return `https://doi.org/${csl.DOI.trim().replace(DOI_PREFIX_RE, "")}`;
|
|
74985
|
+
return void 0;
|
|
74986
|
+
};
|
|
74987
|
+
const ReferenceLink = ({ reference }) => {
|
|
74988
|
+
var _a2;
|
|
74989
|
+
const href = referenceHref(reference);
|
|
74990
|
+
if (!href || ((_a2 = reference.citation) == null ? void 0 : _a2.includes(href))) return null;
|
|
74991
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
|
|
74992
|
+
" ",
|
|
74993
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("a", { href, target: "_blank", rel: "noopener noreferrer", children: /* @__PURE__ */ jsxRuntimeExports.jsx(RefIcon$2, {}) })
|
|
74994
|
+
] });
|
|
74995
|
+
};
|
|
74976
74996
|
class ReferencePopover extends React.Component {
|
|
74977
74997
|
constructor(props) {
|
|
74978
74998
|
super(props);
|
|
@@ -74998,9 +75018,15 @@ html body {
|
|
|
74998
75018
|
} else if (error) {
|
|
74999
75019
|
return /* @__PURE__ */ jsxRuntimeExports.jsx(ErrorMsg, { error });
|
|
75000
75020
|
} else if (reference.length === 1) {
|
|
75001
|
-
return
|
|
75021
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
|
|
75022
|
+
reference[0].citation,
|
|
75023
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(ReferenceLink, { reference: reference[0] })
|
|
75024
|
+
] });
|
|
75002
75025
|
} else {
|
|
75003
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsx("ul", { children: reference.map((r2) => /* @__PURE__ */ jsxRuntimeExports.
|
|
75026
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx("ul", { children: reference.map((r2) => /* @__PURE__ */ jsxRuntimeExports.jsxs("li", { children: [
|
|
75027
|
+
r2.citation,
|
|
75028
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(ReferenceLink, { reference: r2 })
|
|
75029
|
+
] }, r2.id)) });
|
|
75004
75030
|
}
|
|
75005
75031
|
});
|
|
75006
75032
|
__publicField(this, "scrollToReference", (e2, id) => {
|
|
@@ -80521,7 +80547,7 @@ html body {
|
|
|
80521
80547
|
var _a2, _b2;
|
|
80522
80548
|
return /* @__PURE__ */ jsxRuntimeExports.jsxs(Row, { children: [
|
|
80523
80549
|
/* @__PURE__ */ jsxRuntimeExports.jsx(Col, { style: { paddingRight: "5px" }, children: get(referenceIndexMap, s.id) && /* @__PURE__ */ jsxRuntimeExports.jsx("span", { children: `[${get(referenceIndexMap, s.id)}]` }) }),
|
|
80524
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(Col, { span: 20, style: { paddingLeft: "18px" }, children: /* @__PURE__ */ jsxRuntimeExports.
|
|
80550
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(Col, { span: 20, style: { paddingLeft: "18px" }, children: /* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
80525
80551
|
XrGutter,
|
|
80526
80552
|
{
|
|
80527
80553
|
merged: ((_a2 = s == null ? void 0 : s.sourceDataset) == null ? void 0 : _a2.key) !== primarySourceDatasetKey,
|
|
@@ -80529,20 +80555,77 @@ html body {
|
|
|
80529
80555
|
datasetKey: s.datasetKey,
|
|
80530
80556
|
verbatimSourceKey: s == null ? void 0 : s.verbatimSourceKey,
|
|
80531
80557
|
sourceDatasetKey: (_b2 = s == null ? void 0 : s.sourceDataset) == null ? void 0 : _b2.key,
|
|
80532
|
-
children:
|
|
80533
|
-
|
|
80534
|
-
|
|
80535
|
-
|
|
80536
|
-
|
|
80537
|
-
|
|
80558
|
+
children: [
|
|
80559
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
80560
|
+
"span",
|
|
80561
|
+
{
|
|
80562
|
+
id: `col-reference-${s.id}`,
|
|
80563
|
+
dangerouslySetInnerHTML: {
|
|
80564
|
+
__html: linkifyHtml(purify.sanitize(s.citation))
|
|
80565
|
+
}
|
|
80538
80566
|
}
|
|
80539
|
-
|
|
80540
|
-
|
|
80567
|
+
),
|
|
80568
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(ReferenceLink, { reference: s })
|
|
80569
|
+
]
|
|
80541
80570
|
}
|
|
80542
80571
|
) })
|
|
80543
80572
|
] }, s.id);
|
|
80544
80573
|
}) });
|
|
80545
80574
|
};
|
|
80575
|
+
const CLB_DATASET_RE = /^clb(\d+)$/;
|
|
80576
|
+
const parseIdentifier = (identifier2, vocab) => {
|
|
80577
|
+
const colonIdx = identifier2.indexOf(":");
|
|
80578
|
+
if (colonIdx < 1) return { value: identifier2 };
|
|
80579
|
+
const scope = identifier2.slice(0, colonIdx);
|
|
80580
|
+
const value = identifier2.slice(colonIdx + 1);
|
|
80581
|
+
const clbMatch = scope.match(CLB_DATASET_RE);
|
|
80582
|
+
if (clbMatch) {
|
|
80583
|
+
return {
|
|
80584
|
+
scope: "clb",
|
|
80585
|
+
value,
|
|
80586
|
+
title: `ChecklistBank dataset ${clbMatch[1]}`,
|
|
80587
|
+
href: `${config.clbPortal}/dataset/${clbMatch[1]}/nameusage/${encodeURIComponent(value)}`
|
|
80588
|
+
};
|
|
80589
|
+
}
|
|
80590
|
+
const entry = vocab == null ? void 0 : vocab[scope];
|
|
80591
|
+
return {
|
|
80592
|
+
scope,
|
|
80593
|
+
value,
|
|
80594
|
+
title: (entry == null ? void 0 : entry.title) || scope,
|
|
80595
|
+
href: (entry == null ? void 0 : entry.resolver) ? entry.resolver.replace("{id}", encodeURIComponent(value)) : void 0
|
|
80596
|
+
};
|
|
80597
|
+
};
|
|
80598
|
+
const IdentifierChip = ({ scope, value, title, href }) => {
|
|
80599
|
+
const inner = /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
|
|
80600
|
+
scope && /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "col-identifier-scope", children: scope }),
|
|
80601
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "col-identifier-value", children: value })
|
|
80602
|
+
] });
|
|
80603
|
+
return href ? /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
80604
|
+
"a",
|
|
80605
|
+
{
|
|
80606
|
+
className: "col-identifier",
|
|
80607
|
+
href,
|
|
80608
|
+
target: "_blank",
|
|
80609
|
+
rel: "noopener noreferrer",
|
|
80610
|
+
title,
|
|
80611
|
+
children: inner
|
|
80612
|
+
}
|
|
80613
|
+
) : /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "col-identifier", title, children: inner });
|
|
80614
|
+
};
|
|
80615
|
+
const IdentifierList = ({ identifiers }) => {
|
|
80616
|
+
const [vocab, setVocab] = reactExports.useState(null);
|
|
80617
|
+
reactExports.useEffect(() => {
|
|
80618
|
+
let cancelled = false;
|
|
80619
|
+
getIdentifierScopeVocab().then((v2) => {
|
|
80620
|
+
if (!cancelled) setVocab(v2);
|
|
80621
|
+
}).catch(() => {
|
|
80622
|
+
});
|
|
80623
|
+
return () => {
|
|
80624
|
+
cancelled = true;
|
|
80625
|
+
};
|
|
80626
|
+
}, []);
|
|
80627
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "col-identifier-list", children: identifiers.map((id) => /* @__PURE__ */ jsxRuntimeExports.jsx(IdentifierChip, { ...parseIdentifier(String(id), vocab) }, id)) });
|
|
80628
|
+
};
|
|
80546
80629
|
var localizedFormat$2 = { exports: {} };
|
|
80547
80630
|
var localizedFormat$1 = localizedFormat$2.exports;
|
|
80548
80631
|
var hasRequiredLocalizedFormat;
|
|
@@ -88703,10 +88786,7 @@ Please report this to https://github.com/markedjs/marked.`, e2) {
|
|
|
88703
88786
|
]
|
|
88704
88787
|
}
|
|
88705
88788
|
),
|
|
88706
|
-
Array.isArray(get(taxon, "identifier")) && get(taxon, "identifier").length > 0 && /* @__PURE__ */ jsxRuntimeExports.jsx(PresentationItem$1, { md, label: "Other identifiers", children:
|
|
88707
|
-
i > 0 && ", ",
|
|
88708
|
-
String(id)
|
|
88709
|
-
] }, i)) }),
|
|
88789
|
+
Array.isArray(get(taxon, "identifier")) && get(taxon, "identifier").length > 0 && /* @__PURE__ */ jsxRuntimeExports.jsx(PresentationItem$1, { md, label: "Other identifiers", children: /* @__PURE__ */ jsxRuntimeExports.jsx(IdentifierList, { identifiers: get(taxon, "identifier") }) }),
|
|
88710
88790
|
get(taxon, "labelHtml") && /* @__PURE__ */ jsxRuntimeExports.jsx(PresentationItem$1, { md, label: "Name", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
88711
88791
|
"span",
|
|
88712
88792
|
{
|
|
@@ -88723,7 +88803,19 @@ Please report this to https://github.com/markedjs/marked.`, e2) {
|
|
|
88723
88803
|
sourceId: get(info, "source.secondarySources['published in'].id")
|
|
88724
88804
|
}
|
|
88725
88805
|
),
|
|
88726
|
-
|
|
88806
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("span", { className: "col-published-in", children: [
|
|
88807
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
88808
|
+
"span",
|
|
88809
|
+
{
|
|
88810
|
+
dangerouslySetInnerHTML: {
|
|
88811
|
+
__html: linkifyHtml(
|
|
88812
|
+
purify.sanitize(get(taxon, "name.publishedIn.citation"))
|
|
88813
|
+
)
|
|
88814
|
+
}
|
|
88815
|
+
}
|
|
88816
|
+
),
|
|
88817
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(ReferenceLink, { reference: get(taxon, "name.publishedIn") })
|
|
88818
|
+
] })
|
|
88727
88819
|
] }),
|
|
88728
88820
|
get(taxon, "status") && /* @__PURE__ */ jsxRuntimeExports.jsxs(PresentationItem$1, { md, label: "Checklist status", children: [
|
|
88729
88821
|
`${get(taxon, "status")} ${get(taxon, "name.rank")}`,
|