@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
@@ -0,0 +1,122 @@
1
+ /**
2
+ * @copyright Sister Software
3
+ * @license AGPL-3.0
4
+ * @author Teffen Ellis, et al.
5
+ *
6
+ * A fake geocoder runtime: canned parse + resolve, an offline stub map style, canned autocomplete, a version list.
7
+ * No network, no ONNX, no maplibre at run time — everything is data. It is what the stories and component tests
8
+ * mount, and what a host mounts to show the UI without the model.
9
+ */
10
+
11
+ import type { ParseResult } from "@mailwoman/core/pipeline/client-result"
12
+
13
+ import type { ResolvedMapPlace } from "#map/place-render"
14
+ import type { GeocoderRuntime, Suggestion } from "#map/types"
15
+ import type { PipelineRuntime } from "#pipeline/types"
16
+
17
+ import type { MapCanvasStyle } from "./MapCanvas.tsx"
18
+
19
+ /**
20
+ * An offline stub map style — one solid `background` layer, zero sources, zero network. Safe for headless Storybook.
21
+ */
22
+ export const STUB_MAP_STYLE: MapCanvasStyle = {
23
+ version: 8,
24
+ name: "demo-runtime-stub",
25
+ sources: {},
26
+ layers: [{ id: "background", type: "background", paint: { "background-color": "#dfe7ee" } }],
27
+ }
28
+
29
+ /**
30
+ * Canned place-autocomplete suggestions — a synchronous fake for the FST prefix-walk.
31
+ */
32
+ export const FAKE_SUGGESTIONS: Suggestion[] = [
33
+ { value: "New York", placetype: "locality" },
34
+ { value: "New Orleans", placetype: "locality" },
35
+ { value: "Newark", placetype: "locality" },
36
+ ]
37
+
38
+ /**
39
+ * A fake DEMO runtime — the map analogue of {@link makePipelineRuntime}. It composes the pipeline fake (canned
40
+ * parse+resolve) with the map surface: the offline stub style, a version list, a backend, an injected autocomplete, and
41
+ * a `resolveMapPlace` that hands the selected candidate a bbox so the declarative overlays draw a marker + outline. No
42
+ * network, no ONNX, no maplibre-at-runtime — everything is data. `runParseWithBias` delegates to the base parse (the
43
+ * bias is ignored by the fake but present so the parameter is exercised).
44
+ */
45
+ export function makeFakeGeocoderRuntime(overrides: Partial<GeocoderRuntime> = {}): GeocoderRuntime {
46
+ const base = makePipelineRuntime()
47
+
48
+ return {
49
+ ...base,
50
+ mapStyle: STUB_MAP_STYLE,
51
+ initialCenter: [-74.006, 40.7128],
52
+ initialZoom: 3,
53
+ overlays: [],
54
+ runParseWithBias: (input, _bias, hooks) => base.runParse(input, hooks),
55
+ autocomplete: async (query: string) =>
56
+ FAKE_SUGGESTIONS.filter((s) => s.value.toLowerCase().startsWith(query.toLowerCase())),
57
+ availableVersions: [
58
+ { version: "v7.2.0", label: "v7.2.0 (latest)" },
59
+ { version: "v7.1.0", label: "v7.1.0" },
60
+ { version: "v6.4.0", label: "v6.4.0" },
61
+ ],
62
+ selectedVersion: "v7.2.0",
63
+ selectVersion: () => {},
64
+ activeBackend: "webgpu (28 MB int8)",
65
+ forceWASM: false,
66
+ setForceWASM: () => {},
67
+ // Enrich the selected candidate with a bbox so an outline renders (case 4: bbox → approximate circle + fit).
68
+ resolveMapPlace: (candidate): ResolvedMapPlace => ({
69
+ ...candidate,
70
+ bbox: {
71
+ minLat: candidate.lat - 0.15,
72
+ maxLat: candidate.lat + 0.15,
73
+ minLon: candidate.lon - 0.15,
74
+ maxLon: candidate.lon + 0.15,
75
+ },
76
+ }),
77
+ ...overrides,
78
+ }
79
+ }
80
+
81
+ /**
82
+ * A fixed, fully-populated parse+resolve result — the shared fixture behind the pipeline runtime + the result panel.
83
+ */
84
+ export function makeFakeParseResult(input = "350 5th Ave, New York, NY 10118"): ParseResult {
85
+ return {
86
+ input,
87
+ tree: { roots: [{ tag: "locality", value: "New York" }] },
88
+ nodes: [
89
+ { tag: "house_number", value: "350", confidence: 0.97, start: 0, end: 3 },
90
+ { tag: "street", value: "5th Ave", confidence: 0.88, start: 4, end: 11 },
91
+ { tag: "locality", value: "New York", confidence: 0.71 },
92
+ ],
93
+ kindResult: { kind: "structured_address", confidence: 0.95, alternatives: [] },
94
+ timing: { shape: 0.4, classify: 12.1, resolve: 4.2 },
95
+ resolved: { id: 85_977_539, name: "New York", placetype: "locality", lat: 40.7128, lon: -74.006, score: 0.82 },
96
+ candidates: [
97
+ { id: 85_977_539, name: "New York", placetype: "locality", lat: 40.7128, lon: -74.006, score: 0.82 },
98
+ { id: 101_715_829, name: "New York", placetype: "region", lat: 43, lon: -75, score: 0.55 },
99
+ ],
100
+ fstActive: true,
101
+ fstProvenance: { builtAt: "2026-07-01T00:00:00Z", stateCount: 51, placeCount: 94_000, importanceMatches: 12_000 },
102
+ }
103
+ }
104
+
105
+ /**
106
+ * A fake parse+resolve runtime that returns a fixed, fully-populated result.
107
+ */
108
+ export function makePipelineRuntime(overrides: Partial<PipelineRuntime> = {}): PipelineRuntime {
109
+ return {
110
+ ready: true,
111
+ parseStageLabels: ["Analyzing input shape…", "Running neural classifier…", "Resolving in gazetteer…"],
112
+ errorMessage: null,
113
+ loading: null,
114
+ runParse: async (input, { onStage }): Promise<ParseResult> => {
115
+ onStage(1)
116
+ onStage(2)
117
+
118
+ return makeFakeParseResult(input)
119
+ },
120
+ ...overrides,
121
+ }
122
+ }
@@ -3,7 +3,7 @@
3
3
  * @license AGPL-3.0
4
4
  * @author Teffen Ellis, et al.
5
5
  *
6
- * `@mailwoman/react/map` — the geocoder-demo map surface, kept behind its OWN subpath so `maplibre-gl`
6
+ * `@mailwoman/react/map` — the geocoder map surface, kept behind its OWN subpath so `maplibre-gl`
7
7
  * / `react-map-gl` (WebGL + DOM at import) never enter the package-root graph. Importing this subpath
8
8
  * pulls the map deps; importing `@mailwoman/react` (root) does not. Consumers who only want the
9
9
  * parse/POI explorers never pay for maplibre.
@@ -12,28 +12,28 @@
12
12
  * `maplibre-gl/dist/maplibre-gl.css` + `@mailwoman/react/styles.css` itself.
13
13
  */
14
14
 
15
- export { DemoMap } from "./DemoMap.tsx"
16
- export type { DemoMapExtraProps, DemoMapProps, DemoMapStyle } from "./DemoMap.tsx"
15
+ export { MapCanvas } from "./MapCanvas.tsx"
16
+ export type { MapCanvasExtraProps, MapCanvasProps, MapCanvasStyle } from "./MapCanvas.tsx"
17
17
 
18
18
  export type {
19
- DemoBackend,
20
- DemoCompareContext,
21
- DemoPanels,
22
- DemoResultContext,
23
- DemoRuntime,
24
- DemoVersionOption,
19
+ CompareContext,
20
+ GeocoderPanels,
21
+ GeocoderRuntime,
22
+ InferenceBackend,
25
23
  LngLatTuple,
26
24
  MapBias,
27
25
  OverlaySpec,
26
+ ResultContext,
28
27
  Suggestion,
29
- } from "./types.ts"
28
+ VersionOption,
29
+ } from "#map/types"
30
30
 
31
31
  // ── Pure geometry + render spec (node-safe; no react-map-gl at runtime) ──────
32
- export { approxCircleGeometry, bboxToBounds, geomBounds, radiusCircleGeometry } from "./geometry.ts"
33
- export type { BoundsTuple, PlaceBBox, PlaceGeometry } from "./geometry.ts"
34
- export { cameraToViewState, computeMapPlaceRenderSpec } from "./place-render.ts"
35
- export type { LngLat, MapCameraTarget, MapPlaceRenderSpec, PlaceTier, ResolvedMapPlace } from "./place-render.ts"
36
- export { useMapPlaceRender } from "./useMapPlaceRender.ts"
32
+ export { approxCircleGeometry, bboxToBounds, geomBounds, radiusCircleGeometry } from "#map/geometry"
33
+ export type { BoundsTuple, PlaceBBox, PlaceGeometry } from "#map/geometry"
34
+ export { cameraToViewState, computeMapPlaceRenderSpec } from "#map/place-render"
35
+ export type { LngLat, MapCameraTarget, MapPlaceRenderSpec, PlaceTier, ResolvedMapPlace } from "#map/place-render"
36
+ export { useMapPlaceRender } from "#map/useMapPlaceRender"
37
37
 
38
38
  // ── Declarative overlays (react-map-gl `<Marker>`/`<Source>`/`<Layer>`) ──────
39
39
  export { OverlayLayers } from "./OverlayLayers.tsx"
@@ -47,30 +47,30 @@ export type { ResultCameraProps } from "./ResultCamera.tsx"
47
47
  export { ResultOverlay } from "./ResultOverlay.tsx"
48
48
  export type { ResultOverlayProps } from "./ResultOverlay.tsx"
49
49
 
50
- // ── Demo controls + composed demo (phase 4) ─────────────────────────────────
50
+ // ── Geocoder controls + the composed geocoder ────────────────────────────────
51
51
  export { BackendControl } from "./BackendControl.tsx"
52
52
  export type { BackendControlProps } from "./BackendControl.tsx"
53
53
  export { CompareToggle } from "./CompareToggle.tsx"
54
54
  export type { CompareToggleProps } from "./CompareToggle.tsx"
55
- export { DemoControls } from "./DemoControls.tsx"
56
- export type { DemoControlsProps } from "./DemoControls.tsx"
57
- export { GeocoderDemo } from "./GeocoderDemo.tsx"
58
- export type { GeocoderDemoProps } from "./GeocoderDemo.tsx"
55
+ export { Geocoder } from "./Geocoder.tsx"
56
+ export type { GeocoderProps } from "./Geocoder.tsx"
57
+ export { GeocoderControls } from "./GeocoderControls.tsx"
58
+ export type { GeocoderControlsProps } from "./GeocoderControls.tsx"
59
59
  export { PlaceAutocomplete } from "./PlaceAutocomplete.tsx"
60
60
  export type { PlaceAutocompleteProps } from "./PlaceAutocomplete.tsx"
61
61
  export { ResultPanel } from "./ResultPanel.tsx"
62
62
  export type { ResultPanelProps } from "./ResultPanel.tsx"
63
- export { useCompareState } from "./useCompareState.ts"
64
- export type { UseCompareState } from "./useCompareState.ts"
65
- export { useDemoGeocode } from "./useDemoGeocode.ts"
66
- export type { UseDemoGeocode, UseDemoGeocodeOptions } from "./useDemoGeocode.ts"
67
- export { usePlaceAutocomplete } from "./usePlaceAutocomplete.ts"
63
+ export { useCompareState } from "#map/useCompareState"
64
+ export type { UseCompareState } from "#map/useCompareState"
65
+ export { useGeocode } from "#map/useGeocode"
66
+ export type { UseGeocode, UseGeocodeOptions } from "#map/useGeocode"
67
+ export { usePlaceAutocomplete } from "#map/usePlaceAutocomplete"
68
68
 
69
69
  export type {
70
70
  AutocompleteInputProps,
71
71
  UsePlaceAutocomplete,
72
72
  UsePlaceAutocompleteOptions,
73
- } from "./usePlaceAutocomplete.ts"
73
+ } from "#map/usePlaceAutocomplete"
74
74
 
75
75
  export { VersionPicker } from "./VersionPicker.tsx"
76
76
  export type { VersionPickerProps } from "./VersionPicker.tsx"
@@ -0,0 +1,51 @@
1
+ /**
2
+ * @copyright Sister Software
3
+ * @license AGPL-3.0
4
+ * @author Teffen Ellis, et al.
5
+ * @file The bare MapLibre control both debug panels portal into.
6
+ *
7
+ * `DashboardMap`'s inspector and the demo page's `_debug.tsx` panel each need an `IControl` whose
8
+ * only job is to own a container element for `createPortal`. The class was duplicated in both;
9
+ * the position and container class are the only differences, so they are parameters here.
10
+ */
11
+
12
+ import type { ControlPosition } from "maplibre-gl"
13
+ import type { IControl, MapInstance } from "react-map-gl/maplibre"
14
+
15
+ export interface DebugControlBaseOptions {
16
+ /**
17
+ * Class applied to the portal container.
18
+ */
19
+ className?: string
20
+ /**
21
+ * Where MapLibre docks the control. @default "bottom-left"
22
+ */
23
+ position?: ControlPosition
24
+ }
25
+
26
+ export class DebugControlBase implements IControl {
27
+ public readonly container: HTMLElement
28
+ readonly #position: ControlPosition
29
+
30
+ constructor({ className, position = "bottom-left" }: DebugControlBaseOptions = {}) {
31
+ this.container = document.createElement("div")
32
+
33
+ if (className) {
34
+ this.container.classList.add(className)
35
+ }
36
+
37
+ this.#position = position
38
+ }
39
+
40
+ public onAdd(_map: MapInstance): HTMLElement {
41
+ return this.container
42
+ }
43
+
44
+ public onRemove(_map: MapInstance): void {
45
+ this.container.remove()
46
+ }
47
+
48
+ public getDefaultPosition(): ControlPosition {
49
+ return this.#position
50
+ }
51
+ }
@@ -19,9 +19,10 @@
19
19
  * 5. bare point → no outline, fly to zoom 12
20
20
  */
21
21
 
22
- import type { ResolvedPlaceView } from "../pipeline/types.ts"
23
- import { approxCircleGeometry, bboxToBounds, geomBounds, radiusCircleGeometry } from "./geometry.ts"
24
- import type { BoundsTuple, PlaceBBox, PlaceGeometry } from "./geometry.ts"
22
+ import type { ResolvedPlaceView } from "@mailwoman/core/pipeline/client-result"
23
+
24
+ import { approxCircleGeometry, bboxToBounds, geomBounds, radiusCircleGeometry } from "#map/geometry"
25
+ import type { BoundsTuple, PlaceBBox, PlaceGeometry } from "#map/geometry"
25
26
 
26
27
  /**
27
28
  * `[longitude, latitude]`.
@@ -167,7 +168,7 @@ export function computeMapPlaceRenderSpec(place: ResolvedMapPlace): MapPlaceRend
167
168
  }
168
169
 
169
170
  /**
170
- * The DECLARATIVE camera path: reshape a `center` target into a `viewState` patch a controlled `<DemoMap viewState>`
171
+ * The DECLARATIVE camera path: reshape a `center` target into a `viewState` patch a controlled `<MapCanvas viewState>`
171
172
  * can apply directly (a hard jump, no animation). Returns `null` for a `bounds` target — fitting a box to the viewport
172
173
  * needs the map's pixel dimensions, which only the live map has, so that case is applied imperatively by
173
174
  * `<ResultCamera>`. Pure + node-testable.
@@ -3,29 +3,33 @@
3
3
  * @license AGPL-3.0
4
4
  * @author Teffen Ellis, et al.
5
5
  *
6
- * Types for the geocoder-demo map surface. Mirrors the pipeline seam: the package owns the UI state
7
- * machine + the declarative map, while the host injects a {@link DemoRuntime} that owns ONNX / httpvfs
8
- * / R2 and the composed map style. {@link DemoRuntime} EXTENDS {@link PipelineRuntime} so the shared
6
+ * Types for the geocoder map surface. Mirrors the pipeline boundary: the package owns the UI state
7
+ * machine + the declarative map, while the host injects a {@link GeocoderRuntime} that owns ONNX / httpvfs
8
+ * / R2 and the composed map style. {@link GeocoderRuntime} EXTENDS {@link PipelineRuntime} so the shared
9
9
  * `runParse` / `parseStageLabels` / `loading` contract is reused, and adds the map-specific surface
10
10
  * (style, overlays, initial center, viewport bias, backend/version selection). Phase 4 adds the
11
- * `resolveMapPlace` enricher, the {@link DemoPanels} injection bag, and the {@link DemoCompareContext}.
11
+ * `resolveMapPlace` enricher, the {@link GeocoderPanels} injection bag, and the {@link CompareContext}.
12
12
  *
13
13
  * The map-spec types are imported type-only from `react-map-gl/maplibre`; nothing here loads maplibre at
14
- * runtime, so this module stays node-safe (its concrete-value CONSUMERS — `DemoMap`, `GeocoderDemo` —
15
- * are the ones gated behind the `@mailwoman/react/map` subpath).
14
+ * runtime, so this module stays node-safe (its concrete-value CONSUMERS — `MapCanvas`, `Geocoder` —
15
+ * are the ones behind the `@mailwoman/react/map` subpath).
16
16
  */
17
17
 
18
+ import type { ParseResult, ResolvedPlaceView } from "@mailwoman/core/pipeline/client-result"
18
19
  import type { ReactNode } from "react"
19
20
  import type { LayerSpecification, SourceSpecification } from "react-map-gl/maplibre"
20
21
 
21
- import type { ParseResult, PipelineRuntime, ResolvedPlaceView } from "../pipeline/types.ts"
22
- import type { DemoMapStyle } from "./DemoMap.tsx"
23
- import type { ResolvedMapPlace } from "./place-render.ts"
22
+ import type { LngLat, ResolvedMapPlace } from "#map/place-render"
23
+ import type { PipelineRuntime } from "#pipeline/types"
24
+
25
+ import type { MapCanvasStyle } from "./MapCanvas.tsx"
24
26
 
25
27
  /**
26
28
  * `[longitude, latitude]`.
29
+ *
30
+ * @deprecated Alias kept for existing imports — {@link LngLat} (from `@mailwoman/react/map`) is the canonical name.
27
31
  */
28
- export type LngLatTuple = [number, number]
32
+ export type LngLatTuple = LngLat
29
33
 
30
34
  /**
31
35
  * A viewport bias handed to `runParse` — the map's current center (and optionally zoom) as a soft prior.
@@ -34,7 +38,7 @@ export interface MapBias {
34
38
  /**
35
39
  * Map center as `[lon, lat]`, typically read from `map.getCenter()`.
36
40
  */
37
- center: LngLatTuple
41
+ center: LngLat
38
42
  /**
39
43
  * Current zoom, if the host wants distance-aware biasing.
40
44
  */
@@ -89,7 +93,7 @@ export interface Suggestion {
89
93
  /**
90
94
  * A selectable model bundle (version tag + a display label the picker shows).
91
95
  */
92
- export interface DemoVersionOption {
96
+ export interface VersionOption {
93
97
  /**
94
98
  * The version tag (e.g. a git tag or model-card version).
95
99
  */
@@ -101,23 +105,23 @@ export interface DemoVersionOption {
101
105
  }
102
106
 
103
107
  /**
104
- * Which neural backend the demo is currently running on.
108
+ * Which neural backend the geocoder is currently running on.
105
109
  */
106
- export type DemoBackend = "webgpu" | "wasm"
110
+ export type InferenceBackend = "webgpu" | "wasm"
107
111
 
108
112
  /**
109
- * The injected demo runtime. Extends {@link PipelineRuntime} (shared `runParse` / `parseStageLabels` / `loading` /
110
- * `ready`) with the map + version/backend surface the demo needs. The host composes `mapStyle` (via cartographer's
113
+ * The injected geocoder runtime. Extends {@link PipelineRuntime} (shared `runParse` / `parseStageLabels` / `loading` /
114
+ * `ready`) with the map + version/backend surface the geocoder needs. The host composes `mapStyle` (via cartographer's
111
115
  * `StyleSpecificationComposer` + the tile-worker TileJSON), supplies the overlay specs, the initial center (from
112
116
  * geolocation), the FST autocomplete, and the calibrator — nothing in the package imports `@mailwoman/cartographer`,
113
- * `@mailwoman/neural-web`, httpvfs, or Docusaurus.
117
+ * `@mailwoman/neural`'s web loader, httpvfs, or Docusaurus.
114
118
  */
115
- export interface DemoRuntime extends PipelineRuntime {
119
+ export interface GeocoderRuntime extends PipelineRuntime {
116
120
  // ── Map ────────────────────────────────────────────────────────────────
117
121
  /**
118
122
  * The composed basemap style (URL or `StyleSpecification`).
119
123
  */
120
- mapStyle: DemoMapStyle
124
+ mapStyle: MapCanvasStyle
121
125
  /**
122
126
  * Host-supplied overlays (coverage, race-dots, …).
123
127
  */
@@ -125,7 +129,7 @@ export interface DemoRuntime extends PipelineRuntime {
125
129
  /**
126
130
  * Initial map center as `[lon, lat]` (the host's browser-geolocation result).
127
131
  */
128
- initialCenter: LngLatTuple
132
+ initialCenter: LngLat
129
133
  /**
130
134
  * Initial zoom for the first camera.
131
135
  */
@@ -133,7 +137,7 @@ export interface DemoRuntime extends PipelineRuntime {
133
137
 
134
138
  // ── Parse extras layered over PipelineRuntime.runParse ──────────────────
135
139
  /**
136
- * A bias-aware parse. The map demo feeds the current viewport center as a soft prior; when absent the host falls back
140
+ * A bias-aware parse. The geocoder feeds the current viewport center as a soft prior; when absent the host falls back
137
141
  * to the base {@link PipelineRuntime.runParse}. Kept separate so the shared `runParse` contract is unchanged.
138
142
  */
139
143
  runParseWithBias?: (
@@ -151,9 +155,9 @@ export interface DemoRuntime extends PipelineRuntime {
151
155
  calibrator?: (raw: number) => number | null
152
156
  /**
153
157
  * Enrich the selected candidate into the richer {@link ResolvedMapPlace} the declarative map render consumes (bbox,
154
- * street tier + uncertainty, a pre-fetched crisp polygon) — the fields that live on the demo's `ResolvedHit` but not
158
+ * street tier + uncertainty, a pre-fetched crisp polygon) — the fields that live on the host's `ResolvedHit` but not
155
159
  * on the shared {@link ResolvedPlaceView}. The host owns this because those extras (and the async polygon fetch in the
156
- * real demo) are host/gazetteer concerns; the package keeps {@link ParseResult} unpolluted. Absent → the candidate
160
+ * real runtime) are host/gazetteer concerns; the package keeps {@link ParseResult} unpolluted. Absent → the candidate
157
161
  * renders as a bare point (marker + a mid-zoom fly-to). Returning `null` also renders nothing.
158
162
  */
159
163
  resolveMapPlace?: (candidate: ResolvedPlaceView, result: ParseResult) => ResolvedMapPlace | null
@@ -162,7 +166,7 @@ export interface DemoRuntime extends PipelineRuntime {
162
166
  /**
163
167
  * The selectable model bundles the version picker offers.
164
168
  */
165
- availableVersions?: DemoVersionOption[]
169
+ availableVersions?: VersionOption[]
166
170
  /**
167
171
  * The currently-selected model version.
168
172
  */
@@ -186,9 +190,10 @@ export interface DemoRuntime extends PipelineRuntime {
186
190
  }
187
191
 
188
192
  /**
189
- * The compare-mode state a {@link DemoPanels.compare} render-prop receives (the second parse itself stays host-side).
193
+ * The compare-mode state a {@link GeocoderPanels.compare} render-prop receives (the second parse itself stays
194
+ * host-side).
190
195
  */
191
- export interface DemoCompareContext {
196
+ export interface CompareContext {
192
197
  /**
193
198
  * The current primary parse result, or `null` before the first submit.
194
199
  */
@@ -204,12 +209,12 @@ export interface DemoCompareContext {
204
209
  }
205
210
 
206
211
  /**
207
- * The state a {@link DemoPanels.result} render-prop receives, so a host can render its OWN result block (the docs
212
+ * The state a {@link GeocoderPanels.result} render-prop receives, so a host can render its OWN result block (a
208
213
  * `<ResultPanel>` with its span-highlight / timing / hierarchy / precision detail) in place of the package's default
209
214
  * {@link ResultPanel}. Everything the default panel needs is passed through; the candidate-selection state stays owned
210
- * by the package (`useDemoGeocode`).
215
+ * by the package (`useGeocode`).
211
216
  */
212
- export interface DemoResultContext {
217
+ export interface ResultContext {
213
218
  /**
214
219
  * The current parse+resolve result.
215
220
  */
@@ -229,14 +234,14 @@ export interface DemoResultContext {
229
234
  }
230
235
 
231
236
  /**
232
- * Host-injected panels for {@link GeocoderDemo}, the map analogue of `PipelinePanels`. Each is an already-rendered
233
- * `ReactNode` (or a thunk of the parse result / compare state) so the package needs neither the heavy docs visualizers
234
- * (ModelVisualizer, VersionCompare, AboutDemo, PermalinkButton) nor their data types. Every field is optional — the
235
- * fake-runtime Storybook stories pass none and still render the whole demo.
237
+ * Host-injected panels for {@link Geocoder}, the map analogue of `PipelinePanels`. Each is an already-rendered
238
+ * `ReactNode` (or a thunk of the parse result / compare state) so the package needs neither the heavy host visualizers
239
+ * (ModelVisualizer, VersionCompare, About, PermalinkButton) nor their data types. Every field is optional — the
240
+ * fake-runtime Storybook stories pass none and still render the whole geocoder.
236
241
  */
237
- export interface DemoPanels {
242
+ export interface GeocoderPanels {
238
243
  /**
239
- * Rendered at the top of the control panel (e.g. the docs "About this demo").
244
+ * Rendered at the top of the control panel (e.g. the host's "About this geocoder").
240
245
  */
241
246
  header?: ReactNode
242
247
  /**
@@ -248,9 +253,9 @@ export interface DemoPanels {
248
253
  */
249
254
  footer?: ReactNode
250
255
  /**
251
- * A device-location / proximity-bias control, rendered between the query form and the autocomplete list (the demo's
252
- * "📍 Use my location" row). Host-owned so the geolocation permission + the bias it feeds into the host's
253
- * {@link DemoRuntime.runParseWithBias} stay a host concern.
256
+ * A device-location / proximity-bias control, rendered between the query form and the autocomplete list (the "📍 Use
257
+ * my location" row). Host-owned so the geolocation permission + the bias it feeds into the host's
258
+ * {@link GeocoderRuntime.runParseWithBias} stay a host concern.
254
259
  */
255
260
  bias?: ReactNode
256
261
  /**
@@ -258,17 +263,17 @@ export interface DemoPanels {
258
263
  */
259
264
  extras?: (result: ParseResult) => ReactNode
260
265
  /**
261
- * Rendered just above the result block (present or empty). The demo's opt-in display toggles live here — calibrated
266
+ * Rendered just above the result block (present or empty). The opt-in display toggles live here — calibrated
262
267
  * confidence + dev-mode — because the host owns both the toggle state AND the {@link result} / {@link debugDrawer}
263
268
  * renderers those toggles drive.
264
269
  */
265
270
  aboveResult?: (context: { result: ParseResult | null }) => ReactNode
266
271
  /**
267
272
  * Replace the package's default {@link ResultPanel} entirely. When provided, the host renders its own result block
268
- * (the docs `<ResultPanel>` — span highlight, timing, hierarchy, precision detail, calibrated confidences) from the
269
- * {@link DemoResultContext}. Absent → the built-in panel renders.
273
+ * (span highlight, timing, hierarchy, precision detail, calibrated confidences) from the {@link ResultContext}. Absent
274
+ * → the built-in panel renders.
270
275
  */
271
- result?: (context: DemoResultContext) => ReactNode
276
+ result?: (context: ResultContext) => ReactNode
272
277
  /**
273
278
  * Rendered in place of the resolved-place panel when nothing resolved (host's FailureDiagnostic). Ignored when
274
279
  * {@link result} is set.
@@ -277,15 +282,15 @@ export interface DemoPanels {
277
282
  /**
278
283
  * The version-compare view — the host renders its own diff from the compare state it owns.
279
284
  */
280
- compare?: (context: DemoCompareContext) => ReactNode
285
+ compare?: (context: CompareContext) => ReactNode
281
286
  /**
282
287
  * The model-visualizer / debug drawer, mounted beside the map (host's ModelVisualizer). A render-prop so the host can
283
- * trace the CURRENT result (its input) — the package passes the live parse result; the host gates on its own dev-mode
284
- * state and returns `null` when the drawer is closed.
288
+ * trace the CURRENT result (its input) — the package passes the live parse result; the host decides on its own
289
+ * dev-mode state and returns `null` when the drawer is closed.
285
290
  */
286
291
  debugDrawer?: (context: { result: ParseResult | null }) => ReactNode
287
292
  /**
288
- * Extra map controls mounted as `<DemoMap>` children (host's DebugControl / LayerToggle via `useControl`).
293
+ * Extra map controls mounted as `<MapCanvas>` children (host's DebugControl / LayerToggle via `useControl`).
289
294
  */
290
295
  mapControls?: ReactNode
291
296
  /**
@@ -3,9 +3,9 @@
3
3
  * @license AGPL-3.0
4
4
  * @author Teffen Ellis, et al.
5
5
  *
6
- * `useDemoGeocode` — the parse+resolve state machine for the geocoder map demo. It REUSES the pipeline's
6
+ * `useGeocode` — the parse+resolve state machine for the geocoder map. It REUSES the pipeline's
7
7
  * `useParsePipeline` (text / busy / stage / result / candidate selection) and layers on the two map-only
8
- * concerns the demo adds over the base explorer:
8
+ * concerns the geocoder adds over the base explorer:
9
9
  *
10
10
  * 1. Viewport bias — when the runtime exposes `runParseWithBias`, the current map center (read through
11
11
  * an injected `getBias`, itself reading the `MapRef`) rides along as a soft proximity prior. The
@@ -20,16 +20,16 @@
20
20
 
21
21
  import { useMemo } from "react"
22
22
 
23
- import type { PipelineRuntime } from "../pipeline/types.ts"
24
- import { useParsePipeline, type UseParsePipeline } from "../pipeline/useParsePipeline.ts"
25
- import type { ResolvedMapPlace } from "./place-render.ts"
26
- import type { DemoRuntime, MapBias } from "./types.ts"
23
+ import type { ResolvedMapPlace } from "#map/place-render"
24
+ import type { GeocoderRuntime, MapBias } from "#map/types"
25
+ import type { PipelineRuntime } from "#pipeline/types"
26
+ import { useParsePipeline, type UseParsePipeline } from "#pipeline/useParsePipeline"
27
27
 
28
- export interface UseDemoGeocodeOptions {
28
+ export interface UseGeocodeOptions {
29
29
  /**
30
- * The injected demo runtime (extends `PipelineRuntime` with the map + bias surface).
30
+ * The injected geocoder runtime (extends `PipelineRuntime` with the map + bias surface).
31
31
  */
32
- runtime: DemoRuntime
32
+ runtime: GeocoderRuntime
33
33
  /**
34
34
  * Address to pre-fill.
35
35
  */
@@ -40,14 +40,14 @@ export interface UseDemoGeocodeOptions {
40
40
  getBias?: () => MapBias | null
41
41
  }
42
42
 
43
- export interface UseDemoGeocode extends UseParsePipeline {
43
+ export interface UseGeocode extends UseParsePipeline {
44
44
  /**
45
45
  * The selected candidate enriched into the map-render shape (bbox / tier / polygon), or `null`.
46
46
  */
47
47
  mapPlace: ResolvedMapPlace | null
48
48
  }
49
49
 
50
- export function useDemoGeocode({ runtime, defaultText, getBias }: UseDemoGeocodeOptions): UseDemoGeocode {
50
+ export function useGeocode({ runtime, defaultText, getBias }: UseGeocodeOptions): UseGeocode {
51
51
  // Bind the viewport bias into a derived `runParse` so `useParsePipeline` is reused unchanged. When the runtime has no
52
52
  // bias-aware parse, pass it straight through.
53
53
  const geoRuntime = useMemo<PipelineRuntime>(() => {
@@ -12,8 +12,8 @@
12
12
 
13
13
  import { useMemo } from "react"
14
14
 
15
- import { computeMapPlaceRenderSpec } from "./place-render.ts"
16
- import type { MapPlaceRenderSpec, ResolvedMapPlace } from "./place-render.ts"
15
+ import { computeMapPlaceRenderSpec } from "#map/place-render"
16
+ import type { MapPlaceRenderSpec, ResolvedMapPlace } from "#map/place-render"
17
17
 
18
18
  /**
19
19
  * Memoize the render spec for a resolved place; `null` in → `null` out (nothing to draw).
@@ -17,8 +17,8 @@
17
17
 
18
18
  import { type KeyboardEvent, useCallback, useEffect, useState } from "react"
19
19
 
20
- import { useDebouncedValue } from "../common/useDebouncedValue.ts"
21
- import type { Suggestion } from "./types.ts"
20
+ import { useDebouncedValue } from "#common/useDebouncedValue"
21
+ import type { Suggestion } from "#map/types"
22
22
 
23
23
  export interface UsePlaceAutocompleteOptions {
24
24
  /**
@@ -7,10 +7,10 @@
7
7
  * Presentational; the selected index is owned by the caller (the pipeline hook).
8
8
  */
9
9
 
10
+ import type { ResolvedPlaceView } from "@mailwoman/core/pipeline/client-result"
10
11
  import type { ReactNode } from "react"
11
12
 
12
- import { cx } from "../common/cx.ts"
13
- import type { ResolvedPlaceView } from "./types.ts"
13
+ import { cx } from "#common/cx"
14
14
 
15
15
  export interface CandidatePickerProps {
16
16
  candidates: ResolvedPlaceView[]
@@ -6,10 +6,10 @@
6
6
  * `ComponentTable` — the tag / value / confidence table of decoded components. Presentational.
7
7
  */
8
8
 
9
+ import type { ParsedComponent } from "@mailwoman/core/pipeline/client-result"
9
10
  import type { ReactNode } from "react"
10
11
 
11
12
  import { ConfidenceCell } from "./ConfidenceCell.tsx"
12
- import type { ParsedComponent } from "./types.ts"
13
13
 
14
14
  export interface ComponentTableProps {
15
15
  nodes: ParsedComponent[]