@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
package/out/poi/POIExplorer.d.ts
CHANGED
|
@@ -2,38 +2,48 @@
|
|
|
2
2
|
* @copyright Sister Software
|
|
3
3
|
* @license AGPL-3.0
|
|
4
4
|
* @author Teffen Ellis, et al.
|
|
5
|
-
*
|
|
6
|
-
* `POIExplorer` — the composed POI-intent tester. Detects a POI subject in free text, shows the
|
|
7
|
-
* category + OverpassQL export, and (when a live-search probe is injected) searches the published
|
|
8
|
-
* poi.db layer. The intent path is self-contained — no weights, no network. All runtime concerns are
|
|
9
|
-
* in {@link usePOISearch}; this file is composition + a `ClientOnly` SSR boundary.
|
|
10
5
|
*/
|
|
11
6
|
import { type ReactNode } from "react";
|
|
12
7
|
import type { LoadPOIRuntime, POILiveSearch } from "#poi/types";
|
|
13
8
|
import { type Preset } from "../common/PresetChips.tsx";
|
|
9
|
+
/**
|
|
10
|
+
* Props for {@linkcode POIExplorer}.
|
|
11
|
+
*/
|
|
14
12
|
export interface POIExplorerProps {
|
|
15
13
|
/**
|
|
16
|
-
*
|
|
14
|
+
* The query that pre-fills the input.
|
|
17
15
|
*/
|
|
18
16
|
defaultText?: string;
|
|
19
17
|
/**
|
|
20
|
-
*
|
|
18
|
+
* The example chips.
|
|
19
|
+
*
|
|
20
|
+
* @default POI_PRESETS
|
|
21
21
|
*/
|
|
22
22
|
presets?: ReadonlyArray<Preset>;
|
|
23
23
|
/**
|
|
24
|
-
*
|
|
24
|
+
* A replacement loader for the taxonomy runtime, such as a mock in stories and tests.
|
|
25
25
|
*/
|
|
26
26
|
loadRuntime?: LoadPOIRuntime;
|
|
27
27
|
/**
|
|
28
|
-
*
|
|
28
|
+
* The live poi.db search.
|
|
29
|
+
* Without it, the explorer shows only the detected intent.
|
|
29
30
|
*/
|
|
30
31
|
runLiveSearch?: POILiveSearch;
|
|
31
32
|
/**
|
|
32
|
-
* Whether {@link runLiveSearch} can
|
|
33
|
-
*
|
|
34
|
-
*
|
|
33
|
+
* Whether {@link runLiveSearch} can search brand subjects by Wikidata QID.
|
|
34
|
+
*
|
|
35
|
+
* When it is false, a brand subject shows its intent and QID chip without a live block.
|
|
36
|
+
* A byte-range probe over httpvfs should leave it off because a brand-wide
|
|
37
|
+
* lookup reads too much of the database.
|
|
35
38
|
*/
|
|
36
39
|
brandLiveSearch?: boolean;
|
|
37
40
|
}
|
|
41
|
+
/**
|
|
42
|
+
* Renders a POI-intent tester that detects a POI subject in free text.
|
|
43
|
+
*
|
|
44
|
+
* It shows the matched category or brand and, for categories, an OverpassQL export.
|
|
45
|
+
* When `runLiveSearch` is set, it can also search the published poi.db.
|
|
46
|
+
* It renders only on the client.
|
|
47
|
+
*/
|
|
38
48
|
export declare function POIExplorer({ defaultText, presets, loadRuntime, runLiveSearch, brandLiveSearch, }: POIExplorerProps): ReactNode;
|
|
39
49
|
//# sourceMappingURL=POIExplorer.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"POIExplorer.d.ts","sourceRoot":"","sources":["../../lib/poi/POIExplorer.tsx"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"POIExplorer.d.ts","sourceRoot":"","sources":["../../lib/poi/POIExplorer.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,KAAK,SAAS,EAAY,MAAM,OAAO,CAAA;AAGhD,OAAO,KAAK,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,YAAY,CAAA;AAK/D,OAAO,EAAe,KAAK,MAAM,EAAE,MAAM,2BAA2B,CAAA;AAOpE;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAChC;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB;;;;OAIG;IACH,OAAO,CAAC,EAAE,aAAa,CAAC,MAAM,CAAC,CAAA;IAC/B;;OAEG;IACH,WAAW,CAAC,EAAE,cAAc,CAAA;IAC5B;;;OAGG;IACH,aAAa,CAAC,EAAE,aAAa,CAAA;IAC7B;;;;;;OAMG;IACH,eAAe,CAAC,EAAE,OAAO,CAAA;CACzB;AAmED;;;;;;GAMG;AACH,wBAAgB,WAAW,CAAC,EAC3B,WAA8B,EAC9B,OAAqB,EACrB,WAAW,EACX,aAAa,EACb,eAAe,GACf,EAAE,gBAAgB,GAAG,SAAS,CAoB9B"}
|
package/out/poi/POIExplorer.js
CHANGED
|
@@ -3,11 +3,6 @@ import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-run
|
|
|
3
3
|
* @copyright Sister Software
|
|
4
4
|
* @license AGPL-3.0
|
|
5
5
|
* @author Teffen Ellis, et al.
|
|
6
|
-
*
|
|
7
|
-
* `POIExplorer` — the composed POI-intent tester. Detects a POI subject in free text, shows the
|
|
8
|
-
* category + OverpassQL export, and (when a live-search probe is injected) searches the published
|
|
9
|
-
* poi.db layer. The intent path is self-contained — no weights, no network. All runtime concerns are
|
|
10
|
-
* in {@link usePOISearch}; this file is composition + a `ClientOnly` SSR boundary.
|
|
11
6
|
*/
|
|
12
7
|
import { useState } from "react";
|
|
13
8
|
import { POI_DEFAULT_TEXT, POI_PRESETS } from "#poi/runtime";
|
|
@@ -29,14 +24,20 @@ function POIExplorerInner({ defaultText, presets, loadRuntime, runLiveSearch, br
|
|
|
29
24
|
brandLiveSearch,
|
|
30
25
|
});
|
|
31
26
|
const subject = result?.subject;
|
|
32
|
-
//
|
|
33
|
-
//
|
|
34
|
-
// hint, so it must show one step earlier). Category: not build-local. Brand: brand-capable probe + a QID.
|
|
27
|
+
// A category is searchable unless it is build-local.
|
|
28
|
+
// A brand needs a QID and a brand-capable probe.
|
|
35
29
|
const showLiveBlock = Boolean(runLiveSearch &&
|
|
36
30
|
subject &&
|
|
37
31
|
(subject.kind === "brand" ? brandLiveSearch && subject.wikidata !== undefined : !subject.buildLocal));
|
|
38
32
|
return (_jsxs("div", { className: "mw-poi-explorer", children: [_jsx(QueryInput, { id: "mw-poi-input", label: "Query", value: text, onChange: setText, placeholder: POI_DEFAULT_TEXT }), _jsx(PresetChips, { presets: presets, onPick: setText }), result ? (_jsxs("div", { className: "mw-result", children: [_jsx(KindBadge, { kindResult: result.kindResult }), subject ? (_jsxs(_Fragment, { children: [_jsx(SubjectPanel, { subject: subject }), subject.kind === "category" ? (_jsx(OverpassBlock, { overpassQL: result.overpassQL, overpassError: result.overpassError })) : null, showLiveBlock ? (_jsx(LiveResultsBlock, { subjectLabel: subject.kind === "brand" ? subject.name : subject.category.label, anchor: subject.remainder, state: liveSearch, onSearch: searchLive })) : null] })) : (_jsx(AbstainPanel, { kind: result.kindResult.kind }))] })) : null] }));
|
|
39
33
|
}
|
|
34
|
+
/**
|
|
35
|
+
* Renders a POI-intent tester that detects a POI subject in free text.
|
|
36
|
+
*
|
|
37
|
+
* It shows the matched category or brand and, for categories, an OverpassQL export.
|
|
38
|
+
* When `runLiveSearch` is set, it can also search the published poi.db.
|
|
39
|
+
* It renders only on the client.
|
|
40
|
+
*/
|
|
40
41
|
export function POIExplorer({ defaultText = POI_DEFAULT_TEXT, presets = POI_PRESETS, loadRuntime, runLiveSearch, brandLiveSearch, }) {
|
|
41
42
|
return (_jsx(ClientOnly, { fallback: _jsx("div", { className: "mw-poi-explorer", children: _jsx("p", { children: "Loading POI tester\u2026" }) }), children: () => (_jsx(POIExplorerInner, { defaultText: defaultText, presets: presets, loadRuntime: loadRuntime, runLiveSearch: runLiveSearch, brandLiveSearch: brandLiveSearch })) }));
|
|
42
43
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"POIExplorer.js","sourceRoot":"","sources":["../../lib/poi/POIExplorer.tsx"],"names":[],"mappings":";AAAA
|
|
1
|
+
{"version":3,"file":"POIExplorer.js","sourceRoot":"","sources":["../../lib/poi/POIExplorer.tsx"],"names":[],"mappings":"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"}
|
package/out/poi/QueryInput.d.ts
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* @license AGPL-3.0
|
|
4
4
|
* @author Teffen Ellis, et al.
|
|
5
5
|
*
|
|
6
|
-
* `QueryInput` — the
|
|
6
|
+
* `QueryInput` — the labeled text field for the POI explorer. Controlled. presentational only.
|
|
7
7
|
*/
|
|
8
8
|
import type { ReactNode } from "react";
|
|
9
9
|
export interface QueryInputProps {
|
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
* @license AGPL-3.0
|
|
4
4
|
* @author Teffen Ellis, et al.
|
|
5
5
|
*
|
|
6
|
-
* `SubjectPanel` — renders the detected POI subject. For a
|
|
7
|
-
* build-local badge + note. For a
|
|
6
|
+
* `SubjectPanel` — renders the detected POI subject. For a category: the category chip, the optional
|
|
7
|
+
* build-local badge + note. For a brand: the brand-name chip + a Wikidata QID chip (linked). Both
|
|
8
8
|
* share the match-detail list (matched phrase, confidence, anchor). Presentational.
|
|
9
9
|
*/
|
|
10
10
|
import type { ReactNode } from "react";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SubjectPanel.d.ts","sourceRoot":"","sources":["../../lib/poi/SubjectPanel.tsx"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAEtC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAA;AAE5C,MAAM,WAAW,iBAAiB;IACjC,OAAO,EAAE,UAAU,CAAA;CACnB;
|
|
1
|
+
{"version":3,"file":"SubjectPanel.d.ts","sourceRoot":"","sources":["../../lib/poi/SubjectPanel.tsx"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAEtC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAA;AAE5C,MAAM,WAAW,iBAAiB;IACjC,OAAO,EAAE,UAAU,CAAA;CACnB;AAqBD,wBAAgB,YAAY,CAAC,EAAE,OAAO,EAAE,EAAE,iBAAiB,GAAG,SAAS,CA4CtE"}
|
package/out/poi/SubjectPanel.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
/**
|
|
3
|
-
* The shared match-detail list (matched phrase, confidence, anchor) —
|
|
3
|
+
* The shared match-detail list (matched phrase, confidence, anchor) —
|
|
4
|
+
* identical for category + brand subjects.
|
|
4
5
|
*/
|
|
5
6
|
function MatchDetail({ subject }) {
|
|
6
7
|
return (_jsxs("dl", { className: "mw-subject__detail", children: [_jsx("dt", { children: "matched phrase" }), _jsx("dd", { children: _jsx("code", { children: subject.matchedPhrase }) }), _jsx("dt", { children: "confidence" }), _jsxs("dd", { children: [Math.round(subject.confidence * 100), "%"] }), _jsx("dt", { children: "anchor" }), _jsx("dd", { children: subject.remainder || _jsx("em", { children: "none \u2014 global query" }) })] }));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SubjectPanel.js","sourceRoot":"","sources":["../../lib/poi/SubjectPanel.tsx"],"names":[],"mappings":";AAkBA
|
|
1
|
+
{"version":3,"file":"SubjectPanel.js","sourceRoot":"","sources":["../../lib/poi/SubjectPanel.tsx"],"names":[],"mappings":";AAkBA;;;GAGG;AACH,SAAS,WAAW,CAAC,EAAE,OAAO,EAAqB;IAClD,OAAO,CACN,cAAI,SAAS,EAAC,oBAAoB,aACjC,0CAAuB,EACvB,uBACC,yBAAO,OAAO,CAAC,aAAa,GAAQ,GAChC,EACL,sCAAmB,EACnB,yBAAK,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,UAAU,GAAG,GAAG,CAAC,SAAO,EAChD,kCAAe,EACf,uBAAK,OAAO,CAAC,SAAS,IAAI,oDAA4B,GAAM,IACxD,CACL,CAAA;AACF,CAAC;AAED,MAAM,UAAU,YAAY,CAAC,EAAE,OAAO,EAAqB;IAC1D,IAAI,OAAO,CAAC,IAAI,KAAK,OAAO,EAAE,CAAC;QAC9B,OAAO,CACN,8BACC,eAAK,SAAS,EAAC,iBAAiB,aAC/B,eAAM,SAAS,EAAC,kBAAkB,YAAE,OAAO,CAAC,IAAI,GAAQ,EACxD,eAAM,SAAS,EAAC,4CAA4C,sBAAa,EACxE,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC,CACnB,YACC,SAAS,EAAC,iBAAiB,EAC3B,IAAI,EAAE,iCAAiC,OAAO,CAAC,QAAQ,EAAE,EACzD,MAAM,EAAC,QAAQ,EACf,GAAG,EAAC,YAAY,YAEf,OAAO,CAAC,QAAQ,GACd,CACJ,CAAC,CAAC,CAAC,IAAI,IACH,EAEN,KAAC,WAAW,IAAC,OAAO,EAAE,OAAO,GAAI,EAEjC,YAAG,SAAS,EAAC,kBAAkB,0GAE3B,IACF,CACH,CAAA;IACF,CAAC;IAED,OAAO,CACN,8BACC,eAAK,SAAS,EAAC,iBAAiB,aAC/B,eAAM,SAAS,EAAC,kBAAkB,YAAE,OAAO,CAAC,QAAQ,CAAC,KAAK,GAAQ,EACjE,OAAO,CAAC,UAAU,CAAC,CAAC,CAAC,eAAM,SAAS,EAAC,mBAAmB,4BAAmB,CAAC,CAAC,CAAC,IAAI,IAC9E,EAEN,KAAC,WAAW,IAAC,OAAO,EAAE,OAAO,GAAI,EAEhC,OAAO,CAAC,UAAU,CAAC,CAAC,CAAC,CACrB,YAAG,SAAS,EAAC,kBAAkB,8GAE3B,CACJ,CAAC,CAAC,CAAC,IAAI,IACN,CACH,CAAA;AACF,CAAC"}
|
package/out/poi/runtime.d.ts
CHANGED
|
@@ -2,26 +2,17 @@
|
|
|
2
2
|
* @copyright Sister Software
|
|
3
3
|
* @license AGPL-3.0
|
|
4
4
|
* @author Teffen Ellis, et al.
|
|
5
|
-
*
|
|
6
|
-
* The default POI runtime loader + presentation helpers. `loadPOIRuntime` dynamically imports the
|
|
7
|
-
* ~2k-record Overture taxonomy snapshot (so bundlers code-split it into its own chunk, fetched only
|
|
8
|
-
* when the explorer actually mounts) and wires the kind classifier over it. Pure + browser-safe: no
|
|
9
|
-
* network, no DOM — the whole intent path runs offline.
|
|
10
5
|
*/
|
|
11
6
|
import type { POIRuntime } from "#poi/types";
|
|
12
7
|
/**
|
|
13
|
-
*
|
|
14
|
-
*
|
|
8
|
+
* Loads the browser POI runtime, importing the taxonomy and brand tables dynamically
|
|
9
|
+
* so they land in their own chunk instead of every consumer's bundle.
|
|
15
10
|
*
|
|
16
|
-
*
|
|
17
|
-
* matches a taxonomy CATEGORY wins (the curated set); only on a category miss does the chain-brand table fire,
|
|
18
|
-
* returning a `kind: "brand"` match carrying the brand's canonical name + Wikidata QID. (The Node path also chains
|
|
19
|
-
* `@mailwoman/variant-aliases` regional slang; the browser tester leaves that out — one fewer package + data table for
|
|
20
|
-
* a demo, and the QID-keyed brand table already covers the headline brands.)
|
|
11
|
+
* Its lexicon tries exact categories and then brands only, a subset of the Node `poiTaxonomyLookup` chain.
|
|
21
12
|
*/
|
|
22
13
|
export declare function loadPOIRuntime(): Promise<POIRuntime>;
|
|
23
14
|
/**
|
|
24
|
-
* Default example queries for the POI explorer — a mix of category, build-local
|
|
15
|
+
* Default example queries for the POI explorer — a mix of category, build-local and chain-brand subjects.
|
|
25
16
|
*/
|
|
26
17
|
export declare const POI_PRESETS: readonly [{
|
|
27
18
|
readonly label: "Drinking fountain";
|
|
@@ -40,7 +31,7 @@ export declare const POI_PRESETS: readonly [{
|
|
|
40
31
|
readonly value: "applebee's near Chicago";
|
|
41
32
|
}];
|
|
42
33
|
/**
|
|
43
|
-
*
|
|
34
|
+
* Holds the query the POI explorer opens on, taken from the first preset so the two stay in step.
|
|
44
35
|
*/
|
|
45
36
|
export declare const POI_DEFAULT_TEXT: "drinking fountain near Springfield";
|
|
46
37
|
/**
|
package/out/poi/runtime.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runtime.d.ts","sourceRoot":"","sources":["../../lib/poi/runtime.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"runtime.d.ts","sourceRoot":"","sources":["../../lib/poi/runtime.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAMH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAA;AAE5C;;;;;GAKG;AACH,wBAAsB,cAAc,IAAI,OAAO,CAAC,UAAU,CAAC,CA+B1D;AAED;;GAEG;AACH,eAAO,MAAM,WAAW;aACrB,KAAK,EAAE,mBAAmB;aAAE,KAAK,EAAE,oCAAoC;;aACvE,KAAK,EAAE,cAAc;aAAE,KAAK,EAAE,cAAc;;aAC5C,KAAK,EAAE,oBAAoB;aAAE,KAAK,EAAE,iCAAiC;;aACrE,KAAK,EAAE,iBAAiB;aAAE,KAAK,EAAE,sBAAsB;;aACvD,KAAK,EAAE,oBAAoB;aAAE,KAAK,EAAE,yBAAyB;EACtD,CAAA;AAEV;;GAEG;AACH,eAAO,MAAM,gBAAgB,sCAAuB,CAAA;AAEpD;;GAEG;AACH,wBAAgB,cAAc,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,CAIxD"}
|
package/out/poi/runtime.js
CHANGED
|
@@ -2,23 +2,14 @@
|
|
|
2
2
|
* @copyright Sister Software
|
|
3
3
|
* @license AGPL-3.0
|
|
4
4
|
* @author Teffen Ellis, et al.
|
|
5
|
-
*
|
|
6
|
-
* The default POI runtime loader + presentation helpers. `loadPOIRuntime` dynamically imports the
|
|
7
|
-
* ~2k-record Overture taxonomy snapshot (so bundlers code-split it into its own chunk, fetched only
|
|
8
|
-
* when the explorer actually mounts) and wires the kind classifier over it. Pure + browser-safe: no
|
|
9
|
-
* network, no DOM — the whole intent path runs offline.
|
|
10
5
|
*/
|
|
11
6
|
import { createKindClassifier } from "@mailwoman/kind-classifier";
|
|
12
7
|
import { createPOIBrandLookup, createPOITaxonomyLookup } from "@mailwoman/poi-taxonomy/table";
|
|
13
8
|
/**
|
|
14
|
-
*
|
|
15
|
-
*
|
|
9
|
+
* Loads the browser POI runtime, importing the taxonomy and brand tables dynamically
|
|
10
|
+
* so they land in their own chunk instead of every consumer's bundle.
|
|
16
11
|
*
|
|
17
|
-
*
|
|
18
|
-
* matches a taxonomy CATEGORY wins (the curated set); only on a category miss does the chain-brand table fire,
|
|
19
|
-
* returning a `kind: "brand"` match carrying the brand's canonical name + Wikidata QID. (The Node path also chains
|
|
20
|
-
* `@mailwoman/variant-aliases` regional slang; the browser tester leaves that out — one fewer package + data table for
|
|
21
|
-
* a demo, and the QID-keyed brand table already covers the headline brands.)
|
|
12
|
+
* Its lexicon tries exact categories and then brands only, a subset of the Node `poiTaxonomyLookup` chain.
|
|
22
13
|
*/
|
|
23
14
|
export async function loadPOIRuntime() {
|
|
24
15
|
const [table, brandTable] = await Promise.all([
|
|
@@ -27,8 +18,6 @@ export async function loadPOIRuntime() {
|
|
|
27
18
|
]);
|
|
28
19
|
const lookup = createPOITaxonomyLookup(table);
|
|
29
20
|
const brands = createPOIBrandLookup(brandTable);
|
|
30
|
-
// Adapt the taxonomy + brand lookups to the `POIPhraseLookup` shape the classifier expects: categories first, brands
|
|
31
|
-
// on a category miss.
|
|
32
21
|
const lexicon = (phrase, locale) => {
|
|
33
22
|
const categoryHits = lookup.lookupPOICategory(phrase, locale);
|
|
34
23
|
if (categoryHits.length) {
|
|
@@ -50,7 +39,7 @@ export async function loadPOIRuntime() {
|
|
|
50
39
|
return { lookup, lexicon, classify: createKindClassifier({ poiLexicon: lexicon }) };
|
|
51
40
|
}
|
|
52
41
|
/**
|
|
53
|
-
* Default example queries for the POI explorer — a mix of category, build-local
|
|
42
|
+
* Default example queries for the POI explorer — a mix of category, build-local and chain-brand subjects.
|
|
54
43
|
*/
|
|
55
44
|
export const POI_PRESETS = [
|
|
56
45
|
{ label: "Drinking fountain", value: "drinking fountain near Springfield" },
|
|
@@ -60,7 +49,7 @@ export const POI_PRESETS = [
|
|
|
60
49
|
{ label: "Applebee's (brand)", value: "applebee's near Chicago" },
|
|
61
50
|
];
|
|
62
51
|
/**
|
|
63
|
-
*
|
|
52
|
+
* Holds the query the POI explorer opens on, taken from the first preset so the two stay in step.
|
|
64
53
|
*/
|
|
65
54
|
export const POI_DEFAULT_TEXT = POI_PRESETS[0].value;
|
|
66
55
|
/**
|
package/out/poi/runtime.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runtime.js","sourceRoot":"","sources":["../../lib/poi/runtime.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"runtime.js","sourceRoot":"","sources":["../../lib/poi/runtime.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAA;AAEjE,OAAO,EAAE,oBAAoB,EAAE,uBAAuB,EAAE,MAAM,+BAA+B,CAAA;AAI7F;;;;;GAKG;AACH,MAAM,CAAC,KAAK,UAAU,cAAc;IACnC,MAAM,CAAC,KAAK,EAAE,UAAU,CAAC,GAAG,MAAM,OAAO,CAAC,GAAG,CAAC;QAC7C,MAAM,CAAC,4CAA4C,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC;QAC3E,MAAM,CAAC,0CAA0C,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC;KACzE,CAAC,CAAA;IAEF,MAAM,MAAM,GAAG,uBAAuB,CAAC,KAAsD,CAAC,CAAA;IAC9F,MAAM,MAAM,GAAG,oBAAoB,CAAC,UAAwD,CAAC,CAAA;IAE7F,MAAM,OAAO,GAAoB,CAAC,MAAM,EAAE,MAAM,EAAE,EAAE;QACnD,MAAM,YAAY,GAAG,MAAM,CAAC,iBAAiB,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;QAE7D,IAAI,YAAY,CAAC,MAAM,EAAE,CAAC;YACzB,OAAO,YAAY,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;gBACnC,IAAI,EAAE,UAAU;gBAChB,UAAU,EAAE,KAAK,CAAC,QAAQ,CAAC,EAAE;gBAC7B,aAAa,EAAE,KAAK,CAAC,aAAa;gBAClC,UAAU,EAAE,KAAK,CAAC,UAAU;aAC5B,CAAC,CAAC,CAAA;QACJ,CAAC;QAED,OAAO,MAAM,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;YACpD,IAAI,EAAE,OAAO;YACb,UAAU,EAAE,KAAK,CAAC,KAAK,CAAC,IAAI;YAC5B,QAAQ,EAAE,KAAK,CAAC,KAAK,CAAC,QAAQ;YAC9B,aAAa,EAAE,KAAK,CAAC,aAAa;YAClC,UAAU,EAAE,KAAK,CAAC,UAAU;SAC5B,CAAC,CAAC,CAAA;IACJ,CAAC,CAAA;IAED,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE,oBAAoB,CAAC,EAAE,UAAU,EAAE,OAAO,EAAE,CAAC,EAAE,CAAA;AACpF,CAAC;AAED;;GAEG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG;IAC1B,EAAE,KAAK,EAAE,mBAAmB,EAAE,KAAK,EAAE,oCAAoC,EAAE;IAC3E,EAAE,KAAK,EAAE,cAAc,EAAE,KAAK,EAAE,cAAc,EAAE;IAChD,EAAE,KAAK,EAAE,oBAAoB,EAAE,KAAK,EAAE,iCAAiC,EAAE;IACzE,EAAE,KAAK,EAAE,iBAAiB,EAAE,KAAK,EAAE,sBAAsB,EAAE;IAC3D,EAAE,KAAK,EAAE,oBAAoB,EAAE,KAAK,EAAE,yBAAyB,EAAE;CACxD,CAAA;AAEV;;GAEG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,WAAW,CAAC,CAAC,CAAC,CAAC,KAAK,CAAA;AAEpD;;GAEG;AACH,MAAM,UAAU,cAAc,CAAC,SAAiB;IAC/C,IAAI,SAAS,GAAG,IAAI;QAAE,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,IAAI,CAAA;IAEzD,OAAO,GAAG,CAAC,SAAS,GAAG,IAAI,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,KAAK,CAAA;AAC7C,CAAC"}
|
package/out/poi/types.d.ts
CHANGED
|
@@ -3,18 +3,22 @@
|
|
|
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";
|
|
12
10
|
import type { POIPhraseLookup, createKindClassifier } from "@mailwoman/kind-classifier";
|
|
13
11
|
import type { createPOITaxonomyLookup } from "@mailwoman/poi-taxonomy/table";
|
|
12
|
+
/**
|
|
13
|
+
* The POI taxonomy lookup that the explorer runtime loads.
|
|
14
|
+
*/
|
|
14
15
|
export type TaxonomyLookup = ReturnType<typeof createPOITaxonomyLookup>;
|
|
16
|
+
/**
|
|
17
|
+
* One taxonomy category record.
|
|
18
|
+
*/
|
|
15
19
|
export type CategoryRecord = NonNullable<ReturnType<TaxonomyLookup["getPOICategory"]>>;
|
|
16
20
|
/**
|
|
17
|
-
* The lazily
|
|
21
|
+
* The lazily loaded POI runtime holds the taxonomy lookup, the lexicon and the kind classifier.
|
|
18
22
|
*/
|
|
19
23
|
export interface POIRuntime {
|
|
20
24
|
lookup: TaxonomyLookup;
|
|
@@ -28,25 +32,25 @@ export interface POISubjectBase {
|
|
|
28
32
|
matchedPhrase: string;
|
|
29
33
|
confidence: number;
|
|
30
34
|
/**
|
|
31
|
-
* The
|
|
35
|
+
* The rest of the query after the subject, usually the location anchor such as "near Springfield".
|
|
32
36
|
*/
|
|
33
37
|
remainder: string;
|
|
34
38
|
}
|
|
35
39
|
/**
|
|
36
|
-
* A resolved POI subject that
|
|
40
|
+
* A resolved POI subject that matched a taxonomy category such as `cafe` or `hospital`.
|
|
37
41
|
*/
|
|
38
42
|
export interface POICategorySubject extends POISubjectBase {
|
|
39
43
|
kind: "category";
|
|
40
44
|
category: CategoryRecord;
|
|
41
45
|
/**
|
|
42
|
-
* Whether this category
|
|
46
|
+
* Whether this category requires the locally built OSM (ODbL) layer.
|
|
43
47
|
*/
|
|
44
48
|
buildLocal: boolean;
|
|
45
49
|
}
|
|
46
50
|
/**
|
|
47
|
-
* A resolved POI subject that
|
|
48
|
-
*
|
|
49
|
-
*
|
|
51
|
+
* A resolved POI subject that matched a chain brand such as `chevron`.
|
|
52
|
+
*
|
|
53
|
+
* Live search looks up a brand by its Wikidata QID instead of by category k-ring.
|
|
50
54
|
*/
|
|
51
55
|
export interface POIBrandSubject extends POISubjectBase {
|
|
52
56
|
kind: "brand";
|
|
@@ -55,16 +59,19 @@ export interface POIBrandSubject extends POISubjectBase {
|
|
|
55
59
|
*/
|
|
56
60
|
name: string;
|
|
57
61
|
/**
|
|
58
|
-
* Wikidata QID
|
|
62
|
+
* The brand's Wikidata QID.
|
|
63
|
+
* It is absent when the lexicon had no QID for the brand.
|
|
59
64
|
*/
|
|
60
65
|
wikidata?: string;
|
|
61
66
|
}
|
|
62
67
|
/**
|
|
63
|
-
* A resolved POI subject
|
|
68
|
+
* A resolved POI subject, either a taxonomy category or a chain brand.
|
|
64
69
|
*/
|
|
65
70
|
export type POISubject = POICategorySubject | POIBrandSubject;
|
|
66
71
|
/**
|
|
67
|
-
* The intent-only result
|
|
72
|
+
* The intent-only result.
|
|
73
|
+
*
|
|
74
|
+
* It holds the kind verdict and, when a category subject was detected, its OverpassQL export.
|
|
68
75
|
*/
|
|
69
76
|
export interface POIExplorerResult {
|
|
70
77
|
kindResult: QueryKindResult;
|
|
@@ -84,8 +91,10 @@ export interface POISearchHit {
|
|
|
84
91
|
confidence: number;
|
|
85
92
|
}
|
|
86
93
|
/**
|
|
87
|
-
*
|
|
88
|
-
*
|
|
94
|
+
* The result of an injected live search.
|
|
95
|
+
*
|
|
96
|
+
* The `unplaced` and `unavailable` states stay separate so the UI can tell an
|
|
97
|
+
* unresolved anchor apart from an unreachable layer.
|
|
89
98
|
*/
|
|
90
99
|
export type POILiveSearchResult = {
|
|
91
100
|
status: "success";
|
|
@@ -98,27 +107,29 @@ export type POILiveSearchResult = {
|
|
|
98
107
|
status: "unavailable";
|
|
99
108
|
};
|
|
100
109
|
/**
|
|
101
|
-
* The injected live-search function.
|
|
102
|
-
*
|
|
110
|
+
* The injected live-search function.
|
|
111
|
+
*
|
|
112
|
+
* It probes the published poi.db for the resolved category, its Overture leaf
|
|
113
|
+
* categories and the anchor text.
|
|
114
|
+
* The explorer runs intent-only when this function is absent.
|
|
115
|
+
*
|
|
116
|
+
* For a brand subject, `brandWikidata` contains the QID and the probe fetches by it.
|
|
117
|
+
* In that case `categoryID` holds the brand name and `overtureCategoryIDs` is empty.
|
|
103
118
|
*
|
|
104
|
-
*
|
|
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).
|
|
119
|
+
* A probe that cannot serve brands should leave `usePOISearch`'s `brandLiveSearch` option unset.
|
|
110
120
|
*/
|
|
111
121
|
export type POILiveSearch = (params: {
|
|
112
122
|
categoryID: string;
|
|
113
123
|
overtureCategoryIDs: string[];
|
|
114
124
|
anchor: string;
|
|
115
125
|
/**
|
|
116
|
-
*
|
|
126
|
+
* The brand's Wikidata QID.
|
|
127
|
+
* It is present only when the subject is a chain brand.
|
|
117
128
|
*/
|
|
118
129
|
brandWikidata?: string;
|
|
119
130
|
}) => Promise<POILiveSearchResult>;
|
|
120
131
|
/**
|
|
121
|
-
* "Search live"
|
|
132
|
+
* The state of a "Search live" request.
|
|
122
133
|
*/
|
|
123
134
|
export type LiveSearchState = {
|
|
124
135
|
status: "idle";
|
|
@@ -133,7 +144,8 @@ export type LiveSearchState = {
|
|
|
133
144
|
centerName: string;
|
|
134
145
|
};
|
|
135
146
|
/**
|
|
136
|
-
* A
|
|
147
|
+
* A runtime loader.
|
|
148
|
+
* Stories and tests inject one to substitute a mock taxonomy.
|
|
137
149
|
*/
|
|
138
150
|
export type LoadPOIRuntime = () => Promise<POIRuntime>;
|
|
139
151
|
//# 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":"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"}
|
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,70 @@
|
|
|
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
|
+
* It defaults to `loadPOIRuntime`.
|
|
19
18
|
*/
|
|
20
19
|
loadRuntime?: LoadPOIRuntime;
|
|
21
20
|
/**
|
|
22
|
-
*
|
|
21
|
+
* The live-search probe.
|
|
22
|
+
* Live search is unavailable when it is absent.
|
|
23
23
|
*/
|
|
24
24
|
runLiveSearch?: POILiveSearch;
|
|
25
25
|
/**
|
|
26
|
-
* Whether the
|
|
27
|
-
*
|
|
28
|
-
*
|
|
29
|
-
* live search is unaffected either way.
|
|
26
|
+
* Whether the probe can search for brand subjects by Wikidata ID, defaulting to
|
|
27
|
+
* false. enable it only for a server-side backend, since fetching every row for
|
|
28
|
+
* a brand over an HTTP range-request database is too slow.
|
|
30
29
|
*/
|
|
31
30
|
brandLiveSearch?: boolean;
|
|
32
31
|
/**
|
|
33
|
-
*
|
|
32
|
+
* The delay in milliseconds before the text is classified.
|
|
33
|
+
* Defaults to 250.
|
|
34
34
|
*/
|
|
35
35
|
debounceMs?: number;
|
|
36
36
|
}
|
|
37
|
+
/**
|
|
38
|
+
* The state that {@link usePOISearch} returns.
|
|
39
|
+
*/
|
|
37
40
|
export interface UsePOISearch {
|
|
38
41
|
/**
|
|
39
42
|
* True once the taxonomy runtime has loaded.
|
|
40
43
|
*/
|
|
41
44
|
runtimeReady: boolean;
|
|
42
45
|
/**
|
|
43
|
-
* The
|
|
46
|
+
* The classification for the current debounced text, `null` for empty text
|
|
47
|
+
* and while classification is pending.
|
|
44
48
|
*/
|
|
45
49
|
result: POIExplorerResult | null;
|
|
46
50
|
/**
|
|
47
|
-
*
|
|
51
|
+
* The live-search state for the current debounced text, `idle` until a search runs.
|
|
48
52
|
*/
|
|
49
53
|
liveSearch: LiveSearchState;
|
|
50
54
|
/**
|
|
51
|
-
* Whether a
|
|
55
|
+
* Whether a probe is wired and the subject supports live search with a non-empty place anchor.
|
|
52
56
|
*/
|
|
53
57
|
canSearchLive: boolean;
|
|
54
58
|
/**
|
|
55
|
-
*
|
|
59
|
+
* Starts a live search for the current subject.
|
|
60
|
+
* It starts no search when `canSearchLive` is false.
|
|
56
61
|
*/
|
|
57
62
|
searchLive: () => Promise<void>;
|
|
58
63
|
}
|
|
64
|
+
/**
|
|
65
|
+
* Classifies debounced query text as a POI category or brand request and runs live searches on demand.
|
|
66
|
+
*
|
|
67
|
+
* Each result is keyed to the query that produced it, live search requires a non-empty anchor.
|
|
68
|
+
* Brands need `brandLiveSearch` plus a Wikidata ID.
|
|
69
|
+
*/
|
|
59
70
|
export declare function usePOISearch({ text, loadRuntime, runLiveSearch, brandLiveSearch, debounceMs, }: UsePOISearchOptions): UsePOISearch;
|
|
60
71
|
//# 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,EAAE,eAAe,EAAE,cAAc,EAAE,iBAAiB,EAAE,aAAa,EAAc,MAAM,YAAY,CAAA;AAE/G;;GAEG;AACH,MAAM,WAAW,mBAAmB;IACnC;;OAEG;IACH,IAAI,EAAE,MAAM,CAAA;IAEZ;;;OAGG;IACH,WAAW,CAAC,EAAE,cAAc,CAAA;IAE5B;;;OAGG;IACH,aAAa,CAAC,EAAE,aAAa,CAAA;IAE7B;;;;OAIG;IACH,eAAe,CAAC,EAAE,OAAO,CAAA;IAEzB;;;OAGG;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;AA0BD;;;;;GAKG;AACH,wBAAgB,YAAY,CAAC,EAC5B,IAAI,EACJ,WAA4B,EAC5B,aAAa,EACb,eAAuB,EACvB,UAAgB,GAChB,EAAE,mBAAmB,GAAG,YAAY,CA6JpC"}
|