@mailwoman/react 11.0.0 → 11.2.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 +3 -3
- package/fonts.css +3 -0
- package/lib/common/About.tsx +6 -5
- package/lib/common/ClientOnly.tsx +6 -4
- package/lib/common/CopyButton.tsx +6 -5
- package/lib/common/KindBadge.tsx +8 -7
- package/lib/common/LoadingIndicator.tsx +7 -7
- package/lib/common/PresetChips.tsx +5 -5
- package/lib/common/confidence-tiers.ts +3 -3
- package/lib/common/cx.ts +6 -6
- package/lib/common/text-tokens.ts +4 -4
- package/lib/common/useBuildInfo.ts +5 -5
- package/lib/common/useClipboard.ts +5 -5
- package/lib/common/useDebouncedValue.ts +6 -6
- package/lib/common.ts +3 -3
- package/lib/index.ts +2 -5
- package/lib/map/AppIdentity.tsx +5 -6
- package/lib/map/CompareToggle.tsx +5 -5
- package/lib/map/DebugInfo.tsx +3 -4
- package/lib/map/Geocoder.tsx +55 -17
- package/lib/map/GeocoderControls.tsx +140 -40
- package/lib/map/GraticuleLayer.tsx +6 -6
- package/lib/map/LoadLedgerList.tsx +96 -0
- package/lib/map/MapCanvas.tsx +19 -16
- package/lib/map/MapChipRow.tsx +3 -4
- package/lib/map/MapCompass.tsx +3 -4
- package/lib/map/MapContextMenu.tsx +206 -0
- package/lib/map/MapControlStack.tsx +3 -4
- package/lib/map/MapFooter.tsx +3 -6
- package/lib/map/MapPlaceCard.tsx +64 -0
- package/lib/map/MapProgressBar.tsx +5 -5
- package/lib/map/MapSearchBar.tsx +5 -4
- package/lib/map/MapSheet.tsx +4 -5
- package/lib/map/OverlayLayers.tsx +11 -10
- package/lib/map/PlaceAutocomplete.tsx +3 -4
- package/lib/map/PlaceMarker.tsx +10 -9
- package/lib/map/ResolvedPlaceLayers.tsx +2 -5
- package/lib/map/ResultCamera.tsx +138 -19
- package/lib/map/ResultOverlay.tsx +2 -5
- package/lib/map/ResultPanel.tsx +10 -5
- package/lib/map/StarfieldLayer.tsx +7 -6
- package/lib/map/VersionPicker.tsx +5 -5
- package/lib/map/fake-runtime.ts +2 -5
- package/lib/map/geometry.ts +3 -6
- package/lib/map/graticule.ts +6 -6
- package/lib/map/jump-curtain.ts +105 -0
- package/lib/map/map-debug.ts +4 -4
- package/lib/map/place-render.ts +32 -14
- package/lib/map/reduced-motion.ts +13 -0
- package/lib/map/starfield.ts +9 -8
- package/lib/map/types.ts +13 -4
- package/lib/map/useCompareState.ts +10 -7
- package/lib/map/useGeocode.ts +42 -12
- package/lib/map/useMapBearing.ts +7 -7
- package/lib/map/useMapPick.ts +277 -0
- package/lib/map/useMapPlaceRender.ts +5 -5
- package/lib/map/usePlaceAutocomplete.ts +2 -5
- package/lib/map.ts +21 -8
- package/lib/network/ReachabilityProvider.tsx +6 -7
- package/lib/pipeline/CandidatePicker.tsx +18 -11
- package/lib/pipeline/ComponentTable.tsx +5 -5
- package/lib/pipeline/ConfidenceCell.tsx +6 -5
- package/lib/pipeline/FailureDiagnostic.tsx +5 -6
- package/lib/pipeline/MatchTable.tsx +46 -0
- package/lib/pipeline/PipelineExplorer.tsx +8 -7
- package/lib/pipeline/QueryForm.tsx +6 -5
- package/lib/pipeline/ResolvedPlace.tsx +6 -6
- package/lib/pipeline/SpanHighlight.tsx +7 -6
- package/lib/pipeline/TimingPanel.tsx +7 -6
- package/lib/pipeline/TreeView.tsx +5 -5
- package/lib/pipeline/copy.ts +6 -6
- package/lib/pipeline/presets.ts +7 -6
- package/lib/pipeline/types.ts +17 -5
- package/lib/pipeline/useParsePipeline.ts +50 -23
- package/lib/pipeline.ts +3 -3
- package/lib/poi/AbstainPanel.tsx +6 -5
- package/lib/poi/LiveResultsBlock.tsx +7 -6
- package/lib/poi/OverpassBlock.tsx +7 -5
- package/lib/poi/POIExplorer.tsx +2 -5
- package/lib/poi/QueryInput.tsx +5 -5
- package/lib/poi/SubjectPanel.tsx +9 -6
- package/lib/poi/runtime.ts +2 -5
- package/lib/poi/types.ts +6 -5
- package/lib/poi/usePOISearch.ts +78 -50
- package/lib/poi.ts +3 -3
- package/lib/runtime/useReleaseRuntime.ts +77 -8
- package/lib/runtime.ts +3 -3
- package/lib/search/SearchModal.tsx +13 -9
- package/lib/search/search.css +3 -0
- package/lib/search/tokens.ts +7 -6
- package/lib/search/types.ts +6 -6
- package/lib/search.ts +3 -3
- package/out/common/About.d.ts +3 -5
- package/out/common/About.d.ts.map +1 -1
- package/out/common/About.js.map +1 -1
- package/out/common/ClientOnly.d.ts +3 -4
- package/out/common/ClientOnly.d.ts.map +1 -1
- package/out/common/ClientOnly.js +5 -4
- package/out/common/ClientOnly.js.map +1 -1
- package/out/common/CopyButton.d.ts +3 -5
- package/out/common/CopyButton.d.ts.map +1 -1
- package/out/common/CopyButton.js.map +1 -1
- package/out/common/KindBadge.d.ts +5 -7
- package/out/common/KindBadge.d.ts.map +1 -1
- package/out/common/KindBadge.js.map +1 -1
- package/out/common/LoadingIndicator.d.ts +0 -10
- package/out/common/LoadingIndicator.d.ts.map +1 -1
- package/out/common/LoadingIndicator.js +6 -7
- package/out/common/LoadingIndicator.js.map +1 -1
- package/out/common/PresetChips.d.ts +2 -5
- package/out/common/PresetChips.d.ts.map +1 -1
- package/out/common/confidence-tiers.d.ts +0 -3
- package/out/common/confidence-tiers.d.ts.map +1 -1
- package/out/common/confidence-tiers.js +2 -3
- package/out/common/confidence-tiers.js.map +1 -1
- package/out/common/cx.d.ts +3 -6
- package/out/common/cx.d.ts.map +1 -1
- package/out/common/cx.js +2 -9
- package/out/common/cx.js.map +1 -1
- package/out/common/text-tokens.d.ts +1 -4
- package/out/common/text-tokens.d.ts.map +1 -1
- package/out/common/text-tokens.js +2 -11
- package/out/common/text-tokens.js.map +1 -1
- package/out/common/useBuildInfo.d.ts +0 -7
- package/out/common/useBuildInfo.d.ts.map +1 -1
- package/out/common/useBuildInfo.js +4 -5
- package/out/common/useBuildInfo.js.map +1 -1
- package/out/common/useClipboard.d.ts +0 -7
- package/out/common/useClipboard.d.ts.map +1 -1
- package/out/common/useClipboard.js +4 -5
- package/out/common/useClipboard.js.map +1 -1
- package/out/common/useDebouncedValue.d.ts +0 -9
- package/out/common/useDebouncedValue.d.ts.map +1 -1
- package/out/common/useDebouncedValue.js +5 -6
- package/out/common/useDebouncedValue.js.map +1 -1
- package/out/common.d.ts +0 -3
- package/out/common.d.ts.map +1 -1
- package/out/common.js +2 -3
- package/out/common.js.map +1 -1
- package/out/index.d.ts +0 -5
- package/out/index.d.ts.map +1 -1
- package/out/index.js +2 -5
- package/out/index.js.map +1 -1
- package/out/map/AppIdentity.d.ts +2 -6
- package/out/map/AppIdentity.d.ts.map +1 -1
- package/out/map/AppIdentity.js.map +1 -1
- package/out/map/CompareToggle.d.ts +2 -5
- package/out/map/CompareToggle.d.ts.map +1 -1
- package/out/map/DebugInfo.d.ts +0 -4
- package/out/map/DebugInfo.d.ts.map +1 -1
- package/out/map/DebugInfo.js +2 -4
- package/out/map/DebugInfo.js.map +1 -1
- package/out/map/Geocoder.d.ts +21 -9
- package/out/map/Geocoder.d.ts.map +1 -1
- package/out/map/Geocoder.js +15 -10
- package/out/map/Geocoder.js.map +1 -1
- package/out/map/GeocoderControls.d.ts +7 -9
- package/out/map/GeocoderControls.d.ts.map +1 -1
- package/out/map/GeocoderControls.js +99 -31
- package/out/map/GeocoderControls.js.map +1 -1
- package/out/map/GraticuleLayer.d.ts +3 -6
- package/out/map/GraticuleLayer.d.ts.map +1 -1
- package/out/map/GraticuleLayer.js +5 -6
- package/out/map/GraticuleLayer.js.map +1 -1
- package/out/map/LoadLedgerList.d.ts +19 -0
- package/out/map/LoadLedgerList.d.ts.map +1 -0
- package/out/map/LoadLedgerList.js +59 -0
- package/out/map/LoadLedgerList.js.map +1 -0
- package/out/map/MapCanvas.d.ts +2 -24
- package/out/map/MapCanvas.d.ts.map +1 -1
- package/out/map/MapCanvas.js +16 -14
- package/out/map/MapCanvas.js.map +1 -1
- package/out/map/MapChipRow.d.ts +0 -4
- package/out/map/MapChipRow.d.ts.map +1 -1
- package/out/map/MapChipRow.js.map +1 -1
- package/out/map/MapCompass.d.ts +0 -4
- package/out/map/MapCompass.d.ts.map +1 -1
- package/out/map/MapCompass.js.map +1 -1
- package/out/map/MapContextMenu.d.ts +88 -0
- package/out/map/MapContextMenu.d.ts.map +1 -0
- package/out/map/MapContextMenu.js +96 -0
- package/out/map/MapContextMenu.js.map +1 -0
- package/out/map/MapControlStack.d.ts +0 -4
- package/out/map/MapControlStack.d.ts.map +1 -1
- package/out/map/MapControlStack.js.map +1 -1
- package/out/map/MapFooter.d.ts +1 -6
- package/out/map/MapFooter.d.ts.map +1 -1
- package/out/map/MapFooter.js +2 -5
- package/out/map/MapFooter.js.map +1 -1
- package/out/map/MapPlaceCard.d.ts +17 -0
- package/out/map/MapPlaceCard.d.ts.map +1 -0
- package/out/map/MapPlaceCard.js +27 -0
- package/out/map/MapPlaceCard.js.map +1 -0
- package/out/map/MapProgressBar.d.ts +2 -5
- package/out/map/MapProgressBar.d.ts.map +1 -1
- package/out/map/MapSearchBar.d.ts +2 -4
- package/out/map/MapSearchBar.d.ts.map +1 -1
- package/out/map/MapSearchBar.js.map +1 -1
- package/out/map/MapSheet.d.ts +1 -5
- package/out/map/MapSheet.d.ts.map +1 -1
- package/out/map/MapSheet.js +2 -4
- package/out/map/MapSheet.js.map +1 -1
- package/out/map/OverlayLayers.d.ts +8 -10
- package/out/map/OverlayLayers.d.ts.map +1 -1
- package/out/map/OverlayLayers.js +10 -10
- package/out/map/OverlayLayers.js.map +1 -1
- package/out/map/PlaceAutocomplete.d.ts +0 -4
- package/out/map/PlaceAutocomplete.d.ts.map +1 -1
- package/out/map/PlaceAutocomplete.js.map +1 -1
- package/out/map/PlaceMarker.d.ts +0 -13
- package/out/map/PlaceMarker.d.ts.map +1 -1
- package/out/map/PlaceMarker.js +9 -9
- package/out/map/PlaceMarker.js.map +1 -1
- package/out/map/ResolvedPlaceLayers.d.ts +0 -5
- package/out/map/ResolvedPlaceLayers.d.ts.map +1 -1
- package/out/map/ResolvedPlaceLayers.js.map +1 -1
- package/out/map/ResultCamera.d.ts +53 -7
- package/out/map/ResultCamera.d.ts.map +1 -1
- package/out/map/ResultCamera.js +103 -17
- package/out/map/ResultCamera.js.map +1 -1
- package/out/map/ResultOverlay.d.ts +0 -5
- package/out/map/ResultOverlay.d.ts.map +1 -1
- package/out/map/ResultOverlay.js +2 -5
- package/out/map/ResultOverlay.js.map +1 -1
- package/out/map/ResultPanel.d.ts +0 -5
- package/out/map/ResultPanel.d.ts.map +1 -1
- package/out/map/ResultPanel.js +2 -1
- package/out/map/ResultPanel.js.map +1 -1
- package/out/map/StarfieldLayer.d.ts +0 -11
- package/out/map/StarfieldLayer.d.ts.map +1 -1
- package/out/map/StarfieldLayer.js +6 -6
- package/out/map/StarfieldLayer.js.map +1 -1
- package/out/map/VersionPicker.d.ts +2 -5
- package/out/map/VersionPicker.d.ts.map +1 -1
- package/out/map/fake-runtime.d.ts +0 -5
- package/out/map/fake-runtime.d.ts.map +1 -1
- package/out/map/fake-runtime.js +2 -5
- package/out/map/fake-runtime.js.map +1 -1
- package/out/map/geometry.d.ts +1 -6
- package/out/map/geometry.d.ts.map +1 -1
- package/out/map/geometry.js +3 -6
- package/out/map/geometry.js.map +1 -1
- package/out/map/graticule.d.ts +3 -6
- package/out/map/graticule.d.ts.map +1 -1
- package/out/map/graticule.js +2 -9
- package/out/map/graticule.js.map +1 -1
- package/out/map/jump-curtain.d.ts +61 -0
- package/out/map/jump-curtain.d.ts.map +1 -0
- package/out/map/jump-curtain.js +69 -0
- package/out/map/jump-curtain.js.map +1 -0
- package/out/map/map-debug.d.ts +1 -4
- package/out/map/map-debug.d.ts.map +1 -1
- package/out/map/map-debug.js +2 -10
- package/out/map/map-debug.js.map +1 -1
- package/out/map/place-render.d.ts +5 -6
- package/out/map/place-render.d.ts.map +1 -1
- package/out/map/place-render.js +21 -12
- package/out/map/place-render.js.map +1 -1
- package/out/map/reduced-motion.d.ts +9 -0
- package/out/map/reduced-motion.d.ts.map +1 -0
- package/out/map/reduced-motion.js +13 -0
- package/out/map/reduced-motion.js.map +1 -0
- package/out/map/starfield.d.ts +0 -14
- package/out/map/starfield.d.ts.map +1 -1
- package/out/map/starfield.js +8 -8
- package/out/map/starfield.js.map +1 -1
- package/out/map/types.d.ts +10 -4
- package/out/map/types.d.ts.map +1 -1
- package/out/map/types.js +2 -7
- package/out/map/types.js.map +1 -1
- package/out/map/useCompareState.d.ts +0 -11
- package/out/map/useCompareState.d.ts.map +1 -1
- package/out/map/useCompareState.js +9 -7
- package/out/map/useCompareState.js.map +1 -1
- package/out/map/useGeocode.d.ts +13 -20
- package/out/map/useGeocode.d.ts.map +1 -1
- package/out/map/useGeocode.js +21 -11
- package/out/map/useGeocode.js.map +1 -1
- package/out/map/useMapBearing.d.ts +2 -9
- package/out/map/useMapBearing.d.ts.map +1 -1
- package/out/map/useMapBearing.js +4 -5
- package/out/map/useMapBearing.js.map +1 -1
- package/out/map/useMapPick.d.ts +28 -0
- package/out/map/useMapPick.d.ts.map +1 -0
- package/out/map/useMapPick.js +206 -0
- package/out/map/useMapPick.js.map +1 -0
- package/out/map/useMapPlaceRender.d.ts +0 -7
- package/out/map/useMapPlaceRender.d.ts.map +1 -1
- package/out/map/useMapPlaceRender.js +4 -5
- package/out/map/useMapPlaceRender.js.map +1 -1
- package/out/map/usePlaceAutocomplete.d.ts +0 -5
- package/out/map/usePlaceAutocomplete.d.ts.map +1 -1
- package/out/map/usePlaceAutocomplete.js +2 -5
- package/out/map/usePlaceAutocomplete.js.map +1 -1
- package/out/map.d.ts +10 -8
- package/out/map.d.ts.map +1 -1
- package/out/map.js +9 -8
- package/out/map.js.map +1 -1
- package/out/network/ReachabilityProvider.d.ts +3 -7
- package/out/network/ReachabilityProvider.d.ts.map +1 -1
- package/out/network/ReachabilityProvider.js +5 -7
- package/out/network/ReachabilityProvider.js.map +1 -1
- package/out/pipeline/CandidatePicker.d.ts +15 -11
- package/out/pipeline/CandidatePicker.d.ts.map +1 -1
- package/out/pipeline/CandidatePicker.js.map +1 -1
- package/out/pipeline/ComponentTable.d.ts +2 -5
- package/out/pipeline/ComponentTable.d.ts.map +1 -1
- package/out/pipeline/ConfidenceCell.d.ts +0 -8
- package/out/pipeline/ConfidenceCell.d.ts.map +1 -1
- package/out/pipeline/ConfidenceCell.js +5 -5
- package/out/pipeline/ConfidenceCell.js.map +1 -1
- package/out/pipeline/FailureDiagnostic.d.ts +2 -6
- package/out/pipeline/FailureDiagnostic.d.ts.map +1 -1
- package/out/pipeline/FailureDiagnostic.js.map +1 -1
- package/out/pipeline/MatchTable.d.ts +7 -0
- package/out/pipeline/MatchTable.d.ts.map +1 -0
- package/out/pipeline/MatchTable.js +18 -0
- package/out/pipeline/MatchTable.js.map +1 -0
- package/out/pipeline/PipelineExplorer.d.ts +5 -7
- package/out/pipeline/PipelineExplorer.d.ts.map +1 -1
- package/out/pipeline/PipelineExplorer.js.map +1 -1
- package/out/pipeline/QueryForm.d.ts +3 -5
- package/out/pipeline/QueryForm.d.ts.map +1 -1
- package/out/pipeline/QueryForm.js.map +1 -1
- package/out/pipeline/ResolvedPlace.d.ts +2 -5
- package/out/pipeline/ResolvedPlace.d.ts.map +1 -1
- package/out/pipeline/SpanHighlight.d.ts +4 -6
- package/out/pipeline/SpanHighlight.d.ts.map +1 -1
- package/out/pipeline/SpanHighlight.js.map +1 -1
- package/out/pipeline/TimingPanel.d.ts +4 -6
- package/out/pipeline/TimingPanel.d.ts.map +1 -1
- package/out/pipeline/TimingPanel.js.map +1 -1
- package/out/pipeline/TreeView.d.ts +2 -5
- package/out/pipeline/TreeView.d.ts.map +1 -1
- package/out/pipeline/copy.d.ts +0 -8
- package/out/pipeline/copy.d.ts.map +1 -1
- package/out/pipeline/copy.js +5 -6
- package/out/pipeline/copy.js.map +1 -1
- package/out/pipeline/presets.d.ts +3 -5
- package/out/pipeline/presets.d.ts.map +1 -1
- package/out/pipeline/presets.js +3 -9
- package/out/pipeline/presets.js.map +1 -1
- package/out/pipeline/types.d.ts +14 -5
- package/out/pipeline/types.d.ts.map +1 -1
- package/out/pipeline/types.js +2 -8
- package/out/pipeline/types.js.map +1 -1
- package/out/pipeline/useParsePipeline.d.ts +6 -6
- package/out/pipeline/useParsePipeline.d.ts.map +1 -1
- package/out/pipeline/useParsePipeline.js +38 -26
- package/out/pipeline/useParsePipeline.js.map +1 -1
- package/out/pipeline.d.ts +0 -3
- package/out/pipeline.d.ts.map +1 -1
- package/out/pipeline.js +2 -3
- package/out/pipeline.js.map +1 -1
- package/out/poi/AbstainPanel.d.ts +3 -5
- package/out/poi/AbstainPanel.d.ts.map +1 -1
- package/out/poi/AbstainPanel.js.map +1 -1
- package/out/poi/LiveResultsBlock.d.ts +4 -6
- package/out/poi/LiveResultsBlock.d.ts.map +1 -1
- package/out/poi/LiveResultsBlock.js.map +1 -1
- package/out/poi/OverpassBlock.d.ts +4 -5
- package/out/poi/OverpassBlock.d.ts.map +1 -1
- package/out/poi/OverpassBlock.js.map +1 -1
- package/out/poi/POIExplorer.d.ts +0 -5
- package/out/poi/POIExplorer.d.ts.map +1 -1
- package/out/poi/POIExplorer.js +2 -5
- package/out/poi/POIExplorer.js.map +1 -1
- package/out/poi/QueryInput.d.ts +2 -5
- package/out/poi/QueryInput.d.ts.map +1 -1
- package/out/poi/SubjectPanel.d.ts +6 -6
- package/out/poi/SubjectPanel.d.ts.map +1 -1
- package/out/poi/SubjectPanel.js.map +1 -1
- package/out/poi/runtime.d.ts +0 -5
- package/out/poi/runtime.d.ts.map +1 -1
- package/out/poi/runtime.js +2 -5
- package/out/poi/runtime.js.map +1 -1
- package/out/poi/types.d.ts +3 -5
- package/out/poi/types.d.ts.map +1 -1
- package/out/poi/types.js +2 -8
- package/out/poi/types.js.map +1 -1
- package/out/poi/usePOISearch.d.ts +7 -5
- package/out/poi/usePOISearch.d.ts.map +1 -1
- package/out/poi/usePOISearch.js +24 -10
- package/out/poi/usePOISearch.js.map +1 -1
- package/out/poi.d.ts +0 -3
- package/out/poi.d.ts.map +1 -1
- package/out/poi.js +2 -3
- package/out/poi.js.map +1 -1
- package/out/runtime/useReleaseRuntime.d.ts +33 -7
- package/out/runtime/useReleaseRuntime.d.ts.map +1 -1
- package/out/runtime/useReleaseRuntime.js +36 -6
- package/out/runtime/useReleaseRuntime.js.map +1 -1
- package/out/runtime.d.ts +0 -3
- package/out/runtime.d.ts.map +1 -1
- package/out/runtime.js +2 -3
- package/out/runtime.js.map +1 -1
- package/out/search/SearchModal.d.ts +0 -12
- package/out/search/SearchModal.d.ts.map +1 -1
- package/out/search/SearchModal.js +12 -9
- package/out/search/SearchModal.js.map +1 -1
- package/out/search/tokens.d.ts +4 -6
- package/out/search/tokens.d.ts.map +1 -1
- package/out/search/tokens.js +6 -6
- package/out/search/tokens.js.map +1 -1
- package/out/search/types.d.ts +3 -6
- package/out/search/types.d.ts.map +1 -1
- package/out/search/types.js +4 -5
- package/out/search/types.js.map +1 -1
- package/out/search.d.ts +0 -3
- package/out/search.d.ts.map +1 -1
- package/out/search.js +2 -3
- package/out/search.js.map +1 -1
- package/package.json +7 -6
- package/styles.css +214 -3
- package/tokens/index.css +3 -0
- package/lib/map/useMapLabelPick.ts +0 -114
- package/out/map/useMapLabelPick.d.ts +0 -13
- package/out/map/useMapLabelPick.d.ts.map +0 -1
- package/out/map/useMapLabelPick.js +0 -95
- package/out/map/useMapLabelPick.js.map +0 -1
|
@@ -1,9 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
* @license AGPL-3.0
|
|
4
|
-
* @author Teffen Ellis, et al.
|
|
5
|
-
*/
|
|
1
|
+
// SPDX-FileCopyrightText: Teffen Ellis and Mailwoman contributors
|
|
2
|
+
// SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Commercial
|
|
6
3
|
|
|
4
|
+
import { coordinatePairText } from "@mailwoman/spatial/point/text"
|
|
7
5
|
import type React from "react"
|
|
8
6
|
import { type ReactNode, useCallback, useEffect, useRef, useState } from "react"
|
|
9
7
|
import type { MapInstance } from "react-map-gl/maplibre"
|
|
@@ -12,16 +10,19 @@ import type { GeocoderPanels, GeocoderRuntime } from "#map/types"
|
|
|
12
10
|
import type { UseCompareState } from "#map/useCompareState"
|
|
13
11
|
import type { UseGeocode } from "#map/useGeocode"
|
|
14
12
|
import { useMapBearing } from "#map/useMapBearing"
|
|
15
|
-
import {
|
|
13
|
+
import { type MapPick, useMapPick } from "#map/useMapPick"
|
|
16
14
|
import type { UsePlaceAutocomplete } from "#map/usePlaceAutocomplete"
|
|
17
15
|
|
|
18
16
|
import { LoadingIndicator } from "../common/LoadingIndicator.tsx"
|
|
19
17
|
import type { Preset } from "../common/PresetChips.tsx"
|
|
20
18
|
import { CompareToggle } from "./CompareToggle.tsx"
|
|
21
19
|
import { DebugInfo } from "./DebugInfo.tsx"
|
|
20
|
+
import { LoadLedgerList } from "./LoadLedgerList.tsx"
|
|
22
21
|
import { MapChipRow } from "./MapChipRow.tsx"
|
|
23
22
|
import { MapCompass } from "./MapCompass.tsx"
|
|
23
|
+
import { MapContextMenu, MapContextMenuAction, useMapContextMenu } from "./MapContextMenu.tsx"
|
|
24
24
|
import { MapControlButton, MapControlGroup, MapControlStack } from "./MapControlStack.tsx"
|
|
25
|
+
import { MapPlaceCard, pickQuery } from "./MapPlaceCard.tsx"
|
|
25
26
|
import { MapProgressBar } from "./MapProgressBar.tsx"
|
|
26
27
|
import { MapSearchBar, SearchGlyph } from "./MapSearchBar.tsx"
|
|
27
28
|
import { MapSheet } from "./MapSheet.tsx"
|
|
@@ -38,15 +39,18 @@ export interface GeocoderControlsProps {
|
|
|
38
39
|
autocomplete: UsePlaceAutocomplete
|
|
39
40
|
compare: UseCompareState
|
|
40
41
|
/**
|
|
41
|
-
*
|
|
42
|
+
* The query the host's URL names.
|
|
43
|
+
*
|
|
44
|
+
* Each new value is submitted once the runtime is ready, unless it is the query submitted last.
|
|
42
45
|
*/
|
|
43
|
-
|
|
46
|
+
query?: string | null
|
|
44
47
|
panels: GeocoderPanels
|
|
45
48
|
presets: ReadonlyArray<Preset>
|
|
46
49
|
/**
|
|
47
50
|
* The input placeholder.
|
|
48
51
|
*
|
|
49
|
-
*
|
|
52
|
+
* A host that pre-fills the field with the same text gets its value selected
|
|
53
|
+
* on focus, so typing replaces it.
|
|
50
54
|
*/
|
|
51
55
|
placeholder: string
|
|
52
56
|
map?: MapInstance | null
|
|
@@ -95,7 +99,7 @@ export function GeocoderControls({
|
|
|
95
99
|
presets,
|
|
96
100
|
placeholder,
|
|
97
101
|
map = null,
|
|
98
|
-
|
|
102
|
+
query = null,
|
|
99
103
|
onSubmitQuery,
|
|
100
104
|
onSelectVersion,
|
|
101
105
|
developer = false,
|
|
@@ -270,7 +274,7 @@ export function GeocoderControls({
|
|
|
270
274
|
if (event.clientY - armed.startY < OVERSCROLL_PROMOTE_PX) return
|
|
271
275
|
|
|
272
276
|
overscrollRef.current = null
|
|
273
|
-
// The drag starts from the pull's origin, so the drawer
|
|
277
|
+
// The drag starts from the pull's origin, so the drawer doesn't jump by the threshold.
|
|
274
278
|
sheetDragRef.current = { startY: armed.startY, startHeight: sheet.getBoundingClientRect().height, moved: true }
|
|
275
279
|
sheet.setPointerCapture(event.pointerId)
|
|
276
280
|
onGripPointerMove(event)
|
|
@@ -288,14 +292,19 @@ export function GeocoderControls({
|
|
|
288
292
|
const toggleSheet = (name: Exclude<SheetName, null>) => setOpenSheet((current) => (current === name ? null : name))
|
|
289
293
|
const closeSheet = useCallback(() => setOpenSheet(null), [])
|
|
290
294
|
|
|
295
|
+
// The query submitted last, from the field or from the host's URL, so the URL's query
|
|
296
|
+
// isn't submitted a second time after the host records the submit it heard.
|
|
297
|
+
const lastSubmitted = useRef<string | null>(null)
|
|
298
|
+
|
|
291
299
|
// Every user-initiated query goes through this function, so `onSubmitQuery` fires from one place.
|
|
292
300
|
const runQuery = useCallback(
|
|
293
|
-
(
|
|
301
|
+
(text: string) => {
|
|
294
302
|
// A new query shows the result panel again at its default height.
|
|
295
303
|
setResultDismissed(false)
|
|
296
304
|
setSheetHeight(null)
|
|
297
|
-
|
|
298
|
-
|
|
305
|
+
lastSubmitted.current = text
|
|
306
|
+
onSubmitQuery?.(text)
|
|
307
|
+
void geocode.submit(text)
|
|
299
308
|
},
|
|
300
309
|
[onSubmitQuery, geocode]
|
|
301
310
|
)
|
|
@@ -305,33 +314,47 @@ export function GeocoderControls({
|
|
|
305
314
|
const clearQuery = useCallback(() => {
|
|
306
315
|
geocode.reset()
|
|
307
316
|
setSheetHeight(null)
|
|
317
|
+
lastSubmitted.current = null
|
|
308
318
|
onSubmitQuery?.("")
|
|
309
319
|
}, [onSubmitQuery, geocode])
|
|
310
320
|
|
|
311
|
-
// The
|
|
321
|
+
// The URL's query waits for `runtime.ready` because the parse pipeline drops
|
|
312
322
|
// a submit made before the model loads.
|
|
313
|
-
//
|
|
314
|
-
|
|
315
|
-
|
|
323
|
+
// A later value, such as the one the back button restores, fills the field and runs.
|
|
324
|
+
// A URL with no query after one with a query is the entry before the first search.
|
|
325
|
+
// It clears the field and the result.
|
|
316
326
|
useEffect(() => {
|
|
317
|
-
if (
|
|
327
|
+
if (query === lastSubmitted.current) return
|
|
328
|
+
|
|
329
|
+
if (!query) {
|
|
330
|
+
if (lastSubmitted.current === null) return
|
|
318
331
|
|
|
319
|
-
|
|
332
|
+
lastSubmitted.current = null
|
|
333
|
+
geocode.setText("")
|
|
334
|
+
geocode.reset()
|
|
320
335
|
|
|
321
|
-
|
|
336
|
+
return
|
|
337
|
+
}
|
|
338
|
+
|
|
339
|
+
if (!runtime.ready) return
|
|
340
|
+
|
|
341
|
+
lastSubmitted.current = query
|
|
342
|
+
geocode.setText(query)
|
|
343
|
+
// oxlint-disable-next-line react/set-state-in-effect -- The history is the external system here: a restored entry's result shows again as a submitted one would.
|
|
344
|
+
setResultDismissed(false)
|
|
322
345
|
// This calls `geocode.submit` directly because the query is already in the URL.
|
|
323
|
-
void geocode.submit(
|
|
324
|
-
}, [
|
|
346
|
+
void geocode.submit(query)
|
|
347
|
+
}, [query, runtime.ready, geocode])
|
|
325
348
|
|
|
326
349
|
// A drawer-breakpoint crossing clears any dragged height.
|
|
327
350
|
// The height could clip the desktop column.
|
|
328
351
|
useEffect(() => {
|
|
329
|
-
const
|
|
352
|
+
const layout = globalThis.matchMedia(DRAWER_LAYOUT)
|
|
330
353
|
const onChange = () => setSheetHeight(null)
|
|
331
354
|
|
|
332
|
-
|
|
355
|
+
layout.addEventListener("change", onChange)
|
|
333
356
|
|
|
334
|
-
return () =>
|
|
357
|
+
return () => layout.removeEventListener("change", onChange)
|
|
335
358
|
}, [])
|
|
336
359
|
|
|
337
360
|
// A user pan, zoom, or rotate shrinks the drawer to its floor detent without dismissing the result.
|
|
@@ -360,7 +383,43 @@ export function GeocoderControls({
|
|
|
360
383
|
}
|
|
361
384
|
}, [map, sheetDetents])
|
|
362
385
|
|
|
363
|
-
//
|
|
386
|
+
// A click on the map opens the place card for what it landed on and pins that point.
|
|
387
|
+
// A label click also fills the field with the label's name, without a parse: the tile
|
|
388
|
+
// feature already holds the coordinate, and a parse could land on a homonym elsewhere.
|
|
389
|
+
const [pick, setPick] = useState<MapPick | null>(null)
|
|
390
|
+
|
|
391
|
+
const onMapPick = useCallback(
|
|
392
|
+
(picked: MapPick) => {
|
|
393
|
+
const [lon, lat] = picked.lngLat
|
|
394
|
+
|
|
395
|
+
if (picked.kind === "label" && picked.name) {
|
|
396
|
+
geocode.setText(picked.name)
|
|
397
|
+
geocode.reset()
|
|
398
|
+
}
|
|
399
|
+
|
|
400
|
+
geocode.pin({
|
|
401
|
+
id: 0,
|
|
402
|
+
name: pickQuery(picked),
|
|
403
|
+
placetype: picked.placetype ?? "point",
|
|
404
|
+
lat,
|
|
405
|
+
lon,
|
|
406
|
+
score: null,
|
|
407
|
+
bbox: null,
|
|
408
|
+
tier: null,
|
|
409
|
+
uncertaintyM: null,
|
|
410
|
+
})
|
|
411
|
+
|
|
412
|
+
setPick(picked)
|
|
413
|
+
},
|
|
414
|
+
[geocode]
|
|
415
|
+
)
|
|
416
|
+
|
|
417
|
+
const closeCard = useCallback(() => {
|
|
418
|
+
setPick(null)
|
|
419
|
+
geocode.pin(null)
|
|
420
|
+
}, [geocode])
|
|
421
|
+
|
|
422
|
+
// Escape dismisses the result and the place card only while no side sheet is open.
|
|
364
423
|
// `MapSheet` also listens for Escape on the document, so one keystroke would otherwise close both.
|
|
365
424
|
useEffect(() => {
|
|
366
425
|
if (openSheet) return
|
|
@@ -368,28 +427,45 @@ export function GeocoderControls({
|
|
|
368
427
|
const onKeyDown = (event: KeyboardEvent) => {
|
|
369
428
|
if (event.key === "Escape") {
|
|
370
429
|
setResultDismissed(true)
|
|
430
|
+
closeCard()
|
|
371
431
|
}
|
|
372
432
|
}
|
|
373
433
|
|
|
374
434
|
document.addEventListener("keydown", onKeyDown)
|
|
375
435
|
|
|
376
436
|
return () => document.removeEventListener("keydown", onKeyDown)
|
|
377
|
-
}, [openSheet])
|
|
437
|
+
}, [openSheet, closeCard])
|
|
378
438
|
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
439
|
+
useMapPick(map, onMapPick)
|
|
440
|
+
|
|
441
|
+
// A search from the map fills the field and runs the text, as a typed query would.
|
|
442
|
+
const searchFromMap = useCallback(
|
|
443
|
+
(text: string) => {
|
|
444
|
+
setPick(null)
|
|
445
|
+
geocode.setText(text)
|
|
383
446
|
geocode.reset()
|
|
384
|
-
runQuery(
|
|
447
|
+
runQuery(text)
|
|
385
448
|
},
|
|
386
449
|
[geocode, runQuery]
|
|
387
450
|
)
|
|
388
451
|
|
|
389
|
-
|
|
452
|
+
// The right-click menu.
|
|
453
|
+
// Its one built-in action searches the point itself.
|
|
454
|
+
// The runtime reads that query as a coordinate pair.
|
|
455
|
+
const contextMenu = useMapContextMenu(map)
|
|
456
|
+
const menuPoint = contextMenu.point
|
|
457
|
+
|
|
458
|
+
const searchMenuPoint = useCallback(() => {
|
|
459
|
+
if (!menuPoint) return
|
|
460
|
+
|
|
461
|
+
const [lon, lat] = menuPoint.lngLat
|
|
462
|
+
|
|
463
|
+
contextMenu.close()
|
|
464
|
+
searchFromMap(coordinatePairText(lat, lon))
|
|
465
|
+
}, [menuPoint, contextMenu, searchFromMap])
|
|
390
466
|
|
|
391
467
|
const chips = presets.map((preset) => ({ label: preset.label, value: preset.value }))
|
|
392
|
-
// The model download
|
|
468
|
+
// The model download doesn't open the result panel.
|
|
393
469
|
// The progress bar reports it instead.
|
|
394
470
|
const showSheet = Boolean(busy || result || errorMessage) && !resultDismissed
|
|
395
471
|
|
|
@@ -397,13 +473,15 @@ export function GeocoderControls({
|
|
|
397
473
|
const drawerRaised =
|
|
398
474
|
showSheet && (sheetHeight === null || (globalThis.window && sheetHeight > sheetDetents().collapsedBelow))
|
|
399
475
|
|
|
400
|
-
|
|
476
|
+
// A failed load is over, so the bar stops and the error takes its place.
|
|
477
|
+
const bundleLoading = Boolean(loading && !runtime.ready && !runtime.errorMessage)
|
|
401
478
|
const steps = loading?.stepLabels.length ?? 0
|
|
402
479
|
|
|
480
|
+
// The step index is the step in progress, so the steps before it are complete.
|
|
403
481
|
// The model downloads during the first step.
|
|
404
482
|
// While bytes arrive, the bar follows the byte fraction scaled into the first step's share,
|
|
405
|
-
// so it
|
|
406
|
-
const stepFraction = steps ? (
|
|
483
|
+
// so it doesn't move backwards when step progress takes over.
|
|
484
|
+
const stepFraction = steps ? Math.max(0, loading?.stepIndex ?? 0) / steps : null
|
|
407
485
|
const byteFraction = loading?.byteFraction
|
|
408
486
|
|
|
409
487
|
const fraction =
|
|
@@ -431,7 +509,7 @@ export function GeocoderControls({
|
|
|
431
509
|
*/}
|
|
432
510
|
<div className="mw-map-panel__header" onPointerDown={onHeaderPointerDown}>
|
|
433
511
|
<div className="mw-map-panel__grip">
|
|
434
|
-
{/* The handle appears only with a result, because there
|
|
512
|
+
{/* The handle appears only with a result, because there's no content to expand without one. */}
|
|
435
513
|
{showSheet ? (
|
|
436
514
|
<button
|
|
437
515
|
type="button"
|
|
@@ -487,6 +565,8 @@ export function GeocoderControls({
|
|
|
487
565
|
}}
|
|
488
566
|
disabled={!runtime.ready}
|
|
489
567
|
placeholder={placeholder}
|
|
568
|
+
// An address is full of proper nouns and codes the browser's dictionary lacks.
|
|
569
|
+
spellCheck={false}
|
|
490
570
|
onKeyDown={autocomplete.onInputKeyDown}
|
|
491
571
|
{...autocomplete.inputProps}
|
|
492
572
|
/>
|
|
@@ -519,7 +599,18 @@ export function GeocoderControls({
|
|
|
519
599
|
|
|
520
600
|
{showSheet ? (
|
|
521
601
|
<div className="mw-map-panel__result">
|
|
522
|
-
{errorMessage ?
|
|
602
|
+
{errorMessage ? (
|
|
603
|
+
<div className="mw-load-error">
|
|
604
|
+
<p className="mw-error">{errorMessage}</p>
|
|
605
|
+
{runtime.errorMessage && runtime.retryLoad ? (
|
|
606
|
+
<button type="button" className="mw-load-error__retry" onClick={runtime.retryLoad}>
|
|
607
|
+
Retry
|
|
608
|
+
</button>
|
|
609
|
+
) : null}
|
|
610
|
+
</div>
|
|
611
|
+
) : null}
|
|
612
|
+
|
|
613
|
+
{runtime.errorMessage && loading?.ledger ? <LoadLedgerList ledger={loading.ledger} open /> : null}
|
|
523
614
|
|
|
524
615
|
{panels.aboveResult ? panels.aboveResult({ result }) : null}
|
|
525
616
|
|
|
@@ -643,6 +734,15 @@ export function GeocoderControls({
|
|
|
643
734
|
</MapSheet>
|
|
644
735
|
) : null}
|
|
645
736
|
|
|
737
|
+
{pick ? <MapPlaceCard pick={pick} onSearch={searchFromMap} onClose={closeCard} /> : null}
|
|
738
|
+
|
|
739
|
+
{menuPoint ? (
|
|
740
|
+
<MapContextMenu point={menuPoint} onClose={contextMenu.close}>
|
|
741
|
+
{panels.contextMenu?.(menuPoint)}
|
|
742
|
+
<MapContextMenuAction onSelect={searchMenuPoint}>Search this point</MapContextMenuAction>
|
|
743
|
+
</MapContextMenu>
|
|
744
|
+
) : null}
|
|
745
|
+
|
|
646
746
|
{panels.footer}
|
|
647
747
|
</>
|
|
648
748
|
)
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
+
// SPDX-FileCopyrightText: Teffen Ellis and Mailwoman contributors
|
|
2
|
+
// SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Commercial
|
|
3
|
+
|
|
1
4
|
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
* Draws a grid of meridians and parallels under the basemap so that the globe is readable while
|
|
7
|
-
* tiles load. Loaded tiles cover the grid.
|
|
5
|
+
* Draws a grid of meridians and parallels under the basemap so that the
|
|
6
|
+
* globe is readable while tiles load.
|
|
7
|
+
* Loaded tiles cover the grid.
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
import { type ReactNode, useMemo } from "react"
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
// SPDX-FileCopyrightText: Teffen Ellis and Mailwoman contributors
|
|
2
|
+
// SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Commercial
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* The load ledger as a disclosure: one row per artifact the release load requested,
|
|
6
|
+
* with its role, bytes, source and state.
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
import {
|
|
10
|
+
ARTIFACT_ROLE_LABELS,
|
|
11
|
+
type ArtifactSource,
|
|
12
|
+
type LedgerEntry,
|
|
13
|
+
type LoadLedgerSnapshot,
|
|
14
|
+
} from "@mailwoman/core/load-ledger"
|
|
15
|
+
import type { ReactNode } from "react"
|
|
16
|
+
|
|
17
|
+
const SOURCE_LABELS: Readonly<Record<ArtifactSource, string>> = {
|
|
18
|
+
"service-worker": "offline cache",
|
|
19
|
+
"http-cache": "browser cache",
|
|
20
|
+
network: "network",
|
|
21
|
+
unknown: "source unknown",
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* The bytes in a kibibyte, the step between the units this list shows.
|
|
26
|
+
*/
|
|
27
|
+
const BYTES_PER_KIB = 1024
|
|
28
|
+
|
|
29
|
+
function formatBytes(bytes: number): string {
|
|
30
|
+
if (bytes < BYTES_PER_KIB) return `${bytes} B`
|
|
31
|
+
|
|
32
|
+
if (bytes < BYTES_PER_KIB * BYTES_PER_KIB) return `${(bytes / BYTES_PER_KIB).toFixed(0)} KB`
|
|
33
|
+
|
|
34
|
+
return `${(bytes / BYTES_PER_KIB / BYTES_PER_KIB).toFixed(1)} MB`
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
function describeBytes(entry: LedgerEntry): string {
|
|
38
|
+
if (entry.total) return `${formatBytes(entry.received)} of ${formatBytes(entry.total)}`
|
|
39
|
+
|
|
40
|
+
return entry.received ? formatBytes(entry.received) : ""
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
function describeState(entry: LedgerEntry): string {
|
|
44
|
+
switch (entry.state) {
|
|
45
|
+
case "loading":
|
|
46
|
+
return "loading"
|
|
47
|
+
case "done":
|
|
48
|
+
return entry.source ? SOURCE_LABELS[entry.source] : "done"
|
|
49
|
+
case "missing":
|
|
50
|
+
return "not published"
|
|
51
|
+
case "failed":
|
|
52
|
+
return entry.error ? `failed: ${entry.error}` : "failed"
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
export interface LoadLedgerListProps {
|
|
57
|
+
ledger: LoadLedgerSnapshot
|
|
58
|
+
/**
|
|
59
|
+
* Opens the disclosure on first render, as after a failed load.
|
|
60
|
+
*/
|
|
61
|
+
open?: boolean
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* A `<details>` listing every artifact in `ledger`, with a summary that counts them
|
|
66
|
+
* and names any that failed.
|
|
67
|
+
*/
|
|
68
|
+
export function LoadLedgerList({ ledger, open = false }: LoadLedgerListProps): ReactNode {
|
|
69
|
+
const done = ledger.entries.filter((entry) => entry.state === "done" || entry.state === "missing").length
|
|
70
|
+
const failed = ledger.entries.filter((entry) => entry.state === "failed").length
|
|
71
|
+
|
|
72
|
+
const summary = [
|
|
73
|
+
`${done} of ${ledger.entries.length} files loaded`,
|
|
74
|
+
failed ? `${failed} failed` : null,
|
|
75
|
+
ledger.waitingForNetwork ? "waiting for network" : null,
|
|
76
|
+
]
|
|
77
|
+
.filter((part): part is string => part != null)
|
|
78
|
+
.join(" · ")
|
|
79
|
+
|
|
80
|
+
return (
|
|
81
|
+
<details className="mw-load-ledger" open={open}>
|
|
82
|
+
<summary>{summary}</summary>
|
|
83
|
+
<ul className="mw-load-ledger__list">
|
|
84
|
+
{ledger.entries.map((entry) => (
|
|
85
|
+
<li key={entry.url} className={`mw-load-ledger__row mw-load-ledger__row--${entry.state}`}>
|
|
86
|
+
<span className="mw-load-ledger__role" title={entry.url}>
|
|
87
|
+
{ARTIFACT_ROLE_LABELS[entry.role]}
|
|
88
|
+
</span>
|
|
89
|
+
<span className="mw-load-ledger__bytes">{describeBytes(entry)}</span>
|
|
90
|
+
<span className="mw-load-ledger__state">{describeState(entry)}</span>
|
|
91
|
+
</li>
|
|
92
|
+
))}
|
|
93
|
+
</ul>
|
|
94
|
+
</details>
|
|
95
|
+
)
|
|
96
|
+
}
|
package/lib/map/MapCanvas.tsx
CHANGED
|
@@ -1,24 +1,27 @@
|
|
|
1
|
+
// SPDX-FileCopyrightText: Teffen Ellis and Mailwoman contributors
|
|
2
|
+
// SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Commercial
|
|
3
|
+
|
|
1
4
|
/**
|
|
2
|
-
* @copyright Sister Software
|
|
3
|
-
* @license AGPL-3.0
|
|
4
|
-
* @author Teffen Ellis, et al.
|
|
5
|
-
*
|
|
6
5
|
* `<MapCanvas>` — the declarative map shell for the geocoder demo, over `react-map-gl/maplibre` (v8).
|
|
7
|
-
*
|
|
8
|
-
*
|
|
6
|
+
*
|
|
7
|
+
* Phase 1 is the shell only: a `<Map>` that takes a host-composed `mapStyle`, an initial
|
|
8
|
+
* (or controlled) view state and a `children` slot for overlays/markers from later phases.
|
|
9
9
|
* No overlay/marker/camera logic lives here yet.
|
|
10
10
|
*
|
|
11
11
|
* node-import safety: this module imports `react-map-gl/maplibre` (which pulls `maplibre-gl` — WebGL
|
|
12
12
|
* + DOM at import) at module scope, so it is reachable only through the `@mailwoman/react/map`
|
|
13
|
-
* subpath, never from the package root (`index.ts`).
|
|
14
|
-
* consumer (or the CI smoke IMPORT_CHECK)
|
|
15
|
-
*
|
|
13
|
+
* subpath, never from the package root (`index.ts`).
|
|
14
|
+
* The bare `import("@mailwoman/react")` a node consumer (or the CI smoke IMPORT_CHECK)
|
|
15
|
+
* runs must never transitively load this file.
|
|
16
|
+
* Keep it out of the root barrel.
|
|
17
|
+
*
|
|
18
|
+
* CSS: the package imports no CSS from its modules (the node-safe invariant),
|
|
19
|
+
* so a host that renders `<MapCanvas>` must import `maplibre-gl/dist/maplibre-gl.css`
|
|
20
|
+
* itself (plus `@mailwoman/react/styles.css` for the `.mw-demo-map` container).
|
|
21
|
+
* `<MapCanvas>` is intrinsically a client component.
|
|
16
22
|
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
* for the `.mw-demo-map` container). `<MapCanvas>` is intrinsically a client component. A host that
|
|
20
|
-
* server-renders should wrap it in a client boundary (the package's `ClientOnly`), exactly as the
|
|
21
|
-
* composed `Geocoder` will in a later phase.
|
|
23
|
+
* A host that server-renders should wrap it in a client boundary (the package's `ClientOnly`),
|
|
24
|
+
* exactly as the composed `Geocoder` will in a later phase.
|
|
22
25
|
*/
|
|
23
26
|
|
|
24
27
|
import { useState } from "react"
|
|
@@ -35,7 +38,7 @@ import { StarfieldLayer } from "#map/StarfieldLayer"
|
|
|
35
38
|
export type MapCanvasStyle = NonNullable<MapProps["mapStyle"]>
|
|
36
39
|
|
|
37
40
|
/**
|
|
38
|
-
* Override for the `<Map>` props `<MapCanvas>`
|
|
41
|
+
* Override for the `<Map>` props `<MapCanvas>` doesn't surface explicitly
|
|
39
42
|
* (e.g. `minZoom`, `attributionControl`, `maplibreLogo`).
|
|
40
43
|
*
|
|
41
44
|
* The controlled fields MapCanvas owns are omitted so they can't be set twice.
|
|
@@ -90,7 +93,7 @@ export interface MapCanvasProps {
|
|
|
90
93
|
*/
|
|
91
94
|
style?: CSSProperties
|
|
92
95
|
/**
|
|
93
|
-
* Other `<Map>` props that MapCanvas
|
|
96
|
+
* Other `<Map>` props that MapCanvas doesn't surface explicitly.
|
|
94
97
|
*/
|
|
95
98
|
mapProps?: MapCanvasExtraProps
|
|
96
99
|
/**
|
package/lib/map/MapChipRow.tsx
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
|
+
// SPDX-FileCopyrightText: Teffen Ellis and Mailwoman contributors
|
|
2
|
+
// SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Commercial
|
|
3
|
+
|
|
1
4
|
/**
|
|
2
|
-
* @copyright Sister Software
|
|
3
|
-
* @license AGPL-3.0
|
|
4
|
-
* @author Teffen Ellis, et al.
|
|
5
|
-
*
|
|
6
5
|
* Render example-query chips in a single horizontally scrollable row.
|
|
7
6
|
*/
|
|
8
7
|
|
package/lib/map/MapCompass.tsx
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
|
+
// SPDX-FileCopyrightText: Teffen Ellis and Mailwoman contributors
|
|
2
|
+
// SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Commercial
|
|
3
|
+
|
|
1
4
|
/**
|
|
2
|
-
* @copyright Sister Software
|
|
3
|
-
* @license AGPL-3.0
|
|
4
|
-
* @author Teffen Ellis, et al.
|
|
5
|
-
*
|
|
6
5
|
* Shows a compass that rotates with the map's rotation angle and hides when the map faces north.
|
|
7
6
|
* A press asks the host to rotate the map back to north.
|
|
8
7
|
*/
|