col-browser 2.4.0 → 2.6.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 +34 -2
- package/es/bibtex.js +1 -1
- package/es/chunks/{BibTex-79CCKAOK.js → BibTex-DRE71Hg-.js} +2 -2
- package/es/chunks/{BibTex-79CCKAOK.js.map → BibTex-DRE71Hg-.js.map} +1 -1
- package/es/chunks/{DatasetCitation-BXtAmjdZ.js → DatasetCitation-Cep2dces.js} +2 -2
- package/es/chunks/{DatasetCitation-BXtAmjdZ.js.map → DatasetCitation-Cep2dces.js.map} +1 -1
- package/es/chunks/{DatasetlogoWithFallback-Dava2uqZ.js → DatasetlogoWithFallback-Bb-kmHts.js} +2 -2
- package/es/chunks/{DatasetlogoWithFallback-Dava2uqZ.js.map → DatasetlogoWithFallback-Bb-kmHts.js.map} +1 -1
- package/es/chunks/Distributions-Czffme5Y.js +1185 -0
- package/es/chunks/Distributions-Czffme5Y.js.map +1 -0
- package/es/chunks/{MergedDataBadge-C1CgoRFz.js → MergedDataBadge-DK53L3R8.js} +2 -2
- package/es/chunks/{MergedDataBadge-C1CgoRFz.js.map → MergedDataBadge-DK53L3R8.js.map} +1 -1
- package/es/chunks/{TaxonBreakdown-DeWamLu_.js → TaxonBreakdown-DqdQ18QM.js} +2 -2
- package/es/chunks/{TaxonBreakdown-DeWamLu_.js.map → TaxonBreakdown-DqdQ18QM.js.map} +1 -1
- package/es/chunks/{XrGutter-CU7_QPAp.js → XrGutter-COJhHpia.js} +2 -2
- package/es/chunks/{XrGutter-CU7_QPAp.js.map → XrGutter-COJhHpia.js.map} +1 -1
- package/es/chunks/config--bs_09I6.js +32 -0
- package/es/chunks/config--bs_09I6.js.map +1 -0
- package/es/chunks/{dataset-BL6g4w0G.js → dataset-BZpjo3Yq.js} +2 -2
- package/es/chunks/{dataset-BL6g4w0G.js.map → dataset-BZpjo3Yq.js.map} +1 -1
- package/es/chunks/{enumeration-DM8Hb36g.js → enumeration-CV8i_q_O.js} +2 -2
- package/es/chunks/{enumeration-DM8Hb36g.js.map → enumeration-CV8i_q_O.js.map} +1 -1
- package/es/chunks/{sector-Qeo1zPxr.js → sector-ucUgPp75.js} +2 -2
- package/es/chunks/{sector-Qeo1zPxr.js.map → sector-ucUgPp75.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 +25 -0
- package/umd/col-browser.js +67 -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/README.md
CHANGED
|
@@ -207,9 +207,38 @@ configure({ dataApi: 'https://api.dev.checklistbank.org/' });
|
|
|
207
207
|
| `clbPortal` | `https://www.checklistbank.org` | outbound links to dataset / publisher pages |
|
|
208
208
|
| `gbifApi` | `https://api.gbif.org` | occurrence counts and distribution-map tiles |
|
|
209
209
|
| `gbifPortal` | `https://www.gbif.org` | the GBIF occurrence-search attribution link |
|
|
210
|
+
| `basemapStyle` | `https://basemaps.cartocdn.com/gl/positron-gl-style/style.json` | the MapLibre basemap under the distribution map |
|
|
211
|
+
| `cartoKey` | `""` | CARTO Basemaps API key, appended to every CARTO request the map makes |
|
|
210
212
|
|
|
211
213
|
`configure()` merges into the shared config, so keys you leave out keep their current value, and trailing slashes are normalised — pass the URL in either form. Components read the base URL as they render and as they fire each request, so call `configure()` before mounting; to switch endpoints at runtime, remount afterwards (the demo app does this with a React `key`).
|
|
212
214
|
|
|
215
|
+
#### Basemap
|
|
216
|
+
|
|
217
|
+
`basemapStyle` is the one key that is not a base URL, so it is stored verbatim — path, query string and API key survive untouched. It takes anything MapLibre accepts as `style`: a style URL with your provider's key baked in, or an inline style object.
|
|
218
|
+
|
|
219
|
+
`cartoKey` authenticates CARTO's own basemaps. CARTO's published styles are static files whose `glyphs`, `sprite` and vector-source URLs are absolute and key-free, so putting `?key=` in the style URL authenticates that one request and nothing else — while CARTO meters *tile* requests. Setting `cartoKey` instead installs a MapLibre `transformRequest` that appends the key to every `cartocdn.com` request the map makes, and leaves other hosts (GBIF occurrence tiles, ChecklistBank) alone:
|
|
220
|
+
|
|
221
|
+
```js
|
|
222
|
+
configure({ cartoKey: "your-carto-key" });
|
|
223
|
+
```
|
|
224
|
+
|
|
225
|
+
A key already baked into `basemapStyle` is left as-is. Leave `cartoKey` empty for a non-CARTO provider and bake that provider's key into `basemapStyle` instead.
|
|
226
|
+
|
|
227
|
+
```js
|
|
228
|
+
// your own CARTO account
|
|
229
|
+
configure({ basemapStyle: 'https://basemaps.cartocdn.com/gl/positron-gl-style/style.json?api_key=YOUR_KEY' });
|
|
230
|
+
|
|
231
|
+
// or another provider entirely
|
|
232
|
+
configure({ basemapStyle: 'https://api.maptiler.com/maps/basic-v2/style.json?key=YOUR_KEY' });
|
|
233
|
+
|
|
234
|
+
// or a style you host yourself
|
|
235
|
+
configure({ basemapStyle: { version: 8, sources: { … }, layers: [ … ] } });
|
|
236
|
+
```
|
|
237
|
+
|
|
238
|
+
The default is CARTO's public Positron CDN, which needs no key — check CARTO's terms before relying on it for production traffic. Map attribution comes from the style document, so switching providers updates the credit in the map's attribution control automatically.
|
|
239
|
+
|
|
240
|
+
`Taxon` and `TaxonDistribution` also take a `basemapStyle` **prop**, which overrides this default for a single map. Unlike the config keys, the prop is live: changing it rebuilds the map on the new style in place, no remount needed. If you pass an inline style *object* as the prop, hold it in a stable reference (a module constant or `useMemo`) rather than an object literal.
|
|
241
|
+
|
|
213
242
|
### Theming (optional)
|
|
214
243
|
|
|
215
244
|
Every top-level component accepts two optional theming props. When neither is set, the library's defaults are used and no Ant Design `ConfigProvider` is mounted.
|
|
@@ -349,13 +378,15 @@ ColBrowser.ReactDOM.createRoot(document.querySelector('#search')).render(
|
|
|
349
378
|
2. `taxonKey` - (controlled) the taxon to render. Read by the host from its URL and passed in.
|
|
350
379
|
3. `pageTitleTemplate` - (Optional) a template for formatting the page title. A string containing the variable `__taxon__` that will be replaced with the taxon name.
|
|
351
380
|
4. `identifierLabel` - (Optional) label for the identifier listed on top of the taxon view. Defaults to `"Identifier"`.
|
|
352
|
-
5. `showDistributionMap` - (Optional) When `true`, render an interactive MapLibre GL map
|
|
381
|
+
5. `showDistributionMap` - (Optional) When `true`, render an interactive MapLibre GL map for distributions whose areas have a known geometry, with a toggle to switch to the plain text list view. The basemap defaults to the keyless CARTO Positron vector style; override it with the `basemapStyle` prop below or globally via [`configure()`](#api-endpoint-optional). **Requires the consumer to load MapLibre GL JS 4+ or 5+ and its CSS** (peer dependency).
|
|
353
382
|
6. `gbifChecklistKey` - (Optional) When set, the distribution map adds a GBIF occurrence overlay (iNaturalist.poly hex bins) for the focal taxon, using the GBIF v2 multitaxonomy tile endpoint. The value is passed as the `checklistKey` query parameter; the focal taxon's id is passed as `taxonKey`. **The consumer is responsible for only setting this when the configured `datasetKey` actually uses identifiers that GBIF recognises under the given checklist.** For datasets keyed by COL identifiers, use the Catalogue of Life backbone UUID:
|
|
354
383
|
|
|
355
384
|
```
|
|
356
385
|
gbifChecklistKey="7ddf754f-d193-4cc9-b351-99906754a03b"
|
|
357
386
|
```
|
|
358
387
|
|
|
388
|
+
7. `basemapStyle` - (Optional) MapLibre style for the basemap under the distribution polygons — a style URL with your provider's API key baked in, or an inline style object. Overrides the global [`configure({ basemapStyle })`](#basemap) default for this map only, and can be changed at runtime: the map rebuilds on the new style in place. Pass an inline style object from a stable reference, not an object literal.
|
|
389
|
+
|
|
359
390
|
To use the map, include MapLibre GL JS alongside React in your page:
|
|
360
391
|
|
|
361
392
|
```html
|
|
@@ -464,7 +495,8 @@ The Taxon page's distribution block — a MapLibre GL vector map of the taxon's
|
|
|
464
495
|
1. `datasetKey` - the dataset key from the [Catalogue of Life ChecklistBank](https://www.checklistbank.org/).
|
|
465
496
|
2. `taxonId` - (controlled) the taxon to render. The component loads the taxon, its distributions, and the rank vocabulary itself.
|
|
466
497
|
3. `gbifChecklistKey` - (Optional) when set, adds the GBIF occurrence overlay (iNaturalist.poly hex bins) for the focal taxon. See the same prop on `ColBrowser.Taxon` for the caveat about checklist-key alignment.
|
|
467
|
-
4. `style` - (Optional) inline style passed through to the outer wrapper.
|
|
498
|
+
4. `style` - (Optional) inline style passed through to the outer wrapper. Note this is the wrapper's CSS, not the map style — see `basemapStyle` below.
|
|
499
|
+
5. `basemapStyle` - (Optional) MapLibre style for the basemap under the distribution polygons — a style URL with your provider's API key baked in, or an inline style object. Overrides the global [`configure({ basemapStyle })`](#basemap) default for this map only, and can be changed at runtime: the map rebuilds on the new style in place. Pass an inline style object from a stable reference, not an object literal.
|
|
468
500
|
|
|
469
501
|
**Requires the consumer to load MapLibre GL JS 4+ or 5+ and its CSS** (peer dependency), same as `ColBrowser.Taxon` with `showDistributionMap`:
|
|
470
502
|
|
package/es/bibtex.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { w as i } from "./chunks/withDatasetKey-BgMY05XE.js";
|
|
2
2
|
import { w as m } from "./chunks/withTheme-Dh6PRuII.js";
|
|
3
|
-
import { B as o } from "./chunks/BibTex-
|
|
3
|
+
import { B as o } from "./chunks/BibTex-DRE71Hg-.js";
|
|
4
4
|
const a = m(i(o));
|
|
5
5
|
export {
|
|
6
6
|
a as BibTex
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { j as s } from "./jsx-runtime-BzflLqGi.js";
|
|
2
2
|
import "react";
|
|
3
|
-
import { c as o } from "./config
|
|
3
|
+
import { c as o } from "./config--bs_09I6.js";
|
|
4
4
|
const b = ({ datasetKey: t, sourceDatasetKey: i, style: r = {} }) => {
|
|
5
5
|
const a = {
|
|
6
6
|
height: "40px"
|
|
@@ -10,4 +10,4 @@ const b = ({ datasetKey: t, sourceDatasetKey: i, style: r = {} }) => {
|
|
|
10
10
|
export {
|
|
11
11
|
b as B
|
|
12
12
|
};
|
|
13
|
-
//# sourceMappingURL=BibTex-
|
|
13
|
+
//# sourceMappingURL=BibTex-DRE71Hg-.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BibTex-
|
|
1
|
+
{"version":3,"file":"BibTex-DRE71Hg-.js","sources":["../../src/components/BibTex.js"],"sourcesContent":["import React from \"react\";\nimport config from \"../config\";\n\nconst BibTex = ({ datasetKey, sourceDatasetKey, style = {} }) => {\nconst defaultStyle = {\n height: \"40px\"\n}\nconst url = sourceDatasetKey ? `${config.dataApi}dataset/${datasetKey}/source/${sourceDatasetKey}.bib` : `${config.dataApi}dataset/${datasetKey}.bib`\n\n return (\n <a href={url} >\n <img src=\"https://www.checklistbank.org/images/bibtex_logo.png\" style={{...defaultStyle, ...style}} />\n </a>\n );\n};\n\nexport default BibTex;\n"],"names":["BibTex","datasetKey","sourceDatasetKey","style","defaultStyle","url","config","jsx"],"mappings":";;;AAGA,MAAMA,IAAS,CAAC,EAAE,YAAAC,GAAY,kBAAAC,GAAkB,OAAAC,IAAQ,CAAA,QAAS;AACjE,QAAMC,IAAe;AAAA,IACjB,QAAQ;AAAA,EAAA,GAENC,IAAMH,IAAmB,GAAGI,EAAO,OAAO,WAAWL,CAAU,WAAWC,CAAgB,SAAS,GAAGI,EAAO,OAAO,WAAWL,CAAU;AAE7I,SACEM,gBAAAA,EAAAA,IAAC,KAAA,EAAE,MAAMF,GACP,gCAAC,OAAA,EAAI,KAAI,wDAAuD,OAAO,EAAC,GAAGD,GAAc,GAAGD,EAAA,GAAQ,GACtG;AAEJ;"}
|
|
@@ -4,7 +4,7 @@ var o = (s, n, t) => g(s, typeof n != "symbol" ? n + "" : n, t);
|
|
|
4
4
|
import { j as l } from "./jsx-runtime-BzflLqGi.js";
|
|
5
5
|
import f from "react";
|
|
6
6
|
import { c as u } from "./router-CssZk5qZ.js";
|
|
7
|
-
import { c as p } from "./config
|
|
7
|
+
import { c as p } from "./config--bs_09I6.js";
|
|
8
8
|
import { Select as x } from "antd";
|
|
9
9
|
import { debounce as S, get as i } from "lodash-es";
|
|
10
10
|
import $ from "react-highlight-words";
|
|
@@ -116,4 +116,4 @@ export {
|
|
|
116
116
|
R as C,
|
|
117
117
|
M as N
|
|
118
118
|
};
|
|
119
|
-
//# sourceMappingURL=DatasetCitation-
|
|
119
|
+
//# sourceMappingURL=DatasetCitation-Cep2dces.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DatasetCitation-
|
|
1
|
+
{"version":3,"file":"DatasetCitation-Cep2dces.js","sources":["../../src/ColTree/NameAutocomplete.js","../../src/components/DatasetCitation.js"],"sourcesContent":["import React from \"react\";\nimport client from \"../api/client\";\nimport config from \"../config\";\nimport { AutoComplete, Input , Select} from \"antd\";\nimport { debounce, get } from \"lodash-es\";\nimport Highlighter from \"react-highlight-words\";\n\n\nclass NameSearchAutocomplete extends React.Component {\n constructor(props) {\n super(props);\n\n this.getNames = debounce(this.getNames, 500);\n this.state = {\n options: [],\n value: \"\",\n randomID: (Math.floor(Math.random() * 100) +1)*(Math.floor(Math.random() * 100) +1)*(Math.floor(Math.random() * 100) +1)\n };\n }\n\n componentDidMount = () => {\n const { defaultTaxonKey } = this.props;\n if (defaultTaxonKey) {\n this.setDefaultValue(defaultTaxonKey);\n }\n };\n\n componentDidUpdate = (prevProps) => {\n const { defaultTaxonKey } = this.props;\n if (defaultTaxonKey !== prevProps.defaultTaxonKey) {\n if (defaultTaxonKey) {\n this.setDefaultValue(defaultTaxonKey);\n } else {\n this.setState({ value: \"\", options: [] });\n }\n }\n };\n\n componentWillUnmount() {\n this.getNames.cancel();\n }\n\n setDefaultValue = (usageId) => {\n const { datasetKey } = this.props;\n client(\n `${config.dataApi}dataset/${datasetKey}/nameusage/search?USAGE_ID=${usageId}`\n ).then((res) => {\n this.setState({ value: get(res, \"data.result[0].usage.label\") || \"\" });\n });\n };\n getNames = (q) => {\n const { datasetKey, minRank, extinct /* hideExtinct */ } = this.props;\n const {value} = this.state;\n const url = datasetKey\n ? `${config.dataApi}dataset/${datasetKey}/nameusage/suggest`\n : `${config.dataApi}name/search`;\n\n client(\n `${url}?limit=25&q=${q}${\n minRank ? `&minRank=${minRank}` : \"\"\n }${extinct ? `&extinct=${extinct}`:''}`\n )\n .then((res) => {\n this.setState({\n // names: res.data || [],\n options: this.getOptions(res.data || [], value)\n });\n })\n .catch((err) => {\n this.setState({ options: [], err });\n });\n };\n onSelectName = (val, obj) => {\n const selectedTaxon = get(obj, \"data.acceptedUsageId\")\n ? {\n key: get(obj, \"data.acceptedUsageId\"),\n rank: get(obj, \"data.rank\"),\n title: get(obj, \"data.parentOrAcceptedName\"),\n }\n : { key: get(obj, \"data.usageId\"), rank: get(obj, \"data.rank\"), title: get(obj, \"data.name\") };\n this.setState({ value: val });\n this.props.onSelectName(selectedTaxon);\n };\n onReset = () => {\n this.setState({ value: \"\", options: [] }, this.props.onResetSearch);\n };\n\n getOptions = (names, searchTerm) => {\n return names.map((o) => {\n return {\n key: o.usageId,\n value: o.usageId, //o.suggestion,\n label: (\n <Highlighter\n highlightStyle={{ fontWeight: \"bold\", padding: 0 }}\n searchWords={searchTerm ? searchTerm.split(\" \") : []}\n autoEscape\n textToHighlight={o.suggestion}\n />\n ),\n data: o,\n };\n });\n }\n render = () => {\n const { placeHolder, autoFocus, disabled } = this.props;\n const { value , options, randomID} = this.state;\n //const randomID = (Math.floor(Math.random() * 100) +1)*(Math.floor(Math.random() * 100) +1)*(Math.floor(Math.random() * 100) +1);\n\n // const options = this.getOptions(this.state.names, value)\n\n return (\n <div id={`taxon_autocomplete_${randomID}`} className=\"taxon-autocomplete\">\n <Select\n value={value || undefined}\n defaultActiveFirstOption={false}\n suffixIcon={null}\n showSearch\n allowClear\n notFoundContent={null}\n\n style={this.props.style ? this.props.style : { width: \"100%\" }}\n options={options}\n filterOption={false}\n onSelect={this.onSelectName}\n onClear={this.onReset}\n onSearch={(q) => (!!q ? this.getNames(q) : this.onReset())}\n placeholder={placeHolder || \"Find taxon\"}\n autoFocus={autoFocus === false ? false : true}\n disabled={disabled}\n getPopupContainer={() => {\n console.log(`Test ${randomID}`)\n return document.getElementById(`taxon_autocomplete_${randomID}`)\n }\n \n }\n \n >\n \n </Select>\n {/* <AutoComplete\n style={this.props.style ? this.props.style : { width: \"100%\" }}\n options={options}\n onSelect={this.onSelectName}\n onSearch={(q) => (!!q ? this.getNames(q) : this.onReset())}\n placeholder={placeHolder || \"Find taxon\"}\n onChange={(value) => {\n if(value){\n this.setState({ value })\n } else {\n setTimeout(this.onReset, 50); \n }\n }}\n value={value}\n autoFocus={autoFocus === false ? false : true}\n disabled={disabled}\n getPopupContainer={() => {\n console.log(`Test ${randomID}`)\n return document.getElementById(`taxon_autocomplete_${randomID}`)\n }\n \n }\n \n >\n <Input.Search allowClear />\n </AutoComplete> */}\n \n </div> \n );\n };\n}\n\nexport default NameSearchAutocomplete;\n","import React from 'react';\n\n\nconst Citation = ({ dataset }) => {\n\n return (\n <div className=\"col-dataset-citation\">\n <div className=\"col-dataset-citation-title\">{dataset.citation ? <span dangerouslySetInnerHTML={{__html: dataset.citation}}></span> : dataset.title}</div>\n <div className=\"col-dataset-citation-source\"> - accessed through <a href={`https://www.checklistbank.org/dataset/${dataset.key}`}>ChecklistBank</a></div>\n </div>\n );\n};\n\n\nexport default Citation;"],"names":["NameSearchAutocomplete","React","props","__publicField","defaultTaxonKey","prevProps","usageId","datasetKey","client","config","res","get","q","minRank","extinct","value","url","err","val","obj","selectedTaxon","names","searchTerm","o","jsx","Highlighter","placeHolder","autoFocus","disabled","options","randomID","Select","debounce","Citation","data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AAC,QAAA,EAAK,yBAAyB,EAAC,QAAQU,EAAQ,SAAA,EAAQ,CAAG,IAAUA,EAAQ,OAAM;AAAA,EACnJC,gBAAAA,EAAAA,KAAC,OAAA,EAAI,WAAU,+BAA8B,UAAA;AAAA,IAAA;AAAA,0BAAqB,KAAA,EAAE,MAAM,yCAAyCD,EAAQ,GAAG,IAAI,UAAA,gBAAA,CAAa;AAAA,EAAA,EAAA,CAAI;AAAA,GACrJ;"}
|
package/es/chunks/{DatasetlogoWithFallback-Dava2uqZ.js → DatasetlogoWithFallback-Bb-kmHts.js}
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { j as l } from "./jsx-runtime-BzflLqGi.js";
|
|
2
2
|
import n from "react";
|
|
3
|
-
import { c } from "./config
|
|
3
|
+
import { c } from "./config--bs_09I6.js";
|
|
4
4
|
class m extends n.Component {
|
|
5
5
|
constructor(t) {
|
|
6
6
|
super(t), this.state = { error: !0, loading: !0 };
|
|
@@ -21,4 +21,4 @@ class m extends n.Component {
|
|
|
21
21
|
export {
|
|
22
22
|
m as D
|
|
23
23
|
};
|
|
24
|
-
//# sourceMappingURL=DatasetlogoWithFallback-
|
|
24
|
+
//# sourceMappingURL=DatasetlogoWithFallback-Bb-kmHts.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DatasetlogoWithFallback-
|
|
1
|
+
{"version":3,"file":"DatasetlogoWithFallback-Bb-kmHts.js","sources":["../../src/components/DatasetlogoWithFallback.js"],"sourcesContent":["import React from \"react\";\nimport config from \"../config\";\n\nclass DatasetlogoWithFallback extends React.Component {\n constructor(props) {\n super(props);\n this.state = { error: true, loading: true };\n }\n render() {\n\n const {fallBack = null, datasetKey, sourceDatasetKey, style, size = 'MEDIUM'} = this.props;\n const {error, loading} = this.state;\n return (loading || !error) ?\n <img\n style={style}\n src={`${config.dataApi}dataset/${datasetKey}/logo/source/${sourceDatasetKey}?size=${size}`}\n onLoad={() => this.setState({error: false, loading: false})}\n onError={() => this.setState({error: true, loading: false})}\n /> : fallBack;\n \n ;\n }\n}\nexport default DatasetlogoWithFallback;"],"names":["DatasetlogoWithFallback","React","props","fallBack","datasetKey","sourceDatasetKey","style","size","error","loading","jsx","config"],"mappings":";;;AAGA,MAAMA,UAAgCC,EAAM,UAAU;AAAA,EACpD,YAAYC,GAAO;AACjB,UAAMA,CAAK,GACX,KAAK,QAAQ,EAAE,OAAO,IAAM,SAAS,GAAA;AAAA,EACvC;AAAA,EACA,SAAS;AAEL,UAAM,EAAC,UAAAC,IAAW,MAAM,YAAAC,GAAY,kBAAAC,GAAkB,OAAAC,GAAO,MAAAC,IAAO,aAAY,KAAK,OAC/E,EAAC,OAAAC,GAAO,SAAAC,EAAA,IAAW,KAAK;AAChC,WAAQA,KAAW,CAACD,IAChBE,gBAAAA,EAAAA;AAAAA,MAAC;AAAA,MAAA;AAAA,QACC,OAAAJ;AAAA,QACA,KAAK,GAAGK,EAAO,OAAO,WAAWP,CAAU,gBAAgBC,CAAgB,SAASE,CAAI;AAAA,QACxF,QAAQ,MAAM,KAAK,SAAS,EAAC,OAAO,IAAO,SAAS,IAAM;AAAA,QAC1D,SAAS,MAAM,KAAK,SAAS,EAAC,OAAO,IAAM,SAAS,GAAA,CAAM;AAAA,MAAA;AAAA,IAAA,IACvDJ;AAAA,EAGX;AACF;"}
|