col-browser 2.3.10 → 2.4.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.
Files changed (53) hide show
  1. package/README.md +29 -0
  2. package/es/bibtex.js +2 -2
  3. package/es/chunks/{BibTex-CPaVr-5w.js → BibTex-79CCKAOK.js} +2 -2
  4. package/es/chunks/{BibTex-CPaVr-5w.js.map → BibTex-79CCKAOK.js.map} +1 -1
  5. package/es/chunks/{DatasetCitation-JpNSTWz-.js → DatasetCitation-BXtAmjdZ.js} +2 -2
  6. package/es/chunks/{DatasetCitation-JpNSTWz-.js.map → DatasetCitation-BXtAmjdZ.js.map} +1 -1
  7. package/es/chunks/{DatasetlogoWithFallback-BhWvpgDn.js → DatasetlogoWithFallback-Dava2uqZ.js} +2 -2
  8. package/es/chunks/{DatasetlogoWithFallback-BhWvpgDn.js.map → DatasetlogoWithFallback-Dava2uqZ.js.map} +1 -1
  9. package/es/chunks/{Distributions-CKn1-Qze.js → Distributions-Bd4hFYdS.js} +3 -3
  10. package/es/chunks/{Distributions-CKn1-Qze.js.map → Distributions-Bd4hFYdS.js.map} +1 -1
  11. package/es/chunks/{MergedDataBadge-DK4XUXsL.js → MergedDataBadge-C1CgoRFz.js} +2 -2
  12. package/es/chunks/{MergedDataBadge-DK4XUXsL.js.map → MergedDataBadge-C1CgoRFz.js.map} +1 -1
  13. package/es/chunks/{TaxonBreakdown-BYRnP8bH.js → TaxonBreakdown-DeWamLu_.js} +2 -2
  14. package/es/chunks/{TaxonBreakdown-BYRnP8bH.js.map → TaxonBreakdown-DeWamLu_.js.map} +1 -1
  15. package/es/chunks/{XrGutter-CORP2r5Y.js → XrGutter-CU7_QPAp.js} +2 -2
  16. package/es/chunks/{XrGutter-CORP2r5Y.js.map → XrGutter-CU7_QPAp.js.map} +1 -1
  17. package/es/chunks/config-D1NH4DTr.js +22 -0
  18. package/es/chunks/config-D1NH4DTr.js.map +1 -0
  19. package/es/chunks/{dataset-BuF063rn.js → dataset-BL6g4w0G.js} +2 -2
  20. package/es/chunks/{dataset-BuF063rn.js.map → dataset-BL6g4w0G.js.map} +1 -1
  21. package/es/chunks/{enumeration-CC8SblcI.js → enumeration-DM8Hb36g.js} +2 -2
  22. package/es/chunks/{enumeration-CC8SblcI.js.map → enumeration-DM8Hb36g.js.map} +1 -1
  23. package/es/chunks/{sector-Behb-WCC.js → sector-Qeo1zPxr.js} +2 -2
  24. package/es/chunks/{sector-Behb-WCC.js.map → sector-Qeo1zPxr.js.map} +1 -1
  25. package/es/chunks/withTheme-Dh6PRuII.js +17 -0
  26. package/es/chunks/withTheme-Dh6PRuII.js.map +1 -0
  27. package/es/config.js +5 -0
  28. package/es/config.js.map +1 -0
  29. package/es/index.js +4 -2
  30. package/es/index.js.map +1 -1
  31. package/es/search.js +14 -13
  32. package/es/search.js.map +1 -1
  33. package/es/sourceDataset.js +7 -6
  34. package/es/sourceDataset.js.map +1 -1
  35. package/es/sourceDatasetList.js +16 -15
  36. package/es/sourceDatasetList.js.map +1 -1
  37. package/es/taxon.js +215 -214
  38. package/es/taxon.js.map +1 -1
  39. package/es/taxonBreakdown.js +23 -22
  40. package/es/taxonBreakdown.js.map +1 -1
  41. package/es/taxonDistribution.js +20 -19
  42. package/es/taxonDistribution.js.map +1 -1
  43. package/es/tree.js +8 -7
  44. package/es/tree.js.map +1 -1
  45. package/package.json +5 -1
  46. package/types/config.d.ts +1 -0
  47. package/types/index.d.ts +21 -0
  48. package/umd/col-browser.js +14 -5
  49. package/umd/col-browser.js.map +1 -1
  50. package/umd/col-browser.min.js +4 -4
  51. package/umd/col-browser.min.js.map +1 -1
  52. package/es/chunks/config-B2Z9BaEd.js +0 -30
  53. package/es/chunks/config-B2Z9BaEd.js.map +0 -1
package/types/index.d.ts CHANGED
@@ -131,6 +131,27 @@ export interface TaxonDistributionProps extends ThemeProps, NavigationProps {
131
131
  auth?: string;
132
132
  }
133
133
 
134
+ /** Base URLs the components talk to. Override them with `configure`. */
135
+ export interface ColBrowserConfig {
136
+ /** ChecklistBank API base. Defaults to "https://api.checklistbank.org/". */
137
+ dataApi: string;
138
+ /** Human-facing ChecklistBank portal, for outbound dataset/publisher links. */
139
+ clbPortal: string;
140
+ /** GBIF API base, for the occurrence count and map tiles. */
141
+ gbifApi: string;
142
+ /** GBIF portal the occurrence attribution link points at. */
143
+ gbifPortal: string;
144
+ }
145
+
146
+ /**
147
+ * Override the base URLs the components talk to, e.g. to point them at the
148
+ * ChecklistBank dev API. Merges into the shared config — keys left out keep
149
+ * their current value. Call once before rendering.
150
+ */
151
+ export function configure(
152
+ overrides: Partial<ColBrowserConfig>
153
+ ): ColBrowserConfig;
154
+
134
155
  export const Tree: React.FC<TreeProps>;
135
156
  export const Search: React.FC<SearchProps>;
136
157
  export const Taxon: React.FC<TaxonProps>;
@@ -29818,7 +29818,7 @@ html body {
29818
29818
  });
29819
29819
  }
29820
29820
  const SPLIT = "__@field_split__";
29821
- function normalize(namePath) {
29821
+ function normalize$1(namePath) {
29822
29822
  return namePath.map((cell) => `${typeof cell}:${cell}`).join(SPLIT);
29823
29823
  }
29824
29824
  class NameMap {
@@ -29826,13 +29826,13 @@ html body {
29826
29826
  __publicField(this, "kvs", /* @__PURE__ */ new Map());
29827
29827
  }
29828
29828
  set(key2, value) {
29829
- this.kvs.set(normalize(key2), value);
29829
+ this.kvs.set(normalize$1(key2), value);
29830
29830
  }
29831
29831
  get(key2) {
29832
- return this.kvs.get(normalize(key2));
29832
+ return this.kvs.get(normalize$1(key2));
29833
29833
  }
29834
29834
  getAsPrefix(key2) {
29835
- const normalizedKey = normalize(key2);
29835
+ const normalizedKey = normalize$1(key2);
29836
29836
  const normalizedPrefix = normalizedKey + SPLIT;
29837
29837
  const results = [];
29838
29838
  const current = this.kvs.get(normalizedKey);
@@ -29856,7 +29856,7 @@ html body {
29856
29856
  }
29857
29857
  }
29858
29858
  delete(key2) {
29859
- this.kvs.delete(normalize(key2));
29859
+ this.kvs.delete(normalize$1(key2));
29860
29860
  }
29861
29861
  // Since we only use this in test, let simply realize this
29862
29862
  map(callback) {
@@ -67806,6 +67806,14 @@ html body {
67806
67806
  // multitaxonomy occurrence search now ships on the production portal.
67807
67807
  gbifPortal: "https://www.gbif.org"
67808
67808
  };
67809
+ const SLASH_TERMINATED = /* @__PURE__ */ new Set(["dataApi"]);
67810
+ const normalize = (key2, value) => SLASH_TERMINATED.has(key2) ? value.replace(/\/*$/, "/") : value.replace(/\/+$/, "");
67811
+ function configure(overrides = {}) {
67812
+ Object.entries(overrides).forEach(([key2, value]) => {
67813
+ config[key2] = typeof value === "string" ? normalize(key2, value) : value;
67814
+ });
67815
+ return config;
67816
+ }
67809
67817
  var dataloader;
67810
67818
  var hasRequiredDataloader;
67811
67819
  function requireDataloader() {
@@ -90001,6 +90009,7 @@ Please report this to https://github.com/markedjs/marked.`, e2) {
90001
90009
  TaxonBreakdown,
90002
90010
  TaxonDistribution,
90003
90011
  Tree,
90012
+ configure,
90004
90013
  withRouting
90005
90014
  }, Symbol.toStringTag, { value: "Module" }));
90006
90015
  const umd = { ...components, React: React$1, ReactDOM: ReactDOMClient };