@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,16 +3,7 @@
3
3
  * @license AGPL-3.0
4
4
  * @author Teffen Ellis, et al.
5
5
  *
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
- * `runParse` / `parseStageLabels` / `loading` contract is reused, and adds the map-specific surface
10
- * (style, overlays, initial center, viewport bias, backend/version selection). Phase 4 adds the
11
- * `resolveMapPlace` enricher, the {@link GeocoderPanels} injection bag, and the {@link CompareContext}.
12
- *
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 — `MapCanvas`, `Geocoder` —
15
- * are the ones behind the `@mailwoman/react/map` subpath).
6
+ * Types for the geocoder map surface. Its `react-map-gl/maplibre` imports are type-only, so the module stays node-safe.
16
7
  */
17
8
  import type { ParseResult, ResolvedPlaceView } from "@mailwoman/core/pipeline/client-result";
18
9
  import type { ReactNode } from "react";
@@ -21,48 +12,33 @@ import type { LngLat, ResolvedMapPlace } from "#map/place-render";
21
12
  import type { PipelineRuntime } from "#pipeline/types";
22
13
  import type { MapCanvasStyle } from "./MapCanvas.tsx";
23
14
  /**
24
- * `[longitude, latitude]`.
15
+ * An alias for {@link LngLat}.
25
16
  *
26
- * @deprecated Alias kept for existing imports — {@link LngLat} (from `@mailwoman/react/map`) is the canonical name.
17
+ * @deprecated Alias kept for existing imports — {@link LngLat}
18
+ * (from `@mailwoman/react/map`) is the canonical name.
27
19
  */
28
20
  export type LngLatTuple = LngLat;
29
21
  /**
30
22
  * A viewport bias handed to `runParse` — the map's current center (and optionally zoom) as a soft prior.
31
23
  */
32
24
  export interface MapBias {
33
- /**
34
- * Map center as `[lon, lat]`, typically read from `map.getCenter()`.
35
- */
36
25
  center: LngLat;
37
- /**
38
- * Current zoom, if the host wants distance-aware biasing.
39
- */
40
26
  zoom?: number;
41
27
  }
42
28
  /**
43
- * A host-supplied overlay: one map `<Source>` plus one or more `<Layer>`s laid over the basemap (coverage "fog of war",
44
- * race-dots, …). The host composes the specs; the package renders them declaratively in a later phase.
29
+ * A host-supplied overlay: one map `<Source>` plus one or more `<Layer>`s laid over the basemap.
45
30
  */
46
31
  export interface OverlaySpec {
47
32
  /**
48
33
  * Stable id — used as the `<Source>` id and the layer-id prefix.
49
34
  */
50
35
  id: string;
51
- /**
52
- * The map source spec (vector/geojson/raster).
53
- */
54
36
  source: SourceSpecification;
55
- /**
56
- * The layers drawn from that source.
57
- */
58
37
  layers: LayerSpecification[];
59
38
  /**
60
- * Whether the overlay is visible initially. @default true
39
+ * @default true
61
40
  */
62
41
  visible?: boolean;
63
- /**
64
- * Human label for a layer-toggle control.
65
- */
66
42
  label?: string;
67
43
  }
68
44
  /**
@@ -87,11 +63,12 @@ export interface Suggestion {
87
63
  */
88
64
  export interface VersionOption {
89
65
  /**
90
- * The version tag (e.g. a git tag or model-card version).
66
+ * The version tag, such as a git tag or model-card version.
91
67
  */
92
68
  version: string;
93
69
  /**
94
- * Display label; falls back to `version`.
70
+ * Display label.
71
+ * The picker falls back to `version`.
95
72
  */
96
73
  label?: string;
97
74
  }
@@ -100,32 +77,26 @@ export interface VersionOption {
100
77
  */
101
78
  export type InferenceBackend = "webgpu" | "wasm";
102
79
  /**
103
- * The injected geocoder runtime. Extends {@link PipelineRuntime} (shared `runParse` / `parseStageLabels` / `loading` /
104
- * `ready`) with the map + version/backend surface the geocoder needs. The host composes `mapStyle` (via cartographer's
105
- * `StyleSpecificationComposer` + the tile-worker TileJSON), supplies the overlay specs, the initial center (from
106
- * geolocation), the FST autocomplete, and the calibrator — nothing in the package imports `@mailwoman/cartographer`,
107
- * `@mailwoman/neural`'s web loader, httpvfs, or Docusaurus.
80
+ * The injected geocoder runtime extends {@link PipelineRuntime} with the map.
81
+ * It also supplies version and backend controls.
82
+ *
83
+ * The package imports no `@mailwoman/cartographer`, `@mailwoman/neural` web loader, httpvfs, or Docusaurus.
108
84
  */
109
85
  export interface GeocoderRuntime extends PipelineRuntime {
110
86
  /**
111
87
  * The composed basemap style (URL or `StyleSpecification`).
112
88
  */
113
89
  mapStyle: MapCanvasStyle;
114
- /**
115
- * Host-supplied overlays (coverage, race-dots, …).
116
- */
117
90
  overlays?: OverlaySpec[];
118
91
  /**
119
- * Initial map center as `[lon, lat]` (the host's browser-geolocation result).
92
+ * Initial map center as `[lon, lat]`.
120
93
  */
121
94
  initialCenter: LngLat;
122
- /**
123
- * Initial zoom for the first camera.
124
- */
125
95
  initialZoom?: number;
126
96
  /**
127
- * A bias-aware parse. The geocoder feeds the current viewport center as a soft prior; when absent the host falls back
128
- * to the base {@link PipelineRuntime.runParse}. Kept separate so the shared `runParse` contract is unchanged.
97
+ * A bias-aware parse that feeds the current viewport center as a soft prior.
98
+ *
99
+ * Absent, the host falls back to {@link PipelineRuntime.runParse}.
129
100
  */
130
101
  runParseWithBias?: (input: string, bias: MapBias | null, hooks: {
131
102
  onStage: (stage: number) => void;
@@ -139,20 +110,23 @@ export interface GeocoderRuntime extends PipelineRuntime {
139
110
  */
140
111
  calibrator?: (raw: number) => number | null;
141
112
  /**
142
- * Enrich the selected candidate into the richer {@link ResolvedMapPlace} the declarative map render consumes (bbox,
143
- * street tier + uncertainty, a pre-fetched crisp polygon) — the fields that live on the host's `ResolvedHit` but not
144
- * on the shared {@link ResolvedPlaceView}. The host owns this because those extras (and the async polygon fetch in the
145
- * real runtime) are host/gazetteer concerns; the package keeps {@link ParseResult} unpolluted. Absent → the candidate
146
- * renders as a bare point (marker + a mid-zoom fly-to). Returning `null` also renders nothing.
113
+ * Enrich the selected candidate into the richer {@link ResolvedMapPlace} the declarative
114
+ * map render consumes (bbox, street tier + uncertainty, a pre-fetched crisp polygon) —
115
+ * the fields that live on the host's `ResolvedHit` but not on the shared {@link ResolvedPlaceView}.
116
+ *
117
+ * The host owns this because those extras (and the async polygon fetch in the real runtime)
118
+ * are host/gazetteer concerns.
119
+ * The package keeps {@link ParseResult} unpolluted.
120
+ *
121
+ * Absent → the candidate renders as a bare point (marker + a mid-zoom fly-to).
122
+ *
123
+ * A `null` result also renders no overlay.
147
124
  */
148
125
  resolveMapPlace?: (candidate: ResolvedPlaceView, result: ParseResult) => ResolvedMapPlace | null;
149
126
  /**
150
127
  * The selectable model bundles the version picker offers.
151
128
  */
152
129
  availableVersions?: VersionOption[];
153
- /**
154
- * The currently-selected model version.
155
- */
156
130
  selectedVersion?: string;
157
131
  /**
158
132
  * Switch the active model bundle (re-loads weights/tokenizer/gazetteer).
@@ -163,26 +137,23 @@ export interface GeocoderRuntime extends PipelineRuntime {
163
137
  */
164
138
  activeBackend?: string;
165
139
  /**
166
- * Whether the CPU/WASM backend is currently forced (the controlled value for the backend toggle).
140
+ * Whether the CPU/wasm backend is currently forced (the controlled value for the backend toggle).
167
141
  */
168
142
  forceWASM?: boolean;
169
143
  /**
170
- * Force the WASM backend (opt out of WebGPU), for the backend toggle.
144
+ * Force the wasm backend (opt out of WebGPU), for the backend toggle.
171
145
  */
172
146
  setForceWASM?: (forceWASM: boolean) => void;
173
147
  }
174
148
  /**
175
- * The compare-mode state a {@link GeocoderPanels.compare} render-prop receives (the second parse itself stays
176
- * host-side).
149
+ * The compare-mode state a {@link GeocoderPanels.compare} render-prop receives.
150
+ * the second parse itself stays host-side.
177
151
  */
178
152
  export interface CompareContext {
179
153
  /**
180
154
  * The current primary parse result, or `null` before the first submit.
181
155
  */
182
156
  result: ParseResult | null;
183
- /**
184
- * Whether the compare toggle is on.
185
- */
186
157
  compareMode: boolean;
187
158
  /**
188
159
  * The version selected to compare against, or `null` when none is chosen.
@@ -190,38 +161,28 @@ export interface CompareContext {
190
161
  compareVersion: string | null;
191
162
  }
192
163
  /**
193
- * The state a {@link GeocoderPanels.result} render-prop receives, so a host can render its OWN result block (a
194
- * `<ResultPanel>` with its span-highlight / timing / hierarchy / precision detail) in place of the package's default
195
- * {@link ResultPanel}. Everything the default panel needs is passed through; the candidate-selection state stays owned
196
- * by the package (`useGeocode`).
164
+ * The state a {@link GeocoderPanels.result} render-prop receives, so a host can render its own result block.
165
+ *
166
+ * The candidate-selection state stays owned by the package (`useGeocode`).
197
167
  */
198
168
  export interface ResultContext {
199
- /**
200
- * The current parse+resolve result.
201
- */
202
169
  result: ParseResult;
203
170
  /**
204
171
  * The selected candidate (falls back to the first), enriched for the resolved-place detail.
205
172
  */
206
173
  selectedCandidate: ResolvedPlaceView | null;
207
- /**
208
- * The selected candidate index, for the picker's active state.
209
- */
210
174
  selectedCandidateIndex: number;
211
- /**
212
- * Fired when a candidate in the picker is chosen.
213
- */
214
175
  onSelectCandidate: (index: number) => void;
215
176
  }
216
177
  /**
217
- * Host-injected panels for {@link Geocoder}, the map analogue of `PipelinePanels`. Each is an already-rendered
218
- * `ReactNode` (or a thunk of the parse result / compare state) so the package needs neither the heavy host visualizers
219
- * (ModelVisualizer, VersionCompare, About, PermalinkButton) nor their data types. Every field is optional — the
220
- * fake-runtime Storybook stories pass none and still render the whole geocoder.
178
+ * Host-injected panels for {@link Geocoder}, the map analogue of `PipelinePanels`.
179
+ *
180
+ * Each is an already-rendered `ReactNode` or a thunk.
181
+ * Every field is optional.
221
182
  */
222
183
  export interface GeocoderPanels {
223
184
  /**
224
- * Rendered at the top of the control panel (e.g. the host's "About this geocoder").
185
+ * Rendered at the top of the control panel, such as the host's "About this geocoder".
225
186
  */
226
187
  header?: ReactNode;
227
188
  /**
@@ -229,13 +190,13 @@ export interface GeocoderPanels {
229
190
  */
230
191
  releaseInfo?: ReactNode;
231
192
  /**
232
- * Rendered at the bottom of the control panel (e.g. a guided tour).
193
+ * Rendered at the bottom of the control panel, such as a guided tour.
233
194
  */
234
195
  footer?: ReactNode;
235
196
  /**
236
- * A device-location / proximity-bias control, rendered between the query form and the autocomplete list (the "📍 Use
237
- * my location" row). Host-owned so the geolocation permission + the bias it feeds into the host's
238
- * {@link GeocoderRuntime.runParseWithBias} stay a host concern.
197
+ * A device-location / proximity-bias control, rendered between the query form and the autocomplete list.
198
+ *
199
+ * Host-owned because the geolocation permission feeds {@link GeocoderRuntime.runParseWithBias}.
239
200
  */
240
201
  bias?: ReactNode;
241
202
  /**
@@ -243,28 +204,27 @@ export interface GeocoderPanels {
243
204
  */
244
205
  extras?: (result: ParseResult) => ReactNode;
245
206
  /**
246
- * Rendered just above the result block (present or empty), for content that reads on THIS answer.
247
- *
248
- * A control that reads on the model rather than on an address belongs in {@link developerExtras}: above the result it
249
- * is the first thing a visitor meets, and on a phone it pushes the answer below the fold.
207
+ * Rendered just above the result block for content that reads on this answer. a
208
+ * control that reads on the model belongs in {@link developerExtras}.
250
209
  */
251
210
  aboveResult?: (context: {
252
211
  result: ParseResult | null;
253
212
  }) => ReactNode;
254
213
  /**
255
- * Host controls appended to the Developer sheet — the opt-in display toggles, whose state and the renderers they
256
- * drive both belong to the host.
214
+ * Host controls appended to the Developer sheet.
215
+ * The host owns their state and renderers.
257
216
  */
258
217
  developerExtras?: ReactNode;
259
218
  /**
260
- * Replace the package's default {@link ResultPanel} entirely. When provided, the host renders its own result block
261
- * (span highlight, timing, hierarchy, precision detail, calibrated confidences) from the {@link ResultContext}. Absent
262
- * → the built-in panel renders.
219
+ * Replaces the package's default {@link ResultPanel}.
220
+ *
221
+ * When absent, the built-in panel renders.
222
+ * When provided, the host renders from {@link ResultContext}.
263
223
  */
264
224
  result?: (context: ResultContext) => ReactNode;
265
225
  /**
266
- * Rendered in place of the resolved-place panel when nothing resolved (host's FailureDiagnostic). Ignored when
267
- * {@link result} is set.
226
+ * Rendered in place of the resolved-place panel when no place resolved. ignored
227
+ * when {@link result} is set.
268
228
  */
269
229
  failure?: (result: ParseResult) => ReactNode;
270
230
  /**
@@ -272,9 +232,8 @@ export interface GeocoderPanels {
272
232
  */
273
233
  compare?: (context: CompareContext) => ReactNode;
274
234
  /**
275
- * The model-visualizer / debug drawer, mounted beside the map (host's ModelVisualizer). A render-prop so the host can
276
- * trace the CURRENT result (its input) — the package passes the live parse result; the host decides on its own
277
- * dev-mode state and returns `null` when the drawer is closed.
235
+ * The model-visualizer / debug drawer mounted beside the map, as a render-prop
236
+ * receiving the live result and returning `null` when closed.
278
237
  */
279
238
  debugDrawer?: (context: {
280
239
  result: ParseResult | null;
@@ -284,11 +243,8 @@ export interface GeocoderPanels {
284
243
  */
285
244
  mapControls?: ReactNode;
286
245
  /**
287
- * A layer control, rendered in the chrome's top column under the example chips rather than in a MapLibre corner.
288
- *
289
- * A render-prop taking the live map handle, because a layer control reads `getStyle().layers` and writes
290
- * `setLayoutProperty` — it cannot be a static node. The handle is `null` until the map instantiates, so the host
291
- * returns `null` for that first frame rather than rendering an empty control.
246
+ * A layer control rendered in the chrome's top column, as a render-prop over the
247
+ * live map handle (null until the map instantiates).
292
248
  */
293
249
  layers?: (context: {
294
250
  map: MapInstance | null;
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../lib/map/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,iBAAiB,EAAE,MAAM,wCAAwC,CAAA;AAC5F,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AACtC,OAAO,KAAK,EAAE,kBAAkB,EAAE,WAAW,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAA;AAEjG,OAAO,KAAK,EAAE,MAAM,EAAE,gBAAgB,EAAE,MAA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;IACpE;;OAEG;IACH,WAAW,CAAC,EAAE,SAAS,CAAA;IACvB;;;OAGG;IACH,MAAM,CAAC,EAAE,CAAC,OAAO,EAAE;QAAE,GAAG,EAAE,WAAW,GAAG,IAAI,CAAA;KAAE,KAAK,SAAS,CAAA;IAC5D;;OAEG;IACH,SAAS,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,SAAS,CAAA;CACvC"}
package/out/map/types.js CHANGED
@@ -3,16 +3,7 @@
3
3
  * @license AGPL-3.0
4
4
  * @author Teffen Ellis, et al.
5
5
  *
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
- * `runParse` / `parseStageLabels` / `loading` contract is reused, and adds the map-specific surface
10
- * (style, overlays, initial center, viewport bias, backend/version selection). Phase 4 adds the
11
- * `resolveMapPlace` enricher, the {@link GeocoderPanels} injection bag, and the {@link CompareContext}.
12
- *
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 — `MapCanvas`, `Geocoder` —
15
- * are the ones behind the `@mailwoman/react/map` subpath).
6
+ * Types for the geocoder map surface. Its `react-map-gl/maplibre` imports are type-only, so the module stays node-safe.
16
7
  */
17
8
  export {};
18
9
  //# sourceMappingURL=types.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../lib/map/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG"}
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../lib/map/types.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG"}
@@ -4,9 +4,9 @@
4
4
  * @author Teffen Ellis, et al.
5
5
  *
6
6
  * `useCompareState` — the small headless state machine behind the demo's compare toggle
7
- * (`_app.tsx:142-143, 1238-1305`): whether compare mode is on, and which version to compare against.
8
- * Turning compare off clears the chosen version; selecting a compare version equal to the primary is
9
- * rejected (the picker filters it out, this guards the programmatic path). The SECOND parse itself is a
7
+ * (`_app.tsx:142-143, 1238-1305`): whether compare mode is on and which version to compare against.
8
+ * The off state clears the chosen version. A selected compare version equal to the primary is
9
+ * rejected (the picker filters it out, this guards the programmatic path). The second parse itself is a
10
10
  * host concern surfaced through `panels.compare` — this hook owns only the toggle + selection.
11
11
  */
12
12
  export interface UseCompareState {
@@ -19,7 +19,8 @@ export interface UseCompareState {
19
19
  */
20
20
  compareVersion: string | null;
21
21
  /**
22
- * Flip compare mode; turning it off clears the chosen version.
22
+ * Flip compare mode.
23
+ * The off state clears the chosen version.
23
24
  */
24
25
  setCompareMode: (compareMode: boolean) => void;
25
26
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"useCompareState.d.ts","sourceRoot":"","sources":["../../lib/map/useCompareState.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAIH,MAAM,WAAW,eAAe;IAC/B;;OAEG;IACH,WAAW,EAAE,OAAO,CAAA;IACpB;;OAEG;IACH,cAAc,EAAE,MAAM,GAAG,IAAI,CAAA;IAC7B;;OAEG;IACH,cAAc,EAAE,CAAC,WAAW,EAAE,OAAO,KAAK,IAAI,CAAA;IAC9C;;OAEG;IACH,iBAAiB,EAAE,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,KAAK,IAAI,CAAA;IACnD;;OAEG;IACH,cAAc,EAAE,CAAC,cAAc,EAAE,MAAM,KAAK,IAAI,CAAA;CAChD;AAED,wBAAgB,eAAe,IAAI,eAAe,CAiBjD"}
1
+ {"version":3,"file":"useCompareState.d.ts","sourceRoot":"","sources":["../../lib/map/useCompareState.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAIH,MAAM,WAAW,eAAe;IAC/B;;OAEG;IACH,WAAW,EAAE,OAAO,CAAA;IACpB;;OAEG;IACH,cAAc,EAAE,MAAM,GAAG,IAAI,CAAA;IAC7B;;;OAGG;IACH,cAAc,EAAE,CAAC,WAAW,EAAE,OAAO,KAAK,IAAI,CAAA;IAC9C;;OAEG;IACH,iBAAiB,EAAE,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,KAAK,IAAI,CAAA;IACnD;;OAEG;IACH,cAAc,EAAE,CAAC,cAAc,EAAE,MAAM,KAAK,IAAI,CAAA;CAChD;AAED,wBAAgB,eAAe,IAAI,eAAe,CAiBjD"}
@@ -4,9 +4,9 @@
4
4
  * @author Teffen Ellis, et al.
5
5
  *
6
6
  * `useCompareState` — the small headless state machine behind the demo's compare toggle
7
- * (`_app.tsx:142-143, 1238-1305`): whether compare mode is on, and which version to compare against.
8
- * Turning compare off clears the chosen version; selecting a compare version equal to the primary is
9
- * rejected (the picker filters it out, this guards the programmatic path). The SECOND parse itself is a
7
+ * (`_app.tsx:142-143, 1238-1305`): whether compare mode is on and which version to compare against.
8
+ * The off state clears the chosen version. A selected compare version equal to the primary is
9
+ * rejected (the picker filters it out, this guards the programmatic path). The second parse itself is a
10
10
  * host concern surfaced through `panels.compare` — this hook owns only the toggle + selection.
11
11
  */
12
12
  import { useCallback, useState } from "react";
@@ -1 +1 @@
1
- {"version":3,"file":"useCompareState.js","sourceRoot":"","sources":["../../lib/map/useCompareState.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AAyB7C,MAAM,UAAU,eAAe;IAC9B,MAAM,CAAC,WAAW,EAAE,mBAAmB,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAA;IAC1D,MAAM,CAAC,cAAc,EAAE,iBAAiB,CAAC,GAAG,QAAQ,CAAgB,IAAI,CAAC,CAAA;IAEzE,MAAM,cAAc,GAAG,WAAW,CAAC,CAAC,IAAa,EAAE,EAAE;QACpD,mBAAmB,CAAC,IAAI,CAAC,CAAA;QAEzB,IAAI,CAAC,IAAI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AE,EAAE,CAAC,CAAA;IAEN,OAAO,EAAE,WAAW,EAAE,cAAc,EAAE,cAAc,EAAE,iBAAiB,EAAE,cAAc,EAAE,CAAA;AAC1F,CAAC"}
@@ -3,12 +3,12 @@
3
3
  * @license AGPL-3.0
4
4
  * @author Teffen Ellis, et al.
5
5
  *
6
- * `useGeocode` — the parse+resolve state machine for the geocoder map. 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
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
- * an injected `getBias`, itself reading the `MapRef`) rides along as a soft proximity prior. The
11
+ * an injected `getBias`, itself reading the `MapRef`) supplies a soft proximity prior. The
12
12
  * bias is injected by deriving a `runParse` that binds it, so `useParsePipeline` is reused verbatim.
13
13
  * 2. The map render place — the selected candidate, enriched by the host's `resolveMapPlace` into the
14
14
  * richer {@link ResolvedMapPlace} the declarative overlays consume (bbox / tier / polygon). Absent
@@ -30,7 +30,9 @@ export interface UseGeocodeOptions {
30
30
  */
31
31
  defaultText: string;
32
32
  /**
33
- * Read the current viewport bias (the map center) at submit time. Absent → no bias.
33
+ * Read the current viewport bias (the map center) at submit time.
34
+ *
35
+ * Absent → no bias.
34
36
  */
35
37
  getBias?: () => MapBias | null;
36
38
  }
@@ -1 +1 @@
1
- {"version":3,"file":"useGeocode.d.ts","sourceRoot":"","sources":["../../lib/map/useGeocode.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAIH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAA;AACzD,OAAO,KAAK,EAAE,eAAe,EAAE,OAAO,EAAE,MAAM,YAAY,CAAA;AAE1D,OAAO,EAAoB,KAAK,gBAAgB,EAAE,MAAM,4BAA4B,CAAA;AAEpF,MAAM,WAAW,iBAAiB;IACjC;;OAEG;IACH,OAAO,EAAE,eAAe,CAAA;IACxB;;OAEG;IACH,WAAW,EAAE,MAAM,CAAA;IACnB;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,OAAO,GAAG,IAAI,CAAA;CAC9B;AAED,MAAM,WAAW,UAAW,SAAQ,gBAAgB;IACnD;;OAEG;IACH,QAAQ,EAAE,gBAAgB,GAAG,IAAI,CAAA;CACjC;AAED,wBAAgB,UAAU,CAAC,EAAE,OAAO,EAAE,WAAW,EAAE,OAAO,EAAE,EAAE,iBAAiB,GAAG,UAAU,CAyB3F"}
1
+ {"version":3,"file":"useGeocode.d.ts","sourceRoot":"","sources":["../../lib/map/useGeocode.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAIH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAA;AACzD,OAAO,KAAK,EAAE,eAAe,EAAE,OAAO,EAAE,MAAM,YAAY,CAAA;AAE1D,OAAO,EAAoB,KAAK,gBAAgB,EAAE,MAAM,4BAA4B,CAAA;AAEpF,MAAM,WAAW,iBAAiB;IACjC;;OAEG;IACH,OAAO,EAAE,eAAe,CAAA;IACxB;;OAEG;IACH,WAAW,EAAE,MAAM,CAAA;IACnB;;;;OAIG;IACH,OAAO,CAAC,EAAE,MAAM,OAAO,GAAG,IAAI,CAAA;CAC9B;AAED,MAAM,WAAW,UAAW,SAAQ,gBAAgB;IACnD;;OAEG;IACH,QAAQ,EAAE,gBAAgB,GAAG,IAAI,CAAA;CACjC;AAED,wBAAgB,UAAU,CAAC,EAAE,OAAO,EAAE,WAAW,EAAE,OAAO,EAAE,EAAE,iBAAiB,GAAG,UAAU,CAyB3F"}
@@ -3,12 +3,12 @@
3
3
  * @license AGPL-3.0
4
4
  * @author Teffen Ellis, et al.
5
5
  *
6
- * `useGeocode` — the parse+resolve state machine for the geocoder map. 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
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
- * an injected `getBias`, itself reading the `MapRef`) rides along as a soft proximity prior. The
11
+ * an injected `getBias`, itself reading the `MapRef`) supplies a soft proximity prior. The
12
12
  * bias is injected by deriving a `runParse` that binds it, so `useParsePipeline` is reused verbatim.
13
13
  * 2. The map render place — the selected candidate, enriched by the host's `resolveMapPlace` into the
14
14
  * richer {@link ResolvedMapPlace} the declarative overlays consume (bbox / tier / polygon). Absent
@@ -20,8 +20,8 @@
20
20
  import { useMemo } from "react";
21
21
  import { useParsePipeline } from "#pipeline/useParsePipeline";
22
22
  export function useGeocode({ runtime, defaultText, getBias }) {
23
- // Bind the viewport bias into a derived `runParse` so `useParsePipeline` is reused unchanged. When the runtime has no
24
- // bias-aware parse, pass it straight through.
23
+ // Bind the viewport bias into a derived `runParse` so `useParsePipeline` is reused unchanged.
24
+ // When the runtime has no bias-aware parse, pass it straight through.
25
25
  const geoRuntime = useMemo(() => {
26
26
  const withBias = runtime.runParseWithBias;
27
27
  if (!withBias)
@@ -1 +1 @@
1
- {"version":3,"file":"useGeocode.js","sourceRoot":"","sources":["../../lib/map/useGeocode.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,OAAO,CAAA;AAK/B,OAAO,EAAE,gBAAgB,EAAyB,MAAM,4BAA4B,CAAA;AAwBpF,MAAM,UAAU,UAAU,CAAC,EAAE,OAAO,EAAE,WAAW,EAAE,OAAO,EAAqB;IAC9E,sHAAsH;IACtH,8CAA8C;IAC9C,MAAM,UAAU,GAAG,OAAO,CAAkB,GAAG,EAAE;QAChD,MAAM,QAAQ,GAAG,OAAO,CAAC,gBAAgB,CAAA;QAEzC,IAAI,CAAC,QAAQ;YAAE,OAAO,OAAO,C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AC,gBAAgB,CAAA;QAEzC,IAAI,CAAC,QAAQ;YAAE,OAAO,OAAO,CAAA;QAE7B,OAAO;YACN,GAAG,OAAO;YACV,QAAQ,EAAE,CAAC,KAAK,EAAE,KAAK,EAAE,EAAE,CAAC,QAAQ,CAAC,KAAK,EAAE,OAAO,EAAE,EAAE,IAAI,IAAI,EAAE,KAAK,CAAC;SACvE,CAAA;IACF,CAAC,EAAE,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC,CAAA;IAEtB,MAAM,QAAQ,GAAG,gBAAgB,CAAC,EAAE,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,CAAC,CAAA;IAEvE,MAAM,QAAQ,GAAG,OAAO,CAA0B,GAAG,EAAE;QACtD,IAAI,CAAC,QAAQ,CAAC,iBAAiB,IAAI,CAAC,QAAQ,CAAC,MAAM;YAAE,OAAO,IAAI,CAAA;QAEhE,OAAO,OAAO,CAAC,eAAe;YAC7B,CAAC,CAAC,OAAO,CAAC,eAAe,CAAC,QAAQ,CAAC,iBAAiB,EAAE,QAAQ,CAAC,MAAM,CAAC;YACtE,CAAC,CAAC,QAAQ,CAAC,iBAAiB,CAAA;IAC9B,CAAC,EAAE,CAAC,QAAQ,CAAC,iBAAiB,EAAE,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAA;IAE1D,OAAO,EAAE,GAAG,QAAQ,EAAE,QAAQ,EAAE,CAAA;AACjC,CAAC"}
@@ -3,26 +3,26 @@
3
3
  * @license AGPL-3.0
4
4
  * @author Teffen Ellis, et al.
5
5
  *
6
- * `useMapBearing` — the map's rotation as React state, for a compass that appears off north and fades back.
7
- *
8
- * The map is an external store, so it is read through `useSyncExternalStore` rather than mirrored into state by an
9
- * effect: the bearing is a number, which makes a stable snapshot, and React tears nothing during a concurrent
10
- * render.
11
- *
12
- * It listens on `rotate` rather than `rotateend`, because the needle has to track the gesture rather than snap once
13
- * the gesture is over. `move` is subscribed too: a `flyTo` or an `easeTo` carrying a bearing rotates the map without
14
- * firing a rotate event, and a compass that misses those stays pointing north over a turned map.
6
+ * The map's rotation as React state, read through `useSyncExternalStore` and subscribed to `move` as well as `rotate`, since a `flyTo` or `easeTo` carrying a direction fires no rotate event.
15
7
  */
16
8
  import type { MapInstance } from "react-map-gl/maplibre";
9
+ /**
10
+ * The map's bearing and a callback that returns the map to north.
11
+ */
17
12
  export interface UseMapBearing {
18
13
  /**
19
- * Degrees off north, as MapLibre reports it. Zero while there is no map.
14
+ * Degrees off north, as MapLibre reports it.
15
+ * Zero while there is no map.
20
16
  */
21
17
  bearing: number;
22
18
  /**
23
- * Rotate the map back to north. A no-op while there is no map.
19
+ * Rotate the map back to north.
20
+ * A no-op while there is no map.
24
21
  */
25
22
  resetNorth: () => void;
26
23
  }
24
+ /**
25
+ * Reads the live map bearing and exposes `resetNorth`.
26
+ */
27
27
  export declare function useMapBearing(map: MapInstance | null): UseMapBearing;
28
28
  //# sourceMappingURL=useMapBearing.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"useMapBearing.d.ts","sourceRoot":"","sources":["../../lib/map/useMapBearing.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAGH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAA;AAExD,MAAM,WAAW,aAAa;IAC7B;;OAEG;IACH,OAAO,EAAE,MAAM,CAAA;IACf;;OAEG;IACH,UAAU,EAAE,MAAM,IAAI,CAAA;CACtB;AAED,wBAAgB,aAAa,CAAC,GAAG,EAAE,WAAW,GAAG,IAAI,GAAG,aAAa,CAyBpE"}
1
+ {"version":3,"file":"useMapBearing.d.ts","sourceRoot":"","sources":["../../lib/map/useMapBearing.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAA;AAExD;;GAEG;AACH,MAAM,WAAW,aAAa;IAC7B;;;OAGG;IACH,OAAO,EAAE,MAAM,CAAA;IACf;;;OAGG;IACH,UAAU,EAAE,MAAM,IAAI,CAAA;CACtB;AAED;;GAEG;AACH,wBAAgB,aAAa,CAAC,GAAG,EAAE,WAAW,GAAG,IAAI,GAAG,aAAa,CAyBpE"}
@@ -3,17 +3,12 @@
3
3
  * @license AGPL-3.0
4
4
  * @author Teffen Ellis, et al.
5
5
  *
6
- * `useMapBearing` — the map's rotation as React state, for a compass that appears off north and fades back.
7
- *
8
- * The map is an external store, so it is read through `useSyncExternalStore` rather than mirrored into state by an
9
- * effect: the bearing is a number, which makes a stable snapshot, and React tears nothing during a concurrent
10
- * render.
11
- *
12
- * It listens on `rotate` rather than `rotateend`, because the needle has to track the gesture rather than snap once
13
- * the gesture is over. `move` is subscribed too: a `flyTo` or an `easeTo` carrying a bearing rotates the map without
14
- * firing a rotate event, and a compass that misses those stays pointing north over a turned map.
6
+ * The map's rotation as React state, read through `useSyncExternalStore` and subscribed to `move` as well as `rotate`, since a `flyTo` or `easeTo` carrying a direction fires no rotate event.
15
7
  */
16
8
  import { useCallback, useSyncExternalStore } from "react";
9
+ /**
10
+ * Reads the live map bearing and exposes `resetNorth`.
11
+ */
17
12
  export function useMapBearing(map) {
18
13
  const subscribe = useCallback((onChange) => {
19
14
  if (!map)
@@ -25,8 +20,8 @@ export function useMapBearing(map) {
25
20
  map.off("move", onChange);
26
21
  };
27
22
  }, [map]);
28
- // The server snapshot is the same reading: there is no map during a server render, and north is what a compass
29
- // shows when it has nothing to report.
23
+ // The server snapshot is the same reading: the server renders no map.
24
+ // and north is what a compass shows with no bearing to report.
30
25
  const readBearing = useCallback(() => map?.getBearing() ?? 0, [map]);
31
26
  const bearing = useSyncExternalStore(subscribe, readBearing, () => 0);
32
27
  const resetNorth = useCallback(() => map?.easeTo({ bearing: 0, pitch: 0 }), [map]);
@@ -1 +1 @@
1
- {"version":3,"file":"useMapBearing.js","sourceRoot":"","sources":["../../lib/map/useMapBearing.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,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,aAAa,CAAC,GAAuB;IACpD,MAAM,SAAS,GAAG,WAAW,CAC5B,CAAC,QAAoB,EAAE,EAAE;QACxB,IAAI,CAAC,GAAG;YAAE,OAAO,GAAG,EAAE,CAAC,SAAS,CAAA;QAEhC,GAAG,CAAC,EAAE,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAA;QAC1B,GAAG,CAAC,EAAE,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAA;QAExB,OAAO,GAAG,EAAE;YACX,GAAG,CAAC,GAAG,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAA;YAC3B,GAAG,CAAC,GAAG,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAA;QAC1B,CAAC,CAAA;IACF,CAAC,EACD,CAAC,GAAG,CAAC,CACL,CAAA;IAED,sEAAsE;IACtE,+DAA+D;IAC/D,MAAM,WAAW,GAAG,WAAW,CAAC,GAAG,EAAE,CAAC,GAAG,EAAE,UAAU,EAAE,IAAI,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,CAAA;IAEpE,MAAM,OAAO,GAAG,oBAAoB,CAAC,SAAS,EAAE,WAAW,EAAE,GAAG,EAAE,CAAC,CAAC,CAAC,CAAA;IAErE,MAAM,UAAU,GAAG,WAAW,CAAC,GAAG,EAAE,CAAC,GAAG,EAAE,MAAM,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,CAAA;IAElF,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,CAAA;AAC/B,CAAC"}
@@ -3,21 +3,11 @@
3
3
  * @license AGPL-3.0
4
4
  * @author Teffen Ellis, et al.
5
5
  *
6
- * `useMapLabelPick` — clicking a place label on the map searches for it, the way the reference map apps behave.
7
- *
8
- * A label on a map looks like a link, so a visitor clicks it. Without this the click reaches the map's pan handler
9
- * and nothing happens, which reads as the label being decoration.
10
- *
11
- * It reads the label's OWN name from the rendered feature rather than reverse-geocoding the click point: the name
12
- * is what the visitor pointed at, and a lookup by coordinate answers whatever is nearest instead, which on a dense
13
- * basemap is regularly not the thing under the cursor.
14
- *
15
- * THE QUERY IS SCOPED, AND THE HOVER QUERY IS THROTTLED. `queryRenderedFeatures` with no `layers` walks the whole
16
- * style: measured at 64.3 ms per call returning 4,819 features over the 79-layer basemap at zoom 14 in Manhattan,
17
- * against 4.9 ms and 44 features scoped to that style's 11 label layers. At one call per pointer move the unscoped
18
- * form is the map's whole frame budget, so the layer list is resolved once per style and the hover query runs at
19
- * most once per animation frame. The click query is not throttled — there is one of those per click.
6
+ * A place-label click searches for its own name. The hook resolves the layer list once per style and throttles the hover query to one per animation frame.
20
7
  */
21
8
  import type { MapInstance } from "react-map-gl/maplibre";
9
+ /**
10
+ * Routes clicks on map labels to `onPick` with the clicked label's own name.
11
+ */
22
12
  export declare function useMapLabelPick(map: MapInstance | null, onPick: (name: string) => void): void;
23
13
  //# sourceMappingURL=useMapLabelPick.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"useMapLabelPick.d.ts","sourceRoot":"","sources":["../../lib/map/useMapLabelPick.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAGH,OAAO,KAAK,EAAE,WAAW,EAAsB,MAAM,uBAAuB,CAAA;AA2C5E,wBAAgB,eAAe,CAAC,GAAG,EAAE,WAAW,GAAG,IAAI,EAAE,MAAM,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,GAAG,IAAI,CAyD7F"}
1
+ {"version":3,"file":"useMapLabelPick.d.ts","sourceRoot":"","sources":["../../lib/map/useMapLabelPick.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,KAAK,EAAE,WAAW,EAAsB,MAAM,uBAAuB,CAAA;AA2C5E;;GAEG;AACH,wBAAgB,eAAe,CAAC,GAAG,EAAE,WAAW,GAAG,IAAI,EAAE,MAAM,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,GAAG,IAAI,CA0D7F"}