@mailwoman/react 9.4.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 (370) hide show
  1. package/README.md +17 -16
  2. package/fonts.css +97 -22
  3. package/lib/common/About.tsx +87 -71
  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 -112
  15. package/lib/map/AppIdentity.tsx +85 -0
  16. package/lib/map/BackendControl.tsx +16 -13
  17. package/lib/map/CompareToggle.tsx +11 -33
  18. package/lib/map/DebugInfo.tsx +88 -0
  19. package/lib/map/Geocoder.tsx +92 -58
  20. package/lib/map/GeocoderControls.tsx +582 -127
  21. package/lib/map/GraticuleLayer.tsx +54 -0
  22. package/lib/map/MapCanvas.tsx +23 -12
  23. package/lib/map/MapChipRow.tsx +73 -0
  24. package/lib/map/MapCompass.tsx +68 -0
  25. package/lib/map/MapControlStack.tsx +97 -0
  26. package/lib/map/MapFooter.tsx +101 -0
  27. package/lib/map/MapProgressBar.tsx +55 -0
  28. package/lib/map/MapSearchBar.tsx +82 -0
  29. package/lib/map/MapSheet.tsx +71 -0
  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 +65 -97
  44. package/lib/map/useCompareState.ts +5 -4
  45. package/lib/map/useGeocode.ts +7 -5
  46. package/lib/map/useMapBearing.ts +56 -0
  47. package/lib/map/useMapLabelPick.ts +114 -0
  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 +38 -24
  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/runtime.ts +16 -0
  75. package/lib/search/SearchModal.tsx +317 -0
  76. package/lib/search/search.css +144 -0
  77. package/lib/search/types.ts +67 -0
  78. package/lib/search.ts +11 -0
  79. package/out/common/About.d.ts +13 -4
  80. package/out/common/About.d.ts.map +1 -1
  81. package/out/common/About.js +5 -2
  82. package/out/common/About.js.map +1 -1
  83. package/out/common/ClientOnly.d.ts +2 -11
  84. package/out/common/ClientOnly.d.ts.map +1 -1
  85. package/out/common/ClientOnly.js +1 -13
  86. package/out/common/ClientOnly.js.map +1 -1
  87. package/out/common/CopyButton.d.ts +3 -1
  88. package/out/common/CopyButton.d.ts.map +1 -1
  89. package/out/common/CopyButton.js.map +1 -1
  90. package/out/common/LoadingIndicator.d.ts +4 -2
  91. package/out/common/LoadingIndicator.d.ts.map +1 -1
  92. package/out/common/LoadingIndicator.js.map +1 -1
  93. package/out/common/PresetChips.d.ts +9 -8
  94. package/out/common/PresetChips.d.ts.map +1 -1
  95. package/out/common/PresetChips.js.map +1 -1
  96. package/out/common/confidence-tiers.d.ts +7 -6
  97. package/out/common/confidence-tiers.d.ts.map +1 -1
  98. package/out/common/confidence-tiers.js +7 -6
  99. package/out/common/confidence-tiers.js.map +1 -1
  100. package/out/common/cx.d.ts +3 -1
  101. package/out/common/cx.d.ts.map +1 -1
  102. package/out/common/cx.js +3 -1
  103. package/out/common/cx.js.map +1 -1
  104. package/out/common/text-tokens.d.ts +4 -3
  105. package/out/common/text-tokens.d.ts.map +1 -1
  106. package/out/common/text-tokens.js +6 -3
  107. package/out/common/text-tokens.js.map +1 -1
  108. package/out/common/useBuildInfo.d.ts +27 -0
  109. package/out/common/useBuildInfo.d.ts.map +1 -0
  110. package/out/common/useBuildInfo.js +32 -0
  111. package/out/common/useBuildInfo.js.map +1 -0
  112. package/out/common/useClipboard.d.ts +1 -3
  113. package/out/common/useClipboard.d.ts.map +1 -1
  114. package/out/common/useClipboard.js +2 -11
  115. package/out/common/useClipboard.js.map +1 -1
  116. package/out/common.d.ts +22 -0
  117. package/out/common.d.ts.map +1 -0
  118. package/out/common.js +15 -0
  119. package/out/common.js.map +1 -0
  120. package/out/index.d.ts +26 -71
  121. package/out/index.d.ts.map +1 -1
  122. package/out/index.js +21 -47
  123. package/out/index.js.map +1 -1
  124. package/out/map/AppIdentity.d.ts +42 -0
  125. package/out/map/AppIdentity.d.ts.map +1 -0
  126. package/out/map/AppIdentity.js +16 -0
  127. package/out/map/AppIdentity.js.map +1 -0
  128. package/out/map/BackendControl.d.ts +9 -10
  129. package/out/map/BackendControl.d.ts.map +1 -1
  130. package/out/map/BackendControl.js +2 -2
  131. package/out/map/BackendControl.js.map +1 -1
  132. package/out/map/CompareToggle.d.ts +8 -31
  133. package/out/map/CompareToggle.d.ts.map +1 -1
  134. package/out/map/CompareToggle.js +5 -2
  135. package/out/map/CompareToggle.js.map +1 -1
  136. package/out/map/DebugInfo.d.ts +34 -0
  137. package/out/map/DebugInfo.d.ts.map +1 -0
  138. package/out/map/DebugInfo.js +39 -0
  139. package/out/map/DebugInfo.js.map +1 -0
  140. package/out/map/Geocoder.d.ts +47 -26
  141. package/out/map/Geocoder.d.ts.map +1 -1
  142. package/out/map/Geocoder.js +34 -50
  143. package/out/map/Geocoder.js.map +1 -1
  144. package/out/map/GeocoderControls.d.ts +23 -33
  145. package/out/map/GeocoderControls.d.ts.map +1 -1
  146. package/out/map/GeocoderControls.js +277 -16
  147. package/out/map/GeocoderControls.js.map +1 -1
  148. package/out/map/GraticuleLayer.d.ts +28 -0
  149. package/out/map/GraticuleLayer.d.ts.map +1 -0
  150. package/out/map/GraticuleLayer.js +25 -0
  151. package/out/map/GraticuleLayer.js.map +1 -0
  152. package/out/map/MapCanvas.d.ts +23 -12
  153. package/out/map/MapCanvas.d.ts.map +1 -1
  154. package/out/map/MapCanvas.js +5 -2
  155. package/out/map/MapCanvas.js.map +1 -1
  156. package/out/map/MapChipRow.d.ts +43 -0
  157. package/out/map/MapChipRow.d.ts.map +1 -0
  158. package/out/map/MapChipRow.js +12 -0
  159. package/out/map/MapChipRow.js.map +1 -0
  160. package/out/map/MapCompass.d.ts +33 -0
  161. package/out/map/MapCompass.d.ts.map +1 -0
  162. package/out/map/MapCompass.js +15 -0
  163. package/out/map/MapCompass.js.map +1 -0
  164. package/out/map/MapControlStack.d.ts +56 -0
  165. package/out/map/MapControlStack.d.ts.map +1 -0
  166. package/out/map/MapControlStack.js +18 -0
  167. package/out/map/MapControlStack.js.map +1 -0
  168. package/out/map/MapFooter.d.ts +27 -0
  169. package/out/map/MapFooter.d.ts.map +1 -0
  170. package/out/map/MapFooter.js +37 -0
  171. package/out/map/MapFooter.js.map +1 -0
  172. package/out/map/MapProgressBar.d.ts +31 -0
  173. package/out/map/MapProgressBar.d.ts.map +1 -0
  174. package/out/map/MapProgressBar.js +8 -0
  175. package/out/map/MapProgressBar.js.map +1 -0
  176. package/out/map/MapSearchBar.d.ts +48 -0
  177. package/out/map/MapSearchBar.d.ts.map +1 -0
  178. package/out/map/MapSearchBar.js +12 -0
  179. package/out/map/MapSearchBar.js.map +1 -0
  180. package/out/map/MapSheet.d.ts +35 -0
  181. package/out/map/MapSheet.d.ts.map +1 -0
  182. package/out/map/MapSheet.js +29 -0
  183. package/out/map/MapSheet.js.map +1 -0
  184. package/out/map/OverlayLayers.d.ts +1 -1
  185. package/out/map/OverlayLayers.js +2 -2
  186. package/out/map/PlaceAutocomplete.d.ts +10 -21
  187. package/out/map/PlaceAutocomplete.d.ts.map +1 -1
  188. package/out/map/PlaceAutocomplete.js +2 -1
  189. package/out/map/PlaceAutocomplete.js.map +1 -1
  190. package/out/map/PlaceMarker.d.ts +4 -2
  191. package/out/map/PlaceMarker.d.ts.map +1 -1
  192. package/out/map/PlaceMarker.js +3 -1
  193. package/out/map/PlaceMarker.js.map +1 -1
  194. package/out/map/ResolvedPlaceLayers.d.ts +5 -14
  195. package/out/map/ResolvedPlaceLayers.d.ts.map +1 -1
  196. package/out/map/ResolvedPlaceLayers.js +2 -2
  197. package/out/map/ResolvedPlaceLayers.js.map +1 -1
  198. package/out/map/ResultCamera.d.ts +8 -31
  199. package/out/map/ResultCamera.d.ts.map +1 -1
  200. package/out/map/ResultCamera.js +3 -28
  201. package/out/map/ResultCamera.js.map +1 -1
  202. package/out/map/ResultOverlay.d.ts +2 -12
  203. package/out/map/ResultOverlay.d.ts.map +1 -1
  204. package/out/map/ResultOverlay.js +1 -2
  205. package/out/map/ResultOverlay.js.map +1 -1
  206. package/out/map/ResultPanel.d.ts +1 -20
  207. package/out/map/ResultPanel.d.ts.map +1 -1
  208. package/out/map/ResultPanel.js +1 -1
  209. package/out/map/ResultPanel.js.map +1 -1
  210. package/out/map/VersionPicker.d.ts +7 -19
  211. package/out/map/VersionPicker.d.ts.map +1 -1
  212. package/out/map/VersionPicker.js +5 -2
  213. package/out/map/VersionPicker.js.map +1 -1
  214. package/out/map/fake-runtime.d.ts +9 -11
  215. package/out/map/fake-runtime.d.ts.map +1 -1
  216. package/out/map/fake-runtime.js +9 -12
  217. package/out/map/fake-runtime.js.map +1 -1
  218. package/out/map/geometry.d.ts +13 -34
  219. package/out/map/geometry.d.ts.map +1 -1
  220. package/out/map/geometry.js +9 -34
  221. package/out/map/geometry.js.map +1 -1
  222. package/out/map/graticule.d.ts +17 -0
  223. package/out/map/graticule.d.ts.map +1 -0
  224. package/out/map/graticule.js +67 -0
  225. package/out/map/graticule.js.map +1 -0
  226. package/out/map/map-debug.d.ts +1 -1
  227. package/out/map/map-debug.d.ts.map +1 -1
  228. package/out/map/map-debug.js +1 -1
  229. package/out/map/map-debug.js.map +1 -1
  230. package/out/map/place-render.d.ts +23 -43
  231. package/out/map/place-render.d.ts.map +1 -1
  232. package/out/map/place-render.js +4 -39
  233. package/out/map/place-render.js.map +1 -1
  234. package/out/map/types.d.ts +67 -95
  235. package/out/map/types.d.ts.map +1 -1
  236. package/out/map/types.js +1 -10
  237. package/out/map/types.js.map +1 -1
  238. package/out/map/useCompareState.d.ts +5 -4
  239. package/out/map/useCompareState.d.ts.map +1 -1
  240. package/out/map/useCompareState.js +3 -3
  241. package/out/map/useCompareState.js.map +1 -1
  242. package/out/map/useGeocode.d.ts +5 -3
  243. package/out/map/useGeocode.d.ts.map +1 -1
  244. package/out/map/useGeocode.js +4 -4
  245. package/out/map/useGeocode.js.map +1 -1
  246. package/out/map/useMapBearing.d.ts +28 -0
  247. package/out/map/useMapBearing.d.ts.map +1 -0
  248. package/out/map/useMapBearing.js +30 -0
  249. package/out/map/useMapBearing.js.map +1 -0
  250. package/out/map/useMapLabelPick.d.ts +13 -0
  251. package/out/map/useMapLabelPick.d.ts.map +1 -0
  252. package/out/map/useMapLabelPick.js +95 -0
  253. package/out/map/useMapLabelPick.js.map +1 -0
  254. package/out/map/useMapPlaceRender.d.ts +2 -6
  255. package/out/map/useMapPlaceRender.d.ts.map +1 -1
  256. package/out/map/useMapPlaceRender.js +2 -6
  257. package/out/map/useMapPlaceRender.js.map +1 -1
  258. package/out/map/usePlaceAutocomplete.d.ts +30 -28
  259. package/out/map/usePlaceAutocomplete.d.ts.map +1 -1
  260. package/out/map/usePlaceAutocomplete.js +6 -33
  261. package/out/map/usePlaceAutocomplete.js.map +1 -1
  262. package/out/map.d.ts +69 -0
  263. package/out/map.d.ts.map +1 -0
  264. package/out/map.js +46 -0
  265. package/out/map.js.map +1 -0
  266. package/out/pipeline/CandidatePicker.d.ts +12 -2
  267. package/out/pipeline/CandidatePicker.d.ts.map +1 -1
  268. package/out/pipeline/CandidatePicker.js +2 -2
  269. package/out/pipeline/CandidatePicker.js.map +1 -1
  270. package/out/pipeline/ConfidenceCell.d.ts +1 -1
  271. package/out/pipeline/ConfidenceCell.js +1 -1
  272. package/out/pipeline/FailureDiagnostic.d.ts +8 -2
  273. package/out/pipeline/FailureDiagnostic.d.ts.map +1 -1
  274. package/out/pipeline/FailureDiagnostic.js +3 -0
  275. package/out/pipeline/FailureDiagnostic.js.map +1 -1
  276. package/out/pipeline/PipelineExplorer.js +1 -1
  277. package/out/pipeline/QueryForm.d.ts +5 -2
  278. package/out/pipeline/QueryForm.d.ts.map +1 -1
  279. package/out/pipeline/QueryForm.js +1 -1
  280. package/out/pipeline/QueryForm.js.map +1 -1
  281. package/out/pipeline/ResolvedPlace.js +1 -1
  282. package/out/pipeline/SpanHighlight.d.ts +4 -3
  283. package/out/pipeline/SpanHighlight.d.ts.map +1 -1
  284. package/out/pipeline/SpanHighlight.js +3 -2
  285. package/out/pipeline/SpanHighlight.js.map +1 -1
  286. package/out/pipeline/TimingPanel.d.ts +1 -1
  287. package/out/pipeline/TimingPanel.js +1 -1
  288. package/out/pipeline/TreeView.d.ts +1 -1
  289. package/out/pipeline/copy.d.ts +1 -1
  290. package/out/pipeline/copy.d.ts.map +1 -1
  291. package/out/pipeline/copy.js +4 -3
  292. package/out/pipeline/copy.js.map +1 -1
  293. package/out/pipeline/presets.d.ts +5 -4
  294. package/out/pipeline/presets.d.ts.map +1 -1
  295. package/out/pipeline/presets.js +15 -13
  296. package/out/pipeline/presets.js.map +1 -1
  297. package/out/pipeline/types.d.ts +21 -14
  298. package/out/pipeline/types.d.ts.map +1 -1
  299. package/out/pipeline/types.js +2 -4
  300. package/out/pipeline/types.js.map +1 -1
  301. package/out/pipeline/useParsePipeline.d.ts +15 -7
  302. package/out/pipeline/useParsePipeline.d.ts.map +1 -1
  303. package/out/pipeline/useParsePipeline.js +10 -7
  304. package/out/pipeline/useParsePipeline.js.map +1 -1
  305. package/out/pipeline.d.ts +33 -0
  306. package/out/pipeline.d.ts.map +1 -0
  307. package/out/pipeline.js +21 -0
  308. package/out/pipeline.js.map +1 -0
  309. package/out/poi/AbstainPanel.d.ts +1 -1
  310. package/out/poi/LiveResultsBlock.d.ts +2 -1
  311. package/out/poi/LiveResultsBlock.d.ts.map +1 -1
  312. package/out/poi/LiveResultsBlock.js +1 -1
  313. package/out/poi/LiveResultsBlock.js.map +1 -1
  314. package/out/poi/POIExplorer.d.ts +22 -12
  315. package/out/poi/POIExplorer.d.ts.map +1 -1
  316. package/out/poi/POIExplorer.js +10 -9
  317. package/out/poi/POIExplorer.js.map +1 -1
  318. package/out/poi/QueryInput.d.ts +1 -1
  319. package/out/poi/SubjectPanel.d.ts +2 -2
  320. package/out/poi/SubjectPanel.d.ts.map +1 -1
  321. package/out/poi/SubjectPanel.js +3 -2
  322. package/out/poi/SubjectPanel.js.map +1 -1
  323. package/out/poi/runtime.d.ts +5 -14
  324. package/out/poi/runtime.d.ts.map +1 -1
  325. package/out/poi/runtime.js +5 -16
  326. package/out/poi/runtime.js.map +1 -1
  327. package/out/poi/types.d.ts +39 -27
  328. package/out/poi/types.d.ts.map +1 -1
  329. package/out/poi/types.js +2 -4
  330. package/out/poi/types.js.map +1 -1
  331. package/out/poi/usePOISearch.d.ts +28 -17
  332. package/out/poi/usePOISearch.d.ts.map +1 -1
  333. package/out/poi/usePOISearch.js +6 -32
  334. package/out/poi/usePOISearch.js.map +1 -1
  335. package/out/poi.d.ts +23 -0
  336. package/out/poi.d.ts.map +1 -0
  337. package/out/poi.js +15 -0
  338. package/out/poi.js.map +1 -0
  339. package/out/runtime/useReleaseRuntime.d.ts +64 -65
  340. package/out/runtime/useReleaseRuntime.d.ts.map +1 -1
  341. package/out/runtime/useReleaseRuntime.js +31 -26
  342. package/out/runtime/useReleaseRuntime.js.map +1 -1
  343. package/out/runtime.d.ts +9 -0
  344. package/out/runtime.d.ts.map +1 -0
  345. package/out/runtime.js +8 -0
  346. package/out/runtime.js.map +1 -0
  347. package/out/search/SearchModal.d.ts +33 -0
  348. package/out/search/SearchModal.d.ts.map +1 -0
  349. package/out/search/SearchModal.js +187 -0
  350. package/out/search/SearchModal.js.map +1 -0
  351. package/out/search/types.d.ts +64 -0
  352. package/out/search/types.d.ts.map +1 -0
  353. package/out/search/types.js +13 -0
  354. package/out/search/types.js.map +1 -0
  355. package/out/search.d.ts +11 -0
  356. package/out/search.d.ts.map +1 -0
  357. package/out/search.js +9 -0
  358. package/out/search.js.map +1 -0
  359. package/package.json +132 -133
  360. package/styles.css +1340 -202
  361. package/tokens/index.css +26 -7
  362. package/tokens/tokens.json +121 -6
  363. package/tokens/tokens.resolver.json +1 -1
  364. package/lib/map/index.ts +0 -76
  365. package/out/map/index.d.ts +0 -52
  366. package/out/map/index.d.ts.map +0 -1
  367. package/out/map/index.js +0 -36
  368. package/out/map/index.js.map +0 -1
  369. package/styleframe.config.ts +0 -321
  370. package/vitest.node.config.ts +0 -20
@@ -0,0 +1,30 @@
1
+ /**
2
+ * @copyright Sister Software
3
+ * @license AGPL-3.0
4
+ * @author Teffen Ellis, et al.
5
+ *
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.
7
+ */
8
+ import { useCallback, useSyncExternalStore } from "react";
9
+ /**
10
+ * Reads the live map bearing and exposes `resetNorth`.
11
+ */
12
+ export function useMapBearing(map) {
13
+ const subscribe = useCallback((onChange) => {
14
+ if (!map)
15
+ return () => undefined;
16
+ map.on("rotate", onChange);
17
+ map.on("move", onChange);
18
+ return () => {
19
+ map.off("rotate", onChange);
20
+ map.off("move", onChange);
21
+ };
22
+ }, [map]);
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.
25
+ const readBearing = useCallback(() => map?.getBearing() ?? 0, [map]);
26
+ const bearing = useSyncExternalStore(subscribe, readBearing, () => 0);
27
+ const resetNorth = useCallback(() => map?.easeTo({ bearing: 0, pitch: 0 }), [map]);
28
+ return { bearing, resetNorth };
29
+ }
30
+ //# sourceMappingURL=useMapBearing.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useMapBearing.js","sourceRoot":"","sources":["../../lib/map/useMapBearing.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,WAAW,EAAE,oBAAoB,EAAE,MAAM,OAAO,CAAA;AAmBzD;;GAEG;AACH,MAAM,UAAU,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"}
@@ -0,0 +1,13 @@
1
+ /**
2
+ * @copyright Sister Software
3
+ * @license AGPL-3.0
4
+ * @author Teffen Ellis, et al.
5
+ *
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.
7
+ */
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
+ */
12
+ export declare function useMapLabelPick(map: MapInstance | null, onPick: (name: string) => void): void;
13
+ //# sourceMappingURL=useMapLabelPick.d.ts.map
@@ -0,0 +1 @@
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"}
@@ -0,0 +1,95 @@
1
+ /**
2
+ * @copyright Sister Software
3
+ * @license AGPL-3.0
4
+ * @author Teffen Ellis, et al.
5
+ *
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.
7
+ */
8
+ import { useEffect, useEffectEvent } from "react";
9
+ /**
10
+ * The protomaps label layers (`<theme>_label`, `places_*`); other layers are geometry
11
+ * rather than readable place names.
12
+ */
13
+ const LABEL_LAYER = /_label|^places_/;
14
+ /**
15
+ * Properties that may contain a label's text, in trust order.
16
+ *
17
+ * `name` comes from Protomaps.
18
+ * Localized variants appear in script-specific styles.
19
+ */
20
+ const NAME_KEYS = ["name", "name:en", "name_en"];
21
+ /**
22
+ * The style's label layer ids.
23
+ *
24
+ * An empty result must stay unqueried, since an empty `layers` option is not the
25
+ * same as an absent one in `queryRenderedFeatures`.
26
+ */
27
+ function labelLayerIDs(map) {
28
+ const layers = map.getStyle()?.layers ?? [];
29
+ return layers.map((layer) => layer.id).filter((id) => LABEL_LAYER.test(id));
30
+ }
31
+ function labelNameAt(map, point, layers) {
32
+ if (!layers.length)
33
+ return null;
34
+ // `queryRenderedFeatures` answers topmost-first, so the first feature with a label is the one the click landed on.
35
+ for (const feature of map.queryRenderedFeatures(point, { layers })) {
36
+ for (const key of NAME_KEYS) {
37
+ const value = feature.properties?.[key];
38
+ if (typeof value === "string" && value.trim())
39
+ return value;
40
+ }
41
+ }
42
+ return null;
43
+ }
44
+ /**
45
+ * Routes clicks on map labels to `onPick` with the clicked label's own name.
46
+ */
47
+ export function useMapLabelPick(map, onPick) {
48
+ // The subscription depends only on the map.
49
+ // `onPick` changes on every render.
50
+ // `useEffectEvent` reads the latest callback without adding it as a reactive dependency.
51
+ const pick = useEffectEvent((name) => onPick(name));
52
+ useEffect(() => {
53
+ if (!map)
54
+ return;
55
+ // Recomputed when the style swaps.
56
+ // Pointer moves read the cached list.
57
+ let layers = labelLayerIDs(map);
58
+ const readLayers = () => {
59
+ layers = labelLayerIDs(map);
60
+ };
61
+ const onClick = (event) => {
62
+ const name = labelNameAt(map, event.point, layers);
63
+ if (name) {
64
+ pick(name);
65
+ }
66
+ };
67
+ let frame = 0;
68
+ const onMove = (event) => {
69
+ if (frame)
70
+ return;
71
+ frame = requestAnimationFrame(() => {
72
+ frame = 0;
73
+ const canvas = map.getCanvas();
74
+ // The drag cursor belongs to the pan gesture.
75
+ // An override mid-drag would fight the map for the pointer.
76
+ if (canvas.style.cursor === "grabbing")
77
+ return;
78
+ canvas.style.cursor = labelNameAt(map, event.point, layers) ? "pointer" : "";
79
+ });
80
+ };
81
+ map.on("styledata", readLayers);
82
+ map.on("click", onClick);
83
+ map.on("mousemove", onMove);
84
+ return () => {
85
+ if (frame) {
86
+ cancelAnimationFrame(frame);
87
+ }
88
+ map.off("styledata", readLayers);
89
+ map.off("click", onClick);
90
+ map.off("mousemove", onMove);
91
+ map.getCanvas().style.cursor = "";
92
+ };
93
+ }, [map]);
94
+ }
95
+ //# sourceMappingURL=useMapLabelPick.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useMapLabelPick.js","sourceRoot":"","sources":["../../lib/map/useMapLabelPick.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,OAAO,CAAA;AAGjD;;;GAGG;AACH,MAAM,WAAW,GAAG,iBAAiB,CAAA;AAErC;;;;;GAKG;AACH,MAAM,SAAS,GAAG,CAAC,MAAM,EAAE,SAAS,EAAE,SAAS,CAAU,CAAA;AAEzD;;;;;GAKG;AACH,SAAS,aAAa,CA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GAAG,CAAC,GAAG,CAAC,WAAW,EAAE,MAAM,CAAC,CAAA;YAC5B,GAAG,CAAC,SAAS,EAAE,CAAC,KAAK,CAAC,MAAM,GAAG,EAAE,CAAA;QAClC,CAAC,CAAA;IACF,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,CAAA;AACV,CAAC"}
@@ -3,15 +3,11 @@
3
3
  * @license AGPL-3.0
4
4
  * @author Teffen Ellis, et al.
5
5
  *
6
- * `useMapPlaceRender` — the thin React memo wrapper over the pure {@link computeMapPlaceRenderSpec}. It
7
- * recomputes the render spec only when the resolved place changes, so the declarative overlays render a
8
- * stable spec object. The MATH lives in `place-render.ts` (pure, node-tested); this file adds nothing
9
- * but memoization, so it stays trivially correct. A `null` place (no result yet, or a result with no
10
- * candidate) yields `null` — the overlays render nothing.
6
+ * The thin React memo wrapper over the pure {@link computeMapPlaceRenderSpec}; a `null` place yields `null`.
11
7
  */
12
8
  import type { MapPlaceRenderSpec, ResolvedMapPlace } from "#map/place-render";
13
9
  /**
14
- * Memoize the render spec for a resolved place; `null` in → `null` out (nothing to draw).
10
+ * Memoize the render spec for a resolved place; `null` in → `null` out (no geometry to draw).
15
11
  */
16
12
  export declare function useMapPlaceRender(place: ResolvedMapPlace | null | undefined): MapPlaceRenderSpec | null;
17
13
  //# sourceMappingURL=useMapPlaceRender.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"useMapPlaceRender.d.ts","sourceRoot":"","sources":["../../lib/map/useMapPlaceRender.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAKH,OAAO,KAAK,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAA;AAE7E;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,gBAAgB,GAAG,IAAI,GAAG,SAAS,GAAG,kBAAkB,GAAG,IAAI,CAEvG"}
1
+ {"version":3,"file":"useMapPlaceRender.d.ts","sourceRoot":"","sources":["../../lib/map/useMapPlaceRender.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAKH,OAAO,KAAK,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAA;AAE7E;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,gBAAgB,GAAG,IAAI,GAAG,SAAS,GAAG,kBAAkB,GAAG,IAAI,CAEvG"}
@@ -3,16 +3,12 @@
3
3
  * @license AGPL-3.0
4
4
  * @author Teffen Ellis, et al.
5
5
  *
6
- * `useMapPlaceRender` — the thin React memo wrapper over the pure {@link computeMapPlaceRenderSpec}. It
7
- * recomputes the render spec only when the resolved place changes, so the declarative overlays render a
8
- * stable spec object. The MATH lives in `place-render.ts` (pure, node-tested); this file adds nothing
9
- * but memoization, so it stays trivially correct. A `null` place (no result yet, or a result with no
10
- * candidate) yields `null` — the overlays render nothing.
6
+ * The thin React memo wrapper over the pure {@link computeMapPlaceRenderSpec}; a `null` place yields `null`.
11
7
  */
12
8
  import { useMemo } from "react";
13
9
  import { computeMapPlaceRenderSpec } from "#map/place-render";
14
10
  /**
15
- * Memoize the render spec for a resolved place; `null` in → `null` out (nothing to draw).
11
+ * Memoize the render spec for a resolved place; `null` in → `null` out (no geometry to draw).
16
12
  */
17
13
  export function useMapPlaceRender(place) {
18
14
  return useMemo(() => (place ? computeMapPlaceRenderSpec(place) : null), [place]);
@@ -1 +1 @@
1
- {"version":3,"file":"useMapPlaceRender.js","sourceRoot":"","sources":["../../lib/map/useMapPlaceRender.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,OAAO,CAAA;AAE/B,OAAO,EAAE,yBAAyB,EAAE,MAAM,mBAAmB,CAAA;AAG7D;;GAEG;AACH,MAAM,UAAU,iBAAiB,CAAC,KAA0C;IAC3E,OAAO,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,yBAAyB,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,CAAA;AACjF,CAAC"}
1
+ {"version":3,"file":"useMapPlaceRender.js","sourceRoot":"","sources":["../../lib/map/useMapPlaceRender.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,OAAO,CAAA;AAE/B,OAAO,EAAE,yBAAyB,EAAE,MAAM,mBAAmB,CAAA;AAG7D;;GAEG;AACH,MAAM,UAAU,iBAAiB,CAAC,KAA0C;IAC3E,OAAO,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,yBAAyB,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,CAAA;AACjF,CAAC"}
@@ -2,44 +2,39 @@
2
2
  * @copyright Sister Software
3
3
  * @license AGPL-3.0
4
4
  * @author Teffen Ellis, et al.
5
- *
6
- * `usePlaceAutocomplete` — the headless "Did you mean" combobox lifted from the demo god component
7
- * (`_app.tsx:820-900`). It walks the host-supplied `autocomplete` over the locality segment the visitor
8
- * is typing (the text after the last comma), owns the suggestion list + keyboard-highlighted active
9
- * descendant, and rewrites the input on pick (replacing just that segment). No FST, no fetch of its own
10
- * — the `autocomplete` fetcher is INJECTED (the package never imports `@mailwoman/resolver-wof-sqlite`),
11
- * so this stays node-safe and testable with a synchronous fake.
12
- *
13
- * Returns the `<input>` aria/combobox props to spread onto the reused {@link QueryForm} input plus an
14
- * `onInputKeyDown` (↑/↓ move the highlight, Enter accepts it AND suppresses submit, Esc dismisses), and
15
- * the presentational {@link PlaceAutocomplete} listbox renders `suggestions` / `activeIndex`.
16
5
  */
17
6
  import { type KeyboardEvent } from "react";
18
7
  import type { Suggestion } from "#map/types";
8
+ /**
9
+ * Options for {@linkcode usePlaceAutocomplete}.
10
+ */
19
11
  export interface UsePlaceAutocompleteOptions {
20
12
  /**
21
- * The current input text.
13
+ * The controlled input text.
14
+ * The segment after the last comma is the query.
22
15
  */
23
16
  text: string;
24
17
  /**
25
- * Setter for the input text (a pick rewrites the last-comma segment).
18
+ * Sets the input text.
19
+ * A pick calls it with the last segment replaced.
26
20
  */
27
21
  setText: (text: string) => void;
28
22
  /**
29
- * The host's autocomplete fetcher (FST prefix-walk). Absent → the combobox is inert.
23
+ * Fetches suggestions for a query.
24
+ * Without it the hook never suggests anything.
30
25
  */
31
26
  autocomplete?: (query: string) => Promise<Suggestion[]>;
32
27
  /**
33
- * Minimum query length before suggesting. @default 2
28
+ * @default 2
34
29
  */
35
30
  minChars?: number;
36
31
  /**
37
- * Debounce before firing the fetcher. @default 150
32
+ * @default 150
38
33
  */
39
34
  debounceMs?: number;
40
35
  }
41
36
  /**
42
- * The combobox aria props to spread onto the input the suggestions describe.
37
+ * The combobox ARIA props to spread onto the input.
43
38
  */
44
39
  export interface AutocompleteInputProps {
45
40
  role: "combobox";
@@ -49,43 +44,50 @@ export interface AutocompleteInputProps {
49
44
  "aria-activedescendant": string | undefined;
50
45
  autoComplete: "off";
51
46
  }
47
+ /**
48
+ * The state and handlers that {@linkcode usePlaceAutocomplete} returns.
49
+ */
52
50
  export interface UsePlaceAutocomplete {
53
51
  /**
54
- * The current suggestions (empty when nothing matches — the listbox then hides).
52
+ * The current suggestions, empty when none match or the visitor dismissed the list.
55
53
  */
56
54
  suggestions: Suggestion[];
57
55
  /**
58
- * The keyboard-highlighted suggestion index; `-1` when none is highlighted.
56
+ * The index highlighted by the keyboard, or `-1` for none.
59
57
  */
60
58
  activeIndex: number;
61
59
  /**
62
- * Set the highlighted index (the listbox calls this on mouse-enter).
60
+ * Sets the highlighted index, such as when the pointer enters an option.
63
61
  */
64
62
  setActiveIndex: (index: number) => void;
65
63
  /**
66
- * Keydown handler for the input: ↑/↓ highlight, Enter accepts (+ suppresses submit), Esc dismisses.
64
+ * Handles input keys: arrows move the highlight, Enter picks instead of submitting and Escape dismisses.
67
65
  */
68
66
  onInputKeyDown: (event: KeyboardEvent<HTMLInputElement>) => void;
69
67
  /**
70
- * Accept a suggestion by value (rewrites the last-comma segment, closes the list).
68
+ * Replaces the text after the last comma with the suggestion and closes the list.
71
69
  */
72
70
  pick: (value: string) => void;
73
71
  /**
74
- * Close the list without picking.
72
+ * Closes the list without picking until the query changes.
75
73
  */
76
74
  dismiss: () => void;
77
75
  /**
78
- * Aria/combobox props for the input the suggestions describe.
76
+ * The combobox ARIA props to spread onto the input.
79
77
  */
80
78
  inputProps: AutocompleteInputProps;
81
79
  /**
82
- * The listbox element id (matches `inputProps["aria-controls"]`).
80
+ * The listbox element ID.
81
+ * It matches `inputProps["aria-controls"]`.
83
82
  */
84
83
  listboxID: string;
85
- /**
86
- * Build the option element id for suggestion `index`.
87
- */
88
84
  optionID: (index: number) => string;
89
85
  }
86
+ /**
87
+ * Fetches debounced place suggestions for the text after the input's last comma.
88
+ *
89
+ * A pick replaces only that segment.
90
+ * A digit-leading segment never reaches `autocomplete`.
91
+ */
90
92
  export declare function usePlaceAutocomplete({ text, setText, autocomplete, minChars, debounceMs, }: UsePlaceAutocompleteOptions): UsePlaceAutocomplete;
91
93
  //# sourceMappingURL=usePlaceAutocomplete.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"usePlaceAutocomplete.d.ts","sourceRoot":"","sources":["../../lib/map/usePlaceAutocomplete.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAAE,KAAK,aAAa,EAAoC,MAAM,OAAO,CAAA;AAG5E,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAA;AAE5C,MAAM,WAAW,2BAA2B;IAC3C;;OAEG;IACH,IAAI,EAAE,MAAM,CAAA;IACZ;;OAEG;IACH,OAAO,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAA;IAC/B;;OAEG;IACH,YAAY,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,OAAO,CAAC,UAAU,EAAE,CAAC,CAAA;IACvD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;GAKG;AACH,wBAAgB,oBAAoB,CAAC,EACpC,IAAI,EACJ,OAAO,EACP,YAAY,EACZ,QAAY,EACZ,UAAgB,GAChB,EAAE,2BAA2B,GAAG,oBAAoB,CAyGpD"}
@@ -2,52 +2,26 @@
2
2
  * @copyright Sister Software
3
3
  * @license AGPL-3.0
4
4
  * @author Teffen Ellis, et al.
5
- *
6
- * `usePlaceAutocomplete` — the headless "Did you mean" combobox lifted from the demo god component
7
- * (`_app.tsx:820-900`). It walks the host-supplied `autocomplete` over the locality segment the visitor
8
- * is typing (the text after the last comma), owns the suggestion list + keyboard-highlighted active
9
- * descendant, and rewrites the input on pick (replacing just that segment). No FST, no fetch of its own
10
- * — the `autocomplete` fetcher is INJECTED (the package never imports `@mailwoman/resolver-wof-sqlite`),
11
- * so this stays node-safe and testable with a synchronous fake.
12
- *
13
- * Returns the `<input>` aria/combobox props to spread onto the reused {@link QueryForm} input plus an
14
- * `onInputKeyDown` (↑/↓ move the highlight, Enter accepts it AND suppresses submit, Esc dismisses), and
15
- * the presentational {@link PlaceAutocomplete} listbox renders `suggestions` / `activeIndex`.
16
5
  */
17
6
  import { useCallback, useEffect, useState } from "react";
18
7
  import { useDebouncedValue } from "#common/useDebouncedValue";
19
8
  const LISTBOX_ID = "mw-demo-suggest-list";
20
- /**
21
- * Stable empty list for the derived no-suggestions state — a fresh `[]` per render would churn the identity every
22
- * consumer and every useCallback dependency list sees.
23
- */
24
9
  const NO_SUGGESTIONS = [];
25
10
  const optionID = (index) => `mw-demo-suggest-${index}`;
26
- /**
27
- * Extract the locality segment being typed — the text after the last comma, trimmed.
28
- */
29
11
  function localitySegment(text) {
30
12
  return (text.includes(",") ? text.slice(text.lastIndexOf(",") + 1) : text).trim();
31
13
  }
32
- /**
33
- * Replace the locality segment (after the last comma) with `name`, preserving the address prefix.
34
- */
35
14
  function replaceSegment(current, name) {
36
15
  return current.includes(",") ? `${current.slice(0, current.lastIndexOf(",") + 1)} ${name}` : name;
37
16
  }
17
+ /**
18
+ * Fetches debounced place suggestions for the text after the input's last comma.
19
+ *
20
+ * A pick replaces only that segment.
21
+ * A digit-leading segment never reaches `autocomplete`.
22
+ */
38
23
  export function usePlaceAutocomplete({ text, setText, autocomplete, minChars = 2, debounceMs = 150, }) {
39
- /**
40
- * The last COMPLETED fetch, keyed by the query that produced it. Visibility is DERIVED from this during render rather
41
- * than pushed through sync setStates in the effect — the effect's only job is the async fetch, so every state write
42
- * in it happens after an await and the react(set-state-in-effect) rule is satisfied by structure, not by exception.
43
- */
44
24
  const [fetched, setFetched] = useState(null);
45
- /**
46
- * The query whose list was dismissed or picked. Suppression as DATA, replacing the one-shot ref flag: a pick stores
47
- * the query the rewritten text will produce, so the post-pick fetch is skipped and the place just chosen is never
48
- * re-suggested. One divergence from the ref version, accepted and small: after Esc, retyping the exact same string
49
- * keeps the list hidden until the query changes.
50
- */
51
25
  const [dismissed, setDismissed] = useState(null);
52
26
  const [activeIndex, setActiveIndex] = useState(-1);
53
27
  const query = localitySegment(text);
@@ -82,7 +56,6 @@ export function usePlaceAutocomplete({ text, setText, autocomplete, minChars = 2
82
56
  const pick = useCallback((value) => {
83
57
  const next = replaceSegment(text, value);
84
58
  setText(next);
85
- // Suppress the fetch the rewritten text would trigger — the segment being typed IS the picked name.
86
59
  setDismissed(localitySegment(next));
87
60
  setFetched(null);
88
61
  setActiveIndex(-1);
@@ -1 +1 @@
1
- {"version":3,"file":"usePlaceAutocomplete.js","sourceRoot":"","sources":["../../lib/map/usePlaceAutocomplete.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAAsB,WAAW,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AAE5E,OAAO,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAA;AA6E7D,MAAM,UAAU,GAAG,sBAAsB,CAAA;AAEzC;;;GAGG;AACH,MAAM,cAAc,GAAiB,EAAE,CAAA;AACvC,MAAM,QAAQ,GAAG,CAAC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AW,CAAC,CAAC,CAAC,CAAC,SAAS;YAC7E,YAAY,EAAE,KAAK;SACnB;QACD,SAAS,EAAE,UAAU;QACrB,QAAQ;KACR,CAAA;AACF,CAAC"}
package/out/map.d.ts ADDED
@@ -0,0 +1,69 @@
1
+ /**
2
+ * @copyright Sister Software
3
+ * @license AGPL-3.0
4
+ * @author Teffen Ellis, et al.
5
+ *
6
+ * `@mailwoman/react/map` — the geocoder map surface, kept behind its own subpath so `maplibre-gl`
7
+ * / `react-map-gl` (WebGL + DOM at import) never enter the package-root graph. This subpath import
8
+ * pulls the map deps. importing `@mailwoman/react` (root) does not. Consumers who only want the
9
+ * parse/POI explorers never pay for maplibre.
10
+ *
11
+ * The host must supply `maplibre-gl` + `react-map-gl` (peer deps) and import
12
+ * `maplibre-gl/dist/maplibre-gl.css` + `@mailwoman/react/styles.css` itself.
13
+ */
14
+ export { MapCanvas } from "./map/MapCanvas.tsx";
15
+ export type { MapCanvasExtraProps, MapCanvasProps, MapCanvasStyle } from "./map/MapCanvas.tsx";
16
+ export { MapChipRow } from "./map/MapChipRow.tsx";
17
+ export type { MapChip, MapChipRowProps } from "./map/MapChipRow.tsx";
18
+ export { MapCompass } from "./map/MapCompass.tsx";
19
+ export type { MapCompassProps } from "./map/MapCompass.tsx";
20
+ export { useMapBearing } from "./map/useMapBearing.ts";
21
+ export type { UseMapBearing } from "./map/useMapBearing.ts";
22
+ export { useMapLabelPick } from "./map/useMapLabelPick.ts";
23
+ export { MapControlButton, MapControlGroup, MapControlStack } from "./map/MapControlStack.tsx";
24
+ export type { MapControlButtonProps, MapControlGroupProps, MapControlStackProps } from "./map/MapControlStack.tsx";
25
+ export { MapFooter } from "./map/MapFooter.tsx";
26
+ export type { MapFooterProps } from "./map/MapFooter.tsx";
27
+ export { MapProgressBar } from "./map/MapProgressBar.tsx";
28
+ export type { MapProgressBarProps } from "./map/MapProgressBar.tsx";
29
+ export { MapSheet, SheetClose } from "./map/MapSheet.tsx";
30
+ export type { MapSheetProps } from "./map/MapSheet.tsx";
31
+ export { MapSearchBar, SearchGlyph } from "./map/MapSearchBar.tsx";
32
+ export type { MapSearchBarProps } from "./map/MapSearchBar.tsx";
33
+ export type { CompareContext, GeocoderPanels, GeocoderRuntime, InferenceBackend, LngLatTuple, MapBias, OverlaySpec, ResultContext, Suggestion, VersionOption, } from "#map/types";
34
+ export { approxCircleGeometry, bboxToBounds, geomBounds, radiusCircleGeometry } from "#map/geometry";
35
+ export type { BoundsTuple, PlaceGeometry } from "#map/geometry";
36
+ export { cameraToViewState, computeMapPlaceRenderSpec } from "#map/place-render";
37
+ export type { LngLat, MapCameraTarget, MapPlaceRenderSpec, PlaceTier, ResolvedMapPlace } from "#map/place-render";
38
+ export { useMapPlaceRender } from "#map/useMapPlaceRender";
39
+ export { OverlayLayers } from "./map/OverlayLayers.tsx";
40
+ export type { OverlayLayersProps } from "./map/OverlayLayers.tsx";
41
+ export { PlaceMarker } from "./map/PlaceMarker.tsx";
42
+ export type { PlaceMarkerProps } from "./map/PlaceMarker.tsx";
43
+ export { ResolvedPlaceLayers } from "./map/ResolvedPlaceLayers.tsx";
44
+ export type { ResolvedPlaceLayersProps } from "./map/ResolvedPlaceLayers.tsx";
45
+ export { ResultCamera } from "./map/ResultCamera.tsx";
46
+ export type { ResultCameraProps } from "./map/ResultCamera.tsx";
47
+ export { ResultOverlay } from "./map/ResultOverlay.tsx";
48
+ export type { ResultOverlayProps } from "./map/ResultOverlay.tsx";
49
+ export { BackendControl } from "./map/BackendControl.tsx";
50
+ export type { BackendControlProps } from "./map/BackendControl.tsx";
51
+ export { CompareToggle } from "./map/CompareToggle.tsx";
52
+ export type { CompareToggleProps } from "./map/CompareToggle.tsx";
53
+ export { Geocoder } from "./map/Geocoder.tsx";
54
+ export type { GeocoderProps } from "./map/Geocoder.tsx";
55
+ export { GeocoderControls } from "./map/GeocoderControls.tsx";
56
+ export type { GeocoderControlsProps } from "./map/GeocoderControls.tsx";
57
+ export { PlaceAutocomplete } from "./map/PlaceAutocomplete.tsx";
58
+ export type { PlaceAutocompleteProps } from "./map/PlaceAutocomplete.tsx";
59
+ export { ResultPanel } from "./map/ResultPanel.tsx";
60
+ export type { ResultPanelProps } from "./map/ResultPanel.tsx";
61
+ export { useCompareState } from "#map/useCompareState";
62
+ export type { UseCompareState } from "#map/useCompareState";
63
+ export { useGeocode } from "#map/useGeocode";
64
+ export type { UseGeocode, UseGeocodeOptions } from "#map/useGeocode";
65
+ export { usePlaceAutocomplete } from "#map/usePlaceAutocomplete";
66
+ export type { AutocompleteInputProps, UsePlaceAutocomplete, UsePlaceAutocompleteOptions, } from "#map/usePlaceAutocomplete";
67
+ export { VersionPicker } from "./map/VersionPicker.tsx";
68
+ export type { VersionPickerProps } from "./map/VersionPicker.tsx";
69
+ //# sourceMappingURL=map.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"map.d.ts","sourceRoot":"","sources":["../lib/map.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAA;AAC/C,YAAY,EAAE,mBAAmB,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAA;AAG9F,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAA;AACjD,YAAY,EAAE,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAA;AACpE,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAA;AACjD,YAAY,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAA;AAC3D,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAA;AACtD,YAAY,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAA;AAC3D,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAA;AAC1D,OAAO,EAAE,gBAAgB,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAA;AAC9F,YAAY,EAAE,qBAAqB,EAAE,oBAAoB,EAA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EACpB,2BAA2B,GAC3B,MAAM,2BAA2B,CAAA;AAElC,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAA;AACvD,YAAY,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAA"}
package/out/map.js ADDED
@@ -0,0 +1,46 @@
1
+ /**
2
+ * @copyright Sister Software
3
+ * @license AGPL-3.0
4
+ * @author Teffen Ellis, et al.
5
+ *
6
+ * `@mailwoman/react/map` — the geocoder map surface, kept behind its own subpath so `maplibre-gl`
7
+ * / `react-map-gl` (WebGL + DOM at import) never enter the package-root graph. This subpath import
8
+ * pulls the map deps. importing `@mailwoman/react` (root) does not. Consumers who only want the
9
+ * parse/POI explorers never pay for maplibre.
10
+ *
11
+ * The host must supply `maplibre-gl` + `react-map-gl` (peer deps) and import
12
+ * `maplibre-gl/dist/maplibre-gl.css` + `@mailwoman/react/styles.css` itself.
13
+ */
14
+ export { MapCanvas } from "./map/MapCanvas.js";
15
+ // ── Map chrome (node-safe presentation. The host supplies the input and reads its own map) ──
16
+ export { MapChipRow } from "./map/MapChipRow.js";
17
+ export { MapCompass } from "./map/MapCompass.js";
18
+ export { useMapBearing } from "./map/useMapBearing.js";
19
+ export { useMapLabelPick } from "./map/useMapLabelPick.js";
20
+ export { MapControlButton, MapControlGroup, MapControlStack } from "./map/MapControlStack.js";
21
+ export { MapFooter } from "./map/MapFooter.js";
22
+ export { MapProgressBar } from "./map/MapProgressBar.js";
23
+ export { MapSheet, SheetClose } from "./map/MapSheet.js";
24
+ export { MapSearchBar, SearchGlyph } from "./map/MapSearchBar.js";
25
+ // ── Pure geometry + render spec (node-safe. No react-map-gl at runtime) ──────
26
+ export { approxCircleGeometry, bboxToBounds, geomBounds, radiusCircleGeometry } from "#map/geometry";
27
+ export { cameraToViewState, computeMapPlaceRenderSpec } from "#map/place-render";
28
+ export { useMapPlaceRender } from "#map/useMapPlaceRender";
29
+ // ── Declarative overlays (react-map-gl `<Marker>`/`<Source>`/`<Layer>`) ──────
30
+ export { OverlayLayers } from "./map/OverlayLayers.js";
31
+ export { PlaceMarker } from "./map/PlaceMarker.js";
32
+ export { ResolvedPlaceLayers } from "./map/ResolvedPlaceLayers.js";
33
+ export { ResultCamera } from "./map/ResultCamera.js";
34
+ export { ResultOverlay } from "./map/ResultOverlay.js";
35
+ // ── Geocoder controls + the composed geocoder ────────────────────────────────
36
+ export { BackendControl } from "./map/BackendControl.js";
37
+ export { CompareToggle } from "./map/CompareToggle.js";
38
+ export { Geocoder } from "./map/Geocoder.js";
39
+ export { GeocoderControls } from "./map/GeocoderControls.js";
40
+ export { PlaceAutocomplete } from "./map/PlaceAutocomplete.js";
41
+ export { ResultPanel } from "./map/ResultPanel.js";
42
+ export { useCompareState } from "#map/useCompareState";
43
+ export { useGeocode } from "#map/useGeocode";
44
+ export { usePlaceAutocomplete } from "#map/usePlaceAutocomplete";
45
+ export { VersionPicker } from "./map/VersionPicker.js";
46
+ //# sourceMappingURL=map.js.map
package/out/map.js.map ADDED
@@ -0,0 +1 @@
1
+ {"version":3,"file":"map.js","sourceRoot":"","sources":["../lib/map.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAqB,CAAA;AAG/C,+FAA+F;AAC/F,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAsB,CAAA;AAEjD,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAsB,CAAA;AAEjD,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAA;AAEtD,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAA;AAC1D,OAAO,EAAE,gBAAgB,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,0BAA2B,CAAA;AAE9F,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAqB,CAAA;AAE/C,OAAO,EAAE,cAAc,EAAE,MAAM,yBAA0B,CAAA;AAEzD,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,mBAAoB,CA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it.
7
- * Presentational; the selected index is owned by the caller (the pipeline hook).
6
+ * `CandidatePicker` — the ranked list of alternate gazetteer candidates. clicking one selects it.
7
+ * Presentational. the selected index is owned by the caller (the pipeline hook).
8
+ *
9
+ * The row shows the rank rather than the score. `ResolvedPlaceView.score` is implementation-defined. Its type specifies
10
+ * "callers should treat as ordinal" — and the backends do not agree on a scale: the FTS regime is a negated bm25
11
+ * plus additive tiers, while the candidate regime is exactly `log10(population + 1)`. Both regimes put
12
+ * "New York · 6.95" (log10 of 8.9M) directly under "350 5th Ave · 1.00" from a bounded blend. That reads as one
13
+ * number beating another by a factor of seven rather than as two numbers that never shared a scale.
14
+ * `docs/records/reviews/2026-08-04-resolver-score-abstention.md` measures this in full.
15
+ *
16
+ * The raw value stays on the button's `title`, at full precision, because it is exactly the right thing to have
17
+ * when you are debugging a ranking and exactly the wrong thing to put in a visitor's eyeline.
8
18
  */
9
19
  import type { ResolvedPlaceView } from "@mailwoman/core/pipeline/client-result";
10
20
  import type { ReactNode } from "react";
@@ -1 +1 @@
1
- {"version":3,"file":"CandidatePicker.d.ts","sourceRoot":"","sources":["../../lib/pipeline/CandidatePicker.tsx"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,wCAAwC,CAAA;AAC/E,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAItC,MAAM,WAAW,oBAAoB;IACpC,UAAU,EAAE,iBAAiB,EAAE,CAAA;IAC/B,aAAa,EAAE,MAAM,CAAA;IACrB,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAA;CACjC;AAED,wBAAgB,eAAe,CAAC,EAAE,UAAU,EAAE,aAAa,EAAE,QAAQ,EAAE,EAAE,oBAAoB,GAAG,SAAS,CAwBxG"}
1
+ {"version":3,"file":"CandidatePicker.d.ts","sourceRoot":"","sources":["../../lib/pipeline/CandidatePicker.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,wCAAwC,CAAA;AAC/E,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAItC,MAAM,WAAW,oBAAoB;IACpC,UAAU,EAAE,iBAAiB,EAAE,CAAA;IAC/B,aAAa,EAAE,MAAM,CAAA;IACrB,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAA;CACjC;AAED,wBAAgB,eAAe,CAAC,EAAE,UAAU,EAAE,aAAa,EAAE,QAAQ,EAAE,EAAE,oBAAoB,GAAG,SAAS,CAsBxG"}
@@ -1,6 +1,6 @@
1
- import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { cx } from "#common/cx";
3
3
  export function CandidatePicker({ candidates, selectedIndex, onSelect }) {
4
- return (_jsxs("div", { className: "mw-candidates", children: [_jsxs("h2", { children: ["Other candidates (", candidates.length - 1, ")"] }), _jsx("ol", { className: "mw-candidates__list", children: candidates.map((candidate, i) => (_jsx("li", { children: _jsxs("button", { type: "button", className: cx("mw-candidates__btn", { "mw-candidates__btn--active": i === selectedIndex }), onClick: () => onSelect(i), title: `${candidate.placetype} • WOF ${candidate.id} • score ${candidate.score.toFixed(3)}`, children: [_jsxs("span", { className: "mw-candidates__rank", children: ["#", i + 1] }), _jsx("span", { className: "mw-candidates__name", children: candidate.name }), _jsxs("span", { className: "mw-candidates__meta", children: [candidate.placetype, " \u00B7 ", candidate.score.toFixed(2)] })] }) }, `${candidate.id}-${i}`))) })] }));
4
+ return (_jsxs("div", { className: "mw-candidates", children: [_jsxs("h2", { children: ["Other candidates (", candidates.length - 1, ")"] }), _jsx("ol", { className: "mw-candidates__list", children: candidates.map((candidate, i) => (_jsx("li", { children: _jsxs("button", { type: "button", className: cx("mw-candidates__btn", { "mw-candidates__btn--active": i === selectedIndex }), onClick: () => onSelect(i), title: `${candidate.placetype} • WOF ${candidate.id} • score ${candidate.score.toFixed(3)}`, children: [_jsxs("span", { className: "mw-candidates__rank", children: ["#", i + 1] }), _jsx("span", { className: "mw-candidates__name", children: candidate.name }), _jsx("span", { className: "mw-candidates__meta", children: candidate.placetype })] }) }, `${candidate.id}-${i}`))) })] }));
5
5
  }
6
6
  //# sourceMappingURL=CandidatePicker.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"CandidatePicker.js","sourceRoot":"","sources":["../../lib/pipeline/CandidatePicker.tsx"],"names":[],"mappings":";AAYA,OAAO,EAAE,EAAE,EAAE,MAAM,YAAY,CAAA;AAQ/B,MAAM,UAAU,eAAe,CAAC,EAAE,UAAU,EAAE,aAAa,EAAE,QAAQ,EAAwB;IAC5F,OAAO,CACN,eAAK,SAAS,EAAC,eAAe,aAC7B,+CAAuB,UAAU,CAAC,MAAM,GAAG,CAAC,SAAO,EACnD,aAAI,SAAS,EAAC,qBAAqB,YACjC,UAAU,CAAC,GAAG,CAAC,CAAC,SAAS,EAAE,CAAC,EAAE,EAAE,CAAC,CACjC,uBACC,kBACC,IAAI,EAAC,QAAQ,EACb,SAAS,EAAE,EAAE,CAAC,oBAAoB,EAAE,EAAE,4BAA4B,EAAE,CAAC,KAAK,aAAa,EAAE,CAAC,EAC1F,OAAO,EAAE,GAAG,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC,EAC1B,KAAK,EAAE,GAAG,SAAS,CAAC,SAAS,UAAU,SAAS,CAAC,EAAE,YAAY,SAAS,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,aAE3F,gBAAM,SAAS,EAAC,qBAAqB,kBAAG,CAAC,GAAG,CAAC,IAAQ,EACrD,eAAM,SAAS,EAAC,qBAAqB,YAAE,SAAS,CAAC,IAAI,GAAQ,EAC7D,gBAAM,SAAS,EAAC,qBAAqB,aACnC,SAAS,CAAC,SAAS,cAAK,SAAS,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,IAC7C,IACC,IAZD,GAAG,SAAS,CAAC,EAAE,IAAI,CAAC,EAAE,CAa1B,CACL,CAAC,GACE,IACA,CACN,CAAA;AACF,CAAC"}
1
+ {"version":3,"file":"CandidatePicker.js","sourceRoot":"","sources":["../../lib/pipeline/CandidatePicker.tsx"],"names":[],"mappings":";AAsBA,OAAO,EAAE,EAAE,EAAE,MAAM,YAAY,CAAA;AAQ/B,MAAM,UAAU,eAAe,CAAC,EAAE,UAAU,EAAE,aAAa,EAAE,QAAQ,EAAwB;IAC5F,OAAO,CACN,eAAK,SAAS,EAAC,eAAe,aAC7B,+CAAuB,UAAU,CAAC,MAAM,GAAG,CAAC,SAAO,EACnD,aAAI,SAAS,EAAC,qBAAqB,YACjC,UAAU,CAAC,GAAG,CAAC,CAAC,SAAS,EAAE,CAAC,EAAE,EAAE,CAAC,CACjC,uBACC,kBACC,IAAI,EAAC,QAAQ,EACb,SAAS,EAAE,EAAE,CAAC,oBAAoB,EAAE,EAAE,4BAA4B,EAAE,CAAC,KAAK,aAAa,EAAE,CAAC,EAC1F,OAAO,EAAE,GAAG,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC,EAC1B,KAAK,EAAE,GAAG,SAAS,CAAC,SAAS,UAAU,SAAS,CAAC,EAAE,YAAY,SAAS,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,aAE3F,gBAAM,SAAS,EAAC,qBAAqB,kBAAG,CAAC,GAAG,CAAC,IAAQ,EACrD,eAAM,SAAS,EAAC,qBAAqB,YAAE,SAAS,CAAC,IAAI,GAAQ,EAC7D,eAAM,SAAS,EAAC,qBAAqB,YAAE,SAAS,CAAC,SAAS,GAAQ,IAC1D,IAVD,GAAG,SAAS,CAAC,EAAE,IAAI,CAAC,EAAE,CAW1B,CACL,CAAC,GACE,IACA,CACN,CAAA;AACF,CAAC"}
@@ -3,7 +3,7 @@
3
3
  * @license AGPL-3.0
4
4
  * @author Teffen Ellis, et al.
5
5
  *
6
- * `ConfidenceCell` — a compact confidence bar + value for the component table. The fill colour follows the shared
6
+ * `ConfidenceCell` — a compact confidence bar + value for the component table. The fill color follows the shared
7
7
  * confidence tiers. Presentational.
8
8
  */
9
9
  export interface ConfidenceCellProps {
@@ -4,7 +4,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
4
4
  * @license AGPL-3.0
5
5
  * @author Teffen Ellis, et al.
6
6
  *
7
- * `ConfidenceCell` — a compact confidence bar + value for the component table. The fill colour follows the shared
7
+ * `ConfidenceCell` — a compact confidence bar + value for the component table. The fill color follows the shared
8
8
  * confidence tiers. Presentational.
9
9
  */
10
10
  import { confidenceTierOrMid } from "#common/confidence-tiers";