@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.
Files changed (278) hide show
  1. package/README.md +1 -1
  2. package/fonts.css +59 -0
  3. package/lib/common/About.tsx +89 -0
  4. package/{common → lib/common}/CopyButton.tsx +1 -1
  5. package/{common → lib/common}/KindBadge.tsx +2 -7
  6. package/{common → lib/common}/LoadingIndicator.tsx +1 -1
  7. package/lib/common/confidence-tiers.ts +50 -0
  8. package/lib/common/text-tokens.ts +88 -0
  9. package/{index.ts → lib/index.ts} +44 -42
  10. package/{map → lib/map}/CompareToggle.tsx +2 -2
  11. package/{map/GeocoderDemo.tsx → lib/map/Geocoder.tsx} +45 -44
  12. package/{map/DemoControls.tsx → lib/map/GeocoderControls.tsx} +19 -19
  13. package/{map/DemoMap.tsx → lib/map/MapCanvas.tsx} +16 -16
  14. package/{map → lib/map}/OverlayLayers.tsx +3 -3
  15. package/{map → lib/map}/PlaceAutocomplete.tsx +2 -2
  16. package/{map → lib/map}/PlaceMarker.tsx +1 -1
  17. package/{map → lib/map}/ResolvedPlaceLayers.tsx +5 -4
  18. package/{map → lib/map}/ResultCamera.tsx +3 -3
  19. package/{map → lib/map}/ResultOverlay.tsx +2 -2
  20. package/{map → lib/map}/ResultPanel.tsx +4 -3
  21. package/{map → lib/map}/VersionPicker.tsx +3 -3
  22. package/lib/map/fake-runtime.ts +122 -0
  23. package/{map → lib/map}/index.ts +26 -26
  24. package/lib/map/map-debug.ts +51 -0
  25. package/{map → lib/map}/place-render.ts +5 -4
  26. package/{map → lib/map}/types.ts +51 -46
  27. package/{map/useDemoGeocode.ts → lib/map/useGeocode.ts} +11 -11
  28. package/{map → lib/map}/useMapPlaceRender.ts +2 -2
  29. package/{map → lib/map}/usePlaceAutocomplete.ts +2 -2
  30. package/{pipeline → lib/pipeline}/CandidatePicker.tsx +2 -2
  31. package/{pipeline → lib/pipeline}/ComponentTable.tsx +1 -1
  32. package/lib/pipeline/ConfidenceCell.tsx +31 -0
  33. package/lib/pipeline/FailureDiagnostic.tsx +56 -0
  34. package/{pipeline → lib/pipeline}/PipelineExplorer.tsx +5 -4
  35. package/{pipeline → lib/pipeline}/QueryForm.tsx +2 -2
  36. package/{pipeline → lib/pipeline}/ResolvedPlace.tsx +17 -4
  37. package/lib/pipeline/SpanHighlight.tsx +97 -0
  38. package/lib/pipeline/TimingPanel.tsx +65 -0
  39. package/lib/pipeline/TreeView.tsx +55 -0
  40. package/{pipeline → lib/pipeline}/copy.ts +1 -1
  41. package/{pipeline → lib/pipeline}/presets.ts +2 -1
  42. package/{pipeline → lib/pipeline}/types.ts +2 -75
  43. package/{pipeline → lib/pipeline}/useParsePipeline.ts +2 -1
  44. package/{poi → lib/poi}/LiveResultsBlock.tsx +2 -2
  45. package/{poi → lib/poi}/POIExplorer.tsx +4 -3
  46. package/{poi → lib/poi}/SubjectPanel.tsx +1 -1
  47. package/{poi → lib/poi}/runtime.ts +3 -3
  48. package/{poi → lib/poi}/types.ts +3 -2
  49. package/{poi → lib/poi}/usePOISearch.ts +5 -5
  50. package/{runtime/useDemoRuntime.ts → lib/runtime/useReleaseRuntime.ts} +24 -26
  51. package/out/common/About.d.ts +12 -0
  52. package/out/common/About.d.ts.map +1 -0
  53. package/out/common/About.js +5 -0
  54. package/out/common/About.js.map +1 -0
  55. package/out/common/ClientOnly.d.ts.map +1 -1
  56. package/out/common/ClientOnly.js.map +1 -1
  57. package/out/common/CopyButton.d.ts.map +1 -1
  58. package/out/common/CopyButton.js +1 -1
  59. package/out/common/CopyButton.js.map +1 -1
  60. package/out/common/KindBadge.d.ts +2 -9
  61. package/out/common/KindBadge.d.ts.map +1 -1
  62. package/out/common/KindBadge.js.map +1 -1
  63. package/out/common/LoadingIndicator.d.ts.map +1 -1
  64. package/out/common/LoadingIndicator.js +1 -1
  65. package/out/common/LoadingIndicator.js.map +1 -1
  66. package/out/common/PresetChips.d.ts.map +1 -1
  67. package/out/common/PresetChips.js.map +1 -1
  68. package/out/common/confidence-tiers.d.ts +36 -0
  69. package/out/common/confidence-tiers.d.ts.map +1 -0
  70. package/out/common/confidence-tiers.js +42 -0
  71. package/out/common/confidence-tiers.js.map +1 -0
  72. package/out/common/cx.d.ts.map +1 -1
  73. package/out/common/cx.js.map +1 -1
  74. package/out/common/text-tokens.d.ts +46 -0
  75. package/out/common/text-tokens.d.ts.map +1 -0
  76. package/out/common/text-tokens.js +52 -0
  77. package/out/common/text-tokens.js.map +1 -0
  78. package/out/common/useClipboard.d.ts.map +1 -1
  79. package/out/common/useClipboard.js.map +1 -1
  80. package/out/common/useDebouncedValue.d.ts.map +1 -1
  81. package/out/common/useDebouncedValue.js.map +1 -1
  82. package/out/index.d.ts +27 -18
  83. package/out/index.d.ts.map +1 -1
  84. package/out/index.js +16 -10
  85. package/out/index.js.map +1 -1
  86. package/out/map/BackendControl.d.ts.map +1 -1
  87. package/out/map/BackendControl.js.map +1 -1
  88. package/out/map/CompareToggle.d.ts +2 -2
  89. package/out/map/CompareToggle.d.ts.map +1 -1
  90. package/out/map/CompareToggle.js.map +1 -1
  91. package/out/map/{GeocoderDemo.d.ts → Geocoder.d.ts} +17 -17
  92. package/out/map/Geocoder.d.ts.map +1 -0
  93. package/out/map/{GeocoderDemo.js → Geocoder.js} +30 -30
  94. package/out/map/Geocoder.js.map +1 -0
  95. package/out/map/GeocoderControls.d.ts +63 -0
  96. package/out/map/GeocoderControls.d.ts.map +1 -0
  97. package/out/map/{DemoControls.js → GeocoderControls.js} +2 -2
  98. package/out/map/GeocoderControls.js.map +1 -0
  99. package/out/map/{DemoMap.d.ts → MapCanvas.d.ts} +16 -16
  100. package/out/map/MapCanvas.d.ts.map +1 -0
  101. package/out/map/{DemoMap.js → MapCanvas.js} +2 -2
  102. package/out/map/MapCanvas.js.map +1 -0
  103. package/out/map/OverlayLayers.d.ts +3 -3
  104. package/out/map/OverlayLayers.d.ts.map +1 -1
  105. package/out/map/OverlayLayers.js +2 -2
  106. package/out/map/OverlayLayers.js.map +1 -1
  107. package/out/map/PlaceAutocomplete.d.ts +1 -1
  108. package/out/map/PlaceAutocomplete.d.ts.map +1 -1
  109. package/out/map/PlaceAutocomplete.js +1 -1
  110. package/out/map/PlaceAutocomplete.js.map +1 -1
  111. package/out/map/PlaceMarker.d.ts +1 -1
  112. package/out/map/PlaceMarker.d.ts.map +1 -1
  113. package/out/map/PlaceMarker.js.map +1 -1
  114. package/out/map/ResolvedPlaceLayers.d.ts +4 -4
  115. package/out/map/ResolvedPlaceLayers.d.ts.map +1 -1
  116. package/out/map/ResolvedPlaceLayers.js.map +1 -1
  117. package/out/map/ResultCamera.d.ts +3 -3
  118. package/out/map/ResultCamera.d.ts.map +1 -1
  119. package/out/map/ResultCamera.js +2 -2
  120. package/out/map/ResultCamera.js.map +1 -1
  121. package/out/map/ResultOverlay.d.ts +2 -2
  122. package/out/map/ResultOverlay.d.ts.map +1 -1
  123. package/out/map/ResultOverlay.js.map +1 -1
  124. package/out/map/ResultPanel.d.ts +2 -2
  125. package/out/map/ResultPanel.d.ts.map +1 -1
  126. package/out/map/ResultPanel.js +1 -1
  127. package/out/map/ResultPanel.js.map +1 -1
  128. package/out/map/VersionPicker.d.ts +3 -3
  129. package/out/map/VersionPicker.d.ts.map +1 -1
  130. package/out/map/VersionPicker.js.map +1 -1
  131. package/out/map/fake-runtime.d.ts +38 -0
  132. package/out/map/fake-runtime.d.ts.map +1 -0
  133. package/out/map/fake-runtime.js +107 -0
  134. package/out/map/fake-runtime.js.map +1 -0
  135. package/out/map/geometry.d.ts.map +1 -1
  136. package/out/map/geometry.js.map +1 -1
  137. package/out/map/index.d.ts +19 -19
  138. package/out/map/index.d.ts.map +1 -1
  139. package/out/map/index.js +11 -11
  140. package/out/map/index.js.map +1 -1
  141. package/out/map/map-debug.d.ts +31 -0
  142. package/out/map/map-debug.d.ts.map +1 -0
  143. package/out/map/map-debug.js +31 -0
  144. package/out/map/map-debug.js.map +1 -0
  145. package/out/map/place-render.d.ts +3 -3
  146. package/out/map/place-render.d.ts.map +1 -1
  147. package/out/map/place-render.js +2 -2
  148. package/out/map/place-render.js.map +1 -1
  149. package/out/map/types.d.ts +50 -46
  150. package/out/map/types.d.ts.map +1 -1
  151. package/out/map/types.js +6 -6
  152. package/out/map/types.js.map +1 -1
  153. package/out/map/useCompareState.d.ts.map +1 -1
  154. package/out/map/useCompareState.js.map +1 -1
  155. package/out/map/{useDemoGeocode.d.ts → useGeocode.d.ts} +11 -11
  156. package/out/map/useGeocode.d.ts.map +1 -0
  157. package/out/map/{useDemoGeocode.js → useGeocode.js} +5 -5
  158. package/out/map/useGeocode.js.map +1 -0
  159. package/out/map/useMapPlaceRender.d.ts +1 -1
  160. package/out/map/useMapPlaceRender.d.ts.map +1 -1
  161. package/out/map/useMapPlaceRender.js +1 -1
  162. package/out/map/useMapPlaceRender.js.map +1 -1
  163. package/out/map/usePlaceAutocomplete.d.ts +1 -1
  164. package/out/map/usePlaceAutocomplete.d.ts.map +1 -1
  165. package/out/map/usePlaceAutocomplete.js +1 -1
  166. package/out/map/usePlaceAutocomplete.js.map +1 -1
  167. package/out/pipeline/CandidatePicker.d.ts +1 -1
  168. package/out/pipeline/CandidatePicker.d.ts.map +1 -1
  169. package/out/pipeline/CandidatePicker.js +1 -1
  170. package/out/pipeline/CandidatePicker.js.map +1 -1
  171. package/out/pipeline/ComponentTable.d.ts +1 -1
  172. package/out/pipeline/ComponentTable.d.ts.map +1 -1
  173. package/out/pipeline/ComponentTable.js.map +1 -1
  174. package/out/pipeline/ConfidenceCell.d.ts +2 -2
  175. package/out/pipeline/ConfidenceCell.d.ts.map +1 -1
  176. package/out/pipeline/ConfidenceCell.js +5 -17
  177. package/out/pipeline/ConfidenceCell.js.map +1 -1
  178. package/out/pipeline/FailureDiagnostic.d.ts +15 -0
  179. package/out/pipeline/FailureDiagnostic.d.ts.map +1 -0
  180. package/out/pipeline/FailureDiagnostic.js +21 -0
  181. package/out/pipeline/FailureDiagnostic.js.map +1 -0
  182. package/out/pipeline/PipelineExplorer.d.ts +1 -1
  183. package/out/pipeline/PipelineExplorer.d.ts.map +1 -1
  184. package/out/pipeline/PipelineExplorer.js +3 -3
  185. package/out/pipeline/PipelineExplorer.js.map +1 -1
  186. package/out/pipeline/QueryForm.d.ts +2 -2
  187. package/out/pipeline/QueryForm.d.ts.map +1 -1
  188. package/out/pipeline/QueryForm.js.map +1 -1
  189. package/out/pipeline/ResolvedPlace.d.ts +1 -1
  190. package/out/pipeline/ResolvedPlace.d.ts.map +1 -1
  191. package/out/pipeline/ResolvedPlace.js +4 -10
  192. package/out/pipeline/ResolvedPlace.js.map +1 -1
  193. package/out/pipeline/SpanHighlight.d.ts +23 -0
  194. package/out/pipeline/SpanHighlight.d.ts.map +1 -0
  195. package/out/pipeline/SpanHighlight.js +31 -0
  196. package/out/pipeline/SpanHighlight.js.map +1 -0
  197. package/out/pipeline/TimingPanel.d.ts +16 -0
  198. package/out/pipeline/TimingPanel.d.ts.map +1 -0
  199. package/out/pipeline/TimingPanel.js +20 -0
  200. package/out/pipeline/TimingPanel.js.map +1 -0
  201. package/out/pipeline/TreeView.d.ts +17 -0
  202. package/out/pipeline/TreeView.d.ts.map +1 -0
  203. package/out/pipeline/TreeView.js +15 -0
  204. package/out/pipeline/TreeView.js.map +1 -0
  205. package/out/pipeline/copy.d.ts +1 -1
  206. package/out/pipeline/copy.d.ts.map +1 -1
  207. package/out/pipeline/copy.js.map +1 -1
  208. package/out/pipeline/presets.d.ts.map +1 -1
  209. package/out/pipeline/presets.js +2 -1
  210. package/out/pipeline/presets.js.map +1 -1
  211. package/out/pipeline/types.d.ts +2 -68
  212. package/out/pipeline/types.d.ts.map +1 -1
  213. package/out/pipeline/types.js +1 -1
  214. package/out/pipeline/types.js.map +1 -1
  215. package/out/pipeline/useParsePipeline.d.ts +2 -1
  216. package/out/pipeline/useParsePipeline.d.ts.map +1 -1
  217. package/out/pipeline/useParsePipeline.js.map +1 -1
  218. package/out/poi/AbstainPanel.d.ts.map +1 -1
  219. package/out/poi/AbstainPanel.js.map +1 -1
  220. package/out/poi/LiveResultsBlock.d.ts +1 -1
  221. package/out/poi/LiveResultsBlock.d.ts.map +1 -1
  222. package/out/poi/LiveResultsBlock.js +1 -1
  223. package/out/poi/LiveResultsBlock.js.map +1 -1
  224. package/out/poi/OverpassBlock.d.ts.map +1 -1
  225. package/out/poi/OverpassBlock.js.map +1 -1
  226. package/out/poi/POIExplorer.d.ts +1 -1
  227. package/out/poi/POIExplorer.d.ts.map +1 -1
  228. package/out/poi/POIExplorer.js +2 -2
  229. package/out/poi/POIExplorer.js.map +1 -1
  230. package/out/poi/QueryInput.d.ts.map +1 -1
  231. package/out/poi/QueryInput.js.map +1 -1
  232. package/out/poi/SubjectPanel.d.ts +1 -1
  233. package/out/poi/SubjectPanel.d.ts.map +1 -1
  234. package/out/poi/SubjectPanel.js.map +1 -1
  235. package/out/poi/runtime.d.ts +1 -1
  236. package/out/poi/runtime.d.ts.map +1 -1
  237. package/out/poi/runtime.js.map +1 -1
  238. package/out/poi/types.d.ts +3 -2
  239. package/out/poi/types.d.ts.map +1 -1
  240. package/out/poi/types.js +1 -1
  241. package/out/poi/types.js.map +1 -1
  242. package/out/poi/usePOISearch.d.ts +1 -1
  243. package/out/poi/usePOISearch.d.ts.map +1 -1
  244. package/out/poi/usePOISearch.js +4 -4
  245. package/out/poi/usePOISearch.js.map +1 -1
  246. package/out/runtime/{useDemoRuntime.d.ts → useReleaseRuntime.d.ts} +20 -22
  247. package/out/runtime/useReleaseRuntime.d.ts.map +1 -0
  248. package/out/runtime/{useDemoRuntime.js → useReleaseRuntime.js} +6 -6
  249. package/out/runtime/useReleaseRuntime.js.map +1 -0
  250. package/package.json +221 -34
  251. package/styleframe.config.ts +321 -0
  252. package/styles.css +1074 -664
  253. package/tokens/index.css +115 -0
  254. package/tokens/tokens.json +521 -0
  255. package/tokens/tokens.resolver.json +185 -0
  256. package/out/map/DemoControls.d.ts +0 -64
  257. package/out/map/DemoControls.d.ts.map +0 -1
  258. package/out/map/DemoControls.js.map +0 -1
  259. package/out/map/DemoMap.d.ts.map +0 -1
  260. package/out/map/DemoMap.js.map +0 -1
  261. package/out/map/GeocoderDemo.d.ts.map +0 -1
  262. package/out/map/GeocoderDemo.js.map +0 -1
  263. package/out/map/useDemoGeocode.d.ts.map +0 -1
  264. package/out/map/useDemoGeocode.js.map +0 -1
  265. package/out/runtime/useDemoRuntime.d.ts.map +0 -1
  266. package/out/runtime/useDemoRuntime.js.map +0 -1
  267. package/pipeline/ConfidenceCell.tsx +0 -43
  268. /package/{common → lib/common}/ClientOnly.tsx +0 -0
  269. /package/{common → lib/common}/PresetChips.tsx +0 -0
  270. /package/{common → lib/common}/cx.ts +0 -0
  271. /package/{common → lib/common}/useClipboard.ts +0 -0
  272. /package/{common → lib/common}/useDebouncedValue.ts +0 -0
  273. /package/{map → lib/map}/BackendControl.tsx +0 -0
  274. /package/{map → lib/map}/geometry.ts +0 -0
  275. /package/{map → lib/map}/useCompareState.ts +0 -0
  276. /package/{poi → lib/poi}/AbstainPanel.tsx +0 -0
  277. /package/{poi → lib/poi}/OverpassBlock.tsx +0 -0
  278. /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 machinery never enters this package's graph.
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> (&lt; 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&apos;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
+ &quot;Springfield&quot; or &quot;Cook County&quot; that the FST can match exactly. These &quot;FST
82
+ prior&quot; 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,7 +9,7 @@
9
9
 
10
10
  import type { ReactNode } from "react"
11
11
 
12
- import { useClipboard } from "./useClipboard.ts"
12
+ import { useClipboard } from "#common/useClipboard"
13
13
 
14
14
  export interface CopyButtonProps {
15
15
  /**
@@ -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: KindBadgeResult
16
+ kindResult: KindView
22
17
  }
23
18
 
24
19
  const formatPct = (n: number): string => `${Math.round(n * 100)}%`
@@ -11,7 +11,7 @@
11
11
 
12
12
  import { memo, type ReactNode } from "react"
13
13
 
14
- import { cx } from "./cx.ts"
14
+ import { cx } from "#common/cx"
15
15
 
16
16
  export type LoadingMode = "pulse" | "spinner" | "staged"
17
17
 
@@ -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 "./common/cx.ts"
25
- export type { ClassValue } from "./common/cx.ts"
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, KindBadgeResult } from "./common/KindBadge.tsx"
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 "./common/useClipboard.ts"
33
- export type { UseClipboard } from "./common/useClipboard.ts"
34
- export { useDebouncedValue } from "./common/useDebouncedValue.ts"
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 "./poi/runtime.ts"
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 "./poi/types.ts"
65
+ } from "#poi/types"
66
66
 
67
- export { usePOISearch } from "./poi/usePOISearch.ts"
68
- export type { UsePOISearch, UsePOISearchOptions } from "./poi/usePOISearch.ts"
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 "./pipeline/copy.ts"
78
- export { PIPELINE_DEFAULT_ADDRESS, PIPELINE_PRESETS } from "./pipeline/presets.ts"
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 "./pipeline/useParsePipeline.ts"
99
- export type { UseParsePipeline, UseParsePipelineOptions } from "./pipeline/useParsePipeline.ts"
100
+ export { useParsePipeline } from "#pipeline/useParsePipeline"
101
+ export type { UseParsePipeline, UseParsePipelineOptions } from "#pipeline/useParsePipeline"
100
102
 
101
- // ── Demo runtime (shared load orchestration; node-safe — no onnx/httpvfs/maplibre) ──
102
- export { useDemoRuntime } from "./runtime/useDemoRuntime.ts"
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
- DemoAssetsLoadContext,
106
- DemoLoaderState,
107
- DemoManifest,
108
- DemoReleaseBase,
109
- DemoRuntimeConfig,
110
- } from "./runtime/useDemoRuntime.ts"
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 demo-map SURFACE lives behind the `@mailwoman/react/map` subpath so `maplibre-gl` / `react-map-gl`
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 `DemoMap` component + hooks are import-able solely via `@mailwoman/react/map`.
118
+ // runtime linkage): the `MapCanvas` component + hooks are import-able solely via `@mailwoman/react/map`.
117
119
  export type {
118
- DemoBackend,
119
- DemoMapExtraProps,
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
- } from "./map/index.ts"
129
+ VersionOption,
130
+ } from "#map/index"
@@ -13,13 +13,13 @@
13
13
 
14
14
  import type { ReactNode } from "react"
15
15
 
16
- import type { DemoVersionOption } from "./types.ts"
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<DemoVersionOption>
22
+ versions: ReadonlyArray<VersionOption>
23
23
  /**
24
24
  * The primary version, excluded from the compare options.
25
25
  */