@mailwoman/react 10.0.0 → 10.1.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 +17 -16
- package/fonts.css +97 -22
- package/lib/common/About.tsx +7 -7
- package/lib/common/ClientOnly.tsx +2 -14
- package/lib/common/CopyButton.tsx +3 -1
- package/lib/common/LoadingIndicator.tsx +4 -2
- package/lib/common/PresetChips.tsx +9 -8
- package/lib/common/confidence-tiers.ts +7 -6
- package/lib/common/cx.ts +3 -1
- package/lib/common/text-tokens.ts +7 -4
- package/lib/common/useBuildInfo.ts +54 -0
- package/lib/common/useClipboard.ts +2 -11
- package/lib/common.ts +22 -0
- package/lib/index.ts +27 -17
- package/lib/map/AppIdentity.tsx +85 -0
- package/lib/map/BackendControl.tsx +9 -10
- package/lib/map/CompareToggle.tsx +8 -31
- package/lib/map/DebugInfo.tsx +88 -0
- package/lib/map/Geocoder.tsx +60 -46
- package/lib/map/GeocoderControls.tsx +430 -134
- package/lib/map/GraticuleLayer.tsx +54 -0
- package/lib/map/MapCanvas.tsx +23 -12
- package/lib/map/MapChipRow.tsx +4 -8
- package/lib/map/MapCompass.tsx +15 -24
- package/lib/map/MapControlStack.tsx +8 -9
- package/lib/map/MapFooter.tsx +2 -16
- package/lib/map/MapProgressBar.tsx +10 -13
- package/lib/map/MapSearchBar.tsx +31 -17
- package/lib/map/MapSheet.tsx +24 -15
- package/lib/map/OverlayLayers.tsx +1 -1
- package/lib/map/PlaceAutocomplete.tsx +10 -21
- package/lib/map/PlaceMarker.tsx +4 -2
- package/lib/map/ResolvedPlaceLayers.tsx +5 -14
- package/lib/map/ResultCamera.tsx +8 -31
- package/lib/map/ResultOverlay.tsx +2 -12
- package/lib/map/ResultPanel.tsx +1 -20
- package/lib/map/VersionPicker.tsx +10 -19
- package/lib/map/fake-runtime.ts +10 -12
- package/lib/map/geometry.ts +14 -47
- package/lib/map/graticule.ts +80 -0
- package/lib/map/map-debug.ts +1 -1
- package/lib/map/place-render.ts +28 -60
- package/lib/map/types.ts +58 -104
- package/lib/map/useCompareState.ts +5 -4
- package/lib/map/useGeocode.ts +7 -5
- package/lib/map/useMapBearing.ts +13 -13
- package/lib/map/useMapLabelPick.ts +21 -30
- package/lib/map/useMapPlaceRender.ts +2 -6
- package/lib/map/usePlaceAutocomplete.ts +44 -50
- package/lib/map.ts +95 -0
- package/lib/pipeline/CandidatePicker.tsx +13 -5
- package/lib/pipeline/ConfidenceCell.tsx +1 -1
- package/lib/pipeline/FailureDiagnostic.tsx +8 -2
- package/lib/pipeline/QueryForm.tsx +5 -2
- package/lib/pipeline/ResolvedPlace.tsx +1 -1
- package/lib/pipeline/SpanHighlight.tsx +7 -5
- package/lib/pipeline/TimingPanel.tsx +1 -1
- package/lib/pipeline/TreeView.tsx +1 -1
- package/lib/pipeline/copy.ts +22 -25
- package/lib/pipeline/presets.ts +15 -13
- package/lib/pipeline/types.ts +21 -14
- package/lib/pipeline/useParsePipeline.ts +16 -13
- package/lib/pipeline.ts +36 -0
- package/lib/poi/AbstainPanel.tsx +1 -1
- package/lib/poi/LiveResultsBlock.tsx +2 -1
- package/lib/poi/POIExplorer.tsx +24 -15
- package/lib/poi/QueryInput.tsx +1 -1
- package/lib/poi/SubjectPanel.tsx +4 -3
- package/lib/poi/runtime.ts +5 -16
- package/lib/poi/types.ts +39 -27
- package/lib/poi/usePOISearch.ts +39 -44
- package/lib/poi.ts +39 -0
- package/lib/runtime/useReleaseRuntime.ts +125 -74
- package/lib/search/SearchModal.tsx +317 -0
- package/lib/search/search.css +144 -0
- package/lib/search/types.ts +67 -0
- package/lib/search.ts +11 -0
- package/out/common/About.d.ts +5 -5
- package/out/common/About.d.ts.map +1 -1
- package/out/common/About.js +1 -1
- package/out/common/About.js.map +1 -1
- package/out/common/ClientOnly.d.ts +2 -11
- package/out/common/ClientOnly.d.ts.map +1 -1
- package/out/common/ClientOnly.js +1 -13
- package/out/common/ClientOnly.js.map +1 -1
- package/out/common/CopyButton.d.ts +3 -1
- package/out/common/CopyButton.d.ts.map +1 -1
- package/out/common/CopyButton.js.map +1 -1
- package/out/common/LoadingIndicator.d.ts +4 -2
- package/out/common/LoadingIndicator.d.ts.map +1 -1
- package/out/common/LoadingIndicator.js.map +1 -1
- package/out/common/PresetChips.d.ts +9 -8
- package/out/common/PresetChips.d.ts.map +1 -1
- package/out/common/PresetChips.js.map +1 -1
- package/out/common/confidence-tiers.d.ts +7 -6
- package/out/common/confidence-tiers.d.ts.map +1 -1
- package/out/common/confidence-tiers.js +7 -6
- package/out/common/confidence-tiers.js.map +1 -1
- package/out/common/cx.d.ts +3 -1
- package/out/common/cx.d.ts.map +1 -1
- package/out/common/cx.js +3 -1
- package/out/common/cx.js.map +1 -1
- package/out/common/text-tokens.d.ts +4 -3
- package/out/common/text-tokens.d.ts.map +1 -1
- package/out/common/text-tokens.js +6 -3
- package/out/common/text-tokens.js.map +1 -1
- package/out/common/useBuildInfo.d.ts +27 -0
- package/out/common/useBuildInfo.d.ts.map +1 -0
- package/out/common/useBuildInfo.js +32 -0
- package/out/common/useBuildInfo.js.map +1 -0
- package/out/common/useClipboard.d.ts +1 -3
- package/out/common/useClipboard.d.ts.map +1 -1
- package/out/common/useClipboard.js +2 -11
- package/out/common/useClipboard.js.map +1 -1
- package/out/common.d.ts +22 -0
- package/out/common.d.ts.map +1 -0
- package/out/common.js +15 -0
- package/out/common.js.map +1 -0
- package/out/index.d.ts +26 -16
- package/out/index.d.ts.map +1 -1
- package/out/index.js +21 -15
- package/out/index.js.map +1 -1
- package/out/map/AppIdentity.d.ts +42 -0
- package/out/map/AppIdentity.d.ts.map +1 -0
- package/out/map/AppIdentity.js +16 -0
- package/out/map/AppIdentity.js.map +1 -0
- package/out/map/BackendControl.d.ts +9 -10
- package/out/map/BackendControl.d.ts.map +1 -1
- package/out/map/BackendControl.js +1 -1
- package/out/map/BackendControl.js.map +1 -1
- package/out/map/CompareToggle.d.ts +8 -31
- package/out/map/CompareToggle.d.ts.map +1 -1
- package/out/map/CompareToggle.js +4 -1
- package/out/map/CompareToggle.js.map +1 -1
- package/out/map/DebugInfo.d.ts +34 -0
- package/out/map/DebugInfo.d.ts.map +1 -0
- package/out/map/DebugInfo.js +39 -0
- package/out/map/DebugInfo.js.map +1 -0
- package/out/map/Geocoder.d.ts +41 -30
- package/out/map/Geocoder.d.ts.map +1 -1
- package/out/map/Geocoder.js +20 -36
- package/out/map/Geocoder.js.map +1 -1
- package/out/map/GeocoderControls.d.ts +14 -42
- package/out/map/GeocoderControls.d.ts.map +1 -1
- package/out/map/GeocoderControls.js +250 -38
- package/out/map/GeocoderControls.js.map +1 -1
- package/out/map/GraticuleLayer.d.ts +28 -0
- package/out/map/GraticuleLayer.d.ts.map +1 -0
- package/out/map/GraticuleLayer.js +25 -0
- package/out/map/GraticuleLayer.js.map +1 -0
- package/out/map/MapCanvas.d.ts +23 -12
- package/out/map/MapCanvas.d.ts.map +1 -1
- package/out/map/MapCanvas.js +5 -2
- package/out/map/MapCanvas.js.map +1 -1
- package/out/map/MapChipRow.d.ts +4 -8
- package/out/map/MapChipRow.d.ts.map +1 -1
- package/out/map/MapChipRow.js.map +1 -1
- package/out/map/MapCompass.d.ts +11 -20
- package/out/map/MapCompass.d.ts.map +1 -1
- package/out/map/MapCompass.js +5 -1
- package/out/map/MapCompass.js.map +1 -1
- package/out/map/MapControlStack.d.ts +8 -9
- package/out/map/MapControlStack.d.ts.map +1 -1
- package/out/map/MapControlStack.js +4 -1
- package/out/map/MapControlStack.js.map +1 -1
- package/out/map/MapFooter.d.ts +2 -15
- package/out/map/MapFooter.d.ts.map +1 -1
- package/out/map/MapFooter.js +0 -14
- package/out/map/MapFooter.js.map +1 -1
- package/out/map/MapProgressBar.d.ts +10 -13
- package/out/map/MapProgressBar.d.ts.map +1 -1
- package/out/map/MapProgressBar.js.map +1 -1
- package/out/map/MapSearchBar.d.ts +16 -17
- package/out/map/MapSearchBar.d.ts.map +1 -1
- package/out/map/MapSearchBar.js +6 -0
- package/out/map/MapSearchBar.js.map +1 -1
- package/out/map/MapSheet.d.ts +15 -12
- package/out/map/MapSheet.d.ts.map +1 -1
- package/out/map/MapSheet.js +8 -12
- package/out/map/MapSheet.js.map +1 -1
- package/out/map/OverlayLayers.d.ts +1 -1
- package/out/map/OverlayLayers.js +1 -1
- package/out/map/PlaceAutocomplete.d.ts +10 -21
- package/out/map/PlaceAutocomplete.d.ts.map +1 -1
- package/out/map/PlaceAutocomplete.js +2 -1
- package/out/map/PlaceAutocomplete.js.map +1 -1
- package/out/map/PlaceMarker.d.ts +4 -2
- package/out/map/PlaceMarker.d.ts.map +1 -1
- package/out/map/PlaceMarker.js +3 -1
- package/out/map/PlaceMarker.js.map +1 -1
- package/out/map/ResolvedPlaceLayers.d.ts +5 -14
- package/out/map/ResolvedPlaceLayers.d.ts.map +1 -1
- package/out/map/ResolvedPlaceLayers.js +1 -1
- package/out/map/ResolvedPlaceLayers.js.map +1 -1
- package/out/map/ResultCamera.d.ts +8 -31
- package/out/map/ResultCamera.d.ts.map +1 -1
- package/out/map/ResultCamera.js +3 -28
- package/out/map/ResultCamera.js.map +1 -1
- package/out/map/ResultOverlay.d.ts +2 -12
- package/out/map/ResultOverlay.d.ts.map +1 -1
- package/out/map/ResultOverlay.js +1 -2
- package/out/map/ResultOverlay.js.map +1 -1
- package/out/map/ResultPanel.d.ts +1 -20
- package/out/map/ResultPanel.d.ts.map +1 -1
- package/out/map/ResultPanel.js.map +1 -1
- package/out/map/VersionPicker.d.ts +7 -19
- package/out/map/VersionPicker.d.ts.map +1 -1
- package/out/map/VersionPicker.js +5 -2
- package/out/map/VersionPicker.js.map +1 -1
- package/out/map/fake-runtime.d.ts +9 -11
- package/out/map/fake-runtime.d.ts.map +1 -1
- package/out/map/fake-runtime.js +9 -12
- package/out/map/fake-runtime.js.map +1 -1
- package/out/map/geometry.d.ts +13 -34
- package/out/map/geometry.d.ts.map +1 -1
- package/out/map/geometry.js +9 -34
- package/out/map/geometry.js.map +1 -1
- package/out/map/graticule.d.ts +17 -0
- package/out/map/graticule.d.ts.map +1 -0
- package/out/map/graticule.js +67 -0
- package/out/map/graticule.js.map +1 -0
- package/out/map/map-debug.d.ts +1 -1
- package/out/map/map-debug.js +1 -1
- package/out/map/place-render.d.ts +23 -43
- package/out/map/place-render.d.ts.map +1 -1
- package/out/map/place-render.js +4 -39
- package/out/map/place-render.js.map +1 -1
- package/out/map/types.d.ts +58 -102
- package/out/map/types.d.ts.map +1 -1
- package/out/map/types.js +1 -10
- package/out/map/types.js.map +1 -1
- package/out/map/useCompareState.d.ts +5 -4
- package/out/map/useCompareState.d.ts.map +1 -1
- package/out/map/useCompareState.js +3 -3
- package/out/map/useCompareState.js.map +1 -1
- package/out/map/useGeocode.d.ts +5 -3
- package/out/map/useGeocode.d.ts.map +1 -1
- package/out/map/useGeocode.js +4 -4
- package/out/map/useGeocode.js.map +1 -1
- package/out/map/useMapBearing.d.ts +11 -11
- package/out/map/useMapBearing.d.ts.map +1 -1
- package/out/map/useMapBearing.js +6 -11
- package/out/map/useMapBearing.js.map +1 -1
- package/out/map/useMapLabelPick.d.ts +4 -14
- package/out/map/useMapLabelPick.d.ts.map +1 -1
- package/out/map/useMapLabelPick.js +21 -30
- package/out/map/useMapLabelPick.js.map +1 -1
- package/out/map/useMapPlaceRender.d.ts +2 -6
- package/out/map/useMapPlaceRender.d.ts.map +1 -1
- package/out/map/useMapPlaceRender.js +2 -6
- package/out/map/useMapPlaceRender.js.map +1 -1
- package/out/map/usePlaceAutocomplete.d.ts +30 -28
- package/out/map/usePlaceAutocomplete.d.ts.map +1 -1
- package/out/map/usePlaceAutocomplete.js +6 -33
- package/out/map/usePlaceAutocomplete.js.map +1 -1
- package/out/map.d.ts +69 -0
- package/out/map.d.ts.map +1 -0
- package/out/map.js +46 -0
- package/out/map.js.map +1 -0
- package/out/pipeline/CandidatePicker.d.ts +12 -2
- package/out/pipeline/CandidatePicker.d.ts.map +1 -1
- package/out/pipeline/CandidatePicker.js +1 -1
- package/out/pipeline/CandidatePicker.js.map +1 -1
- package/out/pipeline/ConfidenceCell.d.ts +1 -1
- package/out/pipeline/ConfidenceCell.js +1 -1
- package/out/pipeline/FailureDiagnostic.d.ts +8 -2
- package/out/pipeline/FailureDiagnostic.d.ts.map +1 -1
- package/out/pipeline/FailureDiagnostic.js +3 -0
- package/out/pipeline/FailureDiagnostic.js.map +1 -1
- package/out/pipeline/QueryForm.d.ts +5 -2
- package/out/pipeline/QueryForm.d.ts.map +1 -1
- package/out/pipeline/QueryForm.js.map +1 -1
- package/out/pipeline/SpanHighlight.d.ts +4 -3
- package/out/pipeline/SpanHighlight.d.ts.map +1 -1
- package/out/pipeline/SpanHighlight.js +3 -2
- package/out/pipeline/SpanHighlight.js.map +1 -1
- package/out/pipeline/TimingPanel.d.ts +1 -1
- package/out/pipeline/TreeView.d.ts +1 -1
- package/out/pipeline/copy.d.ts +1 -1
- package/out/pipeline/copy.d.ts.map +1 -1
- package/out/pipeline/copy.js +4 -3
- package/out/pipeline/copy.js.map +1 -1
- package/out/pipeline/presets.d.ts +5 -4
- package/out/pipeline/presets.d.ts.map +1 -1
- package/out/pipeline/presets.js +15 -13
- package/out/pipeline/presets.js.map +1 -1
- package/out/pipeline/types.d.ts +21 -14
- package/out/pipeline/types.d.ts.map +1 -1
- package/out/pipeline/types.js +2 -4
- package/out/pipeline/types.js.map +1 -1
- package/out/pipeline/useParsePipeline.d.ts +14 -9
- package/out/pipeline/useParsePipeline.d.ts.map +1 -1
- package/out/pipeline/useParsePipeline.js +7 -8
- package/out/pipeline/useParsePipeline.js.map +1 -1
- package/out/pipeline.d.ts +33 -0
- package/out/pipeline.d.ts.map +1 -0
- package/out/pipeline.js +21 -0
- package/out/pipeline.js.map +1 -0
- package/out/poi/AbstainPanel.d.ts +1 -1
- package/out/poi/LiveResultsBlock.d.ts +2 -1
- package/out/poi/LiveResultsBlock.d.ts.map +1 -1
- package/out/poi/LiveResultsBlock.js.map +1 -1
- package/out/poi/POIExplorer.d.ts +22 -12
- package/out/poi/POIExplorer.d.ts.map +1 -1
- package/out/poi/POIExplorer.js +9 -8
- package/out/poi/POIExplorer.js.map +1 -1
- package/out/poi/QueryInput.d.ts +1 -1
- package/out/poi/SubjectPanel.d.ts +2 -2
- package/out/poi/SubjectPanel.d.ts.map +1 -1
- package/out/poi/SubjectPanel.js +2 -1
- package/out/poi/SubjectPanel.js.map +1 -1
- package/out/poi/runtime.d.ts +5 -14
- package/out/poi/runtime.d.ts.map +1 -1
- package/out/poi/runtime.js +5 -16
- package/out/poi/runtime.js.map +1 -1
- package/out/poi/types.d.ts +39 -27
- package/out/poi/types.d.ts.map +1 -1
- package/out/poi/types.js +2 -4
- package/out/poi/types.js.map +1 -1
- package/out/poi/usePOISearch.d.ts +28 -17
- package/out/poi/usePOISearch.d.ts.map +1 -1
- package/out/poi/usePOISearch.js +6 -32
- package/out/poi/usePOISearch.js.map +1 -1
- package/out/poi.d.ts +23 -0
- package/out/poi.d.ts.map +1 -0
- package/out/poi.js +15 -0
- package/out/poi.js.map +1 -0
- package/out/runtime/useReleaseRuntime.d.ts +64 -65
- package/out/runtime/useReleaseRuntime.d.ts.map +1 -1
- package/out/runtime/useReleaseRuntime.js +31 -26
- package/out/runtime/useReleaseRuntime.js.map +1 -1
- package/out/{runtime/index.d.ts → runtime.d.ts} +1 -1
- package/out/runtime.d.ts.map +1 -0
- package/out/{runtime/index.js → runtime.js} +1 -1
- package/out/runtime.js.map +1 -0
- package/out/search/SearchModal.d.ts +33 -0
- package/out/search/SearchModal.d.ts.map +1 -0
- package/out/search/SearchModal.js +187 -0
- package/out/search/SearchModal.js.map +1 -0
- package/out/search/types.d.ts +64 -0
- package/out/search/types.d.ts.map +1 -0
- package/out/search/types.js +13 -0
- package/out/search/types.js.map +1 -0
- package/out/search.d.ts +11 -0
- package/out/search.d.ts.map +1 -0
- package/out/search.js +9 -0
- package/out/search.js.map +1 -0
- package/package.json +60 -142
- package/styles.css +482 -266
- package/tokens/index.css +24 -6
- package/tokens/tokens.json +114 -6
- package/lib/common/index.ts +0 -22
- package/lib/map/index.ts +0 -95
- package/lib/pipeline/index.ts +0 -36
- package/lib/poi/index.ts +0 -39
- package/out/common/index.d.ts +0 -22
- package/out/common/index.d.ts.map +0 -1
- package/out/common/index.js +0 -15
- package/out/common/index.js.map +0 -1
- package/out/map/index.d.ts +0 -69
- package/out/map/index.d.ts.map +0 -1
- package/out/map/index.js +0 -46
- package/out/map/index.js.map +0 -1
- package/out/pipeline/index.d.ts +0 -33
- package/out/pipeline/index.d.ts.map +0 -1
- package/out/pipeline/index.js +0 -21
- package/out/pipeline/index.js.map +0 -1
- package/out/poi/index.d.ts +0 -23
- package/out/poi/index.d.ts.map +0 -1
- package/out/poi/index.js +0 -15
- package/out/poi/index.js.map +0 -1
- package/out/runtime/index.d.ts.map +0 -1
- package/out/runtime/index.js.map +0 -1
- package/styleframe.config.ts +0 -329
- package/vitest.node.config.ts +0 -20
- /package/lib/{runtime/index.ts → runtime.ts} +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AppIdentity.d.ts","sourceRoot":"","sources":["../../lib/map/AppIdentity.tsx"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAStC;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAChC;;OAEG;IACH,IAAI,EAAE,SAAS,CAAA;IACf;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB;;;OAGG;IACH,UAAU,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,MAAM,CAAA;CACvC;AAED;;;GAGG;AACH,wBAAgB,WAAW,CAAC,EAC3B,IAAI,EACJ,OAAO,EACP,SAAqC,EACrC,YAAY,EACZ,UAAU,GACV,EAAE,gBAAgB,GAAG,SAAS,CA4B9B"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useBuildInfo } from "#common/useBuildInfo";
|
|
3
|
+
/**
|
|
4
|
+
* The number of commit characters shown in the footer.
|
|
5
|
+
*/
|
|
6
|
+
const DISPLAYED_LENGTH = 6;
|
|
7
|
+
/**
|
|
8
|
+
* Renders the app name, documentation link and short build commit.
|
|
9
|
+
* The commit is omitted when no build record loads.
|
|
10
|
+
*/
|
|
11
|
+
export function AppIdentity({ name, docsURL, docsLabel = "Developer Documentation", buildInfoURL, commitHref, }) {
|
|
12
|
+
const build = useBuildInfo(buildInfoURL);
|
|
13
|
+
const commit = build?.commit;
|
|
14
|
+
return (_jsxs(_Fragment, { children: [_jsx("strong", { children: name }), docsURL ? (_jsxs(_Fragment, { children: [" ", _jsx("a", { href: docsURL, children: docsLabel })] })) : null, commit ? (_jsxs(_Fragment, { children: [" (", commitHref ? (_jsx("a", { href: commitHref(commit), title: `Built from ${commit}`, children: _jsx("code", { children: commit.slice(0, DISPLAYED_LENGTH) }) })) : (_jsx("code", { title: `Built from ${commit}`, children: commit.slice(0, DISPLAYED_LENGTH) })), ")"] })) : null] }));
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=AppIdentity.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AppIdentity.js","sourceRoot":"","sources":["../../lib/map/AppIdentity.tsx"],"names":[],"mappings":";AAWA,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAA;AAEnD;;GAEG;AACH,MAAM,gBAAgB,GAAG,CAAC,CAAA;AA8B1B;;;GAGG;AACH,MAAM,UAAU,WAAW,CAAC,EAC3B,IAAI,EACJ,OAAO,EACP,SAAS,GAAG,yBAAyB,EACrC,YAAY,EACZ,UAAU,GACQ;IAClB,MAAM,KAAK,GAAG,YAAY,CAAC,YAAY,CAAC,CAAA;IACxC,MAAM,MAAM,GAAG,KAAK,EAAE,MAAM,CAAA;IAE5B,OAAO,CACN,8BACC,2BAAS,IAAI,GAAU,EACtB,OAAO,CAAC,CAAC,CAAC,CACV,8BACE,GAAG,EACJ,YAAG,IAAI,EAAE,OAAO,YAAG,SAAS,GAAK,IAC/B,CACH,CAAC,CAAC,CAAC,IAAI,EACP,MAAM,CAAC,CAAC,CAAC,CACT,8BACE,IAAI,EACJ,UAAU,CAAC,CAAC,CAAC,CACb,YAAG,IAAI,EAAE,UAAU,CAAC,MAAM,CAAC,EAAE,KAAK,EAAE,cAAc,MAAM,EAAE,YACzD,yBAAO,MAAM,CAAC,KAAK,CAAC,CAAC,EAAE,gBAAgB,CAAC,GAAQ,GAC7C,CACJ,CAAC,CAAC,CAAC,CACH,eAAM,KAAK,EAAE,cAAc,MAAM,EAAE,YAAG,MAAM,CAAC,KAAK,CAAC,CAAC,EAAE,gBAAgB,CAAC,GAAQ,CAC/E,EACA,GAAG,IACF,CACH,CAAC,CAAC,CAAC,IAAI,IACN,CACH,CAAA;AACF,CAAC"}
|
|
@@ -3,30 +3,29 @@
|
|
|
3
3
|
* @license AGPL-3.0
|
|
4
4
|
* @author Teffen Ellis, et al.
|
|
5
5
|
*
|
|
6
|
-
*
|
|
7
|
-
* panel (`_app.tsx:1255-1280`), as a dumb presentational unit. It shows which backend the runtime
|
|
8
|
-
* resolved to (WebGPU / WASM, with the int8 size the host formats into the label) and lets the visitor
|
|
9
|
-
* opt out of WebGPU. Props in, one boolean event out — the host re-loads the bundle on the toggle.
|
|
10
|
-
*
|
|
11
|
-
* NODE-SAFE: pure React, no maplibre.
|
|
6
|
+
* Shows the active inference backend and a checkbox that forces WASM. The host applies the change.
|
|
12
7
|
*/
|
|
13
8
|
import type { ReactNode } from "react";
|
|
9
|
+
/**
|
|
10
|
+
* Props for {@link BackendControl}.
|
|
11
|
+
*/
|
|
14
12
|
export interface BackendControlProps {
|
|
15
13
|
/**
|
|
16
|
-
* The backend the runtime
|
|
14
|
+
* The backend the runtime chose, such as `webgpu (28 MB int8)`.
|
|
15
|
+
* It is empty until known.
|
|
17
16
|
*/
|
|
18
17
|
activeBackend?: string;
|
|
19
18
|
/**
|
|
20
|
-
* Whether the
|
|
19
|
+
* Whether the WASM backend is forced.
|
|
21
20
|
*/
|
|
22
21
|
forceWASM: boolean;
|
|
23
22
|
/**
|
|
24
|
-
*
|
|
23
|
+
* Called when the visitor toggles the "Force WASM" checkbox.
|
|
25
24
|
*/
|
|
26
25
|
onForceWASMChange: (forceWASM: boolean) => void;
|
|
27
26
|
}
|
|
28
27
|
/**
|
|
29
|
-
*
|
|
28
|
+
* Renders the backend indicator and the "Force WASM" checkbox.
|
|
30
29
|
*/
|
|
31
30
|
export declare function BackendControl({ activeBackend, forceWASM, onForceWASMChange }: BackendControlProps): ReactNode;
|
|
32
31
|
//# sourceMappingURL=BackendControl.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BackendControl.d.ts","sourceRoot":"","sources":["../../lib/map/BackendControl.tsx"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"BackendControl.d.ts","sourceRoot":"","sources":["../../lib/map/BackendControl.tsx"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAEtC;;GAEG;AACH,MAAM,WAAW,mBAAmB;IACnC;;;OAGG;IACH,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB;;OAEG;IACH,SAAS,EAAE,OAAO,CAAA;IAClB;;OAEG;IACH,iBAAiB,EAAE,CAAC,SAAS,EAAE,OAAO,KAAK,IAAI,CAAA;CAC/C;AAED;;GAEG;AACH,wBAAgB,cAAc,CAAC,EAAE,aAAa,EAAE,SAAS,EAAE,iBAAiB,EAAE,EAAE,mBAAmB,GAAG,SAAS,CAiB9G"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
3
|
+
* Renders the backend indicator and the "Force WASM" checkbox.
|
|
4
4
|
*/
|
|
5
5
|
export function BackendControl({ activeBackend, forceWASM, onForceWASMChange }) {
|
|
6
6
|
return (_jsxs("div", { className: "mw-demo-backend", children: [_jsx("span", { className: "mw-map-sheet__label", children: "Inference backend" }), activeBackend ? (_jsxs("span", { className: "mw-demo-backend__active", children: ["Running on ", _jsx("code", { children: activeBackend })] })) : null, _jsxs("label", { className: "mw-map-sheet__check mw-demo-backend__toggle", children: [_jsx("input", { type: "checkbox", checked: forceWASM, onChange: (event) => onForceWASMChange(event.target.checked) }), "Force WASM"] })] }));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BackendControl.js","sourceRoot":"","sources":["../../lib/map/BackendControl.tsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"BackendControl.js","sourceRoot":"","sources":["../../lib/map/BackendControl.tsx"],"names":[],"mappings":";AA6BA;;GAEG;AACH,MAAM,UAAU,cAAc,CAAC,EAAE,aAAa,EAAE,SAAS,EAAE,iBAAiB,EAAuB;IAClG,OAAO,CACN,eAAK,SAAS,EAAC,iBAAiB,aAC/B,eAAM,SAAS,EAAC,qBAAqB,kCAAyB,EAE7D,aAAa,CAAC,CAAC,CAAC,CAChB,gBAAM,SAAS,EAAC,yBAAyB,4BAC7B,yBAAO,aAAa,GAAQ,IACjC,CACP,CAAC,CAAC,CAAC,IAAI,EAER,iBAAO,SAAS,EAAC,6CAA6C,aAC7D,gBAAO,IAAI,EAAC,UAAU,EAAC,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,iBAAiB,CAAC,KAAK,CAAC,MAAM,CAAC,OAAO,CAAC,GAAI,kBAEpG,IACH,CACN,CAAA;AACF,CAAC"}
|
|
@@ -3,51 +3,28 @@
|
|
|
3
3
|
* @license AGPL-3.0
|
|
4
4
|
* @author Teffen Ellis, et al.
|
|
5
5
|
*
|
|
6
|
-
*
|
|
7
|
-
* control panel (`_app.tsx:1281-1339`), as a dumb presentational unit. Turning it on reveals a second
|
|
8
|
-
* version picker (the primary version filtered out); the actual second parse is a host concern the
|
|
9
|
-
* composed demo surfaces through `panels.compare`. Props in, two events out.
|
|
10
|
-
*
|
|
11
|
-
* NODE-SAFE: pure React, no maplibre.
|
|
6
|
+
* Renders a compare-mode checkbox and a selector for the second model version, leaving the comparison itself to the host.
|
|
12
7
|
*/
|
|
13
8
|
import type { ReactNode } from "react";
|
|
14
9
|
import type { VersionOption } from "#map/types";
|
|
10
|
+
/**
|
|
11
|
+
* Props for {@link CompareToggle}.
|
|
12
|
+
*/
|
|
15
13
|
export interface CompareToggleProps {
|
|
16
|
-
/**
|
|
17
|
-
* The selectable model bundles (the primary version is filtered out of the compare list).
|
|
18
|
-
*/
|
|
19
14
|
versions: ReadonlyArray<VersionOption>;
|
|
20
|
-
/**
|
|
21
|
-
* The primary version, excluded from the compare options.
|
|
22
|
-
*/
|
|
23
15
|
primaryVersion: string | null;
|
|
24
|
-
/**
|
|
25
|
-
* Whether compare mode is on.
|
|
26
|
-
*/
|
|
27
16
|
compareMode: boolean;
|
|
28
|
-
/**
|
|
29
|
-
* Fired when the visitor flips compare mode.
|
|
30
|
-
*/
|
|
31
17
|
onCompareModeChange: (compareMode: boolean) => void;
|
|
32
|
-
/**
|
|
33
|
-
* The version chosen to compare against, or `null` when none is chosen.
|
|
34
|
-
*/
|
|
35
18
|
compareVersion: string | null;
|
|
36
|
-
/**
|
|
37
|
-
* Fired with the chosen compare version (or `null` when the empty option is picked).
|
|
38
|
-
*/
|
|
39
19
|
onCompareVersionChange: (version: string | null) => void;
|
|
40
|
-
/**
|
|
41
|
-
* Disable the compare-version select (e.g. while a parse or compare load runs).
|
|
42
|
-
*/
|
|
43
20
|
disabled?: boolean;
|
|
44
|
-
/**
|
|
45
|
-
* A status line rendered under the select (e.g. the compare backend, or a "Loading…" line).
|
|
46
|
-
*/
|
|
47
21
|
status?: ReactNode;
|
|
48
22
|
}
|
|
49
23
|
/**
|
|
50
|
-
*
|
|
24
|
+
* Renders the compare checkbox.
|
|
25
|
+
*
|
|
26
|
+
* In compare mode, it also renders the version selector. and no control at all
|
|
27
|
+
* when fewer than two versions exist.
|
|
51
28
|
*/
|
|
52
29
|
export declare function CompareToggle({ versions, primaryVersion, compareMode, onCompareModeChange, compareVersion, onCompareVersionChange, disabled, status, }: CompareToggleProps): ReactNode;
|
|
53
30
|
//# sourceMappingURL=CompareToggle.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CompareToggle.d.ts","sourceRoot":"","sources":["../../lib/map/CompareToggle.tsx"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"CompareToggle.d.ts","sourceRoot":"","sources":["../../lib/map/CompareToggle.tsx"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAEtC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAA;AAE/C;;GAEG;AACH,MAAM,WAAW,kBAAkB;IAClC,QAAQ,EAAE,aAAa,CAAC,aAAa,CAAC,CAAA;IACtC,cAAc,EAAE,MAAM,GAAG,IAAI,CAAA;IAC7B,WAAW,EAAE,OAAO,CAAA;IACpB,mBAAmB,EAAE,CAAC,WAAW,EAAE,OAAO,KAAK,IAAI,CAAA;IACnD,cAAc,EAAE,MAAM,GAAG,IAAI,CAAA;IAC7B,sBAAsB,EAAE,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,KAAK,IAAI,CAAA;IACxD,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,MAAM,CAAC,EAAE,SAAS,CAAA;CAClB;AAED;;;;;GAKG;AACH,wBAAgB,aAAa,CAAC,EAC7B,QAAQ,EACR,cAAc,EACd,WAAW,EACX,mBAAmB,EACnB,cAAc,EACd,sBAAsB,EACtB,QAAQ,EACR,MAAM,GACN,EAAE,kBAAkB,GAAG,SAAS,CAmChC"}
|
package/out/map/CompareToggle.js
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
3
|
+
* Renders the compare checkbox.
|
|
4
|
+
*
|
|
5
|
+
* In compare mode, it also renders the version selector. and no control at all
|
|
6
|
+
* when fewer than two versions exist.
|
|
4
7
|
*/
|
|
5
8
|
export function CompareToggle({ versions, primaryVersion, compareMode, onCompareModeChange, compareVersion, onCompareVersionChange, disabled, status, }) {
|
|
6
9
|
if (versions.length < 2)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CompareToggle.js","sourceRoot":"","sources":["../../lib/map/CompareToggle.tsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"CompareToggle.js","sourceRoot":"","sources":["../../lib/map/CompareToggle.tsx"],"names":[],"mappings":";AA0BA;;;;;GAKG;AACH,MAAM,UAAU,aAAa,CAAC,EAC7B,QAAQ,EACR,cAAc,EACd,WAAW,EACX,mBAAmB,EACnB,cAAc,EACd,sBAAsB,EACtB,QAAQ,EACR,MAAM,GACc;IACpB,IAAI,QAAQ,CAAC,MAAM,GAAG,CAAC;QAAE,OAAO,IAAI,CAAA;IAEpC,MAAM,OAAO,GAAG,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,OAAO,KAAK,cAAc,CAAC,CAAA;IAEpE,OAAO,CACN,eAAK,SAAS,EAAC,iBAAiB,aAC/B,iBAAO,SAAS,EAAC,6CAA6C,aAC7D,gBAAO,IAAI,EAAC,UAAU,EAAC,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,mBAAmB,CAAC,KAAK,CAAC,MAAM,CAAC,OAAO,CAAC,GAAI,kCAExG,EACP,WAAW,CAAC,CAAC,CAAC,CACd,eAAK,SAAS,EAAC,iBAAiB,aAC/B,gBAAO,SAAS,EAAC,wBAAwB,EAAC,OAAO,EAAC,yBAAyB,6BAEnE,EACR,kBACC,EAAE,EAAC,yBAAyB,EAC5B,SAAS,EAAC,yBAAyB,EACnC,KAAK,EAAE,cAAc,IAAI,EAAE,EAC3B,QAAQ,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,sBAAsB,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,IAAI,IAAI,CAAC,EAC/D,QAAQ,EAAE,QAAQ,aAElB,iBAAQ,KAAK,EAAC,EAAE,qCAAyB,EACxC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CACnB,iBAAwB,KAAK,EAAE,CAAC,CAAC,OAAO,YACtC,CAAC,CAAC,KAAK,IAAI,CAAC,CAAC,OAAO,IADT,CAAC,CAAC,OAAO,CAEb,CACT,CAAC,IACM,EACR,MAAM,CAAC,CAAC,CAAC,YAAG,SAAS,EAAC,yBAAyB,YAAE,MAAM,GAAK,CAAC,CAAC,CAAC,IAAI,IAC/D,CACN,CAAC,CAAC,CAAC,IAAI,IACH,CACN,CAAA;AACF,CAAC"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @copyright Sister Software
|
|
3
|
+
* @license AGPL-3.0
|
|
4
|
+
* @author Teffen Ellis, et al.
|
|
5
|
+
*
|
|
6
|
+
* Display and log build, model and runtime details for bug reports.
|
|
7
|
+
* Report the actual execution backend because successful loading does not imply WebGPU ran.
|
|
8
|
+
*/
|
|
9
|
+
import { type ReactNode } from "react";
|
|
10
|
+
export interface DebugInfoProps {
|
|
11
|
+
/**
|
|
12
|
+
* The backend the runtime resolved to (e.g. `webgpu (28 MB int8)`); empty before it is known.
|
|
13
|
+
*/
|
|
14
|
+
activeBackend?: string;
|
|
15
|
+
/**
|
|
16
|
+
* Whether the CPU/wasm backend is currently forced.
|
|
17
|
+
*
|
|
18
|
+
* This explains a `wasm` backend that would otherwise indicate a WebGPU failure.
|
|
19
|
+
*/
|
|
20
|
+
forceWASM?: boolean;
|
|
21
|
+
/**
|
|
22
|
+
* The model version the runtime loaded.
|
|
23
|
+
*
|
|
24
|
+
* The training series.
|
|
25
|
+
* It differs from the npm version.
|
|
26
|
+
*/
|
|
27
|
+
selectedVersion?: string | null;
|
|
28
|
+
/**
|
|
29
|
+
* Whether the asset bundle finished loading.
|
|
30
|
+
*/
|
|
31
|
+
ready?: boolean;
|
|
32
|
+
}
|
|
33
|
+
export declare function DebugInfo({ activeBackend, forceWASM, selectedVersion, ready }: DebugInfoProps): ReactNode;
|
|
34
|
+
//# sourceMappingURL=DebugInfo.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DebugInfo.d.ts","sourceRoot":"","sources":["../../lib/map/DebugInfo.tsx"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,KAAK,SAAS,EAAsB,MAAM,OAAO,CAAA;AAI1D,MAAM,WAAW,cAAc;IAC9B;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB;;;;OAIG;IACH,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB;;;;;OAKG;IACH,eAAe,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IAC/B;;OAEG;IACH,KAAK,CAAC,EAAE,OAAO,CAAA;CACf;AAcD,wBAAgB,SAAS,CAAC,EAAE,aAAa,EAAE,SAAS,EAAE,eAAe,EAAE,KAAK,EAAE,EAAE,cAAc,GAAG,SAAS,CAsCzG"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
/**
|
|
3
|
+
* @copyright Sister Software
|
|
4
|
+
* @license AGPL-3.0
|
|
5
|
+
* @author Teffen Ellis, et al.
|
|
6
|
+
*
|
|
7
|
+
* Display and log build, model and runtime details for bug reports.
|
|
8
|
+
* Report the actual execution backend because successful loading does not imply WebGPU ran.
|
|
9
|
+
*/
|
|
10
|
+
import { useEffect, useMemo } from "react";
|
|
11
|
+
import { useBuildInfo } from "#common/useBuildInfo";
|
|
12
|
+
/**
|
|
13
|
+
* One row of the record, as a label and a value.
|
|
14
|
+
*/
|
|
15
|
+
function Row({ label, value }) {
|
|
16
|
+
return (_jsxs("div", { className: "mw-debug-info__row", children: [_jsx("span", { className: "mw-debug-info__label", children: label }), _jsx("code", { className: "mw-debug-info__value", children: value })] }));
|
|
17
|
+
}
|
|
18
|
+
export function DebugInfo({ activeBackend, forceWASM, selectedVersion, ready }) {
|
|
19
|
+
const build = useBuildInfo();
|
|
20
|
+
// Memoized on the primitives it reads, so the log below fires when a value changes
|
|
21
|
+
// rather than on every render.
|
|
22
|
+
// A record rebuilt each render would be a new object each time and log continuously.
|
|
23
|
+
const record = useMemo(() => ({
|
|
24
|
+
app: build?.app ?? "—",
|
|
25
|
+
commit: build?.commit ?? build?.revision ?? "—",
|
|
26
|
+
buildTime: build?.buildTime ?? "—",
|
|
27
|
+
model: selectedVersion ?? "—",
|
|
28
|
+
backend: activeBackend || (ready ? "unknown" : "loading…"),
|
|
29
|
+
forceWASM: Boolean(forceWASM),
|
|
30
|
+
webgpuInBrowser: typeof navigator !== "undefined" && "gpu" in navigator,
|
|
31
|
+
userAgent: typeof navigator !== "undefined" ? navigator.userAgent : "—",
|
|
32
|
+
}), [build?.app, build?.commit, build?.revision, build?.buildTime, selectedVersion, activeBackend, forceWASM, ready]);
|
|
33
|
+
useEffect(() => {
|
|
34
|
+
// eslint-disable-next-line no-console -- this is the feature: the record has to reach the console a reporter copies.
|
|
35
|
+
console.info("[mailwoman] debug info", record);
|
|
36
|
+
}, [record]);
|
|
37
|
+
return (_jsxs("div", { className: "mw-debug-info", children: [_jsx(Row, { label: "Build", value: record.app }), _jsx(Row, { label: "Commit", value: record.commit.slice(0, 12) }), _jsx(Row, { label: "Built", value: record.buildTime }), _jsx(Row, { label: "Model", value: record.model }), _jsx(Row, { label: "Backend", value: record.backend }), _jsx(Row, { label: "WebGPU available", value: record.webgpuInBrowser ? "yes" : "no" }), _jsx(Row, { label: "Force WASM", value: record.forceWASM ? "on" : "off" })] }));
|
|
38
|
+
}
|
|
39
|
+
//# sourceMappingURL=DebugInfo.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DebugInfo.js","sourceRoot":"","sources":["../../lib/map/DebugInfo.tsx"],"names":[],"mappings":";AAAA;;;;;;;GAOG;AAEH,OAAO,EAAkB,SAAS,EAAE,OAAO,EAAE,MAAM,OAAO,CAAA;AAE1D,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAA;AA0BnD;;GAEG;AACH,SAAS,GAAG,CAAC,EAAE,KAAK,EAAE,KAAK,EAAoC;IAC9D,OAAO,CACN,eAAK,SAAS,EAAC,oBAAoB,aAClC,eAAM,SAAS,EAAC,sBAAsB,YAAE,KAAK,GAAQ,EACrD,eAAM,SAAS,EAAC,sBAAsB,YAAE,KAAK,GAAQ,IAChD,CACN,CAAA;AACF,CAAC;AAED,MAAM,UAAU,SAAS,CAAC,EAAE,aAAa,EAAE,SAAS,EAAE,eAAe,EAAE,KAAK,EAAkB;IAC7F,MAAM,KAAK,GAAG,YAAY,EAAE,CAAA;IAE5B,mFAAmF;IACnF,+BAA+B;IAC/B,qFAAqF;IACrF,MAAM,MAAM,GAAG,OAAO,CACrB,GAAG,EAAE,CAAC,CAAC;QACN,GAAG,EAAE,KAAK,EAAE,GAAG,IAAI,GAAG;QACtB,MAAM,EAAE,KAAK,EAAE,MAAM,IAAI,KAAK,EAAE,QAAQ,IAAI,GAAG;QAC/C,SAAS,EAAE,KAAK,EAAE,SAAS,IAAI,GAAG;QAClC,KAAK,EAAE,eAAe,IAAI,GAAG;QAC7B,OAAO,EAAE,aAAa,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,UAAU,CAAC;QAC1D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AAC,KAAK,EAAE,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,GAAI,IAC7D,CACN,CAAA;AACF,CAAC"}
|
package/out/map/Geocoder.d.ts
CHANGED
|
@@ -2,66 +2,77 @@
|
|
|
2
2
|
* @copyright Sister Software
|
|
3
3
|
* @license AGPL-3.0
|
|
4
4
|
* @author Teffen Ellis, et al.
|
|
5
|
-
*
|
|
6
|
-
* `<Geocoder>` — the WHOLE geocoder, composed. It is the map analogue of `PipelineExplorer`
|
|
7
|
-
* and takes the SAME DI shape: an injected {@link GeocoderRuntime} (the host owns ONNX / httpvfs / R2 /
|
|
8
|
-
* the composed map style) plus a {@link GeocoderPanels} bag (the host's ModelVisualizer / VersionCompare /
|
|
9
|
-
* About / Permalink). Everything here is composition + a `ClientOnly` boundary:
|
|
10
|
-
*
|
|
11
|
-
* - the floating {@link GeocoderControls} panel (version / compare / backend / query+autocomplete / result),
|
|
12
|
-
* - the declarative {@link MapCanvas} with the phase-2 overlays ({@link OverlayLayers}) and the
|
|
13
|
-
* resolved-place marker/outline/camera ({@link ResolvedPlaceLayers}) driven by the parse state,
|
|
14
|
-
* - the hooks that wire them: {@link useGeocode} (parse + viewport bias + map place),
|
|
15
|
-
* {@link usePlaceAutocomplete}, {@link useCompareState}.
|
|
16
|
-
*
|
|
17
|
-
* Because it pulls {@link MapCanvas} (→ `react-map-gl` → `maplibre-gl`, WebGL + DOM at import), it lives on
|
|
18
|
-
* the `@mailwoman/react/map` subpath ONLY — never the package root. The whole thing renders in Storybook
|
|
19
|
-
* over a fake runtime (offline stub style + canned geocode) with no network, no ONNX, no gazetteer.
|
|
20
5
|
*/
|
|
21
6
|
import { type ReactNode } from "react";
|
|
22
7
|
import type { GeocoderPanels, GeocoderRuntime } from "#map/types";
|
|
23
8
|
import type { Preset } from "../common/PresetChips.tsx";
|
|
9
|
+
/**
|
|
10
|
+
* Props for {@linkcode Geocoder}.
|
|
11
|
+
*/
|
|
24
12
|
export interface GeocoderProps {
|
|
25
13
|
/**
|
|
26
|
-
* The
|
|
14
|
+
* The geocoder runtime supplies the map style and overlays.
|
|
15
|
+
*
|
|
16
|
+
* It also supplies the parser and version and backend controls.
|
|
27
17
|
*/
|
|
28
18
|
runtime: GeocoderRuntime;
|
|
29
19
|
/**
|
|
30
|
-
*
|
|
20
|
+
* Panels supplied by the host.
|
|
31
21
|
*/
|
|
32
22
|
panels?: GeocoderPanels;
|
|
33
23
|
/**
|
|
34
|
-
*
|
|
24
|
+
* The address that pre-fills the search field.
|
|
25
|
+
* It is not run automatically.
|
|
35
26
|
*/
|
|
36
27
|
defaultAddress?: string;
|
|
37
28
|
/**
|
|
38
|
-
*
|
|
29
|
+
* A query to run once when the runtime is ready, such as a permalink's `?q=` value.
|
|
30
|
+
*
|
|
31
|
+
* Unlike {@link GeocoderProps.defaultAddress}, this query is submitted,
|
|
32
|
+
* so a shared link reproduces its result.
|
|
33
|
+
*/
|
|
34
|
+
initialQuery?: string | null;
|
|
35
|
+
/**
|
|
36
|
+
* The example chips.
|
|
37
|
+
*
|
|
38
|
+
* @default []
|
|
39
39
|
*/
|
|
40
40
|
presets?: ReadonlyArray<Preset>;
|
|
41
41
|
/**
|
|
42
|
-
*
|
|
43
|
-
*
|
|
42
|
+
* Whether the developer panel starts open.
|
|
43
|
+
*
|
|
44
|
+
* @default false
|
|
44
45
|
*/
|
|
45
46
|
developer?: boolean;
|
|
46
47
|
/**
|
|
47
|
-
*
|
|
48
|
-
*
|
|
48
|
+
* Called with each user-submitted query.
|
|
49
|
+
*
|
|
50
|
+
* The host decides how to write the query to its URL.
|
|
51
|
+
* This package never touches `location`.
|
|
49
52
|
*/
|
|
50
53
|
onSubmitQuery?: (query: string) => void;
|
|
51
54
|
/**
|
|
52
|
-
*
|
|
53
|
-
*
|
|
55
|
+
* The minimum map zoom at which the viewport is sent as a location bias.
|
|
56
|
+
*
|
|
57
|
+
* @default 4
|
|
54
58
|
*/
|
|
55
59
|
minBiasZoom?: number;
|
|
56
60
|
/**
|
|
57
|
-
*
|
|
58
|
-
*
|
|
59
|
-
*
|
|
61
|
+
* Whether the map moves to each resolved place.
|
|
62
|
+
*
|
|
63
|
+
* Set it to false when the host controls the camera or a test needs a fixed view.
|
|
64
|
+
* The marker and outline render either way.
|
|
65
|
+
*
|
|
66
|
+
* @default true
|
|
60
67
|
*/
|
|
61
68
|
applyResultCamera?: boolean;
|
|
62
69
|
}
|
|
63
70
|
/**
|
|
64
|
-
*
|
|
71
|
+
* Renders the map and search controls as one geocoder.
|
|
72
|
+
* It also renders host panels.
|
|
73
|
+
*
|
|
74
|
+
* It renders only on the client because MapLibre needs browser APIs.
|
|
75
|
+
* Import it from `@mailwoman/react/map`.
|
|
65
76
|
*/
|
|
66
|
-
export declare function Geocoder({ runtime, panels, defaultAddress, presets, minBiasZoom, applyResultCamera, developer, onSubmitQuery, }: GeocoderProps): ReactNode;
|
|
77
|
+
export declare function Geocoder({ runtime, panels, defaultAddress, presets, minBiasZoom, applyResultCamera, developer, initialQuery, onSubmitQuery, }: GeocoderProps): ReactNode;
|
|
67
78
|
//# sourceMappingURL=Geocoder.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Geocoder.d.ts","sourceRoot":"","sources":["../../lib/map/Geocoder.tsx"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"Geocoder.d.ts","sourceRoot":"","sources":["../../lib/map/Geocoder.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,KAAK,SAAS,EAA4C,MAAM,OAAO,CAAA;AAGhF,OAAO,KAAK,EAAE,cAAc,EAAE,eAAe,EAAW,MAAM,YAAY,CAAA;AAO1E,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,2BAA2B,CAAA;AAOvD;;GAEG;AACH,MAAM,WAAW,aAAa;IAC7B;;;;OAIG;IACH,OAAO,EAAE,eAAe,CAAA;IACxB;;OAEG;IACH,MAAM,CAAC,EAAE,cAAc,CAAA;IACvB;;;OAGG;IACH,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB;;;;;OAKG;IACH,YAAY,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IAC5B;;;;OAIG;IACH,OAAO,CAAC,EAAE,aAAa,CAAC,MAAM,CAAC,CAAA;IAC/B;;;;OAIG;IACH,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB;;;;;OAKG;IACH,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAA;IACvC;;;;OAIG;IACH,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB;;;;;;;OAOG;IACH,iBAAiB,CAAC,EAAE,OAAO,CAAA;CAC3B;AAgID;;;;;;GAMG;AACH,wBAAgB,QAAQ,CAAC,EACxB,OAAO,EACP,MAAkB,EAClB,cAAmB,EACnB,OAAoB,EACpB,WAAe,EACf,iBAAwB,EACxB,SAAiB,EACjB,YAAmB,EACnB,aAAa,GACb,EAAE,aAAa,GAAG,SAAS,CAwB3B"}
|
package/out/map/Geocoder.js
CHANGED
|
@@ -3,21 +3,6 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
3
3
|
* @copyright Sister Software
|
|
4
4
|
* @license AGPL-3.0
|
|
5
5
|
* @author Teffen Ellis, et al.
|
|
6
|
-
*
|
|
7
|
-
* `<Geocoder>` — the WHOLE geocoder, composed. It is the map analogue of `PipelineExplorer`
|
|
8
|
-
* and takes the SAME DI shape: an injected {@link GeocoderRuntime} (the host owns ONNX / httpvfs / R2 /
|
|
9
|
-
* the composed map style) plus a {@link GeocoderPanels} bag (the host's ModelVisualizer / VersionCompare /
|
|
10
|
-
* About / Permalink). Everything here is composition + a `ClientOnly` boundary:
|
|
11
|
-
*
|
|
12
|
-
* - the floating {@link GeocoderControls} panel (version / compare / backend / query+autocomplete / result),
|
|
13
|
-
* - the declarative {@link MapCanvas} with the phase-2 overlays ({@link OverlayLayers}) and the
|
|
14
|
-
* resolved-place marker/outline/camera ({@link ResolvedPlaceLayers}) driven by the parse state,
|
|
15
|
-
* - the hooks that wire them: {@link useGeocode} (parse + viewport bias + map place),
|
|
16
|
-
* {@link usePlaceAutocomplete}, {@link useCompareState}.
|
|
17
|
-
*
|
|
18
|
-
* Because it pulls {@link MapCanvas} (→ `react-map-gl` → `maplibre-gl`, WebGL + DOM at import), it lives on
|
|
19
|
-
* the `@mailwoman/react/map` subpath ONLY — never the package root. The whole thing renders in Storybook
|
|
20
|
-
* over a fake runtime (offline stub style + canned geocode) with no network, no ONNX, no gazetteer.
|
|
21
6
|
*/
|
|
22
7
|
import { useCallback, useEffect, useRef, useState } from "react";
|
|
23
8
|
import { useCompareState } from "#map/useCompareState";
|
|
@@ -26,32 +11,29 @@ import { useMapPlaceRender } from "#map/useMapPlaceRender";
|
|
|
26
11
|
import { usePlaceAutocomplete } from "#map/usePlaceAutocomplete";
|
|
27
12
|
import { ClientOnly } from "../common/ClientOnly.js";
|
|
28
13
|
import { GeocoderControls } from "./GeocoderControls.js";
|
|
14
|
+
import { GraticuleLayer } from "./GraticuleLayer.js";
|
|
29
15
|
import { MapCanvas } from "./MapCanvas.js";
|
|
30
16
|
import { OverlayLayers } from "./OverlayLayers.js";
|
|
31
17
|
import { ResolvedPlaceLayers } from "./ResolvedPlaceLayers.js";
|
|
32
|
-
function GeocoderInner({ runtime, panels, defaultAddress, presets, minBiasZoom, applyResultCamera, developer, onSubmitQuery, }) {
|
|
18
|
+
function GeocoderInner({ runtime, panels, defaultAddress, presets, minBiasZoom, applyResultCamera, developer, initialQuery, onSubmitQuery, }) {
|
|
33
19
|
const mapRef = useRef(null);
|
|
34
|
-
// The
|
|
35
|
-
//
|
|
36
|
-
// handle also puts it in state — one poll, two consumers.
|
|
20
|
+
// The controls render outside `<MapCanvas>` and cannot call `useMap()`.
|
|
21
|
+
// The map is kept in state so they re-render when it loads.
|
|
37
22
|
const [map, setMap] = useState(null);
|
|
38
|
-
// The
|
|
39
|
-
|
|
40
|
-
//
|
|
41
|
-
// TEST INJECTION POINT: the e2e viewport-bias suite drives the REAL map (pan + zoom past the bias threshold)
|
|
42
|
-
// before submitting, and a browser test cannot reach a React ref — so the same handle is republished on
|
|
43
|
-
// `globalThis.__mailwomanMapCanvas`, and cleared on unmount so a torn-down geocoder leaves no stale handle.
|
|
23
|
+
// The graticule is inserted before the first non-background layer, so it draws under the data layers.
|
|
24
|
+
const [baseLayerID, setBaseLayerID] = useState(undefined);
|
|
44
25
|
const onMapLoad = useCallback((event) => {
|
|
26
|
+
// Browser tests read the map from this global.
|
|
45
27
|
;
|
|
46
28
|
globalThis.__mailwomanMapCanvas = event.target;
|
|
47
29
|
setMap(event.target);
|
|
30
|
+
const layers = event.target.getStyle()?.layers ?? [];
|
|
31
|
+
setBaseLayerID(layers.find((layer) => layer.type !== "background")?.id);
|
|
48
32
|
}, []);
|
|
49
33
|
useEffect(() => () => {
|
|
50
34
|
setMap(null);
|
|
51
35
|
delete globalThis.__mailwomanMapCanvas;
|
|
52
36
|
}, []);
|
|
53
|
-
// Read the viewport bias at submit time — through the map handle, never a threaded state value, so granting/zooming
|
|
54
|
-
// mid-session doesn't re-create the parse callback. Below the min-bias zoom, a whole-globe center is noise → null.
|
|
55
37
|
const getBias = useCallback(() => {
|
|
56
38
|
const live = mapRef.current?.getMap();
|
|
57
39
|
if (!live)
|
|
@@ -80,19 +62,21 @@ function GeocoderInner({ runtime, panels, defaultAddress, presets, minBiasZoom,
|
|
|
80
62
|
latitude: runtime.initialCenter[1],
|
|
81
63
|
zoom: runtime.initialZoom ?? 3,
|
|
82
64
|
}, style: { width: "100%", height: "100%" },
|
|
83
|
-
//
|
|
84
|
-
//
|
|
85
|
-
mapProps: { attributionControl: { compact: true }, maplibreLogo: false, onLoad: onMapLoad }, children: [_jsx(OverlayLayers, { overlays: runtime.overlays }), _jsx(ResolvedPlaceLayers, { spec: spec, applyCamera: applyResultCamera }), panels.mapControls] }) }), _jsx(GeocoderControls, { runtime: runtime, geocode: geocode, autocomplete: autocomplete, compare: compare, panels: panels, presets: presets, placeholder: defaultAddress, map: map, onSubmitQuery: onSubmitQuery, onSelectVersion: onSelectVersion, onForceWASMChange: onForceWASMChange, developer: developer }), panels.debugDrawer ? panels.debugDrawer({ result: geocode.result }) : null] }));
|
|
65
|
+
// The attribution is compact.
|
|
66
|
+
// The MapLibre logo is hidden.
|
|
67
|
+
mapProps: { attributionControl: { compact: true }, maplibreLogo: false, onLoad: onMapLoad }, children: [_jsx(GraticuleLayer, { beforeID: baseLayerID }), _jsx(OverlayLayers, { overlays: runtime.overlays }), _jsx(ResolvedPlaceLayers, { spec: spec, applyCamera: applyResultCamera }), panels.mapControls] }) }), _jsx(GeocoderControls, { runtime: runtime, geocode: geocode, autocomplete: autocomplete, compare: compare, panels: panels, presets: presets, placeholder: defaultAddress, initialQuery: initialQuery, map: map, onSubmitQuery: onSubmitQuery, onSelectVersion: onSelectVersion, onForceWASMChange: onForceWASMChange, developer: developer }), panels.debugDrawer ? panels.debugDrawer({ result: geocode.result }) : null] }));
|
|
86
68
|
}
|
|
87
|
-
|
|
88
|
-
* Stable empty defaults — a fresh `{}`/`[]` per render would churn every downstream memo dep.
|
|
89
|
-
*/
|
|
69
|
+
// These defaults are module constants so each render sees the same reference and memo dependencies stay stable.
|
|
90
70
|
const NO_PANELS = {};
|
|
91
71
|
const NO_PRESETS = [];
|
|
92
72
|
/**
|
|
93
|
-
*
|
|
73
|
+
* Renders the map and search controls as one geocoder.
|
|
74
|
+
* It also renders host panels.
|
|
75
|
+
*
|
|
76
|
+
* It renders only on the client because MapLibre needs browser APIs.
|
|
77
|
+
* Import it from `@mailwoman/react/map`.
|
|
94
78
|
*/
|
|
95
|
-
export function Geocoder({ runtime, panels = NO_PANELS, defaultAddress = "", presets = NO_PRESETS, minBiasZoom = 4, applyResultCamera = true, developer = false, onSubmitQuery, }) {
|
|
96
|
-
return (_jsx(ClientOnly, { fallback: _jsx("div", { className: "mw-geocoder-demo", children: _jsx("p", { children: "Loading the geocoder\u2026" }) }), children: () => (_jsx(GeocoderInner, { runtime: runtime, panels: panels, defaultAddress: defaultAddress, presets: presets, minBiasZoom: minBiasZoom, applyResultCamera: applyResultCamera, developer: developer, onSubmitQuery: onSubmitQuery })) }));
|
|
79
|
+
export function Geocoder({ runtime, panels = NO_PANELS, defaultAddress = "", presets = NO_PRESETS, minBiasZoom = 4, applyResultCamera = true, developer = false, initialQuery = null, onSubmitQuery, }) {
|
|
80
|
+
return (_jsx(ClientOnly, { fallback: _jsx("div", { className: "mw-geocoder-demo", children: _jsx("p", { children: "Loading the geocoder\u2026" }) }), children: () => (_jsx(GeocoderInner, { runtime: runtime, panels: panels, defaultAddress: defaultAddress, presets: presets, minBiasZoom: minBiasZoom, applyResultCamera: applyResultCamera, developer: developer, initialQuery: initialQuery, onSubmitQuery: onSubmitQuery })) }));
|
|
97
81
|
}
|
|
98
82
|
//# sourceMappingURL=Geocoder.js.map
|
package/out/map/Geocoder.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Geocoder.js","sourceRoot":"","sources":["../../lib/map/Geocoder.tsx"],"names":[],"mappings":";AAAA
|
|
1
|
+
{"version":3,"file":"Geocoder.js","sourceRoot":"","sources":["../../lib/map/Geocoder.tsx"],"names":[],"mappings":";AAAA;;;;GAIG;AAEH,OAAO,EAAkB,WAAW,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AAIhF,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAA;AACtD,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AAC5C,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAA;AAC1D,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAA;AAEhE,OAAO,EAAE,UAAU,EAAE,MAAM,yBAA0B,CAAA;AAErD,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAwB,CAAA;AACzD,OAA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E,CAAC,CAAC,CAAC,CAAC,IAAI,IACtE,CACN,CAAA;AACF,CAAC;AAED,gHAAgH;AAChH,MAAM,SAAS,GAAmB,EAAE,CAAA;AACpC,MAAM,UAAU,GAA0B,EAAE,CAAA;AAE5C;;;;;;GAMG;AACH,MAAM,UAAU,QAAQ,CAAC,EACxB,OAAO,EACP,MAAM,GAAG,SAAS,EAClB,cAAc,GAAG,EAAE,EACnB,OAAO,GAAG,UAAU,EACpB,WAAW,GAAG,CAAC,EACf,iBAAiB,GAAG,IAAI,EACxB,SAAS,GAAG,KAAK,EACjB,YAAY,GAAG,IAAI,EACnB,aAAa,GACE;IACf,OAAO,CACN,KAAC,UAAU,IACV,QAAQ,EACP,cAAK,SAAS,EAAC,kBAAkB,YAChC,qDAA4B,GACvB,YAGN,GAAG,EAAE,CAAC,CACN,KAAC,aAAa,IACb,OAAO,EAAE,OAAO,EAChB,MAAM,EAAE,MAAM,EACd,cAAc,EAAE,cAAc,EAC9B,OAAO,EAAE,OAAO,EAChB,WAAW,EAAE,WAAW,EACxB,iBAAiB,EAAE,iBAAiB,EACpC,SAAS,EAAE,SAAS,EACpB,YAAY,EAAE,YAAY,EAC1B,aAAa,EAAE,aAAa,GAC3B,CACF,GACW,CACb,CAAA;AACF,CAAC"}
|
|
@@ -2,15 +2,6 @@
|
|
|
2
2
|
* @copyright Sister Software
|
|
3
3
|
* @license AGPL-3.0
|
|
4
4
|
* @author Teffen Ellis, et al.
|
|
5
|
-
*
|
|
6
|
-
* The geocoder's chrome over the map: a search pill on top, example chips on one line beneath it, a control column
|
|
7
|
-
* down the right edge, and a result sheet that rises from the bottom when there is something to show.
|
|
8
|
-
*
|
|
9
|
-
* It replaces a 400px full-height panel that carried every control at once. The layout is the one the reference
|
|
10
|
-
* map apps use, and the reason is the map: chrome that floats over it leaves the map the page, where a slab makes
|
|
11
|
-
* the map the leftover third.
|
|
12
|
-
*
|
|
13
|
-
* NODE-SAFE: pure React + the shared units, no maplibre.
|
|
14
5
|
*/
|
|
15
6
|
import { type ReactNode } from "react";
|
|
16
7
|
import type { MapInstance } from "react-map-gl/maplibre";
|
|
@@ -19,63 +10,44 @@ import type { UseCompareState } from "#map/useCompareState";
|
|
|
19
10
|
import type { UseGeocode } from "#map/useGeocode";
|
|
20
11
|
import type { UsePlaceAutocomplete } from "#map/usePlaceAutocomplete";
|
|
21
12
|
import type { Preset } from "../common/PresetChips.tsx";
|
|
13
|
+
/**
|
|
14
|
+
* Props for {@linkcode GeocoderControls}.
|
|
15
|
+
*/
|
|
22
16
|
export interface GeocoderControlsProps {
|
|
23
|
-
/**
|
|
24
|
-
* The injected geocoder runtime.
|
|
25
|
-
*/
|
|
26
17
|
runtime: GeocoderRuntime;
|
|
27
|
-
/**
|
|
28
|
-
* The parse+resolve state machine.
|
|
29
|
-
*/
|
|
30
18
|
geocode: UseGeocode;
|
|
31
|
-
/**
|
|
32
|
-
* The place-autocomplete combobox state.
|
|
33
|
-
*/
|
|
34
19
|
autocomplete: UsePlaceAutocomplete;
|
|
35
|
-
/**
|
|
36
|
-
* The compare-mode state.
|
|
37
|
-
*/
|
|
38
20
|
compare: UseCompareState;
|
|
39
21
|
/**
|
|
40
|
-
*
|
|
22
|
+
* A query from the URL to run once the runtime is ready.
|
|
41
23
|
*/
|
|
24
|
+
initialQuery?: string | null;
|
|
42
25
|
panels: GeocoderPanels;
|
|
43
|
-
/**
|
|
44
|
-
* Example chips.
|
|
45
|
-
*/
|
|
46
26
|
presets: ReadonlyArray<Preset>;
|
|
47
27
|
/**
|
|
48
|
-
*
|
|
28
|
+
* The input placeholder.
|
|
29
|
+
*
|
|
30
|
+
* The field also selects its value on focus while it still equals this text.
|
|
49
31
|
*/
|
|
50
32
|
placeholder: string;
|
|
51
|
-
/**
|
|
52
|
-
* The live map, for the controls that read it: the compass takes its bearing, the host's layer control reads its
|
|
53
|
-
* style. `null` until react-map-gl instantiates the map.
|
|
54
|
-
*/
|
|
55
33
|
map?: MapInstance | null;
|
|
56
34
|
/**
|
|
57
|
-
*
|
|
58
|
-
* package never touches `location`, because the address bar is the app's state, not a control's.
|
|
35
|
+
* Called before each user-initiated query, so the host can write the query to its URL.
|
|
59
36
|
*/
|
|
60
37
|
onSubmitQuery?: (query: string) => void;
|
|
61
|
-
/**
|
|
62
|
-
* Select a model version (the composed geocoder also clears a now-colliding compare selection).
|
|
63
|
-
*/
|
|
64
38
|
onSelectVersion: (version: string) => void;
|
|
65
|
-
/**
|
|
66
|
-
* Toggle the forced WASM backend.
|
|
67
|
-
*/
|
|
68
39
|
onForceWASMChange: (forceWASM: boolean) => void;
|
|
69
40
|
/**
|
|
70
|
-
*
|
|
71
|
-
* the model rather than on an address, and above the query field they were the first thing every visitor met.
|
|
41
|
+
* Whether the developer panel starts open.
|
|
72
42
|
*
|
|
73
43
|
* @default false
|
|
74
44
|
*/
|
|
75
45
|
developer?: boolean;
|
|
76
46
|
}
|
|
77
47
|
/**
|
|
78
|
-
*
|
|
48
|
+
* Renders the search and result panels, map control rail and side sheets over the map.
|
|
49
|
+
*
|
|
50
|
+
* On narrow screens, users can drag the search panel between bottom-drawer detents.
|
|
79
51
|
*/
|
|
80
|
-
export declare function GeocoderControls({ runtime, geocode, autocomplete, compare, panels, presets, placeholder, map, onSubmitQuery, onSelectVersion, onForceWASMChange, developer, }: GeocoderControlsProps): ReactNode;
|
|
52
|
+
export declare function GeocoderControls({ runtime, geocode, autocomplete, compare, panels, presets, placeholder, map, initialQuery, onSubmitQuery, onSelectVersion, onForceWASMChange, developer, }: GeocoderControlsProps): ReactNode;
|
|
81
53
|
//# sourceMappingURL=GeocoderControls.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GeocoderControls.d.ts","sourceRoot":"","sources":["../../lib/map/GeocoderControls.tsx"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"GeocoderControls.d.ts","sourceRoot":"","sources":["../../lib/map/GeocoderControls.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OA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