@mailwoman/react 10.0.0 → 10.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 +18 -16
- package/fonts.css +97 -22
- package/lib/common/About.tsx +10 -10
- package/lib/common/ClientOnly.tsx +2 -14
- package/lib/common/CopyButton.tsx +9 -3
- package/lib/common/LoadingIndicator.tsx +13 -5
- package/lib/common/PresetChips.tsx +11 -8
- package/lib/common/confidence-tiers.ts +8 -7
- package/lib/common/cx.ts +3 -1
- package/lib/common/text-tokens.ts +10 -13
- 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 -18
- package/lib/map/AppIdentity.tsx +89 -0
- package/lib/map/CompareToggle.tsx +8 -31
- package/lib/map/DebugInfo.tsx +75 -0
- package/lib/map/Geocoder.tsx +65 -50
- package/lib/map/GeocoderControls.tsx +425 -141
- package/lib/map/GraticuleLayer.tsx +56 -0
- package/lib/map/MapCanvas.tsx +26 -13
- package/lib/map/MapChipRow.tsx +4 -8
- package/lib/map/MapCompass.tsx +18 -25
- package/lib/map/MapControlStack.tsx +11 -10
- package/lib/map/MapFooter.tsx +5 -17
- 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 +14 -3
- package/lib/map/PlaceAutocomplete.tsx +12 -21
- package/lib/map/PlaceMarker.tsx +10 -4
- package/lib/map/ResolvedPlaceLayers.tsx +14 -15
- package/lib/map/ResultCamera.tsx +10 -31
- package/lib/map/ResultOverlay.tsx +14 -16
- package/lib/map/ResultPanel.tsx +1 -20
- package/lib/map/VersionPicker.tsx +10 -19
- package/lib/map/fake-runtime.ts +46 -19
- package/lib/map/geometry.ts +14 -47
- package/lib/map/graticule.ts +80 -0
- package/lib/map/map-debug.ts +4 -2
- package/lib/map/place-render.ts +30 -62
- package/lib/map/types.ts +57 -116
- 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 +3 -7
- package/lib/map/usePlaceAutocomplete.ts +44 -50
- package/lib/map.ts +92 -0
- package/lib/pipeline/CandidatePicker.tsx +13 -5
- package/lib/pipeline/ConfidenceCell.tsx +2 -2
- package/lib/pipeline/FailureDiagnostic.tsx +8 -2
- package/lib/pipeline/PipelineExplorer.tsx +6 -3
- package/lib/pipeline/QueryForm.tsx +5 -2
- package/lib/pipeline/ResolvedPlace.tsx +2 -2
- package/lib/pipeline/SpanHighlight.tsx +7 -5
- package/lib/pipeline/TimingPanel.tsx +1 -1
- package/lib/pipeline/TreeView.tsx +2 -2
- package/lib/pipeline/copy.ts +22 -25
- package/lib/pipeline/presets.ts +15 -13
- package/lib/pipeline/types.ts +20 -17
- 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 +29 -17
- package/lib/poi/QueryInput.tsx +1 -1
- package/lib/poi/SubjectPanel.tsx +4 -3
- package/lib/poi/runtime.ts +14 -16
- package/lib/poi/types.ts +58 -47
- package/lib/poi/usePOISearch.ts +91 -82
- package/lib/poi.ts +40 -0
- package/lib/runtime/useReleaseRuntime.ts +122 -90
- package/lib/search/SearchModal.tsx +478 -0
- package/lib/search/search.css +282 -0
- package/lib/search/types.ts +68 -0
- package/lib/search.ts +11 -0
- package/out/common/About.d.ts +6 -6
- 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 +9 -3
- package/out/common/CopyButton.d.ts.map +1 -1
- package/out/common/CopyButton.js.map +1 -1
- package/out/common/LoadingIndicator.d.ts +13 -5
- package/out/common/LoadingIndicator.d.ts.map +1 -1
- package/out/common/LoadingIndicator.js.map +1 -1
- package/out/common/PresetChips.d.ts +11 -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 +8 -7
- 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 +6 -11
- 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 +46 -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/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 +27 -0
- package/out/map/DebugInfo.d.ts.map +1 -0
- package/out/map/DebugInfo.js +36 -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 +23 -37
- package/out/map/Geocoder.js.map +1 -1
- package/out/map/GeocoderControls.d.ts +15 -44
- package/out/map/GeocoderControls.d.ts.map +1 -1
- package/out/map/GeocoderControls.js +250 -39
- package/out/map/GeocoderControls.js.map +1 -1
- package/out/map/GraticuleLayer.d.ts +30 -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 +26 -13
- 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 +14 -21
- 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 +11 -10
- 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 +5 -16
- 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 +8 -2
- package/out/map/OverlayLayers.d.ts.map +1 -1
- package/out/map/OverlayLayers.js +3 -3
- package/out/map/OverlayLayers.js.map +1 -1
- package/out/map/PlaceAutocomplete.d.ts +12 -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 +10 -4
- 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 +14 -15
- 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 +10 -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 +14 -16
- 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 +45 -19
- 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 +4 -2
- package/out/map/map-debug.d.ts.map +1 -1
- package/out/map/map-debug.js +1 -1
- package/out/map/map-debug.js.map +1 -1
- package/out/map/place-render.d.ts +25 -45
- 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 +57 -113
- 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 +3 -7
- 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 +67 -0
- package/out/map.d.ts.map +1 -0
- package/out/map.js +45 -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 +2 -2
- package/out/pipeline/ConfidenceCell.d.ts.map +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/PipelineExplorer.d.ts +6 -2
- package/out/pipeline/PipelineExplorer.d.ts.map +1 -1
- package/out/pipeline/PipelineExplorer.js +1 -1
- package/out/pipeline/PipelineExplorer.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/ResolvedPlace.d.ts +1 -1
- package/out/pipeline/ResolvedPlace.d.ts.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/TreeView.js.map +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 +20 -17
- 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 +11 -10
- 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 +14 -16
- package/out/poi/runtime.js.map +1 -1
- package/out/poi/types.d.ts +53 -45
- 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 +30 -17
- package/out/poi/usePOISearch.d.ts.map +1 -1
- package/out/poi/usePOISearch.js +48 -64
- 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 +63 -74
- package/out/runtime/useReleaseRuntime.d.ts.map +1 -1
- package/out/runtime/useReleaseRuntime.js +31 -32
- 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 +40 -0
- package/out/search/SearchModal.d.ts.map +1 -0
- package/out/search/SearchModal.js +255 -0
- package/out/search/SearchModal.js.map +1 -0
- package/out/search/types.d.ts +65 -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 +73 -165
- 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/BackendControl.tsx +0 -51
- 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/BackendControl.d.ts +0 -32
- package/out/map/BackendControl.d.ts.map +0 -1
- package/out/map/BackendControl.js +0 -8
- package/out/map/BackendControl.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
package/out/poi/types.d.ts
CHANGED
|
@@ -3,18 +3,23 @@
|
|
|
3
3
|
* @license AGPL-3.0
|
|
4
4
|
* @author Teffen Ellis, et al.
|
|
5
5
|
*
|
|
6
|
-
* Types for the POI explorer.
|
|
7
|
-
*
|
|
8
|
-
* INJECTED async function ({@link POILiveSearch}) so the httpvfs/worker implementation stays out of this
|
|
9
|
-
* package's browser graph (it lives in the docs site, which knows where the layer is served).
|
|
6
|
+
* Types for the POI explorer. Live poi.db search is injected as {@link POILiveSearch} so the httpvfs
|
|
7
|
+
* worker stays out of this package's browser graph.
|
|
10
8
|
*/
|
|
11
9
|
import type { QueryKindResult } from "@mailwoman/core/pipeline";
|
|
10
|
+
import type { POIDistanceHit } from "@mailwoman/core/resolver";
|
|
12
11
|
import type { POIPhraseLookup, createKindClassifier } from "@mailwoman/kind-classifier";
|
|
13
12
|
import type { createPOITaxonomyLookup } from "@mailwoman/poi-taxonomy/table";
|
|
13
|
+
/**
|
|
14
|
+
* The POI taxonomy lookup that the explorer runtime loads.
|
|
15
|
+
*/
|
|
14
16
|
export type TaxonomyLookup = ReturnType<typeof createPOITaxonomyLookup>;
|
|
17
|
+
/**
|
|
18
|
+
* One taxonomy category record.
|
|
19
|
+
*/
|
|
15
20
|
export type CategoryRecord = NonNullable<ReturnType<TaxonomyLookup["getPOICategory"]>>;
|
|
16
21
|
/**
|
|
17
|
-
* The lazily
|
|
22
|
+
* The lazily loaded POI runtime holds the taxonomy lookup, the lexicon and the kind classifier.
|
|
18
23
|
*/
|
|
19
24
|
export interface POIRuntime {
|
|
20
25
|
lookup: TaxonomyLookup;
|
|
@@ -28,25 +33,25 @@ export interface POISubjectBase {
|
|
|
28
33
|
matchedPhrase: string;
|
|
29
34
|
confidence: number;
|
|
30
35
|
/**
|
|
31
|
-
* The
|
|
36
|
+
* The rest of the query after the subject, usually the location anchor such as "near Springfield".
|
|
32
37
|
*/
|
|
33
38
|
remainder: string;
|
|
34
39
|
}
|
|
35
40
|
/**
|
|
36
|
-
* A resolved POI subject that
|
|
41
|
+
* A resolved POI subject that matched a taxonomy category such as `cafe` or `hospital`.
|
|
37
42
|
*/
|
|
38
43
|
export interface POICategorySubject extends POISubjectBase {
|
|
39
44
|
kind: "category";
|
|
40
45
|
category: CategoryRecord;
|
|
41
46
|
/**
|
|
42
|
-
* Whether this category
|
|
47
|
+
* Whether this category requires the locally built OSM (ODbL) layer.
|
|
43
48
|
*/
|
|
44
49
|
buildLocal: boolean;
|
|
45
50
|
}
|
|
46
51
|
/**
|
|
47
|
-
* A resolved POI subject that
|
|
48
|
-
*
|
|
49
|
-
*
|
|
52
|
+
* A resolved POI subject that matched a chain brand such as `chevron`.
|
|
53
|
+
*
|
|
54
|
+
* Live search looks up a brand by its Wikidata QID instead of by category k-ring.
|
|
50
55
|
*/
|
|
51
56
|
export interface POIBrandSubject extends POISubjectBase {
|
|
52
57
|
kind: "brand";
|
|
@@ -55,37 +60,35 @@ export interface POIBrandSubject extends POISubjectBase {
|
|
|
55
60
|
*/
|
|
56
61
|
name: string;
|
|
57
62
|
/**
|
|
58
|
-
* Wikidata QID
|
|
63
|
+
* The brand's Wikidata QID.
|
|
64
|
+
* It is `null` when the lexicon had no QID for the brand.
|
|
59
65
|
*/
|
|
60
|
-
wikidata
|
|
66
|
+
wikidata: string | null;
|
|
61
67
|
}
|
|
62
68
|
/**
|
|
63
|
-
* A resolved POI subject
|
|
69
|
+
* A resolved POI subject, either a taxonomy category or a chain brand.
|
|
64
70
|
*/
|
|
65
71
|
export type POISubject = POICategorySubject | POIBrandSubject;
|
|
66
72
|
/**
|
|
67
|
-
* The intent-only result
|
|
73
|
+
* The intent-only result.
|
|
74
|
+
*
|
|
75
|
+
* It holds the kind verdict and, when a category subject was detected, its OverpassQL export.
|
|
68
76
|
*/
|
|
69
77
|
export interface POIExplorerResult {
|
|
70
78
|
kindResult: QueryKindResult;
|
|
71
|
-
subject
|
|
72
|
-
overpassQL
|
|
73
|
-
overpassError
|
|
79
|
+
subject: POISubject | null;
|
|
80
|
+
overpassQL: string | null;
|
|
81
|
+
overpassError: string | null;
|
|
74
82
|
}
|
|
75
83
|
/**
|
|
76
84
|
* One live poi.db hit, as the results list renders it.
|
|
77
85
|
*/
|
|
78
|
-
export
|
|
79
|
-
name: string;
|
|
80
|
-
lat: number;
|
|
81
|
-
lon: number;
|
|
82
|
-
distanceM: number;
|
|
83
|
-
country: string;
|
|
84
|
-
confidence: number;
|
|
85
|
-
}
|
|
86
|
+
export type POISearchHit = POIDistanceHit;
|
|
86
87
|
/**
|
|
87
|
-
*
|
|
88
|
-
*
|
|
88
|
+
* The result of an injected live search.
|
|
89
|
+
*
|
|
90
|
+
* The `unplaced` and `unavailable` states stay separate so the UI can tell an
|
|
91
|
+
* unresolved anchor apart from an unreachable layer.
|
|
89
92
|
*/
|
|
90
93
|
export type POILiveSearchResult = {
|
|
91
94
|
status: "success";
|
|
@@ -98,27 +101,31 @@ export type POILiveSearchResult = {
|
|
|
98
101
|
status: "unavailable";
|
|
99
102
|
};
|
|
100
103
|
/**
|
|
101
|
-
*
|
|
102
|
-
*
|
|
103
|
-
*
|
|
104
|
-
* Brand support is ADDITIVE: when the resolved subject is a chain brand, `brandWikidata` carries its QID and the probe
|
|
105
|
-
* fetches by that QID instead of a category k-ring (`categoryID`/`overtureCategoryIDs` are then the brand name / empty
|
|
106
|
-
* and unused). The category path is byte-identical to before. A probe that can't serve brands simply leaves brand live
|
|
107
|
-
* search unwired at the call site (see `usePOISearch`'s `brandLiveSearch` option) — the docs' httpvfs probe does
|
|
108
|
-
* exactly that, brand-wide row hydration being pathological over byte-range (measured; the brand path is server-side
|
|
109
|
-
* only).
|
|
104
|
+
* What a live search looks for near `anchor`: a taxonomy category with its Overture
|
|
105
|
+
* leaf categories, or a chain brand identified by its Wikidata QID.
|
|
110
106
|
*/
|
|
111
|
-
export type
|
|
107
|
+
export type POILiveSearchRequest = {
|
|
108
|
+
kind: "category";
|
|
112
109
|
categoryID: string;
|
|
113
110
|
overtureCategoryIDs: string[];
|
|
114
111
|
anchor: string;
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
112
|
+
} | {
|
|
113
|
+
kind: "brand";
|
|
114
|
+
brandName: string;
|
|
115
|
+
wikidata: string;
|
|
116
|
+
anchor: string;
|
|
117
|
+
};
|
|
118
|
+
/**
|
|
119
|
+
* The injected live-search function.
|
|
120
|
+
*
|
|
121
|
+
* It probes the published poi.db for the request's subject and the anchor text.
|
|
122
|
+
* The explorer runs intent-only when this function is absent.
|
|
123
|
+
*
|
|
124
|
+
* A probe that cannot serve brands should leave `usePOISearch`'s `brandLiveSearch` option unset.
|
|
125
|
+
*/
|
|
126
|
+
export type POILiveSearch = (request: POILiveSearchRequest) => Promise<POILiveSearchResult>;
|
|
120
127
|
/**
|
|
121
|
-
* "Search live"
|
|
128
|
+
* The state of a "Search live" request.
|
|
122
129
|
*/
|
|
123
130
|
export type LiveSearchState = {
|
|
124
131
|
status: "idle";
|
|
@@ -133,7 +140,8 @@ export type LiveSearchState = {
|
|
|
133
140
|
centerName: string;
|
|
134
141
|
};
|
|
135
142
|
/**
|
|
136
|
-
* A
|
|
143
|
+
* A runtime loader.
|
|
144
|
+
* Stories and tests inject one to substitute a mock taxonomy.
|
|
137
145
|
*/
|
|
138
146
|
export type LoadPOIRuntime = () => Promise<POIRuntime>;
|
|
139
147
|
//# sourceMappingURL=types.d.ts.map
|
package/out/poi/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../lib/poi/types.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../lib/poi/types.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAA;AAC/D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAA;AAC9D,OAAO,KAAK,EAAE,eAAe,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAA;AACvF,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,+BAA+B,CAAA;AAE5E;;GAEG;AACH,MAAM,MAAM,cAAc,GAAG,UAAU,CAAC,OAAO,uBAAuB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U,EAAE,MAAM,CAAA;CAAE,GAC/D;IAAE,MAAM,EAAE,UAAU,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,GACtC;IAAE,MAAM,EAAE,aAAa,CAAA;CAAE,CAAA;AAE5B;;;GAGG;AACH,MAAM,MAAM,oBAAoB,GAC7B;IACA,IAAI,EAAE,UAAU,CAAA;IAChB,UAAU,EAAE,MAAM,CAAA;IAClB,mBAAmB,EAAE,MAAM,EAAE,CAAA;IAC7B,MAAM,EAAE,MAAM,CAAA;CACb,GACD;IACA,IAAI,EAAE,OAAO,CAAA;IACb,SAAS,EAAE,MAAM,CAAA;IACjB,QAAQ,EAAE,MAAM,CAAA;IAChB,MAAM,EAAE,MAAM,CAAA;CACb,CAAA;AAEJ;;;;;;;GAOG;AACH,MAAM,MAAM,aAAa,GAAG,CAAC,OAAO,EAAE,oBAAoB,KAAK,OAAO,CAAC,mBAAmB,CAAC,CAAA;AAE3F;;GAEG;AACH,MAAM,MAAM,eAAe,GACxB;IAAE,MAAM,EAAE,MAAM,CAAA;CAAE,GAClB;IAAE,MAAM,EAAE,SAAS,CAAA;CAAE,GACrB;IAAE,MAAM,EAAE,OAAO,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,GACpC;IAAE,MAAM,EAAE,SAAS,CAAC;IAAC,IAAI,EAAE,YAAY,EAAE,CAAC;IAAC,UAAU,EAAE,MAAM,CAAA;CAAE,CAAA;AAElE;;;GAGG;AACH,MAAM,MAAM,cAAc,GAAG,MAAM,OAAO,CAAC,UAAU,CAAC,CAAA"}
|
package/out/poi/types.js
CHANGED
|
@@ -3,10 +3,8 @@
|
|
|
3
3
|
* @license AGPL-3.0
|
|
4
4
|
* @author Teffen Ellis, et al.
|
|
5
5
|
*
|
|
6
|
-
* Types for the POI explorer.
|
|
7
|
-
*
|
|
8
|
-
* INJECTED async function ({@link POILiveSearch}) so the httpvfs/worker implementation stays out of this
|
|
9
|
-
* package's browser graph (it lives in the docs site, which knows where the layer is served).
|
|
6
|
+
* Types for the POI explorer. Live poi.db search is injected as {@link POILiveSearch} so the httpvfs
|
|
7
|
+
* worker stays out of this package's browser graph.
|
|
10
8
|
*/
|
|
11
9
|
export {};
|
|
12
10
|
//# sourceMappingURL=types.js.map
|
package/out/poi/types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../lib/poi/types.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../lib/poi/types.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG"}
|
|
@@ -2,59 +2,72 @@
|
|
|
2
2
|
* @copyright Sister Software
|
|
3
3
|
* @license AGPL-3.0
|
|
4
4
|
* @author Teffen Ellis, et al.
|
|
5
|
-
*
|
|
6
|
-
* `usePOISearch` — the headless core of the POI explorer. Owns the taxonomy-runtime load, the
|
|
7
|
-
* debounced classify → subject → OverpassQL derivation, and the "Search live" state machine. The
|
|
8
|
-
* runtime loader and the live-search probe are both INJECTABLE, so stories/tests drive it with mocks
|
|
9
|
-
* and no network or db. Presentation is entirely the caller's concern.
|
|
10
5
|
*/
|
|
11
6
|
import type { LiveSearchState, LoadPOIRuntime, POIExplorerResult, POILiveSearch } from "#poi/types";
|
|
7
|
+
/**
|
|
8
|
+
* Options for {@link usePOISearch}.
|
|
9
|
+
*/
|
|
12
10
|
export interface UsePOISearchOptions {
|
|
13
11
|
/**
|
|
14
|
-
* The current query text
|
|
12
|
+
* The current query text, owned and updated by the caller.
|
|
15
13
|
*/
|
|
16
14
|
text: string;
|
|
17
15
|
/**
|
|
18
|
-
*
|
|
16
|
+
* The loader that the hook calls once on mount.
|
|
17
|
+
*
|
|
18
|
+
* @defaultValue `loadPOIRuntime`
|
|
19
19
|
*/
|
|
20
20
|
loadRuntime?: LoadPOIRuntime;
|
|
21
21
|
/**
|
|
22
|
-
*
|
|
22
|
+
* The live-search probe.
|
|
23
|
+
* Live search is unavailable when it is absent.
|
|
23
24
|
*/
|
|
24
25
|
runLiveSearch?: POILiveSearch;
|
|
25
26
|
/**
|
|
26
|
-
* Whether the
|
|
27
|
-
*
|
|
28
|
-
*
|
|
29
|
-
* live search is unaffected either way.
|
|
27
|
+
* Whether the probe can search for brand subjects by Wikidata ID, defaulting to
|
|
28
|
+
* false. enable it only for a server-side backend, since fetching every row for
|
|
29
|
+
* a brand over an HTTP range-request database is too slow.
|
|
30
30
|
*/
|
|
31
31
|
brandLiveSearch?: boolean;
|
|
32
32
|
/**
|
|
33
|
-
*
|
|
33
|
+
* The delay in milliseconds before the text is classified.
|
|
34
|
+
*
|
|
35
|
+
* @defaultValue `250`
|
|
34
36
|
*/
|
|
35
37
|
debounceMs?: number;
|
|
36
38
|
}
|
|
39
|
+
/**
|
|
40
|
+
* The state that {@link usePOISearch} returns.
|
|
41
|
+
*/
|
|
37
42
|
export interface UsePOISearch {
|
|
38
43
|
/**
|
|
39
44
|
* True once the taxonomy runtime has loaded.
|
|
40
45
|
*/
|
|
41
46
|
runtimeReady: boolean;
|
|
42
47
|
/**
|
|
43
|
-
* The
|
|
48
|
+
* The classification for the current debounced text, `null` for empty text
|
|
49
|
+
* and while classification is pending.
|
|
44
50
|
*/
|
|
45
51
|
result: POIExplorerResult | null;
|
|
46
52
|
/**
|
|
47
|
-
*
|
|
53
|
+
* The live-search state for the current debounced text, `idle` until a search runs.
|
|
48
54
|
*/
|
|
49
55
|
liveSearch: LiveSearchState;
|
|
50
56
|
/**
|
|
51
|
-
* Whether a
|
|
57
|
+
* Whether a probe is wired and the subject supports live search with a non-empty place anchor.
|
|
52
58
|
*/
|
|
53
59
|
canSearchLive: boolean;
|
|
54
60
|
/**
|
|
55
|
-
*
|
|
61
|
+
* Starts a live search for the current subject.
|
|
62
|
+
* It starts no search when `canSearchLive` is false.
|
|
56
63
|
*/
|
|
57
64
|
searchLive: () => Promise<void>;
|
|
58
65
|
}
|
|
66
|
+
/**
|
|
67
|
+
* Classifies debounced query text as a POI category or brand request and runs live searches on demand.
|
|
68
|
+
*
|
|
69
|
+
* Each result is keyed to the query that produced it, live search requires a non-empty anchor.
|
|
70
|
+
* Brands need `brandLiveSearch` plus a Wikidata ID.
|
|
71
|
+
*/
|
|
59
72
|
export declare function usePOISearch({ text, loadRuntime, runLiveSearch, brandLiveSearch, debounceMs, }: UsePOISearchOptions): UsePOISearch;
|
|
60
73
|
//# sourceMappingURL=usePOISearch.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"usePOISearch.d.ts","sourceRoot":"","sources":["../../lib/poi/usePOISearch.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"usePOISearch.d.ts","sourceRoot":"","sources":["../../lib/poi/usePOISearch.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAUH,OAAO,KAAK,EACX,eAAe,EACf,cAAc,EACd,iBAAiB,EACjB,aAAa,EAGb,MAAM,YAAY,CAAA;AAEnB;;GAEG;AACH,MAAM,WAAW,mBAAmB;IACnC;;OAEG;IACH,IAAI,EAAE,MAAM,CAAA;IAEZ;;;;OAIG;IACH,WAAW,CAAC,EAAE,cAAc,CAAA;IAE5B;;;OAGG;IACH,aAAa,CAAC,EAAE,aAAa,CAAA;IAE7B;;;;OAIG;IACH,eAAe,CAAC,EAAE,OAAO,CAAA;IAEzB;;;;OAIG;IACH,UAAU,CAAC,EAAE,MAAM,CAAA;CACnB;AAED;;GAEG;AACH,MAAM,WAAW,YAAY;IAC5B;;OAEG;IACH,YAAY,EAAE,OAAO,CAAA;IAErB;;;OAGG;IACH,MAAM,EAAE,iBAAiB,GAAG,IAAI,CAAA;IAEhC;;OAEG;IACH,UAAU,EAAE,eAAe,CAAA;IAE3B;;OAEG;IACH,aAAa,EAAE,OAAO,CAAA;IAEtB;;;OAGG;IACH,UAAU,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAA;CAC/B;AA2BD;;;;;GAKG;AACH,wBAAgB,YAAY,CAAC,EAC5B,IAAI,EACJ,WAA4B,EAC5B,aAAa,EACb,eAAuB,EACvB,UAAgB,GAChB,EAAE,mBAAmB,GAAG,YAAY,CAiKpC"}
|
package/out/poi/usePOISearch.js
CHANGED
|
@@ -2,11 +2,6 @@
|
|
|
2
2
|
* @copyright Sister Software
|
|
3
3
|
* @license AGPL-3.0
|
|
4
4
|
* @author Teffen Ellis, et al.
|
|
5
|
-
*
|
|
6
|
-
* `usePOISearch` — the headless core of the POI explorer. Owns the taxonomy-runtime load, the
|
|
7
|
-
* debounced classify → subject → OverpassQL derivation, and the "Search live" state machine. The
|
|
8
|
-
* runtime loader and the live-search probe are both INJECTABLE, so stories/tests drive it with mocks
|
|
9
|
-
* and no network or db. Presentation is entirely the caller's concern.
|
|
10
5
|
*/
|
|
11
6
|
import { matchPOISubject } from "@mailwoman/kind-classifier";
|
|
12
7
|
import { emitOverpassQL } from "@mailwoman/poi-taxonomy/overpass";
|
|
@@ -14,44 +9,37 @@ import { computeQueryShape } from "@mailwoman/query-shape";
|
|
|
14
9
|
import { useCallback, useEffect, useEffectEvent, useState } from "react";
|
|
15
10
|
import { useDebouncedValue } from "#common/useDebouncedValue";
|
|
16
11
|
import { loadPOIRuntime } from "#poi/runtime";
|
|
17
|
-
|
|
18
|
-
* Compute the OverpassQL export for a matched subject, capturing any emitter error rather than throwing.
|
|
19
|
-
*/
|
|
20
|
-
function buildOverpass(runtime, categoryID, matchedPhrase, remainder) {
|
|
12
|
+
function buildOverpass(runtime, categoryID) {
|
|
21
13
|
const category = runtime.lookup.getPOICategory(categoryID);
|
|
22
14
|
if (!category) {
|
|
23
|
-
return {};
|
|
15
|
+
return { overpassQL: null, overpassError: null };
|
|
24
16
|
}
|
|
25
17
|
const intent = {
|
|
26
|
-
subject: { kind: "category", categoryIDs: [categoryID]
|
|
27
|
-
|
|
18
|
+
subject: { kind: "category", categoryIDs: [categoryID] },
|
|
19
|
+
anchor: null,
|
|
28
20
|
};
|
|
29
21
|
try {
|
|
30
|
-
return {
|
|
22
|
+
return {
|
|
23
|
+
overpassQL: emitOverpassQL(intent, category.osmTag ? { osmTags: [category.osmTag] } : {}),
|
|
24
|
+
overpassError: null,
|
|
25
|
+
};
|
|
31
26
|
}
|
|
32
27
|
catch (error) {
|
|
33
|
-
return { overpassError: error instanceof Error ? error.message : String(error) };
|
|
28
|
+
return { overpassQL: null, overpassError: error instanceof Error ? error.message : String(error) };
|
|
34
29
|
}
|
|
35
30
|
}
|
|
31
|
+
/**
|
|
32
|
+
* Classifies debounced query text as a POI category or brand request and runs live searches on demand.
|
|
33
|
+
*
|
|
34
|
+
* Each result is keyed to the query that produced it, live search requires a non-empty anchor.
|
|
35
|
+
* Brands need `brandLiveSearch` plus a Wikidata ID.
|
|
36
|
+
*/
|
|
36
37
|
export function usePOISearch({ text, loadRuntime = loadPOIRuntime, runLiveSearch, brandLiveSearch = false, debounceMs = 250, }) {
|
|
37
38
|
const [runtime, setRuntime] = useState(null);
|
|
38
|
-
/**
|
|
39
|
-
* The classify result KEYED BY the query that produced it. The visible result is derived during render
|
|
40
|
-
* (`storedResult.query === trimmedText ? … : null`), so a new query invalidates the old answer by derivation — the
|
|
41
|
-
* effect never writes state synchronously to "reset", which is the react(set-state-in-effect) shape the lint bump
|
|
42
|
-
* rightly flags.
|
|
43
|
-
*/
|
|
44
39
|
const [storedResult, setStoredResult] = useState(null);
|
|
45
|
-
/**
|
|
46
|
-
* Live-search state, keyed the same way: launched FOR a query, visible only while that query stands.
|
|
47
|
-
*/
|
|
48
40
|
const [storedLive, setStoredLive] = useState(null);
|
|
49
41
|
const debouncedText = useDebouncedValue(text, debounceMs);
|
|
50
42
|
const trimmedText = debouncedText.trim();
|
|
51
|
-
// The load fires exactly ONCE on mount regardless of whether the caller passes a fresh `loadRuntime`
|
|
52
|
-
// closure each render (an inline `async () => …` would otherwise retrigger the effect → reload →
|
|
53
|
-
// re-render loop). `useEffectEvent` reads the LATEST closure without joining the dependency list —
|
|
54
|
-
// the runtime is a load-once resource.
|
|
55
43
|
const loadRuntimeEvent = useEffectEvent(() => loadRuntime());
|
|
56
44
|
useEffect(() => {
|
|
57
45
|
let cancelled = false;
|
|
@@ -64,9 +52,6 @@ export function usePOISearch({ text, loadRuntime = loadPOIRuntime, runLiveSearch
|
|
|
64
52
|
cancelled = true;
|
|
65
53
|
};
|
|
66
54
|
}, []);
|
|
67
|
-
// Classify the debounced query and derive the subject + OverpassQL (async, so it lives in an effect).
|
|
68
|
-
// Every state write below happens after an await — invalidation on query change is handled by the
|
|
69
|
-
// key derivation above, not by a synchronous reset here.
|
|
70
55
|
useEffect(() => {
|
|
71
56
|
if (!runtime)
|
|
72
57
|
return;
|
|
@@ -79,13 +64,11 @@ export function usePOISearch({ text, loadRuntime = loadPOIRuntime, runLiveSearch
|
|
|
79
64
|
runtime.classify(input, shape).then((kindResult) => {
|
|
80
65
|
if (cancelled)
|
|
81
66
|
return;
|
|
82
|
-
const matched = kindResult.kind === "poi_query" ? matchPOISubject(trimmed,
|
|
67
|
+
const matched = kindResult.kind === "poi_query" ? matchPOISubject(trimmed, null, runtime.lexicon) : null;
|
|
83
68
|
if (!matched) {
|
|
84
|
-
setStoredResult({ query: trimmed, value: { kindResult } });
|
|
69
|
+
setStoredResult({ query: trimmed, value: { kindResult, subject: null, overpassQL: null, overpassError: null } });
|
|
85
70
|
return;
|
|
86
71
|
}
|
|
87
|
-
// Brand subject: the lexicon carries the brand's canonical name as `categoryID` + its Wikidata QID. No category
|
|
88
|
-
// record, no OverpassQL (brands are searched by QID against the layer's `brand_wikidata` index, not OSM tags).
|
|
89
72
|
if ((matched.match.kind ?? "category") === "brand") {
|
|
90
73
|
setStoredResult({
|
|
91
74
|
query: trimmed,
|
|
@@ -94,18 +77,20 @@ export function usePOISearch({ text, loadRuntime = loadPOIRuntime, runLiveSearch
|
|
|
94
77
|
subject: {
|
|
95
78
|
kind: "brand",
|
|
96
79
|
name: matched.match.categoryID,
|
|
97
|
-
|
|
80
|
+
wikidata: matched.match.wikidata || null,
|
|
98
81
|
matchedPhrase: matched.match.matchedPhrase,
|
|
99
82
|
confidence: matched.match.confidence,
|
|
100
83
|
remainder: matched.remainder,
|
|
101
84
|
},
|
|
85
|
+
overpassQL: null,
|
|
86
|
+
overpassError: null,
|
|
102
87
|
},
|
|
103
88
|
});
|
|
104
89
|
return;
|
|
105
90
|
}
|
|
106
91
|
const category = runtime.lookup.getPOICategory(matched.match.categoryID);
|
|
107
92
|
if (!category) {
|
|
108
|
-
setStoredResult({ query: trimmed, value: { kindResult } });
|
|
93
|
+
setStoredResult({ query: trimmed, value: { kindResult, subject: null, overpassQL: null, overpassError: null } });
|
|
109
94
|
return;
|
|
110
95
|
}
|
|
111
96
|
setStoredResult({
|
|
@@ -120,7 +105,7 @@ export function usePOISearch({ text, loadRuntime = loadPOIRuntime, runLiveSearch
|
|
|
120
105
|
remainder: matched.remainder,
|
|
121
106
|
buildLocal: runtime.lookup.requiresBuildLocalLayer(category),
|
|
122
107
|
},
|
|
123
|
-
...buildOverpass(runtime, matched.match.categoryID
|
|
108
|
+
...buildOverpass(runtime, matched.match.categoryID),
|
|
124
109
|
},
|
|
125
110
|
});
|
|
126
111
|
});
|
|
@@ -128,45 +113,44 @@ export function usePOISearch({ text, loadRuntime = loadPOIRuntime, runLiveSearch
|
|
|
128
113
|
cancelled = true;
|
|
129
114
|
};
|
|
130
115
|
}, [trimmedText, runtime]);
|
|
131
|
-
// Derived visibility: an answer stands only while its query does. A new query reads as null/idle
|
|
132
|
-
// with no reset write anywhere.
|
|
133
116
|
const result = storedResult?.query === trimmedText ? storedResult.value : null;
|
|
134
117
|
const liveSearch = storedLive?.query === trimmedText ? storedLive.state : { status: "idle" };
|
|
135
|
-
const subject = result?.subject;
|
|
136
|
-
|
|
137
|
-
// BRAND with a QID AND a brand-capable probe (`brandLiveSearch`). Brands without a QID / without a brand probe show
|
|
138
|
-
// the intent + QID chip but no live affordance.
|
|
139
|
-
const subjectLiveCapable = subject !== undefined &&
|
|
140
|
-
(subject.kind === "brand" ? brandLiveSearch && subject.wikidata !== undefined : !subject.buildLocal);
|
|
118
|
+
const subject = result?.subject ?? null;
|
|
119
|
+
const subjectLiveCapable = subject !== null && (subject.kind === "brand" ? brandLiveSearch && subject.wikidata !== null : !subject.buildLocal);
|
|
141
120
|
const canSearchLive = Boolean(runLiveSearch && runtime && subject && subjectLiveCapable && subject.remainder.trim().length > 0);
|
|
142
121
|
const searchLive = useCallback(async () => {
|
|
143
122
|
if (!runLiveSearch || !runtime || !subject || !subject.remainder.trim())
|
|
144
123
|
return;
|
|
145
|
-
|
|
146
|
-
|
|
124
|
+
let request;
|
|
125
|
+
if (subject.kind === "brand") {
|
|
126
|
+
if (!brandLiveSearch || !subject.wikidata)
|
|
127
|
+
return;
|
|
128
|
+
request = { kind: "brand", brandName: subject.name, wikidata: subject.wikidata, anchor: subject.remainder };
|
|
129
|
+
}
|
|
130
|
+
else {
|
|
131
|
+
if (subject.buildLocal)
|
|
132
|
+
return;
|
|
133
|
+
request = {
|
|
134
|
+
kind: "category",
|
|
135
|
+
categoryID: subject.category.id,
|
|
136
|
+
overtureCategoryIDs: runtime.lookup.resolveOvertureCategories(subject.category.id),
|
|
137
|
+
anchor: subject.remainder,
|
|
138
|
+
};
|
|
139
|
+
}
|
|
147
140
|
setStoredLive({ query: trimmedText, state: { status: "loading" } });
|
|
148
141
|
try {
|
|
149
|
-
const
|
|
150
|
-
|
|
151
|
-
categoryID: subject.name,
|
|
152
|
-
overtureCategoryIDs: [],
|
|
153
|
-
anchor: subject.remainder,
|
|
154
|
-
brandWikidata: subject.wikidata,
|
|
155
|
-
}
|
|
156
|
-
: {
|
|
157
|
-
categoryID: subject.category.id,
|
|
158
|
-
// Fan the canonical seed id out over its Overture leaves — the same translation the Node reader uses.
|
|
159
|
-
overtureCategoryIDs: runtime.lookup.resolveOvertureCategories(subject.category.id),
|
|
160
|
-
anchor: subject.remainder,
|
|
161
|
-
});
|
|
162
|
-
if (outcome.status === "success") {
|
|
142
|
+
const response = await runLiveSearch(request);
|
|
143
|
+
if (response.status === "success") {
|
|
163
144
|
setStoredLive({
|
|
164
145
|
query: trimmedText,
|
|
165
|
-
state: { status: "success", hits:
|
|
146
|
+
state: { status: "success", hits: response.hits, centerName: response.centerName },
|
|
166
147
|
});
|
|
167
148
|
}
|
|
168
|
-
else if (
|
|
169
|
-
setStoredLive({
|
|
149
|
+
else if (response.status === "unplaced") {
|
|
150
|
+
setStoredLive({
|
|
151
|
+
query: trimmedText,
|
|
152
|
+
state: { status: "error", message: `couldn't place "${response.anchor}"` },
|
|
153
|
+
});
|
|
170
154
|
}
|
|
171
155
|
else {
|
|
172
156
|
setStoredLive({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"usePOISearch.js","sourceRoot":"","sources":["../../lib/poi/usePOISearch.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"usePOISearch.js","sourceRoot":"","sources":["../../lib/poi/usePOISearch.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAA;AAC5D,OAAO,EAAE,cAAc,EAAE,MAAM,kCAAkC,CAAA;AAEjE,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAA;AAC1D,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,cAAc,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AAExE,OAAO,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAA;AAC7D,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAA;AA+E7C,SAAS,aAAa,CACrB,OAAmB,EACnB,UAAkB;IAElB,MAAM,QAAQ,GAAG,OAAO,CAAC,MAAM,CAAC,cAAc,CAAC,UAAU,CAAC,CAAA;IAE1D,IAAI,CAAC,QAAQ,EAAE,CAAC;QACf,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,aAAa,EAAE,IAAI,EAAE,CAAA;IACjD,CAAC;IAED,MAAM,MAAM,GAAuB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AC9E,CAAC,CAAA;YACH,CAAC;QACF,CAAC;QAAC,MAAM,CAAC;YACR,aAAa,CAAC;gBACb,KAAK,EAAE,WAAW;gBAClB,KAAK,EAAE,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,yCAAyC,EAAE;aAC9E,CAAC,CAAA;QACH,CAAC;IACF,CAAC,EAAE,CAAC,aAAa,EAAE,OAAO,EAAE,OAAO,EAAE,eAAe,EAAE,WAAW,CAAC,CAAC,CAAA;IAEnE,OAAO,EAAE,YAAY,EAAE,OAAO,KAAK,IAAI,EAAE,MAAM,EAAE,UAAU,EAAE,aAAa,EAAE,UAAU,EAAE,CAAA;AACzF,CAAC"}
|
package/out/poi.d.ts
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @copyright Sister Software
|
|
3
|
+
* @license AGPL-3.0
|
|
4
|
+
* @author Teffen Ellis, et al.
|
|
5
|
+
* @file POI explorer components, hooks, runtime and interfaces.
|
|
6
|
+
*/
|
|
7
|
+
export { AbstainPanel } from "./poi/AbstainPanel.tsx";
|
|
8
|
+
export type { AbstainPanelProps } from "./poi/AbstainPanel.tsx";
|
|
9
|
+
export { LiveResultsBlock } from "./poi/LiveResultsBlock.tsx";
|
|
10
|
+
export type { LiveResultsBlockProps } from "./poi/LiveResultsBlock.tsx";
|
|
11
|
+
export { OverpassBlock } from "./poi/OverpassBlock.tsx";
|
|
12
|
+
export type { OverpassBlockProps } from "./poi/OverpassBlock.tsx";
|
|
13
|
+
export { POIExplorer } from "./poi/POIExplorer.tsx";
|
|
14
|
+
export type { POIExplorerProps } from "./poi/POIExplorer.tsx";
|
|
15
|
+
export { QueryInput } from "./poi/QueryInput.tsx";
|
|
16
|
+
export type { QueryInputProps } from "./poi/QueryInput.tsx";
|
|
17
|
+
export { formatDistance, loadPOIRuntime, POI_DEFAULT_TEXT, POI_PRESETS } from "#poi/runtime";
|
|
18
|
+
export { SubjectPanel } from "./poi/SubjectPanel.tsx";
|
|
19
|
+
export type { SubjectPanelProps } from "./poi/SubjectPanel.tsx";
|
|
20
|
+
export type { CategoryRecord, LiveSearchState, LoadPOIRuntime, POIBrandSubject, POICategorySubject, POIExplorerResult, POILiveSearch, POILiveSearchRequest, POILiveSearchResult, POIRuntime, POISearchHit, POISubject, POISubjectBase, TaxonomyLookup, } from "#poi/types";
|
|
21
|
+
export { usePOISearch } from "#poi/usePOISearch";
|
|
22
|
+
export type { UsePOISearch, UsePOISearchOptions } from "#poi/usePOISearch";
|
|
23
|
+
//# sourceMappingURL=poi.d.ts.map
|
package/out/poi.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"poi.d.ts","sourceRoot":"","sources":["../lib/poi.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAA;AACrD,YAAY,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAA;AAC/D,OAAO,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAA;AAC7D,YAAY,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAA;AACvE,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAA;AACvD,YAAY,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAA;AACjE,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAA;AACnD,YAAY,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAA;AAC7D,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAA;AACjD,YAAY,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAA;AAC3D,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,cAAc,CAAA;AAC5F,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAA;AACrD,YAAY,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAA;AAE/D,YAAY,EACX,cAAc,EACd,eAAe,EACf,cAAc,EACd,eAAe,EACf,kBAAkB,EAClB,iBAAiB,EACjB,aAAa,EACb,oBAAoB,EACpB,mBAAmB,EACnB,UAAU,EACV,YAAY,EACZ,UAAU,EACV,cAAc,EACd,cAAc,GACd,MAAM,YAAY,CAAA;AAEnB,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AAChD,YAAY,EAAE,YAAY,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAA"}
|
package/out/poi.js
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @copyright Sister Software
|
|
3
|
+
* @license AGPL-3.0
|
|
4
|
+
* @author Teffen Ellis, et al.
|
|
5
|
+
* @file POI explorer components, hooks, runtime and interfaces.
|
|
6
|
+
*/
|
|
7
|
+
export { AbstainPanel } from "./poi/AbstainPanel.js";
|
|
8
|
+
export { LiveResultsBlock } from "./poi/LiveResultsBlock.js";
|
|
9
|
+
export { OverpassBlock } from "./poi/OverpassBlock.js";
|
|
10
|
+
export { POIExplorer } from "./poi/POIExplorer.js";
|
|
11
|
+
export { QueryInput } from "./poi/QueryInput.js";
|
|
12
|
+
export { formatDistance, loadPOIRuntime, POI_DEFAULT_TEXT, POI_PRESETS } from "#poi/runtime";
|
|
13
|
+
export { SubjectPanel } from "./poi/SubjectPanel.js";
|
|
14
|
+
export { usePOISearch } from "#poi/usePOISearch";
|
|
15
|
+
//# sourceMappingURL=poi.js.map
|
package/out/poi.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"poi.js","sourceRoot":"","sources":["../lib/poi.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAwB,CAAA;AAErD,OAAO,EAAE,gBAAgB,EAAE,MAAM,2BAA4B,CAAA;AAE7D,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAyB,CAAA;AAEvD,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAuB,CAAA;AAEnD,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAsB,CAAA;AAEjD,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,cAAc,CAAA;AAC5F,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAwB,CAAA;AAoBrD,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA"}
|