col-browser 2.6.1 → 2.6.2

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.
@@ -1,26 +0,0 @@
1
- import { j as r } from "./jsx-runtime-BzflLqGi.js";
2
- import n from "react";
3
- import { get as s } from "lodash-es";
4
- class i extends n.Component {
5
- render() {
6
- const { error: e } = this.props;
7
- return /* @__PURE__ */ r.jsxs("div", { children: [
8
- e.message && /* @__PURE__ */ r.jsx("h3", { children: e.message }),
9
- s(e, "response.data.message") && /* @__PURE__ */ r.jsx("p", { children: s(e, "response.data.message") }),
10
- s(e, "response.data.details") && /* @__PURE__ */ r.jsx("p", { children: s(e, "response.data.details") }),
11
- s(e, "config.method") && /* @__PURE__ */ r.jsxs("p", { children: [
12
- "HTTP method: ",
13
- /* @__PURE__ */ r.jsx("strong", { children: s(e, "config.method").toUpperCase() })
14
- ] }),
15
- s(e, "response.request.responseURL") && /* @__PURE__ */ r.jsx("p", { children: /* @__PURE__ */ r.jsx("a", { href: s(e, "response.request.responseURL"), target: "_blank", children: s(e, "response.request.responseURL") }) }),
16
- s(e, "config.data") && typeof s(e, "config.data") == "string" && /* @__PURE__ */ r.jsxs("div", { children: [
17
- /* @__PURE__ */ r.jsx("h4", { children: "Body:" }),
18
- /* @__PURE__ */ r.jsx("p", { children: s(e, "config.data") })
19
- ] })
20
- ] });
21
- }
22
- }
23
- export {
24
- i as E
25
- };
26
- //# sourceMappingURL=ErrorMsg-K8k5PPTp.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ErrorMsg-K8k5PPTp.js","sources":["../../src/components/ErrorMsg.js"],"sourcesContent":["import React from 'react';\nimport { get } from \"lodash-es\";\n\nclass ErrorMsg extends React.Component {\n\n render() {\n\n const { error } = this.props;\n return (\n <div>\n {error.message && <h3>\n {error.message}\n </h3>}\n {get(error, 'response.data.message') && <p>\n {get(error, 'response.data.message')}\n </p>}\n {get(error, 'response.data.details') && <p>\n {get(error, 'response.data.details')}\n </p>}\n {get(error, 'config.method') && <p>\n HTTP method: <strong>{get(error, 'config.method').toUpperCase()}</strong>\n </p>}\n {get(error, 'response.request.responseURL') &&\n <p><a href={get(error, 'response.request.responseURL')} target=\"_blank\">{get(error, 'response.request.responseURL')}</a></p>}\n {get(error, 'config.data') && typeof get(error, 'config.data') === 'string' && <div>\n <h4>Body:</h4>\n <p>\n {get(error, 'config.data')}\n </p></div>}\n </div>\n\n );\n }\n}\n\n\n\nexport default ErrorMsg;\n"],"names":["ErrorMsg","React","error","jsx","get","jsxs"],"mappings":";;;AAGA,MAAMA,UAAiBC,EAAM,UAAU;AAAA,EAEnC,SAAS;AAEL,UAAM,EAAE,OAAAC,MAAU,KAAK;AACvB,kCACK,OAAA,EACI,UAAA;AAAA,MAAAA,EAAM,WAAWC,gBAAAA,MAAC,MAAA,EACd,UAAAD,EAAM,SACX;AAAA,MACCE,EAAIF,GAAO,uBAAuB,2BAAM,KAAA,EACpC,UAAAE,EAAIF,GAAO,uBAAuB,EAAA,CACvC;AAAA,MACCE,EAAIF,GAAO,uBAAuB,2BAAM,KAAA,EACpC,UAAAE,EAAIF,GAAO,uBAAuB,EAAA,CACvC;AAAA,MACCE,EAAIF,GAAO,eAAe,4BAAM,KAAA,EAAE,UAAA;AAAA,QAAA;AAAA,8BACjB,UAAA,EAAQ,UAAAE,EAAIF,GAAO,eAAe,EAAE,cAAY,CAAE;AAAA,MAAA,GACpE;AAAA,MACCE,EAAIF,GAAO,8BAA8B,KACtCC,gBAAAA,EAAAA,IAAC,KAAA,EAAE,gCAAC,KAAA,EAAE,MAAMC,EAAIF,GAAO,8BAA8B,GAAG,QAAO,UAAU,YAAIA,GAAO,8BAA8B,GAAE,GAAI;AAAA,MAC1HE,EAAIF,GAAO,aAAa,KAAK,OAAOE,EAAIF,GAAO,aAAa,KAAM,YAAYG,gBAAAA,EAAAA,KAAC,OAAA,EAC5E,UAAA;AAAA,QAAAF,gBAAAA,EAAAA,IAAC,QAAG,UAAA,QAAA,CAAK;AAAA,QACTA,gBAAAA,EAAAA,IAAC,KAAA,EACA,UAAAC,EAAIF,GAAO,aAAa,EAAA,CAC9B;AAAA,MAAA,EAAA,CAAI;AAAA,IAAA,GACR;AAAA,EAGR;AACJ;"}
@@ -1,82 +0,0 @@
1
- import { j as e } from "./jsx-runtime-BzflLqGi.js";
2
- import { useState as c, useEffect as E, useRef as b } from "react";
3
- import { Tag as p, Popover as H } from "antd";
4
- import { c as L, L as O } from "./router-CssZk5qZ.js";
5
- import { c as $ } from "./config--bs_09I6.js";
6
- const f = {
7
- 14: "The data was created by the homotypic grouping algorithm"
8
- }, q = ({
9
- style: S = {},
10
- datasetKey: k,
11
- sourceDatasetKey: x,
12
- sourceId: I,
13
- popoverPlacement: w,
14
- verbatimSourceKey: n,
15
- sectorKey: W,
16
- createdBy: a
17
- }) => {
18
- const [l, m] = c(null), [R, d] = c(!1), [t, g] = c(null), [A, u] = c(!1), [i, C] = c(!1), r = x || (t == null ? void 0 : t.sourceDatasetKey), h = I || (t == null ? void 0 : t.sourceId);
19
- E(() => {
20
- i && n && !f[a] && M();
21
- }, [n, i]), E(() => {
22
- i && r && v(r);
23
- }, [i, r]);
24
- const v = (s) => {
25
- d(!0), L(`${$.dataApi}dataset/${s}`).then((o) => {
26
- d(!1), m(o.data);
27
- }).catch((o) => {
28
- console.error("Error fetching source dataset:", o), d(!1), m(null);
29
- });
30
- }, M = () => {
31
- u(!0), g(null), L(
32
- `${$.dataApi}dataset/${k}/verbatimsource/${n}`
33
- ).then((s) => {
34
- u(!1), g(s.data);
35
- }).catch((s) => {
36
- console.error("Error fetching verbatim record:", s), u(!1), g(null);
37
- });
38
- }, j = b(Math.random().toString(36).substring(2, 15)), P = ((t == null ? void 0 : t.sourceEntity) || "").toLowerCase().replace(/\s+/g, "") === "reference" ? "reference" : "taxon", y = h && r ? `https://www.checklistbank.org/dataset/${r}/${P}/${encodeURIComponent(
39
- h
40
- )}` : null, T = R || !!n && A, V = /* @__PURE__ */ e.jsxs("div", { style: { minWidth: "300px" }, children: [
41
- !!f[a] && /* @__PURE__ */ e.jsx("div", { children: f[a] }),
42
- /* @__PURE__ */ e.jsxs("div", { children: [
43
- /* @__PURE__ */ e.jsx("strong", { children: "Source:" }),
44
- " ",
45
- l ? /* @__PURE__ */ e.jsx(O, { to: "source", args: l.key, children: l.title }) : T ? "Loading..." : "—"
46
- ] }),
47
- y && /* @__PURE__ */ e.jsxs("div", { children: [
48
- /* @__PURE__ */ e.jsx("strong", { children: "ID:" }),
49
- " ",
50
- /* @__PURE__ */ e.jsx("a", { href: y, target: "_blank", rel: "noreferrer", children: h })
51
- ] }),
52
- (t == null ? void 0 : t.issues) && t.issues.length > 0 && /* @__PURE__ */ e.jsxs("div", { children: [
53
- /* @__PURE__ */ e.jsx("span", { children: "Issues: " }),
54
- t.issues.map((s, o) => /* @__PURE__ */ e.jsx(p, { style: { margin: "2px" }, children: s }, o))
55
- ] })
56
- ] }), D = {
57
- cursor: "pointer",
58
- fontFamily: "monospace",
59
- fontSize: "8px",
60
- fontWeight: 900,
61
- padding: "2px",
62
- lineHeight: "8px",
63
- verticalAlign: "middle",
64
- marginRight: "2px",
65
- ...S
66
- };
67
- return x || n ? /* @__PURE__ */ e.jsx("div", { style: { display: "inline" }, id: j.current, children: /* @__PURE__ */ e.jsx(
68
- H,
69
- {
70
- getPopupContainer: () => document.getElementById(j.current),
71
- content: V,
72
- trigger: "click",
73
- placement: w || "right",
74
- onOpenChange: C,
75
- children: /* @__PURE__ */ e.jsx(p, { color: "purple", style: D, children: "XR" })
76
- }
77
- ) }) : /* @__PURE__ */ e.jsx("div", { style: { display: "inline" }, children: /* @__PURE__ */ e.jsx(p, { color: "purple", style: { ...D, cursor: "default" }, children: "XR" }) });
78
- };
79
- export {
80
- q as M
81
- };
82
- //# sourceMappingURL=MergedDataBadge-DK53L3R8.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"MergedDataBadge-DK53L3R8.js","sources":["../../src/components/MergedDataBadge.js"],"sourcesContent":["import React, { useEffect, useState, useRef } from \"react\";\nimport { Tag, Popover } from \"antd\";\nimport client from \"../api/client\";\nimport config from \"../config\";\nimport { LinkTo } from \"../router\";\n\nconst createdByAlgorithm = {\n 14: \"The data was created by the homotypic grouping algorithm\",\n};\n\nconst MergedDataBadge = ({\n style = {},\n datasetKey,\n sourceDatasetKey,\n sourceId,\n popoverPlacement,\n verbatimSourceKey,\n sectorKey,\n createdBy,\n}) => {\n const [sourceDataset, setSourceDataset] = useState(null);\n const [sourceDatasetLoading, setSourceDatasetLoading] = useState(false);\n const [verbatimRecord, setVerbatimRecord] = useState(null);\n const [verbatimRecordLoading, setVerbatimRecordLoading] = useState(false);\n const [open, setOpen] = useState(false);\n\n // A merged record's provenance can arrive two ways: explicit props, or — for\n // merged usages, whose own sourceDatasetKey is null — only on the verbatim\n // source record. Resolve both so the popover can always name the source\n // dataset and link the source id when one exists.\n const effectiveSourceDatasetKey =\n sourceDatasetKey || verbatimRecord?.sourceDatasetKey;\n const effectiveSourceId = sourceId || verbatimRecord?.sourceId;\n\n // Fetch the verbatim record (carries sourceDatasetKey / sourceId / entity).\n useEffect(() => {\n if (open && verbatimSourceKey && !createdByAlgorithm[createdBy]) {\n getVerbatimRecord();\n }\n }, [verbatimSourceKey, open]);\n\n // Fetch the source dataset once its key is known — from the prop, or from the\n // verbatim record once that has loaded.\n useEffect(() => {\n if (open && effectiveSourceDatasetKey) {\n getSourceDataset(effectiveSourceDatasetKey);\n }\n }, [open, effectiveSourceDatasetKey]);\n\n const getSourceDataset = (key) => {\n setSourceDatasetLoading(true);\n client(`${config.dataApi}dataset/${key}`)\n .then((res) => {\n setSourceDatasetLoading(false);\n setSourceDataset(res.data);\n })\n .catch((err) => {\n console.error(\"Error fetching source dataset:\", err);\n setSourceDatasetLoading(false);\n setSourceDataset(null);\n });\n };\n\n const getVerbatimRecord = () => {\n setVerbatimRecordLoading(true);\n setVerbatimRecord(null);\n client(\n `${config.dataApi}dataset/${datasetKey}/verbatimsource/${verbatimSourceKey}`\n )\n .then((res) => {\n setVerbatimRecordLoading(false);\n setVerbatimRecord(res.data);\n })\n .catch((err) => {\n console.error(\"Error fetching verbatim record:\", err);\n setVerbatimRecordLoading(false);\n setVerbatimRecord(null);\n });\n };\n\n const idRef = useRef(Math.random().toString(36).substring(2, 15));\n\n // ChecklistBank link to the source record. References live under /reference;\n // everything else (the common name-usage case) under /taxon.\n const clbEntity = (verbatimRecord?.sourceEntity || \"\")\n .toLowerCase()\n .replace(/\\s+/g, \"\");\n const clbPath = clbEntity === \"reference\" ? \"reference\" : \"taxon\";\n const sourceRecordHref =\n effectiveSourceId && effectiveSourceDatasetKey\n ? `https://www.checklistbank.org/dataset/${effectiveSourceDatasetKey}/${clbPath}/${encodeURIComponent(\n effectiveSourceId\n )}`\n : null;\n\n const loadingSource =\n sourceDatasetLoading || (!!verbatimSourceKey && verbatimRecordLoading);\n\n const content = (\n <div style={{ minWidth: \"300px\" }}>\n {!!createdByAlgorithm[createdBy] && (\n <div>{createdByAlgorithm[createdBy]}</div>\n )}\n <div>\n <strong>Source:</strong>{\" \"}\n {sourceDataset ? (\n <LinkTo to=\"source\" args={sourceDataset.key}>\n {sourceDataset.title}\n </LinkTo>\n ) : loadingSource ? (\n \"Loading...\"\n ) : (\n \"—\"\n )}\n </div>\n {sourceRecordHref && (\n <div>\n <strong>ID:</strong>{\" \"}\n <a href={sourceRecordHref} target=\"_blank\" rel=\"noreferrer\">\n {effectiveSourceId}\n </a>\n </div>\n )}\n {verbatimRecord?.issues && verbatimRecord.issues.length > 0 && (\n <div>\n <span>Issues: </span>\n {verbatimRecord.issues.map((issue, index) => (\n <Tag key={index} style={{ margin: \"2px\" }}>\n {issue}\n </Tag>\n ))}\n </div>\n )}\n </div>\n );\n\n const tagStyle = {\n cursor: \"pointer\",\n fontFamily: \"monospace\",\n fontSize: \"8px\",\n fontWeight: 900,\n padding: \"2px\",\n lineHeight: \"8px\",\n verticalAlign: \"middle\",\n marginRight: \"2px\",\n ...style,\n };\n\n return !!sourceDatasetKey || !!verbatimSourceKey ? (\n <div style={{ display: \"inline\" }} id={idRef.current}>\n <Popover\n getPopupContainer={() => document.getElementById(idRef.current)}\n content={content}\n trigger={\"click\"}\n placement={popoverPlacement || \"right\"}\n onOpenChange={setOpen}\n >\n <Tag color=\"purple\" style={tagStyle}>\n XR\n </Tag>\n </Popover>\n </div>\n ) : (\n <div style={{ display: \"inline\" }}>\n <Tag color=\"purple\" style={{ ...tagStyle, cursor: \"default\" }}>\n XR\n </Tag>\n </div>\n );\n};\n\nexport default MergedDataBadge;\n"],"names":["createdByAlgorithm","MergedDataBadge","style","datasetKey","sourceDatasetKey","sourceId","popoverPlacement","verbatimSourceKey","sectorKey","createdBy","sourceDataset","setSourceDataset","useState","sourceDatasetLoading","setSourceDatasetLoading","verbatimRecord","setVerbatimRecord","verbatimRecordLoading","setVerbatimRecordLoading","open","setOpen","effectiveSourceDatasetKey","effectiveSourceId","useEffect","getVerbatimRecord","getSourceDataset","key","client","config","res","err","idRef","useRef","clbPath","sourceRecordHref","loadingSource","content","jsxs","jsx","LinkTo","issue","index","Tag","tagStyle","Popover"],"mappings":";;;;;AAMA,MAAMA,IAAqB;AAAA,EACzB,IAAI;AACN,GAEMC,IAAkB,CAAC;AAAA,EACvB,OAAAC,IAAQ,CAAA;AAAA,EACR,YAAAC;AAAA,EACA,kBAAAC;AAAA,EACA,UAAAC;AAAA,EACA,kBAAAC;AAAA,EACA,mBAAAC;AAAA,EACA,WAAAC;AAAA,EACA,WAAAC;AACF,MAAM;AACJ,QAAM,CAACC,GAAeC,CAAgB,IAAIC,EAAS,IAAI,GACjD,CAACC,GAAsBC,CAAuB,IAAIF,EAAS,EAAK,GAChE,CAACG,GAAgBC,CAAiB,IAAIJ,EAAS,IAAI,GACnD,CAACK,GAAuBC,CAAwB,IAAIN,EAAS,EAAK,GAClE,CAACO,GAAMC,CAAO,IAAIR,EAAS,EAAK,GAMhCS,IACJjB,MAAoBW,KAAA,gBAAAA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