col-browser 2.2.3 → 2.2.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.
@@ -70816,6 +70816,9 @@ html body {
70816
70816
  params.facetLimit = FACET_LIMIT;
70817
70817
  }
70818
70818
  delete params.fuzzy;
70819
+ if (params.type && String(params.type).toUpperCase() !== "FUZZY") {
70820
+ delete params.type;
70821
+ }
70819
70822
  if (!params.limit) {
70820
70823
  params.limit = PAGE_SIZE;
70821
70824
  }
@@ -70936,6 +70939,7 @@ html body {
70936
70939
  taxGroups
70937
70940
  } = this.state;
70938
70941
  const { datasetKey, defaultTaxonKey, citation } = this.props;
70942
+ const isFuzzy = String(params.type || "").toUpperCase() === "FUZZY";
70939
70943
  const facetRanks = get(facets, "rank") ? facets.rank.map((r2) => ({
70940
70944
  value: r2.value,
70941
70945
  label: `${startCase(r2.value)} (${r2.count.toLocaleString("en-GB")})`
@@ -71047,61 +71051,53 @@ html body {
71047
71051
  autoFocus: false
71048
71052
  }
71049
71053
  ) }),
71050
- /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { style: { marginTop: "10px" }, children: [
71051
- /* @__PURE__ */ jsxRuntimeExports.jsx(Form, { layout: "inline", children: /* @__PURE__ */ jsxRuntimeExports.jsx(FormItem, { label: "Matching", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
71054
+ /* @__PURE__ */ jsxRuntimeExports.jsx("div", { style: { marginTop: "10px" }, children: /* @__PURE__ */ jsxRuntimeExports.jsxs(Form, { layout: "inline", children: [
71055
+ (this.state.datasetOrigin === "xrelease" || this.state.datasetOrigin === "project") && /* @__PURE__ */ jsxRuntimeExports.jsx(FormItem, { label: "Content", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
71052
71056
  RadioGroup,
71053
71057
  {
71058
+ style: { marginLeft: "8px" },
71054
71059
  size: "small",
71055
71060
  onChange: (evt) => {
71056
- this.updateSearch({ type: evt.target.value });
71061
+ this.updateSearch({ sectorMode: evt.target.value.split(",").filter((v2) => v2 !== "") });
71057
71062
  },
71058
- value: params.type || "WHOLE_WORDS",
71063
+ value: isArray(params == null ? void 0 : params.sectorMode) ? (_a2 = params == null ? void 0 : params.sectorMode) == null ? void 0 : _a2.join(",") : (params == null ? void 0 : params.sectorMode) || "",
71059
71064
  optionType: "button",
71060
71065
  options: [
71061
- { value: "EXACT", label: "Exact" },
71062
- { value: "WHOLE_WORDS", label: "Words" },
71063
- { value: "PREFIX", label: "Prefix" },
71064
- { value: "FUZZY", label: "Fuzzy" }
71066
+ { value: "", label: "All" },
71067
+ { value: "attach,union", label: "Base" },
71068
+ { value: "merge", label: "Extended" }
71065
71069
  ]
71066
71070
  }
71067
- ) }) }),
71068
- /* @__PURE__ */ jsxRuntimeExports.jsxs(Form, { layout: "inline", children: [
71069
- (this.state.datasetOrigin === "xrelease" || this.state.datasetOrigin === "project") && /* @__PURE__ */ jsxRuntimeExports.jsx(FormItem, { label: "Content", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
71070
- RadioGroup,
71071
- {
71072
- style: { marginLeft: "8px" },
71073
- size: "small",
71074
- onChange: (evt) => {
71075
- this.updateSearch({ sectorMode: evt.target.value.split(",").filter((v2) => v2 !== "") });
71076
- },
71077
- value: isArray(params == null ? void 0 : params.sectorMode) ? (_a2 = params == null ? void 0 : params.sectorMode) == null ? void 0 : _a2.join(",") : (params == null ? void 0 : params.sectorMode) || "",
71078
- optionType: "button",
71079
- options: [
71080
- { value: "", label: "All" },
71081
- { value: "attach,union", label: "Base" },
71082
- { value: "merge", label: "Extended" }
71083
- ]
71084
- }
71085
- ) }),
71086
- /* @__PURE__ */ jsxRuntimeExports.jsx(FormItem, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(
71087
- Select,
71088
- {
71089
- mode: "multiple",
71090
- allowClear: true,
71091
- size: "small",
71092
- style: { minWidth: 200 },
71093
- placeholder: "Search fields",
71094
- value: isArray(params == null ? void 0 : params.content) ? params.content : (params == null ? void 0 : params.content) ? [params.content] : [],
71095
- onChange: (value) => this.updateSearch({ content: value.length ? value : null }),
71096
- options: [
71097
- { value: "SCIENTIFIC_NAME", label: "Scientific name" },
71098
- { value: "AUTHORSHIP", label: "Authorship" },
71099
- { value: "VERNACULAR_NAME", label: "Vernacular name" }
71100
- ]
71101
- }
71102
- ) })
71103
- ] })
71104
- ] })
71071
+ ) }),
71072
+ /* @__PURE__ */ jsxRuntimeExports.jsx(FormItem, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(
71073
+ Select,
71074
+ {
71075
+ mode: "multiple",
71076
+ allowClear: true,
71077
+ size: "small",
71078
+ style: { minWidth: 200 },
71079
+ placeholder: "Search fields",
71080
+ value: isArray(params == null ? void 0 : params.content) ? params.content : (params == null ? void 0 : params.content) ? [params.content] : [],
71081
+ onChange: (value) => this.updateSearch({ content: value.length ? value : null }),
71082
+ options: [
71083
+ { value: "SCIENTIFIC_NAME", label: "Scientific name" },
71084
+ { value: "AUTHORSHIP", label: "Authorship" },
71085
+ { value: "VERNACULAR_NAME", label: "Vernacular name" }
71086
+ ]
71087
+ }
71088
+ ) }),
71089
+ /* @__PURE__ */ jsxRuntimeExports.jsx(FormItem, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(
71090
+ Button$1,
71091
+ {
71092
+ size: "small",
71093
+ color: isFuzzy ? "primary" : "default",
71094
+ variant: "outlined",
71095
+ "aria-pressed": isFuzzy,
71096
+ onClick: () => this.updateSearch({ type: isFuzzy ? null : "FUZZY" }),
71097
+ children: "Fuzzy"
71098
+ }
71099
+ ) })
71100
+ ] }) })
71105
71101
  ] }),
71106
71102
  /* @__PURE__ */ jsxRuntimeExports.jsxs(Col, { xs: 24, sm: 24, md: 12, children: [
71107
71103
  /* @__PURE__ */ jsxRuntimeExports.jsx(
@@ -78246,6 +78242,7 @@ html body {
78246
78242
  }) => {
78247
78243
  var _a2;
78248
78244
  const containerRef = reactExports.useRef(null);
78245
+ const wrapperRef = reactExports.useRef(null);
78249
78246
  const mapRef = reactExports.useRef(null);
78250
78247
  const popupRef = reactExports.useRef(null);
78251
78248
  const recordMapRef = reactExports.useRef(/* @__PURE__ */ new Map());
@@ -78347,6 +78344,10 @@ html body {
78347
78344
  new maplibregl.NavigationControl({ showCompass: false }),
78348
78345
  "top-left"
78349
78346
  );
78347
+ map.addControl(
78348
+ new maplibregl.FullscreenControl({ container: wrapperRef.current }),
78349
+ "top-right"
78350
+ );
78350
78351
  mapRef.current = map;
78351
78352
  map.on("load", () => {
78352
78353
  setStyleReady(true);
@@ -78735,93 +78736,102 @@ html body {
78735
78736
  );
78736
78737
  }
78737
78738
  const focalName = ((_a2 = focalTaxon == null ? void 0 : focalTaxon.name) == null ? void 0 : _a2.scientificName) || "This taxon";
78738
- return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "col-distributions-map", style: { position: "relative" }, children: [
78739
- /* @__PURE__ */ jsxRuntimeExports.jsx(
78740
- "div",
78741
- {
78742
- ref: containerRef,
78743
- style: { height: 360, width: "100%", background: "#f5f5f5" }
78744
- }
78745
- ),
78746
- /* @__PURE__ */ jsxRuntimeExports.jsx(
78747
- LayerControl,
78748
- {
78749
- open: controlOpen,
78750
- onOpen: openControl,
78751
- onClose: () => setControlOpen(false),
78752
- focalName,
78753
- focalReady,
78754
- focalVisible,
78755
- onToggleFocal: () => setFocalVisible((v2) => !v2),
78756
- gbifEnabled: !!gbifChecklistKey,
78757
- gbifVisible,
78758
- gbifAvailable,
78759
- onToggleGbif: handleToggleGbif,
78760
- descendantStatus: descendantState.status,
78761
- descendantsByRank,
78762
- descendantColors,
78763
- visibleTaxonIds,
78764
- onToggleTaxon: toggleTaxon,
78765
- onToggleRankGroup: toggleRankGroup,
78766
- onRetry: () => {
78767
- fetchTriggeredRef.current = false;
78768
- setDescendantState({ status: "idle", taxa: [] });
78769
- triggerDescendantFetch();
78770
- }
78771
- }
78772
- ),
78773
- !showDescendantLegend && (presentMeans.length > 0 || gbifChecklistKey && gbifAvailable !== false && gbifVisible) && /* @__PURE__ */ jsxRuntimeExports.jsxs(
78774
- "div",
78775
- {
78776
- style: {
78777
- position: "absolute",
78778
- bottom: 8,
78779
- left: 8,
78780
- zIndex: 1,
78781
- background: "#fff",
78782
- borderRadius: 4,
78783
- boxShadow: "0 1px 4px rgba(0,0,0,0.2)",
78784
- padding: "6px 8px",
78785
- fontSize: 12,
78786
- lineHeight: 1.5
78787
- },
78788
- children: [
78789
- presentMeans.map((m2) => /* @__PURE__ */ jsxRuntimeExports.jsxs(
78790
- "div",
78791
- {
78792
- style: { display: "flex", alignItems: "center", gap: 6 },
78793
- children: [
78794
- /* @__PURE__ */ jsxRuntimeExports.jsx(
78795
- "span",
78796
- {
78797
- style: {
78798
- display: "inline-block",
78799
- width: 12,
78800
- height: 12,
78801
- background: m2.color,
78802
- border: "1px solid rgba(0,0,0,0.15)",
78803
- borderRadius: 2
78804
- }
78805
- }
78806
- ),
78807
- /* @__PURE__ */ jsxRuntimeExports.jsx("span", { children: m2.label })
78808
- ]
78739
+ return /* @__PURE__ */ jsxRuntimeExports.jsxs(
78740
+ "div",
78741
+ {
78742
+ className: "col-distributions-map",
78743
+ ref: wrapperRef,
78744
+ style: { position: "relative" },
78745
+ children: [
78746
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
78747
+ "div",
78748
+ {
78749
+ ref: containerRef,
78750
+ className: "col-distributions-map__canvas",
78751
+ style: { height: 360, width: "100%", background: "#f5f5f5" }
78752
+ }
78753
+ ),
78754
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
78755
+ LayerControl,
78756
+ {
78757
+ open: controlOpen,
78758
+ onOpen: openControl,
78759
+ onClose: () => setControlOpen(false),
78760
+ focalName,
78761
+ focalReady,
78762
+ focalVisible,
78763
+ onToggleFocal: () => setFocalVisible((v2) => !v2),
78764
+ gbifEnabled: !!gbifChecklistKey,
78765
+ gbifVisible,
78766
+ gbifAvailable,
78767
+ onToggleGbif: handleToggleGbif,
78768
+ descendantStatus: descendantState.status,
78769
+ descendantsByRank,
78770
+ descendantColors,
78771
+ visibleTaxonIds,
78772
+ onToggleTaxon: toggleTaxon,
78773
+ onToggleRankGroup: toggleRankGroup,
78774
+ onRetry: () => {
78775
+ fetchTriggeredRef.current = false;
78776
+ setDescendantState({ status: "idle", taxa: [] });
78777
+ triggerDescendantFetch();
78778
+ }
78779
+ }
78780
+ ),
78781
+ !showDescendantLegend && (presentMeans.length > 0 || gbifChecklistKey && gbifAvailable !== false && gbifVisible) && /* @__PURE__ */ jsxRuntimeExports.jsxs(
78782
+ "div",
78783
+ {
78784
+ style: {
78785
+ position: "absolute",
78786
+ bottom: 8,
78787
+ left: 8,
78788
+ zIndex: 1,
78789
+ background: "#fff",
78790
+ borderRadius: 4,
78791
+ boxShadow: "0 1px 4px rgba(0,0,0,0.2)",
78792
+ padding: "6px 8px",
78793
+ fontSize: 12,
78794
+ lineHeight: 1.5
78809
78795
  },
78810
- m2.key
78811
- )),
78812
- gbifChecklistKey && gbifAvailable !== false && gbifVisible && /* @__PURE__ */ jsxRuntimeExports.jsx(GbifLegendEntry, {})
78813
- ]
78814
- }
78815
- ),
78816
- showDescendantLegend && /* @__PURE__ */ jsxRuntimeExports.jsx(
78817
- IncludedTaxaLegend,
78818
- {
78819
- visibleGroups: descendantLegend.visibleGroups,
78820
- unmappableGroups: descendantLegend.unmappableGroups,
78821
- showGbif: !!gbifChecklistKey && gbifAvailable !== false && gbifVisible
78822
- }
78823
- )
78824
- ] });
78796
+ children: [
78797
+ presentMeans.map((m2) => /* @__PURE__ */ jsxRuntimeExports.jsxs(
78798
+ "div",
78799
+ {
78800
+ style: { display: "flex", alignItems: "center", gap: 6 },
78801
+ children: [
78802
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
78803
+ "span",
78804
+ {
78805
+ style: {
78806
+ display: "inline-block",
78807
+ width: 12,
78808
+ height: 12,
78809
+ background: m2.color,
78810
+ border: "1px solid rgba(0,0,0,0.15)",
78811
+ borderRadius: 2
78812
+ }
78813
+ }
78814
+ ),
78815
+ /* @__PURE__ */ jsxRuntimeExports.jsx("span", { children: m2.label })
78816
+ ]
78817
+ },
78818
+ m2.key
78819
+ )),
78820
+ gbifChecklistKey && gbifAvailable !== false && gbifVisible && /* @__PURE__ */ jsxRuntimeExports.jsx(GbifLegendEntry, {})
78821
+ ]
78822
+ }
78823
+ ),
78824
+ showDescendantLegend && /* @__PURE__ */ jsxRuntimeExports.jsx(
78825
+ IncludedTaxaLegend,
78826
+ {
78827
+ visibleGroups: descendantLegend.visibleGroups,
78828
+ unmappableGroups: descendantLegend.unmappableGroups,
78829
+ showGbif: !!gbifChecklistKey && gbifAvailable !== false && gbifVisible
78830
+ }
78831
+ )
78832
+ ]
78833
+ }
78834
+ );
78825
78835
  };
78826
78836
  const LayerControl = ({
78827
78837
  open: open2,
@@ -78853,7 +78863,8 @@ html body {
78853
78863
  title: "Layers",
78854
78864
  style: {
78855
78865
  position: "absolute",
78856
- top: 10,
78866
+ // Sits just below the maplibre fullscreen control (top-right).
78867
+ top: 48,
78857
78868
  right: 10,
78858
78869
  zIndex: 2,
78859
78870
  width: 30,
@@ -78876,7 +78887,8 @@ html body {
78876
78887
  {
78877
78888
  style: {
78878
78889
  position: "absolute",
78879
- top: 10,
78890
+ // Aligns with the collapsed "+" button, below the fullscreen control.
78891
+ top: 48,
78880
78892
  right: 10,
78881
78893
  zIndex: 2,
78882
78894
  background: "#fff",
@@ -79146,8 +79158,7 @@ html body {
79146
79158
  ] }) : /* @__PURE__ */ jsxRuntimeExports.jsx(ListView, { datasetKey, data })
79147
79159
  ] });
79148
79160
  }
79149
- const mapNudge = label && showMap ? { marginTop: -3 } : null;
79150
- const content = /* @__PURE__ */ jsxRuntimeExports.jsx("div", { style: { ...mapNudge, ...style2 }, children: body });
79161
+ const content = /* @__PURE__ */ jsxRuntimeExports.jsx("div", { style: style2, children: body });
79151
79162
  return label ? /* @__PURE__ */ jsxRuntimeExports.jsx(PresentationItem$1, { md: md2, label, children: content }) : content;
79152
79163
  };
79153
79164
  const rankStyle = {