@mailwoman/react 10.0.0 → 10.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (376) hide show
  1. package/README.md +17 -16
  2. package/fonts.css +97 -22
  3. package/lib/common/About.tsx +7 -7
  4. package/lib/common/ClientOnly.tsx +2 -14
  5. package/lib/common/CopyButton.tsx +3 -1
  6. package/lib/common/LoadingIndicator.tsx +4 -2
  7. package/lib/common/PresetChips.tsx +9 -8
  8. package/lib/common/confidence-tiers.ts +7 -6
  9. package/lib/common/cx.ts +3 -1
  10. package/lib/common/text-tokens.ts +7 -4
  11. package/lib/common/useBuildInfo.ts +54 -0
  12. package/lib/common/useClipboard.ts +2 -11
  13. package/lib/common.ts +22 -0
  14. package/lib/index.ts +27 -17
  15. package/lib/map/AppIdentity.tsx +85 -0
  16. package/lib/map/BackendControl.tsx +9 -10
  17. package/lib/map/CompareToggle.tsx +8 -31
  18. package/lib/map/DebugInfo.tsx +88 -0
  19. package/lib/map/Geocoder.tsx +60 -46
  20. package/lib/map/GeocoderControls.tsx +430 -134
  21. package/lib/map/GraticuleLayer.tsx +54 -0
  22. package/lib/map/MapCanvas.tsx +23 -12
  23. package/lib/map/MapChipRow.tsx +4 -8
  24. package/lib/map/MapCompass.tsx +15 -24
  25. package/lib/map/MapControlStack.tsx +8 -9
  26. package/lib/map/MapFooter.tsx +2 -16
  27. package/lib/map/MapProgressBar.tsx +10 -13
  28. package/lib/map/MapSearchBar.tsx +31 -17
  29. package/lib/map/MapSheet.tsx +24 -15
  30. package/lib/map/OverlayLayers.tsx +1 -1
  31. package/lib/map/PlaceAutocomplete.tsx +10 -21
  32. package/lib/map/PlaceMarker.tsx +4 -2
  33. package/lib/map/ResolvedPlaceLayers.tsx +5 -14
  34. package/lib/map/ResultCamera.tsx +8 -31
  35. package/lib/map/ResultOverlay.tsx +2 -12
  36. package/lib/map/ResultPanel.tsx +1 -20
  37. package/lib/map/VersionPicker.tsx +10 -19
  38. package/lib/map/fake-runtime.ts +10 -12
  39. package/lib/map/geometry.ts +14 -47
  40. package/lib/map/graticule.ts +80 -0
  41. package/lib/map/map-debug.ts +1 -1
  42. package/lib/map/place-render.ts +28 -60
  43. package/lib/map/types.ts +58 -104
  44. package/lib/map/useCompareState.ts +5 -4
  45. package/lib/map/useGeocode.ts +7 -5
  46. package/lib/map/useMapBearing.ts +13 -13
  47. package/lib/map/useMapLabelPick.ts +21 -30
  48. package/lib/map/useMapPlaceRender.ts +2 -6
  49. package/lib/map/usePlaceAutocomplete.ts +44 -50
  50. package/lib/map.ts +95 -0
  51. package/lib/pipeline/CandidatePicker.tsx +13 -5
  52. package/lib/pipeline/ConfidenceCell.tsx +1 -1
  53. package/lib/pipeline/FailureDiagnostic.tsx +8 -2
  54. package/lib/pipeline/QueryForm.tsx +5 -2
  55. package/lib/pipeline/ResolvedPlace.tsx +1 -1
  56. package/lib/pipeline/SpanHighlight.tsx +7 -5
  57. package/lib/pipeline/TimingPanel.tsx +1 -1
  58. package/lib/pipeline/TreeView.tsx +1 -1
  59. package/lib/pipeline/copy.ts +22 -25
  60. package/lib/pipeline/presets.ts +15 -13
  61. package/lib/pipeline/types.ts +21 -14
  62. package/lib/pipeline/useParsePipeline.ts +16 -13
  63. package/lib/pipeline.ts +36 -0
  64. package/lib/poi/AbstainPanel.tsx +1 -1
  65. package/lib/poi/LiveResultsBlock.tsx +2 -1
  66. package/lib/poi/POIExplorer.tsx +24 -15
  67. package/lib/poi/QueryInput.tsx +1 -1
  68. package/lib/poi/SubjectPanel.tsx +4 -3
  69. package/lib/poi/runtime.ts +5 -16
  70. package/lib/poi/types.ts +39 -27
  71. package/lib/poi/usePOISearch.ts +39 -44
  72. package/lib/poi.ts +39 -0
  73. package/lib/runtime/useReleaseRuntime.ts +125 -74
  74. package/lib/search/SearchModal.tsx +317 -0
  75. package/lib/search/search.css +144 -0
  76. package/lib/search/types.ts +67 -0
  77. package/lib/search.ts +11 -0
  78. package/out/common/About.d.ts +5 -5
  79. package/out/common/About.d.ts.map +1 -1
  80. package/out/common/About.js +1 -1
  81. package/out/common/About.js.map +1 -1
  82. package/out/common/ClientOnly.d.ts +2 -11
  83. package/out/common/ClientOnly.d.ts.map +1 -1
  84. package/out/common/ClientOnly.js +1 -13
  85. package/out/common/ClientOnly.js.map +1 -1
  86. package/out/common/CopyButton.d.ts +3 -1
  87. package/out/common/CopyButton.d.ts.map +1 -1
  88. package/out/common/CopyButton.js.map +1 -1
  89. package/out/common/LoadingIndicator.d.ts +4 -2
  90. package/out/common/LoadingIndicator.d.ts.map +1 -1
  91. package/out/common/LoadingIndicator.js.map +1 -1
  92. package/out/common/PresetChips.d.ts +9 -8
  93. package/out/common/PresetChips.d.ts.map +1 -1
  94. package/out/common/PresetChips.js.map +1 -1
  95. package/out/common/confidence-tiers.d.ts +7 -6
  96. package/out/common/confidence-tiers.d.ts.map +1 -1
  97. package/out/common/confidence-tiers.js +7 -6
  98. package/out/common/confidence-tiers.js.map +1 -1
  99. package/out/common/cx.d.ts +3 -1
  100. package/out/common/cx.d.ts.map +1 -1
  101. package/out/common/cx.js +3 -1
  102. package/out/common/cx.js.map +1 -1
  103. package/out/common/text-tokens.d.ts +4 -3
  104. package/out/common/text-tokens.d.ts.map +1 -1
  105. package/out/common/text-tokens.js +6 -3
  106. package/out/common/text-tokens.js.map +1 -1
  107. package/out/common/useBuildInfo.d.ts +27 -0
  108. package/out/common/useBuildInfo.d.ts.map +1 -0
  109. package/out/common/useBuildInfo.js +32 -0
  110. package/out/common/useBuildInfo.js.map +1 -0
  111. package/out/common/useClipboard.d.ts +1 -3
  112. package/out/common/useClipboard.d.ts.map +1 -1
  113. package/out/common/useClipboard.js +2 -11
  114. package/out/common/useClipboard.js.map +1 -1
  115. package/out/common.d.ts +22 -0
  116. package/out/common.d.ts.map +1 -0
  117. package/out/common.js +15 -0
  118. package/out/common.js.map +1 -0
  119. package/out/index.d.ts +26 -16
  120. package/out/index.d.ts.map +1 -1
  121. package/out/index.js +21 -15
  122. package/out/index.js.map +1 -1
  123. package/out/map/AppIdentity.d.ts +42 -0
  124. package/out/map/AppIdentity.d.ts.map +1 -0
  125. package/out/map/AppIdentity.js +16 -0
  126. package/out/map/AppIdentity.js.map +1 -0
  127. package/out/map/BackendControl.d.ts +9 -10
  128. package/out/map/BackendControl.d.ts.map +1 -1
  129. package/out/map/BackendControl.js +1 -1
  130. package/out/map/BackendControl.js.map +1 -1
  131. package/out/map/CompareToggle.d.ts +8 -31
  132. package/out/map/CompareToggle.d.ts.map +1 -1
  133. package/out/map/CompareToggle.js +4 -1
  134. package/out/map/CompareToggle.js.map +1 -1
  135. package/out/map/DebugInfo.d.ts +34 -0
  136. package/out/map/DebugInfo.d.ts.map +1 -0
  137. package/out/map/DebugInfo.js +39 -0
  138. package/out/map/DebugInfo.js.map +1 -0
  139. package/out/map/Geocoder.d.ts +41 -30
  140. package/out/map/Geocoder.d.ts.map +1 -1
  141. package/out/map/Geocoder.js +20 -36
  142. package/out/map/Geocoder.js.map +1 -1
  143. package/out/map/GeocoderControls.d.ts +14 -42
  144. package/out/map/GeocoderControls.d.ts.map +1 -1
  145. package/out/map/GeocoderControls.js +250 -38
  146. package/out/map/GeocoderControls.js.map +1 -1
  147. package/out/map/GraticuleLayer.d.ts +28 -0
  148. package/out/map/GraticuleLayer.d.ts.map +1 -0
  149. package/out/map/GraticuleLayer.js +25 -0
  150. package/out/map/GraticuleLayer.js.map +1 -0
  151. package/out/map/MapCanvas.d.ts +23 -12
  152. package/out/map/MapCanvas.d.ts.map +1 -1
  153. package/out/map/MapCanvas.js +5 -2
  154. package/out/map/MapCanvas.js.map +1 -1
  155. package/out/map/MapChipRow.d.ts +4 -8
  156. package/out/map/MapChipRow.d.ts.map +1 -1
  157. package/out/map/MapChipRow.js.map +1 -1
  158. package/out/map/MapCompass.d.ts +11 -20
  159. package/out/map/MapCompass.d.ts.map +1 -1
  160. package/out/map/MapCompass.js +5 -1
  161. package/out/map/MapCompass.js.map +1 -1
  162. package/out/map/MapControlStack.d.ts +8 -9
  163. package/out/map/MapControlStack.d.ts.map +1 -1
  164. package/out/map/MapControlStack.js +4 -1
  165. package/out/map/MapControlStack.js.map +1 -1
  166. package/out/map/MapFooter.d.ts +2 -15
  167. package/out/map/MapFooter.d.ts.map +1 -1
  168. package/out/map/MapFooter.js +0 -14
  169. package/out/map/MapFooter.js.map +1 -1
  170. package/out/map/MapProgressBar.d.ts +10 -13
  171. package/out/map/MapProgressBar.d.ts.map +1 -1
  172. package/out/map/MapProgressBar.js.map +1 -1
  173. package/out/map/MapSearchBar.d.ts +16 -17
  174. package/out/map/MapSearchBar.d.ts.map +1 -1
  175. package/out/map/MapSearchBar.js +6 -0
  176. package/out/map/MapSearchBar.js.map +1 -1
  177. package/out/map/MapSheet.d.ts +15 -12
  178. package/out/map/MapSheet.d.ts.map +1 -1
  179. package/out/map/MapSheet.js +8 -12
  180. package/out/map/MapSheet.js.map +1 -1
  181. package/out/map/OverlayLayers.d.ts +1 -1
  182. package/out/map/OverlayLayers.js +1 -1
  183. package/out/map/PlaceAutocomplete.d.ts +10 -21
  184. package/out/map/PlaceAutocomplete.d.ts.map +1 -1
  185. package/out/map/PlaceAutocomplete.js +2 -1
  186. package/out/map/PlaceAutocomplete.js.map +1 -1
  187. package/out/map/PlaceMarker.d.ts +4 -2
  188. package/out/map/PlaceMarker.d.ts.map +1 -1
  189. package/out/map/PlaceMarker.js +3 -1
  190. package/out/map/PlaceMarker.js.map +1 -1
  191. package/out/map/ResolvedPlaceLayers.d.ts +5 -14
  192. package/out/map/ResolvedPlaceLayers.d.ts.map +1 -1
  193. package/out/map/ResolvedPlaceLayers.js +1 -1
  194. package/out/map/ResolvedPlaceLayers.js.map +1 -1
  195. package/out/map/ResultCamera.d.ts +8 -31
  196. package/out/map/ResultCamera.d.ts.map +1 -1
  197. package/out/map/ResultCamera.js +3 -28
  198. package/out/map/ResultCamera.js.map +1 -1
  199. package/out/map/ResultOverlay.d.ts +2 -12
  200. package/out/map/ResultOverlay.d.ts.map +1 -1
  201. package/out/map/ResultOverlay.js +1 -2
  202. package/out/map/ResultOverlay.js.map +1 -1
  203. package/out/map/ResultPanel.d.ts +1 -20
  204. package/out/map/ResultPanel.d.ts.map +1 -1
  205. package/out/map/ResultPanel.js.map +1 -1
  206. package/out/map/VersionPicker.d.ts +7 -19
  207. package/out/map/VersionPicker.d.ts.map +1 -1
  208. package/out/map/VersionPicker.js +5 -2
  209. package/out/map/VersionPicker.js.map +1 -1
  210. package/out/map/fake-runtime.d.ts +9 -11
  211. package/out/map/fake-runtime.d.ts.map +1 -1
  212. package/out/map/fake-runtime.js +9 -12
  213. package/out/map/fake-runtime.js.map +1 -1
  214. package/out/map/geometry.d.ts +13 -34
  215. package/out/map/geometry.d.ts.map +1 -1
  216. package/out/map/geometry.js +9 -34
  217. package/out/map/geometry.js.map +1 -1
  218. package/out/map/graticule.d.ts +17 -0
  219. package/out/map/graticule.d.ts.map +1 -0
  220. package/out/map/graticule.js +67 -0
  221. package/out/map/graticule.js.map +1 -0
  222. package/out/map/map-debug.d.ts +1 -1
  223. package/out/map/map-debug.js +1 -1
  224. package/out/map/place-render.d.ts +23 -43
  225. package/out/map/place-render.d.ts.map +1 -1
  226. package/out/map/place-render.js +4 -39
  227. package/out/map/place-render.js.map +1 -1
  228. package/out/map/types.d.ts +58 -102
  229. package/out/map/types.d.ts.map +1 -1
  230. package/out/map/types.js +1 -10
  231. package/out/map/types.js.map +1 -1
  232. package/out/map/useCompareState.d.ts +5 -4
  233. package/out/map/useCompareState.d.ts.map +1 -1
  234. package/out/map/useCompareState.js +3 -3
  235. package/out/map/useCompareState.js.map +1 -1
  236. package/out/map/useGeocode.d.ts +5 -3
  237. package/out/map/useGeocode.d.ts.map +1 -1
  238. package/out/map/useGeocode.js +4 -4
  239. package/out/map/useGeocode.js.map +1 -1
  240. package/out/map/useMapBearing.d.ts +11 -11
  241. package/out/map/useMapBearing.d.ts.map +1 -1
  242. package/out/map/useMapBearing.js +6 -11
  243. package/out/map/useMapBearing.js.map +1 -1
  244. package/out/map/useMapLabelPick.d.ts +4 -14
  245. package/out/map/useMapLabelPick.d.ts.map +1 -1
  246. package/out/map/useMapLabelPick.js +21 -30
  247. package/out/map/useMapLabelPick.js.map +1 -1
  248. package/out/map/useMapPlaceRender.d.ts +2 -6
  249. package/out/map/useMapPlaceRender.d.ts.map +1 -1
  250. package/out/map/useMapPlaceRender.js +2 -6
  251. package/out/map/useMapPlaceRender.js.map +1 -1
  252. package/out/map/usePlaceAutocomplete.d.ts +30 -28
  253. package/out/map/usePlaceAutocomplete.d.ts.map +1 -1
  254. package/out/map/usePlaceAutocomplete.js +6 -33
  255. package/out/map/usePlaceAutocomplete.js.map +1 -1
  256. package/out/map.d.ts +69 -0
  257. package/out/map.d.ts.map +1 -0
  258. package/out/map.js +46 -0
  259. package/out/map.js.map +1 -0
  260. package/out/pipeline/CandidatePicker.d.ts +12 -2
  261. package/out/pipeline/CandidatePicker.d.ts.map +1 -1
  262. package/out/pipeline/CandidatePicker.js +1 -1
  263. package/out/pipeline/CandidatePicker.js.map +1 -1
  264. package/out/pipeline/ConfidenceCell.d.ts +1 -1
  265. package/out/pipeline/ConfidenceCell.js +1 -1
  266. package/out/pipeline/FailureDiagnostic.d.ts +8 -2
  267. package/out/pipeline/FailureDiagnostic.d.ts.map +1 -1
  268. package/out/pipeline/FailureDiagnostic.js +3 -0
  269. package/out/pipeline/FailureDiagnostic.js.map +1 -1
  270. package/out/pipeline/QueryForm.d.ts +5 -2
  271. package/out/pipeline/QueryForm.d.ts.map +1 -1
  272. package/out/pipeline/QueryForm.js.map +1 -1
  273. package/out/pipeline/SpanHighlight.d.ts +4 -3
  274. package/out/pipeline/SpanHighlight.d.ts.map +1 -1
  275. package/out/pipeline/SpanHighlight.js +3 -2
  276. package/out/pipeline/SpanHighlight.js.map +1 -1
  277. package/out/pipeline/TimingPanel.d.ts +1 -1
  278. package/out/pipeline/TreeView.d.ts +1 -1
  279. package/out/pipeline/copy.d.ts +1 -1
  280. package/out/pipeline/copy.d.ts.map +1 -1
  281. package/out/pipeline/copy.js +4 -3
  282. package/out/pipeline/copy.js.map +1 -1
  283. package/out/pipeline/presets.d.ts +5 -4
  284. package/out/pipeline/presets.d.ts.map +1 -1
  285. package/out/pipeline/presets.js +15 -13
  286. package/out/pipeline/presets.js.map +1 -1
  287. package/out/pipeline/types.d.ts +21 -14
  288. package/out/pipeline/types.d.ts.map +1 -1
  289. package/out/pipeline/types.js +2 -4
  290. package/out/pipeline/types.js.map +1 -1
  291. package/out/pipeline/useParsePipeline.d.ts +14 -9
  292. package/out/pipeline/useParsePipeline.d.ts.map +1 -1
  293. package/out/pipeline/useParsePipeline.js +7 -8
  294. package/out/pipeline/useParsePipeline.js.map +1 -1
  295. package/out/pipeline.d.ts +33 -0
  296. package/out/pipeline.d.ts.map +1 -0
  297. package/out/pipeline.js +21 -0
  298. package/out/pipeline.js.map +1 -0
  299. package/out/poi/AbstainPanel.d.ts +1 -1
  300. package/out/poi/LiveResultsBlock.d.ts +2 -1
  301. package/out/poi/LiveResultsBlock.d.ts.map +1 -1
  302. package/out/poi/LiveResultsBlock.js.map +1 -1
  303. package/out/poi/POIExplorer.d.ts +22 -12
  304. package/out/poi/POIExplorer.d.ts.map +1 -1
  305. package/out/poi/POIExplorer.js +9 -8
  306. package/out/poi/POIExplorer.js.map +1 -1
  307. package/out/poi/QueryInput.d.ts +1 -1
  308. package/out/poi/SubjectPanel.d.ts +2 -2
  309. package/out/poi/SubjectPanel.d.ts.map +1 -1
  310. package/out/poi/SubjectPanel.js +2 -1
  311. package/out/poi/SubjectPanel.js.map +1 -1
  312. package/out/poi/runtime.d.ts +5 -14
  313. package/out/poi/runtime.d.ts.map +1 -1
  314. package/out/poi/runtime.js +5 -16
  315. package/out/poi/runtime.js.map +1 -1
  316. package/out/poi/types.d.ts +39 -27
  317. package/out/poi/types.d.ts.map +1 -1
  318. package/out/poi/types.js +2 -4
  319. package/out/poi/types.js.map +1 -1
  320. package/out/poi/usePOISearch.d.ts +28 -17
  321. package/out/poi/usePOISearch.d.ts.map +1 -1
  322. package/out/poi/usePOISearch.js +6 -32
  323. package/out/poi/usePOISearch.js.map +1 -1
  324. package/out/poi.d.ts +23 -0
  325. package/out/poi.d.ts.map +1 -0
  326. package/out/poi.js +15 -0
  327. package/out/poi.js.map +1 -0
  328. package/out/runtime/useReleaseRuntime.d.ts +64 -65
  329. package/out/runtime/useReleaseRuntime.d.ts.map +1 -1
  330. package/out/runtime/useReleaseRuntime.js +31 -26
  331. package/out/runtime/useReleaseRuntime.js.map +1 -1
  332. package/out/{runtime/index.d.ts → runtime.d.ts} +1 -1
  333. package/out/runtime.d.ts.map +1 -0
  334. package/out/{runtime/index.js → runtime.js} +1 -1
  335. package/out/runtime.js.map +1 -0
  336. package/out/search/SearchModal.d.ts +33 -0
  337. package/out/search/SearchModal.d.ts.map +1 -0
  338. package/out/search/SearchModal.js +187 -0
  339. package/out/search/SearchModal.js.map +1 -0
  340. package/out/search/types.d.ts +64 -0
  341. package/out/search/types.d.ts.map +1 -0
  342. package/out/search/types.js +13 -0
  343. package/out/search/types.js.map +1 -0
  344. package/out/search.d.ts +11 -0
  345. package/out/search.d.ts.map +1 -0
  346. package/out/search.js +9 -0
  347. package/out/search.js.map +1 -0
  348. package/package.json +60 -142
  349. package/styles.css +482 -266
  350. package/tokens/index.css +24 -6
  351. package/tokens/tokens.json +114 -6
  352. package/lib/common/index.ts +0 -22
  353. package/lib/map/index.ts +0 -95
  354. package/lib/pipeline/index.ts +0 -36
  355. package/lib/poi/index.ts +0 -39
  356. package/out/common/index.d.ts +0 -22
  357. package/out/common/index.d.ts.map +0 -1
  358. package/out/common/index.js +0 -15
  359. package/out/common/index.js.map +0 -1
  360. package/out/map/index.d.ts +0 -69
  361. package/out/map/index.d.ts.map +0 -1
  362. package/out/map/index.js +0 -46
  363. package/out/map/index.js.map +0 -1
  364. package/out/pipeline/index.d.ts +0 -33
  365. package/out/pipeline/index.d.ts.map +0 -1
  366. package/out/pipeline/index.js +0 -21
  367. package/out/pipeline/index.js.map +0 -1
  368. package/out/poi/index.d.ts +0 -23
  369. package/out/poi/index.d.ts.map +0 -1
  370. package/out/poi/index.js +0 -15
  371. package/out/poi/index.js.map +0 -1
  372. package/out/runtime/index.d.ts.map +0 -1
  373. package/out/runtime/index.js.map +0 -1
  374. package/styleframe.config.ts +0 -329
  375. package/vitest.node.config.ts +0 -20
  376. /package/lib/{runtime/index.ts → runtime.ts} +0 -0
@@ -3,23 +3,23 @@
3
3
  * @license AGPL-3.0
4
4
  * @author Teffen Ellis, et al.
5
5
  *
6
- * Default query + example addresses for the pipeline explorer. Hosts can override via props; these
6
+ * Default query + example addresses for the pipeline explorer. Hosts can override via props. These
7
7
  * mirror the docs demo's set so the extracted component looks identical out of the box.
8
8
  */
9
9
 
10
10
  import type { Preset } from "../common/PresetChips.tsx"
11
11
 
12
12
  /**
13
- * Address the pipeline explorer opens on. Chosen because it exercises every stage — house number, street, directional,
14
- * locality and region — in one line.
13
+ * Address the pipeline explorer opens on.
14
+ *
15
+ * It exercises every stage (house number, street, directional, locality and region) in one line.
15
16
  */
16
17
  export const PIPELINE_DEFAULT_ADDRESS = "1600 Pennsylvania Ave NW, Washington, DC 20500"
17
18
 
18
- // `country` mirrors the docs `EXAMPLE_ADDRESSES` set (kept in parity) — the placetype-pair country pin (#1278 phase 2's
19
- // `{country}` override). A host that wires the pair prior pins the country while the input equals the preset text, so a
20
- // locale structural routing can't detect (NZ) still fires; free-typed input drops to structural detection.
19
+ // `country` mirrors the docs `EXAMPLE_ADDRESSES` set and is kept in parity.
20
+ // A host that wires the pair prior pins the country while the input equals the preset text.
21
21
  /**
22
- * Preset inputs offered in the explorer, each picked to show a different parse behaviour.
22
+ * Preset inputs offered in the explorer, each picked to show a different parse behavior.
23
23
  */
24
24
  export const PIPELINE_PRESETS: ReadonlyArray<Preset> = [
25
25
  { label: "White House", value: "1600 Pennsylvania Ave NW, Washington, DC 20500", country: "us" },
@@ -32,16 +32,18 @@ export const PIPELINE_PRESETS: ReadonlyArray<Preset> = [
32
32
  { label: "Berlin (native order)", value: "Straußstraße 27, 12623 Berlin", country: "de" },
33
33
  { label: "Berlin city-state (int'l order)", value: "5 Hauptstraße, Berlin, Berlin 10115", country: "de" },
34
34
  { label: "Paris (street fall-through)", value: "181 Rue du Chevaleret, Paris", country: "fr" },
35
- // GB dependent_locality (placetype-pair-prior arc) — "Henbury" flips to dependent_locality via the en-gb pair-index
36
- // prior; the UK postcode is also structurally detectable (parity with docs EXAMPLE_ADDRESSES).
35
+ // "Henbury" flips to dependent_locality via the en-gb pair-index prior.
36
+ // The UK postcode is structurally detectable, in parity with the docs EXAMPLE_ADDRESSES.
37
37
  {
38
38
  label: "Macclesfield (GB dependent_locality)",
39
39
  value: "41 Hightree Drive, Henbury, Macclesfield, SK11 9PD",
40
40
  country: "gb",
41
41
  },
42
- // NZ dependent_locality (en-nz pair-prior arc) — Plimmerton is a suburb (dependent_locality) of Porirua. Postcode
43
- // DELIBERATELY OMITTED: a trailing "Porirua 5026" folds "porirua 5026" in segment mode and misses the index's bare
44
- // "porirua" key (tracked as #1308). The `country: "nz"` pin is required — locale-hint can't structurally detect
45
- // NZ (4-digit postcode isn't distinctive), so only the pin selects the nz index; free-typed NZ stays unfired.
42
+ // Plimmerton is a suburb (dependent_locality) of Porirua.
43
+ // The postcode is deliberately omitted, since a trailing "Porirua 5026" folds "porirua
44
+ // 5026" in segment mode and misses the index's bare "porirua" key.
45
+ // The `country: "nz"` pin is required, since locale-hint cannot structurally
46
+ // detect NZ (a 4-digit postcode is not distinctive).
47
+ // Only the pin selects the nz index.
46
48
  { label: "Plimmerton (NZ dependent_locality)", value: "35 Steyne Avenue, Plimmerton, Porirua", country: "nz" },
47
49
  ]
@@ -3,10 +3,8 @@
3
3
  * @license AGPL-3.0
4
4
  * @author Teffen Ellis, et al.
5
5
  *
6
- * Types for the pipeline (parse + resolve) explorer. The model/gazetteer runtime is INJECTED as a
7
- * {@link PipelineRuntime}: this package owns the UI state machine + presentation, while the host
8
- * (the docs site's RuntimeEmbed, or any app) owns loading ONNX/WOF and executing a parse. That keeps
9
- * onnxruntime-web, sql.js-httpvfs, and node builtins entirely out of this package's browser graph.
6
+ * Types for the pipeline (parse + resolve) explorer. The runtime is injected as a {@link PipelineRuntime},
7
+ * keeping onnxruntime-web, sqlite-wasm and node builtins out of this package's browser graph.
10
8
  */
11
9
 
12
10
  import type { ParseResult } from "@mailwoman/core/pipeline/client-result"
@@ -19,11 +17,20 @@ export interface PipelineLoadingState {
19
17
  progress?: string
20
18
  stepLabels: string[]
21
19
  stepIndex: number
20
+ /**
21
+ * Bytes received over bytes expected for the asset being fetched right now, in [0, 1],
22
+ * or `null` when no download is in progress or the response declares no length.
23
+ *
24
+ * The step index cannot report this download because the model is fetched before the first step begins.
25
+ */
26
+ byteFraction?: number | null
22
27
  }
23
28
 
24
29
  /**
25
- * The injected parse runtime. The host implements `runParse` (compute shape → classify → resolve) and reports load
26
- * progress + errors. This package never imports the model or gazetteer — it only calls this contract.
30
+ * The injected parse runtime.
31
+ *
32
+ * The host implements this interface and supplies the model and gazetteer,
33
+ * keeping both imports out of this package.
27
34
  */
28
35
  export interface PipelineRuntime {
29
36
  /**
@@ -31,7 +38,8 @@ export interface PipelineRuntime {
31
38
  */
32
39
  ready: boolean
33
40
  /**
34
- * Execute a full parse+resolve, reporting stage progress via `onStage` (0-based index into `parseStageLabels`).
41
+ * Execute a full parse+resolve, reporting stage progress via `onStage`
42
+ * (0-based index into `parseStageLabels`).
35
43
  */
36
44
  runParse: (input: string, hooks: { onStage: (stage: number) => void }) => Promise<ParseResult>
37
45
  /**
@@ -49,17 +57,16 @@ export interface PipelineRuntime {
49
57
  }
50
58
 
51
59
  /**
52
- * Optional host-injected panels. Each is a function of the current parse result returning already-rendered content (the
53
- * docs site's SpanHighlight, TreeView, TimingPanel, …). Kept as `ReactNode` thunks so this package needs neither those
54
- * components nor their heavy data types.
60
+ * Optional host-injected panels, kept as `ReactNode` thunks so this package needs
61
+ * neither the host's components nor their data types.
55
62
  */
56
63
  export interface PipelinePanels {
57
64
  /**
58
- * Rendered above the form (e.g. the docs "About this demo").
65
+ * Rendered above the form.
59
66
  */
60
67
  header?: ReactNode
61
68
  /**
62
- * Rendered below everything (e.g. a guided tour).
69
+ * Rendered below everything.
63
70
  */
64
71
  footer?: ReactNode
65
72
  /**
@@ -67,7 +74,7 @@ export interface PipelinePanels {
67
74
  */
68
75
  versionControl?: ReactNode
69
76
  /**
70
- * Backend indicator + WASM toggle.
77
+ * Backend indicator + wasm toggle.
71
78
  */
72
79
  backendControl?: ReactNode
73
80
  /**
@@ -79,7 +86,7 @@ export interface PipelinePanels {
79
86
  */
80
87
  extras?: (result: ParseResult) => ReactNode
81
88
  /**
82
- * Rendered in place of the resolved-place panel when nothing resolved (host's FailureDiagnostic).
89
+ * Rendered in place of the resolved-place panel when no place resolved (host's FailureDiagnostic).
83
90
  */
84
91
  failure?: (result: ParseResult) => ReactNode
85
92
  }
@@ -3,10 +3,8 @@
3
3
  * @license AGPL-3.0
4
4
  * @author Teffen Ellis, et al.
5
5
  *
6
- * `useParsePipeline` — the headless core of the pipeline explorer. Owns the query text, the
7
- * busy/stage flags, the parse result, and the candidate selection; delegates the actual parse+resolve
8
- * to the injected {@link PipelineRuntime}. No model or gazetteer code lives here — it just drives the
9
- * contract and shapes the UI state.
6
+ * The headless core of the pipeline explorer. It owns query text, busy/stage flags, result and candidate selection.
7
+ * It delegates parse and resolve to the injected {@link PipelineRuntime}.
10
8
  */
11
9
 
12
10
  import type { ParseResult, ResolvedPlaceView } from "@mailwoman/core/pipeline/client-result"
@@ -14,11 +12,17 @@ import { useCallback, useState } from "react"
14
12
 
15
13
  import type { PipelineRuntime } from "#pipeline/types"
16
14
 
15
+ /**
16
+ * The runtime and starting text for {@link useParsePipeline}.
17
+ */
17
18
  export interface UseParsePipelineOptions {
18
19
  runtime: PipelineRuntime
19
20
  defaultText: string
20
21
  }
21
22
 
23
+ /**
24
+ * The state and handlers that {@link useParsePipeline} returns.
25
+ */
22
26
  export interface UseParsePipeline {
23
27
  text: string
24
28
  setText: (text: string) => void
@@ -36,18 +40,19 @@ export interface UseParsePipeline {
36
40
  */
37
41
  selectedCandidate: ResolvedPlaceView | null
38
42
  /**
39
- * Parse and resolve the current text. Safe to bind to a form's `onSubmit`.
40
- *
41
- * Pass `query` to submit a value the field has not re-rendered with yet — a preset press sets the text and submits in
42
- * one handler, and that state update is not visible to this call.
43
+ * Parse and resolve the current text, safe to bind to a form's `onSubmit`;
44
+ * pass `query` to submit a value the field has not re-rendered with yet.
43
45
  */
44
46
  submit: (query?: string) => Promise<void>
45
47
  /**
46
- * Clear the result (used when a preset replaces the input).
48
+ * Clear the result, used when a preset replaces the input.
47
49
  */
48
50
  reset: () => void
49
51
  }
50
52
 
53
+ /**
54
+ * Drives the injected runtime and exposes the explorer's UI state.
55
+ */
51
56
  export function useParsePipeline({ runtime, defaultText }: UseParsePipelineOptions): UseParsePipeline {
52
57
  const [text, setText] = useState(defaultText)
53
58
  const [busy, setBusy] = useState(false)
@@ -56,9 +61,8 @@ export function useParsePipeline({ runtime, defaultText }: UseParsePipelineOptio
56
61
  const [selectedCandidateIndex, setSelectedCandidateIndex] = useState(0)
57
62
  const [parseError, setParseError] = useState<string | null>(null)
58
63
 
59
- // `query` exists because `setText` does not reach this closure before the call after it runs. A preset that called
60
- // `setText(value)` then `submit()` parsed the PREVIOUS text — the field showed the preset and the map answered the
61
- // address before it. A caller that already knows the query passes it; the field's own submit passes nothing.
64
+ // `setText` does not reach this closure before the call after it runs,
65
+ // so a caller that already knows the query passes it.
62
66
  const submit = useCallback(
63
67
  async (query?: string) => {
64
68
  if (!runtime.ready || busy) return
@@ -85,7 +89,6 @@ export function useParsePipeline({ runtime, defaultText }: UseParsePipelineOptio
85
89
 
86
90
  const reset = useCallback(() => setResult(null), [])
87
91
 
88
- // Derived during render — no effect needed.
89
92
  const selectedCandidate = result ? (result.candidates[selectedCandidateIndex] ?? result.candidates[0] ?? null) : null
90
93
 
91
94
  return {
@@ -0,0 +1,36 @@
1
+ /**
2
+ * @copyright Sister Software
3
+ * @license AGPL-3.0
4
+ * @author Teffen Ellis, et al.
5
+ * @file Pipeline explorer components, visualizers, hooks and interfaces.
6
+ */
7
+
8
+ export { About } from "./common/About.tsx"
9
+ export { FailureDiagnostic } from "./pipeline/FailureDiagnostic.tsx"
10
+ export type { FailureDiagnosticProps } from "./pipeline/FailureDiagnostic.tsx"
11
+ export { SpanHighlight } from "./pipeline/SpanHighlight.tsx"
12
+ export type { SpanHighlightProps } from "./pipeline/SpanHighlight.tsx"
13
+ export { TimingPanel } from "./pipeline/TimingPanel.tsx"
14
+ export type { TimingPanelProps } from "./pipeline/TimingPanel.tsx"
15
+ export { TreeView } from "./pipeline/TreeView.tsx"
16
+ export type { TreeViewProps } from "./pipeline/TreeView.tsx"
17
+
18
+ export { CandidatePicker } from "./pipeline/CandidatePicker.tsx"
19
+ export type { CandidatePickerProps } from "./pipeline/CandidatePicker.tsx"
20
+ export { ComponentTable } from "./pipeline/ComponentTable.tsx"
21
+ export type { ComponentTableProps } from "./pipeline/ComponentTable.tsx"
22
+ export { ConfidenceCell } from "./pipeline/ConfidenceCell.tsx"
23
+ export type { ConfidenceCellProps } from "./pipeline/ConfidenceCell.tsx"
24
+ export { buildParsePayload } from "#pipeline/copy"
25
+ export { PIPELINE_DEFAULT_ADDRESS, PIPELINE_PRESETS } from "#pipeline/presets"
26
+ export { PipelineExplorer } from "./pipeline/PipelineExplorer.tsx"
27
+ export type { PipelineExplorerProps } from "./pipeline/PipelineExplorer.tsx"
28
+ export { QueryForm } from "./pipeline/QueryForm.tsx"
29
+ export type { QueryFormProps } from "./pipeline/QueryForm.tsx"
30
+ export { ResolvedPlace } from "./pipeline/ResolvedPlace.tsx"
31
+ export type { ResolvedPlaceProps } from "./pipeline/ResolvedPlace.tsx"
32
+
33
+ export type { PipelineLoadingState, PipelinePanels, PipelineRuntime } from "#pipeline/types"
34
+
35
+ export { useParsePipeline } from "#pipeline/useParsePipeline"
36
+ export type { UseParsePipeline, UseParsePipelineOptions } from "#pipeline/useParsePipeline"
@@ -3,7 +3,7 @@
3
3
  * @license AGPL-3.0
4
4
  * @author Teffen Ellis, et al.
5
5
  *
6
- * `AbstainPanel` — shown when the query carries no POI intent (it parses as an address). Names the
6
+ * `AbstainPanel` — shown when the query has no POI intent (it parses as an address). Names the
7
7
  * classifier's kind so the abstention is legible. Presentational.
8
8
  */
9
9
 
@@ -15,7 +15,8 @@ import type { LiveSearchState } from "#poi/types"
15
15
 
16
16
  export interface LiveResultsBlockProps {
17
17
  /**
18
- * Subject label for empty-state copy — a category ("No hospital results near …") or a brand ("No chevron results …").
18
+ * Subject label for empty-state copy — a category ("No hospital results near …")
19
+ * or a brand ("No chevron results …").
19
20
  */
20
21
  subjectLabel: string
21
22
  /**
@@ -2,11 +2,6 @@
2
2
  * @copyright Sister Software
3
3
  * @license AGPL-3.0
4
4
  * @author Teffen Ellis, et al.
5
- *
6
- * `POIExplorer` — the composed POI-intent tester. Detects a POI subject in free text, shows the
7
- * category + OverpassQL export, and (when a live-search probe is injected) searches the published
8
- * poi.db layer. The intent path is self-contained — no weights, no network. All runtime concerns are
9
- * in {@link usePOISearch}; this file is composition + a `ClientOnly` SSR boundary.
10
5
  */
11
6
 
12
7
  import { type ReactNode, useState } from "react"
@@ -24,27 +19,35 @@ import { OverpassBlock } from "./OverpassBlock.tsx"
24
19
  import { QueryInput } from "./QueryInput.tsx"
25
20
  import { SubjectPanel } from "./SubjectPanel.tsx"
26
21
 
22
+ /**
23
+ * Props for {@linkcode POIExplorer}.
24
+ */
27
25
  export interface POIExplorerProps {
28
26
  /**
29
- * Query to pre-fill in the input.
27
+ * The query that pre-fills the input.
30
28
  */
31
29
  defaultText?: string
32
30
  /**
33
- * Example chips. @default the built-in POI presets
31
+ * The example chips.
32
+ *
33
+ * @default POI_PRESETS
34
34
  */
35
35
  presets?: ReadonlyArray<Preset>
36
36
  /**
37
- * Override the taxonomy-runtime loader (stories/tests inject a mock).
37
+ * A replacement loader for the taxonomy runtime, such as a mock in stories and tests.
38
38
  */
39
39
  loadRuntime?: LoadPOIRuntime
40
40
  /**
41
- * Live poi.db probe. Absent ⇒ intent-only (no live-results affordance).
41
+ * The live poi.db search.
42
+ * Without it, the explorer shows only the detected intent.
42
43
  */
43
44
  runLiveSearch?: POILiveSearch
44
45
  /**
45
- * Whether {@link runLiveSearch} can serve BRAND subjects (fetch by QID). Default false: a brand subject shows the
46
- * intent + QID chip but no live block. The docs' httpvfs probe leaves this off (brand-wide byte-range hydration is
47
- * pathological — measured); a server-side backend can enable it.
46
+ * Whether {@link runLiveSearch} can search brand subjects by Wikidata QID.
47
+ *
48
+ * When it is false, a brand subject shows its intent and QID chip without a live block.
49
+ * A byte-range probe over httpvfs should leave it off because a brand-wide
50
+ * lookup reads too much of the database.
48
51
  */
49
52
  brandLiveSearch?: boolean
50
53
  }
@@ -72,9 +75,8 @@ function POIExplorerInner({
72
75
 
73
76
  const subject = result?.subject
74
77
 
75
- // The live block appears whenever the subject COULD be live-searched with an anchor — i.e. capable minus the
76
- // anchor-present requirement (`canSearchLive` also requires an anchor; the block itself renders the "add an anchor"
77
- // hint, so it must show one step earlier). Category: not build-local. Brand: brand-capable probe + a QID.
78
+ // A category is searchable unless it is build-local.
79
+ // A brand needs a QID and a brand-capable probe.
78
80
  const showLiveBlock = Boolean(
79
81
  runLiveSearch &&
80
82
  subject &&
@@ -115,6 +117,13 @@ function POIExplorerInner({
115
117
  )
116
118
  }
117
119
 
120
+ /**
121
+ * Renders a POI-intent tester that detects a POI subject in free text.
122
+ *
123
+ * It shows the matched category or brand and, for categories, an OverpassQL export.
124
+ * When `runLiveSearch` is set, it can also search the published poi.db.
125
+ * It renders only on the client.
126
+ */
118
127
  export function POIExplorer({
119
128
  defaultText = POI_DEFAULT_TEXT,
120
129
  presets = POI_PRESETS,
@@ -3,7 +3,7 @@
3
3
  * @license AGPL-3.0
4
4
  * @author Teffen Ellis, et al.
5
5
  *
6
- * `QueryInput` — the labelled text field for the POI explorer. Controlled; presentational only.
6
+ * `QueryInput` — the labeled text field for the POI explorer. Controlled. presentational only.
7
7
  */
8
8
 
9
9
  import type { ReactNode } from "react"
@@ -3,8 +3,8 @@
3
3
  * @license AGPL-3.0
4
4
  * @author Teffen Ellis, et al.
5
5
  *
6
- * `SubjectPanel` — renders the detected POI subject. For a CATEGORY: the category chip, the optional
7
- * build-local badge + note. For a BRAND: the brand-name chip + a Wikidata QID chip (linked). Both
6
+ * `SubjectPanel` — renders the detected POI subject. For a category: the category chip, the optional
7
+ * build-local badge + note. For a brand: the brand-name chip + a Wikidata QID chip (linked). Both
8
8
  * share the match-detail list (matched phrase, confidence, anchor). Presentational.
9
9
  */
10
10
 
@@ -17,7 +17,8 @@ export interface SubjectPanelProps {
17
17
  }
18
18
 
19
19
  /**
20
- * The shared match-detail list (matched phrase, confidence, anchor) — identical for category + brand subjects.
20
+ * The shared match-detail list (matched phrase, confidence, anchor) —
21
+ * identical for category + brand subjects.
21
22
  */
22
23
  function MatchDetail({ subject }: SubjectPanelProps): ReactNode {
23
24
  return (
@@ -2,11 +2,6 @@
2
2
  * @copyright Sister Software
3
3
  * @license AGPL-3.0
4
4
  * @author Teffen Ellis, et al.
5
- *
6
- * The default POI runtime loader + presentation helpers. `loadPOIRuntime` dynamically imports the
7
- * ~2k-record Overture taxonomy snapshot (so bundlers code-split it into its own chunk, fetched only
8
- * when the explorer actually mounts) and wires the kind classifier over it. Pure + browser-safe: no
9
- * network, no DOM — the whole intent path runs offline.
10
5
  */
11
6
 
12
7
  import { createKindClassifier } from "@mailwoman/kind-classifier"
@@ -16,14 +11,10 @@ import { createPOIBrandLookup, createPOITaxonomyLookup } from "@mailwoman/poi-ta
16
11
  import type { POIRuntime } from "#poi/types"
17
12
 
18
13
  /**
19
- * Build the POI runtime, dynamically importing the taxonomy + brand JSON so the tables land in their own chunk. A
20
- * static import would inline the whole snapshot into every consumer's bundle.
14
+ * Loads the browser POI runtime, importing the taxonomy and brand tables dynamically
15
+ * so they land in their own chunk instead of every consumer's bundle.
21
16
  *
22
- * The lexicon unions categories then brands, mirroring the Node runtime's `poiTaxonomyLookup` precedence: a phrase that
23
- * matches a taxonomy CATEGORY wins (the curated set); only on a category miss does the chain-brand table fire,
24
- * returning a `kind: "brand"` match carrying the brand's canonical name + Wikidata QID. (The Node path also chains
25
- * `@mailwoman/variant-aliases` regional slang; the browser tester leaves that out — one fewer package + data table for
26
- * a demo, and the QID-keyed brand table already covers the headline brands.)
17
+ * Its lexicon tries exact categories and then brands only, a subset of the Node `poiTaxonomyLookup` chain.
27
18
  */
28
19
  export async function loadPOIRuntime(): Promise<POIRuntime> {
29
20
  const [table, brandTable] = await Promise.all([
@@ -34,8 +25,6 @@ export async function loadPOIRuntime(): Promise<POIRuntime> {
34
25
  const lookup = createPOITaxonomyLookup(table as Parameters<typeof createPOITaxonomyLookup>[0])
35
26
  const brands = createPOIBrandLookup(brandTable as Parameters<typeof createPOIBrandLookup>[0])
36
27
 
37
- // Adapt the taxonomy + brand lookups to the `POIPhraseLookup` shape the classifier expects: categories first, brands
38
- // on a category miss.
39
28
  const lexicon: POIPhraseLookup = (phrase, locale) => {
40
29
  const categoryHits = lookup.lookupPOICategory(phrase, locale)
41
30
 
@@ -61,7 +50,7 @@ export async function loadPOIRuntime(): Promise<POIRuntime> {
61
50
  }
62
51
 
63
52
  /**
64
- * Default example queries for the POI explorer — a mix of category, build-local, and chain-brand subjects.
53
+ * Default example queries for the POI explorer — a mix of category, build-local and chain-brand subjects.
65
54
  */
66
55
  export const POI_PRESETS = [
67
56
  { label: "Drinking fountain", value: "drinking fountain near Springfield" },
@@ -72,7 +61,7 @@ export const POI_PRESETS = [
72
61
  ] as const
73
62
 
74
63
  /**
75
- * Query the POI explorer opens on — the first preset, so the two stay in step.
64
+ * Holds the query the POI explorer opens on, taken from the first preset so the two stay in step.
76
65
  */
77
66
  export const POI_DEFAULT_TEXT = POI_PRESETS[0].value
78
67
 
package/lib/poi/types.ts CHANGED
@@ -3,22 +3,26 @@
3
3
  * @license AGPL-3.0
4
4
  * @author Teffen Ellis, et al.
5
5
  *
6
- * Types for the POI explorer. The intent path (classification → subject → OverpassQL) is fully
7
- * self-contained over the pure `@mailwoman/*` packages; the live poi.db path is expressed only as an
8
- * INJECTED async function ({@link POILiveSearch}) so the httpvfs/worker implementation stays out of this
9
- * package's browser graph (it lives in the docs site, which knows where the layer is served).
6
+ * Types for the POI explorer. Live poi.db search is injected as {@link POILiveSearch} so the httpvfs
7
+ * worker stays out of this package's browser graph.
10
8
  */
11
9
 
12
10
  import type { QueryKindResult } from "@mailwoman/core/pipeline"
13
11
  import type { POIPhraseLookup, createKindClassifier } from "@mailwoman/kind-classifier"
14
12
  import type { createPOITaxonomyLookup } from "@mailwoman/poi-taxonomy/table"
15
13
 
14
+ /**
15
+ * The POI taxonomy lookup that the explorer runtime loads.
16
+ */
16
17
  export type TaxonomyLookup = ReturnType<typeof createPOITaxonomyLookup>
17
18
 
19
+ /**
20
+ * One taxonomy category record.
21
+ */
18
22
  export type CategoryRecord = NonNullable<ReturnType<TaxonomyLookup["getPOICategory"]>>
19
23
 
20
24
  /**
21
- * The lazily-loaded POI runtime: the taxonomy lookup, the adapted lexicon, and the kind classifier over it.
25
+ * The lazily loaded POI runtime holds the taxonomy lookup, the lexicon and the kind classifier.
22
26
  */
23
27
  export interface POIRuntime {
24
28
  lookup: TaxonomyLookup
@@ -33,27 +37,27 @@ export interface POISubjectBase {
33
37
  matchedPhrase: string
34
38
  confidence: number
35
39
  /**
36
- * The non-subject remainder of the query (the location anchor, e.g. "near Springfield").
40
+ * The rest of the query after the subject, usually the location anchor such as "near Springfield".
37
41
  */
38
42
  remainder: string
39
43
  }
40
44
 
41
45
  /**
42
- * A resolved POI subject that names a taxonomy CATEGORY (`cafe`, `hospital`, `drinking fountain`).
46
+ * A resolved POI subject that matched a taxonomy category such as `cafe` or `hospital`.
43
47
  */
44
48
  export interface POICategorySubject extends POISubjectBase {
45
49
  kind: "category"
46
50
  category: CategoryRecord
47
51
  /**
48
- * Whether this category needs the locally-built OSM (ODbL) layer — precomputed off the runtime.
52
+ * Whether this category requires the locally built OSM (ODbL) layer.
49
53
  */
50
54
  buildLocal: boolean
51
55
  }
52
56
 
53
57
  /**
54
- * A resolved POI subject that names a chain BRAND (`chevron`, `applebee's`). Brands carry a Wikidata QID and are
55
- * searched by that QID, NOT by category k-ring — see `@mailwoman/poi-taxonomy`'s brand table + the layer's
56
- * `brand_wikidata` index.
58
+ * A resolved POI subject that matched a chain brand such as `chevron`.
59
+ *
60
+ * Live search looks up a brand by its Wikidata QID instead of by category k-ring.
57
61
  */
58
62
  export interface POIBrandSubject extends POISubjectBase {
59
63
  kind: "brand"
@@ -62,18 +66,21 @@ export interface POIBrandSubject extends POISubjectBase {
62
66
  */
63
67
  name: string
64
68
  /**
65
- * Wikidata QID, when the lexicon carried one (`Q319642` = Chevron). Absent ⇒ matched by name alone.
69
+ * The brand's Wikidata QID.
70
+ * It is absent when the lexicon had no QID for the brand.
66
71
  */
67
72
  wikidata?: string
68
73
  }
69
74
 
70
75
  /**
71
- * A resolved POI subject — a taxonomy category or a chain brand — plus its match metadata.
76
+ * A resolved POI subject, either a taxonomy category or a chain brand.
72
77
  */
73
78
  export type POISubject = POICategorySubject | POIBrandSubject
74
79
 
75
80
  /**
76
- * The intent-only result: the kind verdict plus (when a subject was detected) its OverpassQL export (category only).
81
+ * The intent-only result.
82
+ *
83
+ * It holds the kind verdict and, when a category subject was detected, its OverpassQL export.
77
84
  */
78
85
  export interface POIExplorerResult {
79
86
  kindResult: QueryKindResult
@@ -95,8 +102,10 @@ export interface POISearchHit {
95
102
  }
96
103
 
97
104
  /**
98
- * Result of an injected live search. Preserves the original tester's two failure modes — the anchor not resolving vs
99
- * the published layer being unreachable — so the UI can word them differently.
105
+ * The result of an injected live search.
106
+ *
107
+ * The `unplaced` and `unavailable` states stay separate so the UI can tell an
108
+ * unresolved anchor apart from an unreachable layer.
100
109
  */
101
110
  export type POILiveSearchResult =
102
111
  | { status: "success"; hits: POISearchHit[]; centerName: string }
@@ -104,28 +113,30 @@ export type POILiveSearchResult =
104
113
  | { status: "unavailable" }
105
114
 
106
115
  /**
107
- * The injected live-search function. Given the resolved category (+ its Overture leaf fan-out) and the anchor text, it
108
- * probes the published poi.db and returns hits. Absent ⇒ the explorer runs intent-only (no "Search live" button).
116
+ * The injected live-search function.
117
+ *
118
+ * It probes the published poi.db for the resolved category, its Overture leaf
119
+ * categories and the anchor text.
120
+ * The explorer runs intent-only when this function is absent.
121
+ *
122
+ * For a brand subject, `brandWikidata` contains the QID and the probe fetches by it.
123
+ * In that case `categoryID` holds the brand name and `overtureCategoryIDs` is empty.
109
124
  *
110
- * Brand support is ADDITIVE: when the resolved subject is a chain brand, `brandWikidata` carries its QID and the probe
111
- * fetches by that QID instead of a category k-ring (`categoryID`/`overtureCategoryIDs` are then the brand name / empty
112
- * and unused). The category path is byte-identical to before. A probe that can't serve brands simply leaves brand live
113
- * search unwired at the call site (see `usePOISearch`'s `brandLiveSearch` option) — the docs' httpvfs probe does
114
- * exactly that, brand-wide row hydration being pathological over byte-range (measured; the brand path is server-side
115
- * only).
125
+ * A probe that cannot serve brands should leave `usePOISearch`'s `brandLiveSearch` option unset.
116
126
  */
117
127
  export type POILiveSearch = (params: {
118
128
  categoryID: string
119
129
  overtureCategoryIDs: string[]
120
130
  anchor: string
121
131
  /**
122
- * Present when the subject is a chain brand — the probe fetches by this QID, not a category k-ring.
132
+ * The brand's Wikidata QID.
133
+ * It is present only when the subject is a chain brand.
123
134
  */
124
135
  brandWikidata?: string
125
136
  }) => Promise<POILiveSearchResult>
126
137
 
127
138
  /**
128
- * "Search live" state machine.
139
+ * The state of a "Search live" request.
129
140
  */
130
141
  export type LiveSearchState =
131
142
  | { status: "idle" }
@@ -134,6 +145,7 @@ export type LiveSearchState =
134
145
  | { status: "success"; hits: POISearchHit[]; centerName: string }
135
146
 
136
147
  /**
137
- * A single-argument runtime loader — injectable so stories/tests can substitute a mock taxonomy.
148
+ * A runtime loader.
149
+ * Stories and tests inject one to substitute a mock taxonomy.
138
150
  */
139
151
  export type LoadPOIRuntime = () => Promise<POIRuntime>