@mailwoman/react 9.2.0 → 9.4.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 +1 -1
- package/fonts.css +59 -0
- package/lib/common/About.tsx +89 -0
- package/{common → lib/common}/CopyButton.tsx +1 -1
- package/{common → lib/common}/KindBadge.tsx +2 -7
- package/{common → lib/common}/LoadingIndicator.tsx +1 -1
- package/lib/common/confidence-tiers.ts +50 -0
- package/lib/common/text-tokens.ts +88 -0
- package/{index.ts → lib/index.ts} +44 -42
- package/{map → lib/map}/CompareToggle.tsx +2 -2
- package/{map/GeocoderDemo.tsx → lib/map/Geocoder.tsx} +45 -44
- package/{map/DemoControls.tsx → lib/map/GeocoderControls.tsx} +19 -19
- package/{map/DemoMap.tsx → lib/map/MapCanvas.tsx} +16 -16
- package/{map → lib/map}/OverlayLayers.tsx +3 -3
- package/{map → lib/map}/PlaceAutocomplete.tsx +2 -2
- package/{map → lib/map}/PlaceMarker.tsx +1 -1
- package/{map → lib/map}/ResolvedPlaceLayers.tsx +5 -4
- package/{map → lib/map}/ResultCamera.tsx +3 -3
- package/{map → lib/map}/ResultOverlay.tsx +2 -2
- package/{map → lib/map}/ResultPanel.tsx +4 -3
- package/{map → lib/map}/VersionPicker.tsx +3 -3
- package/lib/map/fake-runtime.ts +122 -0
- package/{map → lib/map}/index.ts +26 -26
- package/lib/map/map-debug.ts +51 -0
- package/{map → lib/map}/place-render.ts +5 -4
- package/{map → lib/map}/types.ts +51 -46
- package/{map/useDemoGeocode.ts → lib/map/useGeocode.ts} +11 -11
- package/{map → lib/map}/useMapPlaceRender.ts +2 -2
- package/{map → lib/map}/usePlaceAutocomplete.ts +2 -2
- package/{pipeline → lib/pipeline}/CandidatePicker.tsx +2 -2
- package/{pipeline → lib/pipeline}/ComponentTable.tsx +1 -1
- package/lib/pipeline/ConfidenceCell.tsx +31 -0
- package/lib/pipeline/FailureDiagnostic.tsx +56 -0
- package/{pipeline → lib/pipeline}/PipelineExplorer.tsx +5 -4
- package/{pipeline → lib/pipeline}/QueryForm.tsx +2 -2
- package/{pipeline → lib/pipeline}/ResolvedPlace.tsx +17 -4
- package/lib/pipeline/SpanHighlight.tsx +97 -0
- package/lib/pipeline/TimingPanel.tsx +65 -0
- package/lib/pipeline/TreeView.tsx +55 -0
- package/{pipeline → lib/pipeline}/copy.ts +1 -1
- package/{pipeline → lib/pipeline}/presets.ts +2 -1
- package/{pipeline → lib/pipeline}/types.ts +2 -75
- package/{pipeline → lib/pipeline}/useParsePipeline.ts +2 -1
- package/{poi → lib/poi}/LiveResultsBlock.tsx +2 -2
- package/{poi → lib/poi}/POIExplorer.tsx +4 -3
- package/{poi → lib/poi}/SubjectPanel.tsx +1 -1
- package/{poi → lib/poi}/runtime.ts +3 -3
- package/{poi → lib/poi}/types.ts +3 -2
- package/{poi → lib/poi}/usePOISearch.ts +5 -5
- package/{runtime/useDemoRuntime.ts → lib/runtime/useReleaseRuntime.ts} +24 -26
- package/out/common/About.d.ts +12 -0
- package/out/common/About.d.ts.map +1 -0
- package/out/common/About.js +5 -0
- package/out/common/About.js.map +1 -0
- package/out/common/ClientOnly.d.ts.map +1 -1
- package/out/common/ClientOnly.js.map +1 -1
- package/out/common/CopyButton.d.ts.map +1 -1
- package/out/common/CopyButton.js +1 -1
- package/out/common/CopyButton.js.map +1 -1
- package/out/common/KindBadge.d.ts +2 -9
- package/out/common/KindBadge.d.ts.map +1 -1
- package/out/common/KindBadge.js.map +1 -1
- package/out/common/LoadingIndicator.d.ts.map +1 -1
- package/out/common/LoadingIndicator.js +1 -1
- package/out/common/LoadingIndicator.js.map +1 -1
- package/out/common/PresetChips.d.ts.map +1 -1
- package/out/common/PresetChips.js.map +1 -1
- package/out/common/confidence-tiers.d.ts +36 -0
- package/out/common/confidence-tiers.d.ts.map +1 -0
- package/out/common/confidence-tiers.js +42 -0
- package/out/common/confidence-tiers.js.map +1 -0
- package/out/common/cx.d.ts.map +1 -1
- package/out/common/cx.js.map +1 -1
- package/out/common/text-tokens.d.ts +46 -0
- package/out/common/text-tokens.d.ts.map +1 -0
- package/out/common/text-tokens.js +52 -0
- package/out/common/text-tokens.js.map +1 -0
- package/out/common/useClipboard.d.ts.map +1 -1
- package/out/common/useClipboard.js.map +1 -1
- package/out/common/useDebouncedValue.d.ts.map +1 -1
- package/out/common/useDebouncedValue.js.map +1 -1
- package/out/index.d.ts +27 -18
- package/out/index.d.ts.map +1 -1
- package/out/index.js +16 -10
- package/out/index.js.map +1 -1
- package/out/map/BackendControl.d.ts.map +1 -1
- package/out/map/BackendControl.js.map +1 -1
- package/out/map/CompareToggle.d.ts +2 -2
- package/out/map/CompareToggle.d.ts.map +1 -1
- package/out/map/CompareToggle.js.map +1 -1
- package/out/map/{GeocoderDemo.d.ts → Geocoder.d.ts} +17 -17
- package/out/map/Geocoder.d.ts.map +1 -0
- package/out/map/{GeocoderDemo.js → Geocoder.js} +30 -30
- package/out/map/Geocoder.js.map +1 -0
- package/out/map/GeocoderControls.d.ts +63 -0
- package/out/map/GeocoderControls.d.ts.map +1 -0
- package/out/map/{DemoControls.js → GeocoderControls.js} +2 -2
- package/out/map/GeocoderControls.js.map +1 -0
- package/out/map/{DemoMap.d.ts → MapCanvas.d.ts} +16 -16
- package/out/map/MapCanvas.d.ts.map +1 -0
- package/out/map/{DemoMap.js → MapCanvas.js} +2 -2
- package/out/map/MapCanvas.js.map +1 -0
- package/out/map/OverlayLayers.d.ts +3 -3
- package/out/map/OverlayLayers.d.ts.map +1 -1
- package/out/map/OverlayLayers.js +2 -2
- package/out/map/OverlayLayers.js.map +1 -1
- package/out/map/PlaceAutocomplete.d.ts +1 -1
- package/out/map/PlaceAutocomplete.d.ts.map +1 -1
- package/out/map/PlaceAutocomplete.js +1 -1
- package/out/map/PlaceAutocomplete.js.map +1 -1
- package/out/map/PlaceMarker.d.ts +1 -1
- package/out/map/PlaceMarker.d.ts.map +1 -1
- package/out/map/PlaceMarker.js.map +1 -1
- package/out/map/ResolvedPlaceLayers.d.ts +4 -4
- package/out/map/ResolvedPlaceLayers.d.ts.map +1 -1
- package/out/map/ResolvedPlaceLayers.js.map +1 -1
- package/out/map/ResultCamera.d.ts +3 -3
- package/out/map/ResultCamera.d.ts.map +1 -1
- package/out/map/ResultCamera.js +2 -2
- package/out/map/ResultCamera.js.map +1 -1
- package/out/map/ResultOverlay.d.ts +2 -2
- package/out/map/ResultOverlay.d.ts.map +1 -1
- package/out/map/ResultOverlay.js.map +1 -1
- package/out/map/ResultPanel.d.ts +2 -2
- package/out/map/ResultPanel.d.ts.map +1 -1
- package/out/map/ResultPanel.js +1 -1
- package/out/map/ResultPanel.js.map +1 -1
- package/out/map/VersionPicker.d.ts +3 -3
- package/out/map/VersionPicker.d.ts.map +1 -1
- package/out/map/VersionPicker.js.map +1 -1
- package/out/map/fake-runtime.d.ts +38 -0
- package/out/map/fake-runtime.d.ts.map +1 -0
- package/out/map/fake-runtime.js +107 -0
- package/out/map/fake-runtime.js.map +1 -0
- package/out/map/geometry.d.ts.map +1 -1
- package/out/map/geometry.js.map +1 -1
- package/out/map/index.d.ts +19 -19
- package/out/map/index.d.ts.map +1 -1
- package/out/map/index.js +11 -11
- package/out/map/index.js.map +1 -1
- package/out/map/map-debug.d.ts +31 -0
- package/out/map/map-debug.d.ts.map +1 -0
- package/out/map/map-debug.js +31 -0
- package/out/map/map-debug.js.map +1 -0
- package/out/map/place-render.d.ts +3 -3
- package/out/map/place-render.d.ts.map +1 -1
- package/out/map/place-render.js +2 -2
- package/out/map/place-render.js.map +1 -1
- package/out/map/types.d.ts +50 -46
- package/out/map/types.d.ts.map +1 -1
- package/out/map/types.js +6 -6
- package/out/map/types.js.map +1 -1
- package/out/map/useCompareState.d.ts.map +1 -1
- package/out/map/useCompareState.js.map +1 -1
- package/out/map/{useDemoGeocode.d.ts → useGeocode.d.ts} +11 -11
- package/out/map/useGeocode.d.ts.map +1 -0
- package/out/map/{useDemoGeocode.js → useGeocode.js} +5 -5
- package/out/map/useGeocode.js.map +1 -0
- package/out/map/useMapPlaceRender.d.ts +1 -1
- package/out/map/useMapPlaceRender.d.ts.map +1 -1
- package/out/map/useMapPlaceRender.js +1 -1
- package/out/map/useMapPlaceRender.js.map +1 -1
- package/out/map/usePlaceAutocomplete.d.ts +1 -1
- package/out/map/usePlaceAutocomplete.d.ts.map +1 -1
- package/out/map/usePlaceAutocomplete.js +1 -1
- package/out/map/usePlaceAutocomplete.js.map +1 -1
- package/out/pipeline/CandidatePicker.d.ts +1 -1
- 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/ComponentTable.d.ts +1 -1
- package/out/pipeline/ComponentTable.d.ts.map +1 -1
- package/out/pipeline/ComponentTable.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 +5 -17
- package/out/pipeline/ConfidenceCell.js.map +1 -1
- package/out/pipeline/FailureDiagnostic.d.ts +15 -0
- package/out/pipeline/FailureDiagnostic.d.ts.map +1 -0
- package/out/pipeline/FailureDiagnostic.js +21 -0
- package/out/pipeline/FailureDiagnostic.js.map +1 -0
- package/out/pipeline/PipelineExplorer.d.ts +1 -1
- package/out/pipeline/PipelineExplorer.d.ts.map +1 -1
- package/out/pipeline/PipelineExplorer.js +3 -3
- package/out/pipeline/PipelineExplorer.js.map +1 -1
- package/out/pipeline/QueryForm.d.ts +2 -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/ResolvedPlace.js +4 -10
- package/out/pipeline/ResolvedPlace.js.map +1 -1
- package/out/pipeline/SpanHighlight.d.ts +23 -0
- package/out/pipeline/SpanHighlight.d.ts.map +1 -0
- package/out/pipeline/SpanHighlight.js +31 -0
- package/out/pipeline/SpanHighlight.js.map +1 -0
- package/out/pipeline/TimingPanel.d.ts +16 -0
- package/out/pipeline/TimingPanel.d.ts.map +1 -0
- package/out/pipeline/TimingPanel.js +20 -0
- package/out/pipeline/TimingPanel.js.map +1 -0
- package/out/pipeline/TreeView.d.ts +17 -0
- package/out/pipeline/TreeView.d.ts.map +1 -0
- package/out/pipeline/TreeView.js +15 -0
- package/out/pipeline/TreeView.js.map +1 -0
- package/out/pipeline/copy.d.ts +1 -1
- package/out/pipeline/copy.d.ts.map +1 -1
- package/out/pipeline/copy.js.map +1 -1
- package/out/pipeline/presets.d.ts.map +1 -1
- package/out/pipeline/presets.js +2 -1
- package/out/pipeline/presets.js.map +1 -1
- package/out/pipeline/types.d.ts +2 -68
- package/out/pipeline/types.d.ts.map +1 -1
- package/out/pipeline/types.js +1 -1
- package/out/pipeline/types.js.map +1 -1
- package/out/pipeline/useParsePipeline.d.ts +2 -1
- package/out/pipeline/useParsePipeline.d.ts.map +1 -1
- package/out/pipeline/useParsePipeline.js.map +1 -1
- package/out/poi/AbstainPanel.d.ts.map +1 -1
- package/out/poi/AbstainPanel.js.map +1 -1
- package/out/poi/LiveResultsBlock.d.ts +1 -1
- package/out/poi/LiveResultsBlock.d.ts.map +1 -1
- package/out/poi/LiveResultsBlock.js +1 -1
- package/out/poi/LiveResultsBlock.js.map +1 -1
- package/out/poi/OverpassBlock.d.ts.map +1 -1
- package/out/poi/OverpassBlock.js.map +1 -1
- package/out/poi/POIExplorer.d.ts +1 -1
- package/out/poi/POIExplorer.d.ts.map +1 -1
- package/out/poi/POIExplorer.js +2 -2
- package/out/poi/POIExplorer.js.map +1 -1
- package/out/poi/QueryInput.d.ts.map +1 -1
- package/out/poi/QueryInput.js.map +1 -1
- package/out/poi/SubjectPanel.d.ts +1 -1
- package/out/poi/SubjectPanel.d.ts.map +1 -1
- package/out/poi/SubjectPanel.js.map +1 -1
- package/out/poi/runtime.d.ts +1 -1
- package/out/poi/runtime.d.ts.map +1 -1
- package/out/poi/runtime.js.map +1 -1
- package/out/poi/types.d.ts +3 -2
- package/out/poi/types.d.ts.map +1 -1
- package/out/poi/types.js +1 -1
- package/out/poi/types.js.map +1 -1
- package/out/poi/usePOISearch.d.ts +1 -1
- package/out/poi/usePOISearch.d.ts.map +1 -1
- package/out/poi/usePOISearch.js +4 -4
- package/out/poi/usePOISearch.js.map +1 -1
- package/out/runtime/{useDemoRuntime.d.ts → useReleaseRuntime.d.ts} +20 -22
- package/out/runtime/useReleaseRuntime.d.ts.map +1 -0
- package/out/runtime/{useDemoRuntime.js → useReleaseRuntime.js} +6 -6
- package/out/runtime/useReleaseRuntime.js.map +1 -0
- package/package.json +221 -34
- package/styleframe.config.ts +321 -0
- package/styles.css +1074 -664
- package/tokens/index.css +115 -0
- package/tokens/tokens.json +521 -0
- package/tokens/tokens.resolver.json +185 -0
- package/out/map/DemoControls.d.ts +0 -64
- package/out/map/DemoControls.d.ts.map +0 -1
- package/out/map/DemoControls.js.map +0 -1
- package/out/map/DemoMap.d.ts.map +0 -1
- package/out/map/DemoMap.js.map +0 -1
- package/out/map/GeocoderDemo.d.ts.map +0 -1
- package/out/map/GeocoderDemo.js.map +0 -1
- package/out/map/useDemoGeocode.d.ts.map +0 -1
- package/out/map/useDemoGeocode.js.map +0 -1
- package/out/runtime/useDemoRuntime.d.ts.map +0 -1
- package/out/runtime/useDemoRuntime.js.map +0 -1
- package/pipeline/ConfidenceCell.tsx +0 -43
- /package/{common → lib/common}/ClientOnly.tsx +0 -0
- /package/{common → lib/common}/PresetChips.tsx +0 -0
- /package/{common → lib/common}/cx.ts +0 -0
- /package/{common → lib/common}/useClipboard.ts +0 -0
- /package/{common → lib/common}/useDebouncedValue.ts +0 -0
- /package/{map → lib/map}/BackendControl.tsx +0 -0
- /package/{map → lib/map}/geometry.ts +0 -0
- /package/{map → lib/map}/useCompareState.ts +0 -0
- /package/{poi → lib/poi}/AbstainPanel.tsx +0 -0
- /package/{poi → lib/poi}/OverpassBlock.tsx +0 -0
- /package/{poi → lib/poi}/QueryInput.tsx +0 -0
package/README.md
CHANGED
|
@@ -10,7 +10,7 @@ Two composed explorers, plus the small presentational units and headless hooks t
|
|
|
10
10
|
- **`POIExplorer`** — a self-contained POI-intent tester (classify → subject → OverpassQL). The intent
|
|
11
11
|
path runs entirely offline over `@mailwoman/kind-classifier`, `@mailwoman/poi-taxonomy`, and
|
|
12
12
|
`@mailwoman/query-shape` — no weights, no network. A live poi.db search is opt-in via an injected
|
|
13
|
-
`runLiveSearch` probe, so the httpvfs/worker
|
|
13
|
+
`runLiveSearch` probe, so the httpvfs/worker implementation never enters this package's graph.
|
|
14
14
|
- **`PipelineExplorer`** — a parse + resolve tester driven by an **injected `PipelineRuntime`**. The
|
|
15
15
|
host supplies `runParse` (compute shape → classify → resolve) and the heavy visualizers as `panels`,
|
|
16
16
|
keeping onnxruntime-web, sql.js-httpvfs, and node builtins out of this package entirely.
|
package/fonts.css
ADDED
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The brand typeface, served from the same origin every app already preconnects to.
|
|
3
|
+
*
|
|
4
|
+
* Six faces, not the twenty the family ships. Each `@font-face` is a network fetch on first paint, and the token
|
|
5
|
+
* layer binds only these: regular and medium for running text, bold where a heading or a chip needs weight, italic
|
|
6
|
+
* for a caption, and two mono weights for the `code`, `number` and `glyph` roles. Iosevka provides no 600, so
|
|
7
|
+
* `--font-weight-semibold: 600` matches the 700 face by the CSS weight-matching rules rather than being synthesized.
|
|
8
|
+
*
|
|
9
|
+
* A rule never names a family here — it names a scale role from `tokens.css`, which names one of the five face
|
|
10
|
+
* roles. Replacing the typeface is an edit to `--font-family-*` in `styleframe.config.ts` plus this file.
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
@font-face {
|
|
14
|
+
font-family: "Iosevka Nexus Web";
|
|
15
|
+
font-display: swap;
|
|
16
|
+
font-weight: 400;
|
|
17
|
+
font-style: normal;
|
|
18
|
+
src: url("https://public.mailwoman.ai/fonts/IoveskaNexus/WOFF2/IosevkaNexus-Regular.woff2") format("woff2");
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
@font-face {
|
|
22
|
+
font-family: "Iosevka Nexus Web";
|
|
23
|
+
font-display: swap;
|
|
24
|
+
font-weight: 450;
|
|
25
|
+
font-style: normal;
|
|
26
|
+
src: url("https://public.mailwoman.ai/fonts/IoveskaNexus/WOFF2/IosevkaNexus-Book.woff2") format("woff2");
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
@font-face {
|
|
30
|
+
font-family: "Iosevka Nexus Web";
|
|
31
|
+
font-display: swap;
|
|
32
|
+
font-weight: 700;
|
|
33
|
+
font-style: normal;
|
|
34
|
+
src: url("https://public.mailwoman.ai/fonts/IoveskaNexus/WOFF2/IosevkaNexus-Bold.woff2") format("woff2");
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
@font-face {
|
|
38
|
+
font-family: "Iosevka Nexus Web";
|
|
39
|
+
font-display: swap;
|
|
40
|
+
font-weight: 400;
|
|
41
|
+
font-style: italic;
|
|
42
|
+
src: url("https://public.mailwoman.ai/fonts/IoveskaNexus/WOFF2/IosevkaNexus-Italic.woff2") format("woff2");
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
@font-face {
|
|
46
|
+
font-family: "Iosevka Nexus Mono Web";
|
|
47
|
+
font-display: swap;
|
|
48
|
+
font-weight: 400;
|
|
49
|
+
font-style: normal;
|
|
50
|
+
src: url("https://public.mailwoman.ai/fonts/IosevkaNexusMono/WOFF2/IosevkaNexusMono-Regular.woff2") format("woff2");
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
@font-face {
|
|
54
|
+
font-family: "Iosevka Nexus Mono Web";
|
|
55
|
+
font-display: swap;
|
|
56
|
+
font-weight: 450;
|
|
57
|
+
font-style: normal;
|
|
58
|
+
src: url("https://public.mailwoman.ai/fonts/IosevkaNexusMono/WOFF2/IosevkaNexusMono-Book.woff2") format("woff2");
|
|
59
|
+
}
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @copyright Sister Software
|
|
3
|
+
* @license AGPL-3.0
|
|
4
|
+
* @author Teffen Ellis, et al.
|
|
5
|
+
*
|
|
6
|
+
* `About` — the collapsible explainer for the browser geocoder: the neural model, the confidence colours, the
|
|
7
|
+
* gazetteer resolver, the byte-range database and the FST prior. Prose about the product a host places above or
|
|
8
|
+
* beside the geocoder; it renders nothing live.
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
import type { ReactNode } from "react"
|
|
12
|
+
|
|
13
|
+
export function About(): ReactNode {
|
|
14
|
+
return (
|
|
15
|
+
<details className="mw-about">
|
|
16
|
+
<summary className="mw-about__summary">
|
|
17
|
+
<span className="mw-about__icon">ℹ️</span>
|
|
18
|
+
About this geocoder
|
|
19
|
+
</summary>
|
|
20
|
+
<div className="mw-about__body">
|
|
21
|
+
<section className="mw-about__section">
|
|
22
|
+
<h3 className="mw-about__heading">Neural model</h3>
|
|
23
|
+
<p>
|
|
24
|
+
A ~29M-parameter BERT-style encoder classifies each token into one of 33 BIO labels covering 16 address
|
|
25
|
+
components (street, house number, unit, locality, region, postcode, venue, country, intersection, etc.). It
|
|
26
|
+
runs entirely in your browser via <strong>onnxruntime-web</strong> (WebGPU with WASM SIMD fallback). The
|
|
27
|
+
model ships as a 37.6 MB int8-quantized ONNX bundle; fp32 weights are also available for higher accuracy.
|
|
28
|
+
</p>
|
|
29
|
+
</section>
|
|
30
|
+
|
|
31
|
+
<section className="mw-about__section">
|
|
32
|
+
<h3 className="mw-about__heading">Confidence colors</h3>
|
|
33
|
+
<p>
|
|
34
|
+
Every classified span carries a confidence score between 0 and 1. The colors in the results table give you a
|
|
35
|
+
quick visual read:
|
|
36
|
+
</p>
|
|
37
|
+
<ul className="mw-about__legend">
|
|
38
|
+
<li className="mw-about__item">
|
|
39
|
+
<span className="mw-about__swatch mw-about__swatch--high" />
|
|
40
|
+
<strong>Green</strong> (≥ 0.8) — high confidence. The model is nearly certain.
|
|
41
|
+
</li>
|
|
42
|
+
<li className="mw-about__item">
|
|
43
|
+
<span className="mw-about__swatch mw-about__swatch--mid" />
|
|
44
|
+
<strong>Amber</strong> (0.5–0.8) — moderate confidence. Worth verifying.
|
|
45
|
+
</li>
|
|
46
|
+
<li className="mw-about__item">
|
|
47
|
+
<span className="mw-about__swatch mw-about__swatch--low" />
|
|
48
|
+
<strong>Red</strong> (< 0.5) — low confidence. The model is unsure — likely wrong.
|
|
49
|
+
</li>
|
|
50
|
+
</ul>
|
|
51
|
+
<p>
|
|
52
|
+
These are raw model scores. For calibrated probabilities, the library ships a per-locale isotonic calibrator
|
|
53
|
+
(<code>calibration.json</code>) that maps the raw scores to well-calibrated probability estimates.
|
|
54
|
+
</p>
|
|
55
|
+
</section>
|
|
56
|
+
|
|
57
|
+
<section className="mw-about__section">
|
|
58
|
+
<h3 className="mw-about__heading">WOF resolver</h3>
|
|
59
|
+
<p>
|
|
60
|
+
After classification, the resolver queries a <strong>Who's On First</strong> (WOF) SQLite gazetteer to
|
|
61
|
+
match the parsed components — locality, region, and postcode — against real-world places with coordinates.
|
|
62
|
+
The cascade tries postcode first (most precise), then locality, then the raw input text. The result is a
|
|
63
|
+
sorted list of candidate places with WOF IDs, placetypes, lat/lon, and bounding boxes.
|
|
64
|
+
</p>
|
|
65
|
+
</section>
|
|
66
|
+
|
|
67
|
+
<section className="mw-about__section">
|
|
68
|
+
<h3 className="mw-about__heading">Byte-range gazetteer</h3>
|
|
69
|
+
<p>
|
|
70
|
+
The gazetteer is a multi-gigabyte SQLite file served from a public bucket. It loads via{" "}
|
|
71
|
+
<strong>sql.js-httpvfs</strong>, which range-requests only the pages a lookup touches, so your browser
|
|
72
|
+
fetches a few hundred kilobytes per session instead of the whole file.
|
|
73
|
+
</p>
|
|
74
|
+
</section>
|
|
75
|
+
|
|
76
|
+
<section className="mw-about__section">
|
|
77
|
+
<h3 className="mw-about__heading">FST prior</h3>
|
|
78
|
+
<p>
|
|
79
|
+
A <strong>finite-state transducer</strong> (FST) built from ~94K US place names runs before the neural
|
|
80
|
+
classifier. It pre-annotates known locality, region, and postcode spans in the input — places like
|
|
81
|
+
"Springfield" or "Cook County" that the FST can match exactly. These "FST
|
|
82
|
+
prior" hits feed the classifier as strong hints, improving locality and region recall on addresses
|
|
83
|
+
where the neural model alone might miss them. The FST is active whenever the selected release includes it.
|
|
84
|
+
</p>
|
|
85
|
+
</section>
|
|
86
|
+
</div>
|
|
87
|
+
</details>
|
|
88
|
+
)
|
|
89
|
+
}
|
|
@@ -9,16 +9,11 @@
|
|
|
9
9
|
* pipeline's projection satisfy it without a hard type dependency.
|
|
10
10
|
*/
|
|
11
11
|
|
|
12
|
+
import type { KindView } from "@mailwoman/core/pipeline/client-result"
|
|
12
13
|
import type { ReactNode } from "react"
|
|
13
14
|
|
|
14
|
-
export interface KindBadgeResult {
|
|
15
|
-
kind: string
|
|
16
|
-
confidence: number
|
|
17
|
-
alternatives: ReadonlyArray<{ kind: string; confidence: number }>
|
|
18
|
-
}
|
|
19
|
-
|
|
20
15
|
export interface KindBadgeProps {
|
|
21
|
-
kindResult:
|
|
16
|
+
kindResult: KindView
|
|
22
17
|
}
|
|
23
18
|
|
|
24
19
|
const formatPct = (n: number): string => `${Math.round(n * 100)}%`
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @copyright Sister Software
|
|
3
|
+
* @license AGPL-3.0
|
|
4
|
+
* @author Teffen Ellis, et al.
|
|
5
|
+
* @file Confidence banding shared by every component that colours a span by confidence.
|
|
6
|
+
*
|
|
7
|
+
* It is a presentation choice, not a model one: the parser emits a continuous confidence and these
|
|
8
|
+
* bounds only decide which colour a span is drawn in, so they live here rather than anywhere the
|
|
9
|
+
* pipeline can see them.
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* At or above this the span is drawn as high-confidence.
|
|
14
|
+
*/
|
|
15
|
+
export const HIGH_CONFIDENCE_MIN = 0.8
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* At or above this the span is drawn as medium-confidence; below it, low.
|
|
19
|
+
*/
|
|
20
|
+
export const MID_CONFIDENCE_MIN = 0.5
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* The banding a component applies to a span's confidence.
|
|
24
|
+
*/
|
|
25
|
+
export type ConfidenceTier = "high" | "mid" | "low"
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Bands a continuous confidence into the three tiers the demo styles against.
|
|
29
|
+
*
|
|
30
|
+
* @param confidence A parser confidence in `[0, 1]`.
|
|
31
|
+
*
|
|
32
|
+
* @returns The tier to style with.
|
|
33
|
+
*/
|
|
34
|
+
export function confidenceTier(confidence: number): ConfidenceTier {
|
|
35
|
+
if (confidence >= HIGH_CONFIDENCE_MIN) return "high"
|
|
36
|
+
|
|
37
|
+
if (confidence >= MID_CONFIDENCE_MIN) return "mid"
|
|
38
|
+
|
|
39
|
+
return "low"
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* {@link confidenceTier} for a possibly-absent confidence: an unmeasured span is drawn as `mid` rather than `low`, so an
|
|
44
|
+
* older model that emits no confidence never reads as uniformly wrong.
|
|
45
|
+
*/
|
|
46
|
+
export function confidenceTierOrMid(confidence?: number): ConfidenceTier {
|
|
47
|
+
if (confidence == null) return "mid"
|
|
48
|
+
|
|
49
|
+
return confidenceTier(confidence)
|
|
50
|
+
}
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @copyright Sister Software
|
|
3
|
+
* @license AGPL-3.0
|
|
4
|
+
* @author Teffen Ellis, et al.
|
|
5
|
+
* @file Word tokenization + span ownership shared by the word-level visualizers.
|
|
6
|
+
*
|
|
7
|
+
* A word-level panel splits the raw input on whitespace and assigns each word to its most specific
|
|
8
|
+
* covering span (the shortest-span owner, the same rule a character-level highlight applies per
|
|
9
|
+
* character). Two panels must agree for the BIO labels to line up between them, so the split and
|
|
10
|
+
* the owner walk live here.
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
export interface WordToken {
|
|
14
|
+
/**
|
|
15
|
+
* The word text as it appears in the input.
|
|
16
|
+
*/
|
|
17
|
+
text: string
|
|
18
|
+
/**
|
|
19
|
+
* Leading whitespace before this word.
|
|
20
|
+
*/
|
|
21
|
+
whitespace: string
|
|
22
|
+
/**
|
|
23
|
+
* Start offset in the input string.
|
|
24
|
+
*/
|
|
25
|
+
start: number
|
|
26
|
+
/**
|
|
27
|
+
* End offset in the input string (exclusive).
|
|
28
|
+
*/
|
|
29
|
+
end: number
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Tokenize the raw input into words, preserving leading whitespace for each token.
|
|
34
|
+
*/
|
|
35
|
+
export function tokenizeWords(input: string): WordToken[] {
|
|
36
|
+
const words: WordToken[] = []
|
|
37
|
+
let i = 0
|
|
38
|
+
|
|
39
|
+
// `charAt` answers "" past the end, which no whitespace test matches, so both walks stop at the input's length.
|
|
40
|
+
while (i < input.length) {
|
|
41
|
+
let ws = ""
|
|
42
|
+
|
|
43
|
+
while (/\s/.test(input.charAt(i))) {
|
|
44
|
+
ws += input.charAt(i)
|
|
45
|
+
|
|
46
|
+
i++
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
if (i >= input.length) break
|
|
50
|
+
const start = i
|
|
51
|
+
|
|
52
|
+
while (i < input.length && !/\s/.test(input.charAt(i))) {
|
|
53
|
+
i++
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
words.push({ text: input.slice(start, i), start, end: i, whitespace: ws })
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
return words
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* A half-open `[start, end)` character range into the input.
|
|
64
|
+
*/
|
|
65
|
+
export interface CharSpan {
|
|
66
|
+
start: number
|
|
67
|
+
end: number
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* Per-word index of the most specific (shortest) span covering it, or `-1` when no span overlaps the word. A word is
|
|
72
|
+
* covered when any part of it falls within the span.
|
|
73
|
+
*/
|
|
74
|
+
export function shortestSpanOwners(words: readonly CharSpan[], spans: readonly CharSpan[]): number[] {
|
|
75
|
+
return words.map((word) => {
|
|
76
|
+
let best = -1
|
|
77
|
+
let bestLen = Infinity
|
|
78
|
+
|
|
79
|
+
for (const [s, sp] of spans.entries()) {
|
|
80
|
+
if (word.start < sp.end && word.end > sp.start && sp.end - sp.start < bestLen) {
|
|
81
|
+
bestLen = sp.end - sp.start
|
|
82
|
+
best = s
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
return best
|
|
87
|
+
})
|
|
88
|
+
}
|
|
@@ -21,17 +21,17 @@ export { ClientOnly } from "./common/ClientOnly.tsx"
|
|
|
21
21
|
export type { ClientOnlyProps } from "./common/ClientOnly.tsx"
|
|
22
22
|
export { CopyButton } from "./common/CopyButton.tsx"
|
|
23
23
|
export type { CopyButtonProps } from "./common/CopyButton.tsx"
|
|
24
|
-
export { cx } from "
|
|
25
|
-
export type { ClassValue } from "
|
|
24
|
+
export { cx } from "#common/cx"
|
|
25
|
+
export type { ClassValue } from "#common/cx"
|
|
26
26
|
export { KindBadge } from "./common/KindBadge.tsx"
|
|
27
|
-
export type { KindBadgeProps
|
|
27
|
+
export type { KindBadgeProps } from "./common/KindBadge.tsx"
|
|
28
28
|
export { LoadingIndicator } from "./common/LoadingIndicator.tsx"
|
|
29
29
|
export type { LoadingIndicatorProps, LoadingMode } from "./common/LoadingIndicator.tsx"
|
|
30
30
|
export { PresetChips } from "./common/PresetChips.tsx"
|
|
31
31
|
export type { Preset, PresetChipsProps } from "./common/PresetChips.tsx"
|
|
32
|
-
export { useClipboard } from "
|
|
33
|
-
export type { UseClipboard } from "
|
|
34
|
-
export { useDebouncedValue } from "
|
|
32
|
+
export { useClipboard } from "#common/useClipboard"
|
|
33
|
+
export type { UseClipboard } from "#common/useClipboard"
|
|
34
|
+
export { useDebouncedValue } from "#common/useDebouncedValue"
|
|
35
35
|
|
|
36
36
|
// ── POI explorer ───────────────────────────────────────────────────────────
|
|
37
37
|
export { AbstainPanel } from "./poi/AbstainPanel.tsx"
|
|
@@ -44,7 +44,7 @@ export { POIExplorer } from "./poi/POIExplorer.tsx"
|
|
|
44
44
|
export type { POIExplorerProps } from "./poi/POIExplorer.tsx"
|
|
45
45
|
export { QueryInput } from "./poi/QueryInput.tsx"
|
|
46
46
|
export type { QueryInputProps } from "./poi/QueryInput.tsx"
|
|
47
|
-
export { formatDistance, loadPOIRuntime, POI_DEFAULT_TEXT, POI_PRESETS } from "
|
|
47
|
+
export { formatDistance, loadPOIRuntime, POI_DEFAULT_TEXT, POI_PRESETS } from "#poi/runtime"
|
|
48
48
|
export { SubjectPanel } from "./poi/SubjectPanel.tsx"
|
|
49
49
|
export type { SubjectPanelProps } from "./poi/SubjectPanel.tsx"
|
|
50
50
|
|
|
@@ -62,10 +62,22 @@ export type {
|
|
|
62
62
|
POISubject,
|
|
63
63
|
POISubjectBase,
|
|
64
64
|
TaxonomyLookup,
|
|
65
|
-
} from "
|
|
65
|
+
} from "#poi/types"
|
|
66
66
|
|
|
67
|
-
export { usePOISearch } from "
|
|
68
|
-
export type { UsePOISearch, UsePOISearchOptions } from "
|
|
67
|
+
export { usePOISearch } from "#poi/usePOISearch"
|
|
68
|
+
export type { UsePOISearch, UsePOISearchOptions } from "#poi/usePOISearch"
|
|
69
|
+
|
|
70
|
+
// ── Result visualizers ─────────────────────────────────────────────────────
|
|
71
|
+
|
|
72
|
+
export { About } from "./common/About.tsx"
|
|
73
|
+
export { FailureDiagnostic } from "./pipeline/FailureDiagnostic.tsx"
|
|
74
|
+
export type { FailureDiagnosticProps } from "./pipeline/FailureDiagnostic.tsx"
|
|
75
|
+
export { SpanHighlight } from "./pipeline/SpanHighlight.tsx"
|
|
76
|
+
export type { SpanHighlightProps } from "./pipeline/SpanHighlight.tsx"
|
|
77
|
+
export { TimingPanel } from "./pipeline/TimingPanel.tsx"
|
|
78
|
+
export type { TimingPanelProps } from "./pipeline/TimingPanel.tsx"
|
|
79
|
+
export { TreeView } from "./pipeline/TreeView.tsx"
|
|
80
|
+
export type { TreeViewProps } from "./pipeline/TreeView.tsx"
|
|
69
81
|
|
|
70
82
|
// ── Pipeline explorer ──────────────────────────────────────────────────────
|
|
71
83
|
export { CandidatePicker } from "./pipeline/CandidatePicker.tsx"
|
|
@@ -74,8 +86,8 @@ export { ComponentTable } from "./pipeline/ComponentTable.tsx"
|
|
|
74
86
|
export type { ComponentTableProps } from "./pipeline/ComponentTable.tsx"
|
|
75
87
|
export { ConfidenceCell } from "./pipeline/ConfidenceCell.tsx"
|
|
76
88
|
export type { ConfidenceCellProps } from "./pipeline/ConfidenceCell.tsx"
|
|
77
|
-
export { buildParsePayload } from "
|
|
78
|
-
export { PIPELINE_DEFAULT_ADDRESS, PIPELINE_PRESETS } from "
|
|
89
|
+
export { buildParsePayload } from "#pipeline/copy"
|
|
90
|
+
export { PIPELINE_DEFAULT_ADDRESS, PIPELINE_PRESETS } from "#pipeline/presets"
|
|
79
91
|
export { PipelineExplorer } from "./pipeline/PipelineExplorer.tsx"
|
|
80
92
|
export type { PipelineExplorerProps } from "./pipeline/PipelineExplorer.tsx"
|
|
81
93
|
export { QueryForm } from "./pipeline/QueryForm.tsx"
|
|
@@ -83,46 +95,36 @@ export type { QueryFormProps } from "./pipeline/QueryForm.tsx"
|
|
|
83
95
|
export { ResolvedPlace } from "./pipeline/ResolvedPlace.tsx"
|
|
84
96
|
export type { ResolvedPlaceProps } from "./pipeline/ResolvedPlace.tsx"
|
|
85
97
|
|
|
86
|
-
export type {
|
|
87
|
-
DualRoleView,
|
|
88
|
-
FSTProvenance,
|
|
89
|
-
ParsedComponent,
|
|
90
|
-
ParseResult,
|
|
91
|
-
PipelineLoadingState,
|
|
92
|
-
PipelinePanels,
|
|
93
|
-
PipelineRuntime,
|
|
94
|
-
ResolvedPlaceView,
|
|
95
|
-
StageTiming,
|
|
96
|
-
} from "./pipeline/types.ts"
|
|
98
|
+
export type { PipelineLoadingState, PipelinePanels, PipelineRuntime } from "#pipeline/types"
|
|
97
99
|
|
|
98
|
-
export { useParsePipeline } from "
|
|
99
|
-
export type { UseParsePipeline, UseParsePipelineOptions } from "
|
|
100
|
+
export { useParsePipeline } from "#pipeline/useParsePipeline"
|
|
101
|
+
export type { UseParsePipeline, UseParsePipelineOptions } from "#pipeline/useParsePipeline"
|
|
100
102
|
|
|
101
|
-
// ──
|
|
102
|
-
export {
|
|
103
|
+
// ── Release runtime (shared load orchestration; node-safe — no onnx/httpvfs/maplibre) ──
|
|
104
|
+
export { useReleaseRuntime } from "#runtime/useReleaseRuntime"
|
|
103
105
|
|
|
104
106
|
export type {
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
} from "
|
|
107
|
+
AssetsLoadContext,
|
|
108
|
+
ReleaseBase,
|
|
109
|
+
ReleaseLoaderState,
|
|
110
|
+
ReleaseManifest,
|
|
111
|
+
ReleaseRuntimeConfig,
|
|
112
|
+
} from "#runtime/useReleaseRuntime"
|
|
111
113
|
|
|
112
114
|
// ── Map (types only from root) ──────────────────────────────────────────────
|
|
113
|
-
// The
|
|
115
|
+
// The map SURFACE lives behind the `@mailwoman/react/map` subpath so `maplibre-gl` / `react-map-gl`
|
|
114
116
|
// (WebGL + DOM at import) never enter the package-root graph — a bare `import("@mailwoman/react")` in node
|
|
115
117
|
// must not pull them. Only the CONTRACT types are re-exported here (fully erased at compile time, so no
|
|
116
|
-
// runtime linkage): the `
|
|
118
|
+
// runtime linkage): the `MapCanvas` component + hooks are import-able solely via `@mailwoman/react/map`.
|
|
117
119
|
export type {
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
DemoMapProps,
|
|
121
|
-
DemoMapStyle,
|
|
122
|
-
DemoRuntime,
|
|
123
|
-
DemoVersionOption,
|
|
120
|
+
GeocoderRuntime,
|
|
121
|
+
InferenceBackend,
|
|
124
122
|
LngLatTuple,
|
|
125
123
|
MapBias,
|
|
124
|
+
MapCanvasExtraProps,
|
|
125
|
+
MapCanvasProps,
|
|
126
|
+
MapCanvasStyle,
|
|
126
127
|
OverlaySpec,
|
|
127
128
|
Suggestion,
|
|
128
|
-
|
|
129
|
+
VersionOption,
|
|
130
|
+
} from "#map/index"
|
|
@@ -13,13 +13,13 @@
|
|
|
13
13
|
|
|
14
14
|
import type { ReactNode } from "react"
|
|
15
15
|
|
|
16
|
-
import type {
|
|
16
|
+
import type { VersionOption } from "#map/types"
|
|
17
17
|
|
|
18
18
|
export interface CompareToggleProps {
|
|
19
19
|
/**
|
|
20
20
|
* The selectable model bundles (the primary version is filtered out of the compare list).
|
|
21
21
|
*/
|
|
22
|
-
versions: ReadonlyArray<
|
|
22
|
+
versions: ReadonlyArray<VersionOption>
|
|
23
23
|
/**
|
|
24
24
|
* The primary version, excluded from the compare options.
|
|
25
25
|
*/
|