col-browser 2.4.0 → 2.5.0
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/README.md +25 -2
- package/es/bibtex.js +1 -1
- package/es/chunks/{BibTex-79CCKAOK.js → BibTex-CyUpSmpY.js} +2 -2
- package/es/chunks/{BibTex-79CCKAOK.js.map → BibTex-CyUpSmpY.js.map} +1 -1
- package/es/chunks/{DatasetCitation-BXtAmjdZ.js → DatasetCitation-BnOkKDTv.js} +2 -2
- package/es/chunks/{DatasetCitation-BXtAmjdZ.js.map → DatasetCitation-BnOkKDTv.js.map} +1 -1
- package/es/chunks/{DatasetlogoWithFallback-Dava2uqZ.js → DatasetlogoWithFallback-DJEkjMJ1.js} +2 -2
- package/es/chunks/{DatasetlogoWithFallback-Dava2uqZ.js.map → DatasetlogoWithFallback-DJEkjMJ1.js.map} +1 -1
- package/es/chunks/Distributions-Dwjo7KhA.js +1173 -0
- package/es/chunks/Distributions-Dwjo7KhA.js.map +1 -0
- package/es/chunks/{MergedDataBadge-C1CgoRFz.js → MergedDataBadge-FvHUdT7B.js} +2 -2
- package/es/chunks/{MergedDataBadge-C1CgoRFz.js.map → MergedDataBadge-FvHUdT7B.js.map} +1 -1
- package/es/chunks/{TaxonBreakdown-DeWamLu_.js → TaxonBreakdown-D9g3tYXL.js} +2 -2
- package/es/chunks/{TaxonBreakdown-DeWamLu_.js.map → TaxonBreakdown-D9g3tYXL.js.map} +1 -1
- package/es/chunks/{XrGutter-CU7_QPAp.js → XrGutter-D3PMq-Dn.js} +2 -2
- package/es/chunks/{XrGutter-CU7_QPAp.js.map → XrGutter-D3PMq-Dn.js.map} +1 -1
- package/es/chunks/config-D4b3a4Yi.js +27 -0
- package/es/chunks/config-D4b3a4Yi.js.map +1 -0
- package/es/chunks/{dataset-BL6g4w0G.js → dataset-D_gmg2Zv.js} +2 -2
- package/es/chunks/{dataset-BL6g4w0G.js.map → dataset-D_gmg2Zv.js.map} +1 -1
- package/es/chunks/{enumeration-DM8Hb36g.js → enumeration-B-nIqCor.js} +2 -2
- package/es/chunks/{enumeration-DM8Hb36g.js.map → enumeration-B-nIqCor.js.map} +1 -1
- package/es/chunks/{sector-Qeo1zPxr.js → sector-CE-w32Gs.js} +2 -2
- package/es/chunks/{sector-Qeo1zPxr.js.map → sector-CE-w32Gs.js.map} +1 -1
- package/es/config.js +1 -1
- package/es/index.js +1 -1
- package/es/search.js +5 -5
- package/es/sourceDataset.js +4 -4
- package/es/sourceDatasetList.js +4 -4
- package/es/taxon.js +758 -754
- package/es/taxon.js.map +1 -1
- package/es/taxonBreakdown.js +2 -2
- package/es/taxonDistribution.js +21 -19
- package/es/taxonDistribution.js.map +1 -1
- package/es/tree.js +5 -5
- package/package.json +1 -1
- package/types/index.d.ts +18 -0
- package/umd/col-browser.js +43 -25
- 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/es/chunks/Distributions-Bd4hFYdS.js +0 -1169
- package/es/chunks/Distributions-Bd4hFYdS.js.map +0 -1
- package/es/chunks/config-D1NH4DTr.js +0 -22
- package/es/chunks/config-D1NH4DTr.js.map +0 -1
package/es/taxonBreakdown.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { w } from "./chunks/withTheme-Dh6PRuII.js";
|
|
2
2
|
import { j as o } from "./chunks/jsx-runtime-BzflLqGi.js";
|
|
3
|
-
import { T } from "./chunks/TaxonBreakdown-
|
|
3
|
+
import { T } from "./chunks/TaxonBreakdown-D9g3tYXL.js";
|
|
4
4
|
import { useState as e, useEffect as A } from "react";
|
|
5
5
|
import { s as b, c as r, R as v, b as B } from "./chunks/router-CssZk5qZ.js";
|
|
6
|
-
import { c as s } from "./chunks/config-
|
|
6
|
+
import { c as s } from "./chunks/config-D4b3a4Yi.js";
|
|
7
7
|
import { Row as D, Col as C, Spin as E } from "antd";
|
|
8
8
|
const S = ({
|
|
9
9
|
taxonId: n,
|
package/es/taxonDistribution.js
CHANGED
|
@@ -1,25 +1,26 @@
|
|
|
1
|
-
import { w as
|
|
1
|
+
import { w as $ } from "./chunks/withTheme-Dh6PRuII.js";
|
|
2
2
|
import { j as n } from "./chunks/jsx-runtime-BzflLqGi.js";
|
|
3
|
-
import { useState as a, useEffect as
|
|
4
|
-
import { s as
|
|
5
|
-
import { c as l } from "./chunks/config-
|
|
6
|
-
import { Row as
|
|
7
|
-
import { D as
|
|
8
|
-
const
|
|
3
|
+
import { useState as a, useEffect as D } from "react";
|
|
4
|
+
import { s as T, c as s, R as g, b as k } from "./chunks/router-CssZk5qZ.js";
|
|
5
|
+
import { c as l } from "./chunks/config-D4b3a4Yi.js";
|
|
6
|
+
import { Row as v, Col as w, Spin as A } from "antd";
|
|
7
|
+
import { D as C } from "./chunks/Distributions-Dwjo7KhA.js";
|
|
8
|
+
const E = ({
|
|
9
9
|
taxonId: o,
|
|
10
10
|
datasetKey: i,
|
|
11
11
|
gbifChecklistKey: d,
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
12
|
+
basemapStyle: x,
|
|
13
|
+
style: b,
|
|
14
|
+
auth: h,
|
|
15
|
+
...j
|
|
15
16
|
}) => {
|
|
16
|
-
|
|
17
|
-
const [u, p] = a(null), [c, m] = a(null), [f,
|
|
18
|
-
return
|
|
17
|
+
T(h);
|
|
18
|
+
const [u, p] = a(null), [c, m] = a(null), [f, R] = a([]);
|
|
19
|
+
return D(() => {
|
|
19
20
|
let r = !1;
|
|
20
21
|
if (p(null), m(null), !(!o || !i))
|
|
21
22
|
return s(`${l.dataApi}vocab/rank`).then((t) => {
|
|
22
|
-
r ||
|
|
23
|
+
r || R(t.data.map((e) => e.name));
|
|
23
24
|
}), s(
|
|
24
25
|
`${l.dataApi}dataset/${i}/taxon/${encodeURIComponent(o)}`
|
|
25
26
|
).then((t) => {
|
|
@@ -32,20 +33,21 @@ const C = ({
|
|
|
32
33
|
}), () => {
|
|
33
34
|
r = !0;
|
|
34
35
|
};
|
|
35
|
-
}, [o, i]), /* @__PURE__ */ n.jsx(
|
|
36
|
-
|
|
36
|
+
}, [o, i]), /* @__PURE__ */ n.jsx(g.Provider, { value: k(j), children: !u || c === null || f.length === 0 ? /* @__PURE__ */ n.jsx(v, { justify: "center", style: { padding: "24px" }, children: /* @__PURE__ */ n.jsx(w, { children: /* @__PURE__ */ n.jsx(A, { size: "large" }) }) }) : /* @__PURE__ */ n.jsx(
|
|
37
|
+
C,
|
|
37
38
|
{
|
|
38
39
|
data: c,
|
|
39
40
|
datasetKey: i,
|
|
40
41
|
focalTaxon: u,
|
|
41
42
|
rankOrder: f,
|
|
42
43
|
gbifChecklistKey: d,
|
|
44
|
+
basemapStyle: x,
|
|
43
45
|
showDistributionMap: !0,
|
|
44
|
-
style:
|
|
46
|
+
style: b
|
|
45
47
|
}
|
|
46
48
|
) });
|
|
47
|
-
},
|
|
49
|
+
}, q = $(E);
|
|
48
50
|
export {
|
|
49
|
-
|
|
51
|
+
q as TaxonDistribution
|
|
50
52
|
};
|
|
51
53
|
//# sourceMappingURL=taxonDistribution.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"taxonDistribution.js","sources":["../src/Taxon/DistributionsWrapper.js","../src/entries/taxonDistribution.js"],"sourcesContent":["import React, { useEffect, useState } from \"react\";\nimport client, { setAuth } from \"../api/client\";\nimport config from \"../config\";\nimport { Row, Col, Spin } from \"antd\";\nimport Distributions from \"./Distributions\";\nimport { RouterContext, buildRouter } from \"../router\";\n\n// Standalone wrapper around the Taxon page's Distributions block.\n// Loads the focal taxon, its info (which carries the distributions array),\n// and the rank vocabulary — same data the Taxon page already loads — so\n// embedders can drop the map onto any page given just (datasetKey, taxonId).\nexport const DistributionsWrapper = ({\n taxonId,\n datasetKey,\n gbifChecklistKey,\n style,\n auth,\n ...routerProps\n}) => {\n // Private candidate releases (preview/dev) require Basic auth on every call,\n // including the taxon/info/rank fetches below via `client`.\n setAuth(auth);\n const [taxon, setTaxon] = useState(null);\n const [distributions, setDistributions] = useState(null);\n const [rank, setRank] = useState([]);\n\n useEffect(() => {\n let cancelled = false;\n setTaxon(null);\n setDistributions(null);\n\n if (!taxonId || !datasetKey) return undefined;\n\n client(`${config.dataApi}vocab/rank`).then((res) => {\n if (!cancelled) setRank(res.data.map((r) => r.name));\n });\n client(\n `${config.dataApi}dataset/${datasetKey}/taxon/${encodeURIComponent(taxonId)}`\n ).then((res) => {\n if (!cancelled) setTaxon(res.data);\n });\n client(\n `${config.dataApi}dataset/${datasetKey}/taxon/${encodeURIComponent(taxonId)}/info`\n ).then((res) => {\n if (!cancelled) setDistributions(res?.data?.distributions || []);\n });\n\n return () => {\n cancelled = true;\n };\n }, [taxonId, datasetKey]);\n\n return (\n <RouterContext.Provider value={buildRouter(routerProps)}>\n {!taxon || distributions === null || rank.length === 0 ? (\n <Row justify=\"center\" style={{ padding: \"24px\" }}>\n <Col>\n <Spin size=\"large\" />\n </Col>\n </Row>\n ) : (\n <Distributions\n data={distributions}\n datasetKey={datasetKey}\n focalTaxon={taxon}\n rankOrder={rank}\n gbifChecklistKey={gbifChecklistKey}\n showDistributionMap={true}\n style={style}\n />\n )}\n </RouterContext.Provider>\n );\n};\n\nexport default DistributionsWrapper;\n","import { withTheme } from \"../withTheme\";\nimport { DistributionsWrapper } from \"../Taxon/DistributionsWrapper\";\n\nexport const TaxonDistribution = withTheme(DistributionsWrapper);\n"],"names":["DistributionsWrapper","taxonId","datasetKey","gbifChecklistKey","style","auth","routerProps","setAuth","taxon","setTaxon","useState","distributions","setDistributions","rank","setRank","useEffect","cancelled","client","config","res","r","_a","jsx","RouterContext","buildRouter","Row","Col","Spin","Distributions","TaxonDistribution","withTheme"],"mappings":";;;;;;;AAWO,MAAMA,IAAuB,CAAC;AAAA,EACnC,SAAAC;AAAA,EACA,YAAAC;AAAA,EACA,kBAAAC;AAAA,EACA,OAAAC;AAAA,EACA,MAAAC;AAAA,EACA,GAAGC;AACL,MAAM;AAGJ,EAAAC,EAAQF,CAAI;AACZ,QAAM,CAACG,GAAOC,CAAQ,IAAIC,EAAS,IAAI,GACjC,CAACC,GAAeC,CAAgB,IAAIF,EAAS,IAAI,GACjD,CAACG,GAAMC,CAAO,IAAIJ,EAAS,CAAA,CAAE;AAEnC,SAAAK,EAAU,MAAM;AACd,QAAIC,IAAY;AAIhB,QAHAP,EAAS,IAAI,GACbG,EAAiB,IAAI,GAEjB,
|
|
1
|
+
{"version":3,"file":"taxonDistribution.js","sources":["../src/Taxon/DistributionsWrapper.js","../src/entries/taxonDistribution.js"],"sourcesContent":["import React, { useEffect, useState } from \"react\";\nimport client, { setAuth } from \"../api/client\";\nimport config from \"../config\";\nimport { Row, Col, Spin } from \"antd\";\nimport Distributions from \"./Distributions\";\nimport { RouterContext, buildRouter } from \"../router\";\n\n// Standalone wrapper around the Taxon page's Distributions block.\n// Loads the focal taxon, its info (which carries the distributions array),\n// and the rank vocabulary — same data the Taxon page already loads — so\n// embedders can drop the map onto any page given just (datasetKey, taxonId).\nexport const DistributionsWrapper = ({\n taxonId,\n datasetKey,\n gbifChecklistKey,\n basemapStyle,\n style,\n auth,\n ...routerProps\n}) => {\n // Private candidate releases (preview/dev) require Basic auth on every call,\n // including the taxon/info/rank fetches below via `client`.\n setAuth(auth);\n const [taxon, setTaxon] = useState(null);\n const [distributions, setDistributions] = useState(null);\n const [rank, setRank] = useState([]);\n\n useEffect(() => {\n let cancelled = false;\n setTaxon(null);\n setDistributions(null);\n\n if (!taxonId || !datasetKey) return undefined;\n\n client(`${config.dataApi}vocab/rank`).then((res) => {\n if (!cancelled) setRank(res.data.map((r) => r.name));\n });\n client(\n `${config.dataApi}dataset/${datasetKey}/taxon/${encodeURIComponent(taxonId)}`\n ).then((res) => {\n if (!cancelled) setTaxon(res.data);\n });\n client(\n `${config.dataApi}dataset/${datasetKey}/taxon/${encodeURIComponent(taxonId)}/info`\n ).then((res) => {\n if (!cancelled) setDistributions(res?.data?.distributions || []);\n });\n\n return () => {\n cancelled = true;\n };\n }, [taxonId, datasetKey]);\n\n return (\n <RouterContext.Provider value={buildRouter(routerProps)}>\n {!taxon || distributions === null || rank.length === 0 ? (\n <Row justify=\"center\" style={{ padding: \"24px\" }}>\n <Col>\n <Spin size=\"large\" />\n </Col>\n </Row>\n ) : (\n <Distributions\n data={distributions}\n datasetKey={datasetKey}\n focalTaxon={taxon}\n rankOrder={rank}\n gbifChecklistKey={gbifChecklistKey}\n basemapStyle={basemapStyle}\n showDistributionMap={true}\n style={style}\n />\n )}\n </RouterContext.Provider>\n );\n};\n\nexport default DistributionsWrapper;\n","import { withTheme } from \"../withTheme\";\nimport { DistributionsWrapper } from \"../Taxon/DistributionsWrapper\";\n\nexport const TaxonDistribution = withTheme(DistributionsWrapper);\n"],"names":["DistributionsWrapper","taxonId","datasetKey","gbifChecklistKey","basemapStyle","style","auth","routerProps","setAuth","taxon","setTaxon","useState","distributions","setDistributions","rank","setRank","useEffect","cancelled","client","config","res","r","_a","jsx","RouterContext","buildRouter","Row","Col","Spin","Distributions","TaxonDistribution","withTheme"],"mappings":";;;;;;;AAWO,MAAMA,IAAuB,CAAC;AAAA,EACnC,SAAAC;AAAA,EACA,YAAAC;AAAA,EACA,kBAAAC;AAAA,EACA,cAAAC;AAAA,EACA,OAAAC;AAAA,EACA,MAAAC;AAAA,EACA,GAAGC;AACL,MAAM;AAGJ,EAAAC,EAAQF,CAAI;AACZ,QAAM,CAACG,GAAOC,CAAQ,IAAIC,EAAS,IAAI,GACjC,CAACC,GAAeC,CAAgB,IAAIF,EAAS,IAAI,GACjD,CAACG,GAAMC,CAAO,IAAIJ,EAAS,CAAA,CAAE;AAEnC,SAAAK,EAAU,MAAM;AACd,QAAIC,IAAY;AAIhB,QAHAP,EAAS,IAAI,GACbG,EAAiB,IAAI,GAEjB,GAACZ,KAAW,CAACC;AAEjB,aAAAgB,EAAO,GAAGC,EAAO,OAAO,YAAY,EAAE,KAAK,CAACC,MAAQ;AAClD,QAAKH,KAAWF,EAAQK,EAAI,KAAK,IAAI,CAACC,MAAMA,EAAE,IAAI,CAAC;AAAA,MACrD,CAAC,GACDH;AAAA,QACE,GAAGC,EAAO,OAAO,WAAWjB,CAAU,UAAU,mBAAmBD,CAAO,CAAC;AAAA,MAAA,EAC3E,KAAK,CAACmB,MAAQ;AACd,QAAKH,KAAWP,EAASU,EAAI,IAAI;AAAA,MACnC,CAAC,GACDF;AAAA,QACE,GAAGC,EAAO,OAAO,WAAWjB,CAAU,UAAU,mBAAmBD,CAAO,CAAC;AAAA,MAAA,EAC3E,KAAK,CAACmB,MAAQ;;AACd,QAAKH,KAAWJ,IAAiBS,IAAAF,KAAA,gBAAAA,EAAK,SAAL,gBAAAE,EAAW,kBAAiB,EAAE;AAAA,MACjE,CAAC,GAEM,MAAM;AACX,QAAAL,IAAY;AAAA,MACd;AAAA,EACF,GAAG,CAAChB,GAASC,CAAU,CAAC,GAGtBqB,gBAAAA,EAAAA,IAACC,EAAc,UAAd,EAAuB,OAAOC,EAAYlB,CAAW,GACnD,UAAA,CAACE,KAASG,MAAkB,QAAQE,EAAK,WAAW,IACnDS,gBAAAA,EAAAA,IAACG,GAAA,EAAI,SAAQ,UAAS,OAAO,EAAE,SAAS,UACtC,UAAAH,gBAAAA,EAAAA,IAACI,GAAA,EACC,UAAAJ,gBAAAA,EAAAA,IAACK,GAAA,EAAK,MAAK,QAAA,CAAQ,EAAA,CACrB,GACF,IAEAL,gBAAAA,EAAAA;AAAAA,IAACM;AAAAA,IAAA;AAAA,MACC,MAAMjB;AAAA,MACN,YAAAV;AAAA,MACA,YAAYO;AAAA,MACZ,WAAWK;AAAA,MACX,kBAAAX;AAAA,MACA,cAAAC;AAAA,MACA,qBAAqB;AAAA,MACrB,OAAAC;AAAA,IAAA;AAAA,EAAA,GAGN;AAEJ,GCxEayB,IAAoBC,EAAU/B,CAAoB;"}
|
package/es/tree.js
CHANGED
|
@@ -8,13 +8,13 @@ import j, { createContext as at } from "react";
|
|
|
8
8
|
import { Popover as ot, Divider as it, Spin as q, Tag as nt, Alert as w, Skeleton as rt, Tree as lt, Button as dt, Row as ht, Col as I, Checkbox as N } from "antd";
|
|
9
9
|
import { sortBy as _, get as m, isUndefined as A, flatten as ct, isArray as O } from "lodash-es";
|
|
10
10
|
import { L as P, c as K, R as H, s as ut, b as pt } from "./chunks/router-CssZk5qZ.js";
|
|
11
|
-
import { c as D } from "./chunks/config-
|
|
11
|
+
import { c as D } from "./chunks/config-D4b3a4Yi.js";
|
|
12
12
|
import L from "dataloader";
|
|
13
|
-
import { c as V, b as z, g as ft } from "./chunks/dataset-
|
|
14
|
-
import { M as xt } from "./chunks/MergedDataBadge-
|
|
13
|
+
import { c as V, b as z, g as ft } from "./chunks/dataset-D_gmg2Zv.js";
|
|
14
|
+
import { M as xt } from "./chunks/MergedDataBadge-FvHUdT7B.js";
|
|
15
15
|
import { E as gt } from "./chunks/ErrorMsg-K8k5PPTp.js";
|
|
16
|
-
import { g as yt } from "./chunks/sector-
|
|
17
|
-
import { C as R, N as mt } from "./chunks/DatasetCitation-
|
|
16
|
+
import { g as yt } from "./chunks/sector-CE-w32Gs.js";
|
|
17
|
+
import { C as R, N as mt } from "./chunks/DatasetCitation-BnOkKDTv.js";
|
|
18
18
|
import { r as F, w as M } from "./chunks/storage-BgdCo9fV.js";
|
|
19
19
|
const E = at({
|
|
20
20
|
datasetLoader: null,
|
package/package.json
CHANGED
package/types/index.d.ts
CHANGED
|
@@ -82,6 +82,12 @@ export interface TaxonProps
|
|
|
82
82
|
identifierLabel?: string;
|
|
83
83
|
showDistributionMap?: boolean;
|
|
84
84
|
gbifChecklistKey?: string | number;
|
|
85
|
+
/**
|
|
86
|
+
* MapLibre basemap for the distribution map: a style URL (with your
|
|
87
|
+
* provider's API key baked in) or an inline style object. Overrides the
|
|
88
|
+
* global `configure({ basemapStyle })` default for this instance.
|
|
89
|
+
*/
|
|
90
|
+
basemapStyle?: string | Record<string, unknown>;
|
|
85
91
|
/** HTTP Basic Auth credentials in `user:password` form. */
|
|
86
92
|
auth?: string;
|
|
87
93
|
}
|
|
@@ -126,6 +132,12 @@ export interface TaxonDistributionProps extends ThemeProps, NavigationProps {
|
|
|
126
132
|
taxonId?: string;
|
|
127
133
|
datasetKey?: string | number;
|
|
128
134
|
gbifChecklistKey?: string | number;
|
|
135
|
+
/**
|
|
136
|
+
* MapLibre basemap for the distribution map: a style URL (with your
|
|
137
|
+
* provider's API key baked in) or an inline style object. Overrides the
|
|
138
|
+
* global `configure({ basemapStyle })` default for this instance.
|
|
139
|
+
*/
|
|
140
|
+
basemapStyle?: string | Record<string, unknown>;
|
|
129
141
|
style?: React.CSSProperties;
|
|
130
142
|
/** HTTP Basic Auth credentials in `user:password` form. */
|
|
131
143
|
auth?: string;
|
|
@@ -141,6 +153,12 @@ export interface ColBrowserConfig {
|
|
|
141
153
|
gbifApi: string;
|
|
142
154
|
/** GBIF portal the occurrence attribution link points at. */
|
|
143
155
|
gbifPortal: string;
|
|
156
|
+
/**
|
|
157
|
+
* MapLibre basemap for the distribution map: a style URL (with your
|
|
158
|
+
* provider's API key baked in) or an inline style object. Defaults to
|
|
159
|
+
* CARTO's keyless Positron CDN. Stored verbatim — not URL-normalised.
|
|
160
|
+
*/
|
|
161
|
+
basemapStyle: string | Record<string, unknown>;
|
|
144
162
|
}
|
|
145
163
|
|
|
146
164
|
/**
|
package/umd/col-browser.js
CHANGED
|
@@ -67804,13 +67804,19 @@ html body {
|
|
|
67804
67804
|
gbifApi: "https://api.gbif.org",
|
|
67805
67805
|
// GBIF human-facing portal where the attribution link points. The
|
|
67806
67806
|
// multitaxonomy occurrence search now ships on the production portal.
|
|
67807
|
-
gbifPortal: "https://www.gbif.org"
|
|
67807
|
+
gbifPortal: "https://www.gbif.org",
|
|
67808
|
+
// MapLibre basemap for the distribution map. Anything MapLibre accepts as
|
|
67809
|
+
// `style` works: a style URL (bake your provider's API key into it) or an
|
|
67810
|
+
// inline style object. The default is CARTO's public Positron CDN, which
|
|
67811
|
+
// needs no key.
|
|
67812
|
+
basemapStyle: "https://basemaps.cartocdn.com/gl/positron-gl-style/style.json"
|
|
67808
67813
|
};
|
|
67809
67814
|
const SLASH_TERMINATED = /* @__PURE__ */ new Set(["dataApi"]);
|
|
67815
|
+
const VERBATIM = /* @__PURE__ */ new Set(["basemapStyle"]);
|
|
67810
67816
|
const normalize = (key2, value) => SLASH_TERMINATED.has(key2) ? value.replace(/\/*$/, "/") : value.replace(/\/+$/, "");
|
|
67811
67817
|
function configure(overrides = {}) {
|
|
67812
67818
|
Object.entries(overrides).forEach(([key2, value]) => {
|
|
67813
|
-
config[key2] = typeof value === "string" ? normalize(key2, value) : value;
|
|
67819
|
+
config[key2] = typeof value === "string" && !VERBATIM.has(key2) ? normalize(key2, value) : value;
|
|
67814
67820
|
});
|
|
67815
67821
|
return config;
|
|
67816
67822
|
}
|
|
@@ -77980,6 +77986,7 @@ html body {
|
|
|
77980
77986
|
});
|
|
77981
77987
|
return out;
|
|
77982
77988
|
};
|
|
77989
|
+
const resolveBasemapStyle = (prop) => prop ?? config.basemapStyle;
|
|
77983
77990
|
const wrapStyle = {
|
|
77984
77991
|
position: "absolute",
|
|
77985
77992
|
bottom: 8,
|
|
@@ -78136,7 +78143,6 @@ html body {
|
|
|
78136
78143
|
const k = resolveKey(record);
|
|
78137
78144
|
return k == null ? MISSING_COLOR : ESTABLISHMENT_COLORS[k];
|
|
78138
78145
|
};
|
|
78139
|
-
const POSITRON_STYLE = "https://basemaps.cartocdn.com/gl/positron-gl-style/style.json";
|
|
78140
78146
|
const GBIF_VISIBLE_KEY = "gbif-visible";
|
|
78141
78147
|
const readStoredGbifVisible = (defaultValue) => readSetting(GBIF_VISIBLE_KEY, defaultValue);
|
|
78142
78148
|
const writeStoredGbifVisible = (visible) => writeSetting(GBIF_VISIBLE_KEY, visible);
|
|
@@ -78249,7 +78255,10 @@ html body {
|
|
|
78249
78255
|
// true | null → show GBIF layer; false → GBIF API returned 0 occurrences,
|
|
78250
78256
|
// grey out the toggle and skip loading tiles. Defaults to true so the
|
|
78251
78257
|
// component works without the count check.
|
|
78252
|
-
gbifAvailable = true
|
|
78258
|
+
gbifAvailable = true,
|
|
78259
|
+
// MapLibre style URL or inline style object; falls back to the global
|
|
78260
|
+
// `configure({ basemapStyle })` value. Changing it rebuilds the map.
|
|
78261
|
+
basemapStyle
|
|
78253
78262
|
}) => {
|
|
78254
78263
|
var _a2;
|
|
78255
78264
|
const containerRef = reactExports.useRef(null);
|
|
@@ -78262,7 +78271,7 @@ html body {
|
|
|
78262
78271
|
const focalAttachedRef = reactExports.useRef(false);
|
|
78263
78272
|
const gbifAttachedRef = reactExports.useRef(false);
|
|
78264
78273
|
const descendantLayersRef = reactExports.useRef(/* @__PURE__ */ new Set());
|
|
78265
|
-
const [
|
|
78274
|
+
const [readyMap, setReadyMap] = reactExports.useState(null);
|
|
78266
78275
|
const [focalReady, setFocalReady] = reactExports.useState(false);
|
|
78267
78276
|
const [descendantState, setDescendantState] = reactExports.useState({
|
|
78268
78277
|
status: "idle",
|
|
@@ -78335,12 +78344,14 @@ html body {
|
|
|
78335
78344
|
return { visibleGroups, unmappableGroups };
|
|
78336
78345
|
}, [descendantState, descendantColors, visibleTaxonIds]);
|
|
78337
78346
|
const showDescendantLegend = descendantLegend.visibleGroups.length > 0;
|
|
78347
|
+
const styleSpec = resolveBasemapStyle(basemapStyle);
|
|
78348
|
+
const styleKey = typeof styleSpec === "string" ? styleSpec : JSON.stringify(styleSpec);
|
|
78338
78349
|
reactExports.useEffect(() => {
|
|
78339
78350
|
if (!containerRef.current || mapRef.current) return;
|
|
78340
78351
|
if (!supported()) return;
|
|
78341
78352
|
const map = new maplibregl.Map({
|
|
78342
78353
|
container: containerRef.current,
|
|
78343
|
-
style:
|
|
78354
|
+
style: styleSpec,
|
|
78344
78355
|
center: [0, 20],
|
|
78345
78356
|
zoom: 1,
|
|
78346
78357
|
minZoom: 0,
|
|
@@ -78361,7 +78372,7 @@ html body {
|
|
|
78361
78372
|
);
|
|
78362
78373
|
mapRef.current = map;
|
|
78363
78374
|
map.on("load", () => {
|
|
78364
|
-
|
|
78375
|
+
setReadyMap(map);
|
|
78365
78376
|
const attrib = map.getContainer().querySelector(".maplibregl-ctrl-attrib");
|
|
78366
78377
|
if (attrib) attrib.classList.remove("maplibregl-compact-show");
|
|
78367
78378
|
});
|
|
@@ -78378,12 +78389,12 @@ html body {
|
|
|
78378
78389
|
focalAttachedRef.current = false;
|
|
78379
78390
|
gbifAttachedRef.current = false;
|
|
78380
78391
|
descendantLayersRef.current = /* @__PURE__ */ new Set();
|
|
78392
|
+
setReadyMap(null);
|
|
78381
78393
|
};
|
|
78382
|
-
}, []);
|
|
78394
|
+
}, [styleKey]);
|
|
78383
78395
|
reactExports.useEffect(() => {
|
|
78384
|
-
|
|
78385
|
-
|
|
78386
|
-
if (!map) return;
|
|
78396
|
+
const map = readyMap;
|
|
78397
|
+
if (!map || !(records == null ? void 0 : records.length)) return;
|
|
78387
78398
|
let cancelled = false;
|
|
78388
78399
|
setFocalReady(false);
|
|
78389
78400
|
Promise.allSettled(
|
|
@@ -78394,7 +78405,7 @@ html body {
|
|
|
78394
78405
|
}))
|
|
78395
78406
|
)
|
|
78396
78407
|
).then((results) => {
|
|
78397
|
-
if (cancelled) return;
|
|
78408
|
+
if (cancelled || mapRef.current !== map) return;
|
|
78398
78409
|
const features = [];
|
|
78399
78410
|
const recordMap = /* @__PURE__ */ new Map();
|
|
78400
78411
|
let failures = 0;
|
|
@@ -78464,7 +78475,7 @@ html body {
|
|
|
78464
78475
|
return () => {
|
|
78465
78476
|
cancelled = true;
|
|
78466
78477
|
};
|
|
78467
|
-
}, [
|
|
78478
|
+
}, [readyMap, records]);
|
|
78468
78479
|
const onFocalClick = (e2) => {
|
|
78469
78480
|
var _a3, _b2;
|
|
78470
78481
|
const map = mapRef.current;
|
|
@@ -78492,8 +78503,7 @@ html body {
|
|
|
78492
78503
|
if (map.getLayer(FOCAL_LINE)) map.setLayoutProperty(FOCAL_LINE, "visibility", v2);
|
|
78493
78504
|
}, [focalVisible, focalReady]);
|
|
78494
78505
|
reactExports.useEffect(() => {
|
|
78495
|
-
|
|
78496
|
-
const map = mapRef.current;
|
|
78506
|
+
const map = readyMap;
|
|
78497
78507
|
if (!map) return;
|
|
78498
78508
|
const removeGbif = () => {
|
|
78499
78509
|
if (map.getLayer(GBIF_LAYER)) map.removeLayer(GBIF_LAYER);
|
|
@@ -78519,16 +78529,16 @@ html body {
|
|
|
78519
78529
|
layout: { visibility: gbifVisible ? "visible" : "none" }
|
|
78520
78530
|
});
|
|
78521
78531
|
gbifAttachedRef.current = true;
|
|
78522
|
-
}, [
|
|
78532
|
+
}, [readyMap, gbifChecklistKey, focalTaxon == null ? void 0 : focalTaxon.id, gbifAvailable]);
|
|
78523
78533
|
reactExports.useEffect(() => {
|
|
78524
78534
|
const map = mapRef.current;
|
|
78525
78535
|
if (!map || !gbifAttachedRef.current) return;
|
|
78526
78536
|
const v2 = gbifVisible ? "visible" : "none";
|
|
78527
78537
|
if (map.getLayer(GBIF_LAYER)) map.setLayoutProperty(GBIF_LAYER, "visibility", v2);
|
|
78528
78538
|
}, [gbifVisible]);
|
|
78539
|
+
const descendantVisibility = (id) => visibleTaxonIds.has(id) ? "visible" : "none";
|
|
78529
78540
|
reactExports.useEffect(() => {
|
|
78530
|
-
|
|
78531
|
-
const map = mapRef.current;
|
|
78541
|
+
const map = readyMap;
|
|
78532
78542
|
if (!map) return;
|
|
78533
78543
|
descendantLayersRef.current.forEach((id) => {
|
|
78534
78544
|
if (map.getLayer(descendantFillId(id))) map.removeLayer(descendantFillId(id));
|
|
@@ -78551,7 +78561,7 @@ html body {
|
|
|
78551
78561
|
}))
|
|
78552
78562
|
)
|
|
78553
78563
|
).then((results) => {
|
|
78554
|
-
if (
|
|
78564
|
+
if (mapRef.current !== map) return;
|
|
78555
78565
|
const features = [];
|
|
78556
78566
|
results.forEach((res, i) => {
|
|
78557
78567
|
if (res.status !== "fulfilled" || !res.value.geojson) return;
|
|
@@ -78584,7 +78594,7 @@ html body {
|
|
|
78584
78594
|
type: "fill",
|
|
78585
78595
|
source: srcId,
|
|
78586
78596
|
paint: { "fill-color": color, "fill-opacity": 0.55 },
|
|
78587
|
-
layout: { visibility:
|
|
78597
|
+
layout: { visibility: descendantVisibility(t2.id) }
|
|
78588
78598
|
},
|
|
78589
78599
|
beforeId
|
|
78590
78600
|
);
|
|
@@ -78594,7 +78604,7 @@ html body {
|
|
|
78594
78604
|
type: "line",
|
|
78595
78605
|
source: srcId,
|
|
78596
78606
|
paint: { "line-color": color, "line-width": 2 },
|
|
78597
|
-
layout: { visibility:
|
|
78607
|
+
layout: { visibility: descendantVisibility(t2.id) }
|
|
78598
78608
|
},
|
|
78599
78609
|
beforeId
|
|
78600
78610
|
);
|
|
@@ -78605,7 +78615,7 @@ html body {
|
|
|
78605
78615
|
}
|
|
78606
78616
|
});
|
|
78607
78617
|
});
|
|
78608
|
-
}, [
|
|
78618
|
+
}, [readyMap, descendantState, descendantColors]);
|
|
78609
78619
|
const onDescendantClick = (e2) => {
|
|
78610
78620
|
var _a3, _b2;
|
|
78611
78621
|
const map = mapRef.current;
|
|
@@ -79078,6 +79088,7 @@ html body {
|
|
|
79078
79088
|
focalTaxon,
|
|
79079
79089
|
rankOrder,
|
|
79080
79090
|
gbifChecklistKey,
|
|
79091
|
+
basemapStyle,
|
|
79081
79092
|
label,
|
|
79082
79093
|
md: md2
|
|
79083
79094
|
}) => {
|
|
@@ -79156,7 +79167,8 @@ html body {
|
|
|
79156
79167
|
focalTaxon,
|
|
79157
79168
|
rankOrder,
|
|
79158
79169
|
gbifChecklistKey,
|
|
79159
|
-
gbifAvailable
|
|
79170
|
+
gbifAvailable,
|
|
79171
|
+
basemapStyle
|
|
79160
79172
|
}
|
|
79161
79173
|
),
|
|
79162
79174
|
showToggle && unmappable > 0 && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { style: { marginTop: 6 }, children: /* @__PURE__ */ jsxRuntimeExports.jsxs("a", { onClick: () => setView("list"), style: { cursor: "pointer" }, children: [
|
|
@@ -88468,7 +88480,8 @@ Please report this to https://github.com/markedjs/marked.`, e2) {
|
|
|
88468
88480
|
const {
|
|
88469
88481
|
datasetKey,
|
|
88470
88482
|
showDistributionMap,
|
|
88471
|
-
gbifChecklistKey
|
|
88483
|
+
gbifChecklistKey,
|
|
88484
|
+
basemapStyle
|
|
88472
88485
|
} = this.props;
|
|
88473
88486
|
const {
|
|
88474
88487
|
taxon,
|
|
@@ -88776,7 +88789,8 @@ Please report this to https://github.com/markedjs/marked.`, e2) {
|
|
|
88776
88789
|
showDistributionMap,
|
|
88777
88790
|
focalTaxon: taxon,
|
|
88778
88791
|
rankOrder: rank,
|
|
88779
|
-
gbifChecklistKey
|
|
88792
|
+
gbifChecklistKey,
|
|
88793
|
+
basemapStyle
|
|
88780
88794
|
}
|
|
88781
88795
|
),
|
|
88782
88796
|
get(taxon, "environments") && /* @__PURE__ */ jsxRuntimeExports.jsx(PresentationItem$1, { md, label: "Environment(s)", children: get(taxon, "environments").join(", ") }),
|
|
@@ -88856,6 +88870,7 @@ Please report this to https://github.com/markedjs/marked.`, e2) {
|
|
|
88856
88870
|
identifierLabel,
|
|
88857
88871
|
showDistributionMap,
|
|
88858
88872
|
gbifChecklistKey,
|
|
88873
|
+
basemapStyle,
|
|
88859
88874
|
auth,
|
|
88860
88875
|
...routerProps
|
|
88861
88876
|
}) {
|
|
@@ -88868,6 +88883,7 @@ Please report this to https://github.com/markedjs/marked.`, e2) {
|
|
|
88868
88883
|
identifierLabel,
|
|
88869
88884
|
showDistributionMap,
|
|
88870
88885
|
gbifChecklistKey,
|
|
88886
|
+
basemapStyle,
|
|
88871
88887
|
auth
|
|
88872
88888
|
}
|
|
88873
88889
|
) });
|
|
@@ -89828,6 +89844,7 @@ Please report this to https://github.com/markedjs/marked.`, e2) {
|
|
|
89828
89844
|
taxonId,
|
|
89829
89845
|
datasetKey,
|
|
89830
89846
|
gbifChecklistKey,
|
|
89847
|
+
basemapStyle,
|
|
89831
89848
|
style: style2,
|
|
89832
89849
|
auth,
|
|
89833
89850
|
...routerProps
|
|
@@ -89867,6 +89884,7 @@ Please report this to https://github.com/markedjs/marked.`, e2) {
|
|
|
89867
89884
|
focalTaxon: taxon,
|
|
89868
89885
|
rankOrder: rank,
|
|
89869
89886
|
gbifChecklistKey,
|
|
89887
|
+
basemapStyle,
|
|
89870
89888
|
showDistributionMap: true,
|
|
89871
89889
|
style: style2
|
|
89872
89890
|
}
|