@mailwoman/react 9.1.0 → 9.3.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.
- package/README.md +2 -2
- package/{common → lib/common}/ClientOnly.tsx +18 -6
- package/{common → lib/common}/CopyButton.tsx +1 -1
- package/{common → lib/common}/LoadingIndicator.tsx +1 -1
- package/{index.ts → lib/index.ts} +17 -17
- package/{map → lib/map}/CompareToggle.tsx +1 -1
- package/{map → lib/map}/DemoControls.tsx +5 -4
- package/{map → lib/map}/DemoMap.tsx +2 -2
- package/{map → lib/map}/GeocoderDemo.tsx +32 -8
- package/{map → lib/map}/OverlayLayers.tsx +3 -3
- package/{map → lib/map}/PlaceAutocomplete.tsx +2 -2
- package/{map → lib/map}/ResolvedPlaceLayers.tsx +2 -1
- package/{map → lib/map}/ResultCamera.tsx +2 -2
- package/{map → lib/map}/ResultOverlay.tsx +2 -2
- package/{map → lib/map}/ResultPanel.tsx +3 -2
- package/{map → lib/map}/VersionPicker.tsx +1 -1
- package/{map → lib/map}/geometry.ts +7 -7
- package/{map → lib/map}/index.ts +12 -12
- package/{map → lib/map}/place-render.ts +3 -3
- package/{map → lib/map}/types.ts +12 -9
- package/{map → lib/map}/useDemoGeocode.ts +4 -4
- package/{map → lib/map}/useMapPlaceRender.ts +2 -2
- package/{map → lib/map}/usePlaceAutocomplete.ts +39 -27
- package/{pipeline → lib/pipeline}/CandidatePicker.tsx +2 -2
- package/{pipeline → lib/pipeline}/ComponentTable.tsx +2 -1
- package/{pipeline → lib/pipeline}/ConfidenceCell.tsx +1 -1
- package/{pipeline → lib/pipeline}/PipelineExplorer.tsx +5 -4
- package/{pipeline → lib/pipeline}/QueryForm.tsx +2 -2
- package/{pipeline → lib/pipeline}/ResolvedPlace.tsx +1 -1
- package/{pipeline → lib/pipeline}/copy.ts +1 -1
- package/{pipeline → lib/pipeline}/presets.ts +2 -1
- package/{pipeline → lib/pipeline}/useParsePipeline.ts +1 -1
- package/{poi → lib/poi}/LiveResultsBlock.tsx +2 -2
- package/{poi → lib/poi}/POIExplorer.tsx +4 -3
- package/{poi → lib/poi}/SubjectPanel.tsx +1 -1
- package/{poi → lib/poi}/runtime.ts +3 -3
- package/{poi → lib/poi}/types.ts +1 -1
- package/{poi → lib/poi}/usePOISearch.ts +77 -51
- package/{runtime → lib/runtime}/useDemoRuntime.ts +8 -5
- package/out/common/ClientOnly.d.ts +5 -2
- package/out/common/ClientOnly.d.ts.map +1 -1
- package/out/common/ClientOnly.js +13 -5
- package/out/common/ClientOnly.js.map +1 -1
- package/out/common/CopyButton.d.ts.map +1 -1
- package/out/common/CopyButton.js +1 -1
- package/out/common/CopyButton.js.map +1 -1
- package/out/common/KindBadge.d.ts.map +1 -1
- package/out/common/KindBadge.js.map +1 -1
- package/out/common/LoadingIndicator.d.ts.map +1 -1
- package/out/common/LoadingIndicator.js +1 -1
- package/out/common/LoadingIndicator.js.map +1 -1
- package/out/common/PresetChips.d.ts.map +1 -1
- package/out/common/PresetChips.js.map +1 -1
- package/out/common/cx.d.ts.map +1 -1
- package/out/common/cx.js.map +1 -1
- package/out/common/useClipboard.d.ts.map +1 -1
- package/out/common/useClipboard.js.map +1 -1
- package/out/common/useDebouncedValue.d.ts.map +1 -1
- package/out/common/useDebouncedValue.js.map +1 -1
- package/out/index.d.ts +17 -17
- package/out/index.d.ts.map +1 -1
- package/out/index.js +9 -9
- package/out/index.js.map +1 -1
- package/out/map/BackendControl.d.ts.map +1 -1
- package/out/map/BackendControl.js.map +1 -1
- package/out/map/CompareToggle.d.ts +1 -1
- package/out/map/CompareToggle.d.ts.map +1 -1
- package/out/map/CompareToggle.js.map +1 -1
- package/out/map/DemoControls.d.ts +4 -4
- package/out/map/DemoControls.d.ts.map +1 -1
- package/out/map/DemoControls.js.map +1 -1
- package/out/map/DemoMap.d.ts +2 -2
- package/out/map/DemoMap.d.ts.map +1 -1
- package/out/map/DemoMap.js.map +1 -1
- package/out/map/GeocoderDemo.d.ts +3 -3
- package/out/map/GeocoderDemo.d.ts.map +1 -1
- package/out/map/GeocoderDemo.js +25 -6
- package/out/map/GeocoderDemo.js.map +1 -1
- package/out/map/OverlayLayers.d.ts +3 -3
- package/out/map/OverlayLayers.d.ts.map +1 -1
- package/out/map/OverlayLayers.js +2 -2
- package/out/map/OverlayLayers.js.map +1 -1
- package/out/map/PlaceAutocomplete.d.ts +1 -1
- package/out/map/PlaceAutocomplete.d.ts.map +1 -1
- package/out/map/PlaceAutocomplete.js +1 -1
- package/out/map/PlaceAutocomplete.js.map +1 -1
- package/out/map/PlaceMarker.d.ts.map +1 -1
- package/out/map/PlaceMarker.js.map +1 -1
- package/out/map/ResolvedPlaceLayers.d.ts +1 -1
- package/out/map/ResolvedPlaceLayers.d.ts.map +1 -1
- package/out/map/ResolvedPlaceLayers.js.map +1 -1
- package/out/map/ResultCamera.d.ts +2 -2
- package/out/map/ResultCamera.d.ts.map +1 -1
- package/out/map/ResultCamera.js +1 -1
- package/out/map/ResultCamera.js.map +1 -1
- package/out/map/ResultOverlay.d.ts +2 -2
- package/out/map/ResultOverlay.d.ts.map +1 -1
- package/out/map/ResultOverlay.js.map +1 -1
- package/out/map/ResultPanel.d.ts +1 -1
- package/out/map/ResultPanel.d.ts.map +1 -1
- package/out/map/ResultPanel.js +1 -1
- package/out/map/ResultPanel.js.map +1 -1
- package/out/map/VersionPicker.d.ts +1 -1
- package/out/map/VersionPicker.d.ts.map +1 -1
- package/out/map/VersionPicker.js.map +1 -1
- package/out/map/geometry.d.ts.map +1 -1
- package/out/map/geometry.js +7 -7
- package/out/map/geometry.js.map +1 -1
- package/out/map/index.d.ts +12 -12
- package/out/map/index.d.ts.map +1 -1
- package/out/map/index.js +6 -6
- package/out/map/index.js.map +1 -1
- package/out/map/place-render.d.ts +2 -2
- package/out/map/place-render.d.ts.map +1 -1
- package/out/map/place-render.js +1 -1
- package/out/map/place-render.js.map +1 -1
- package/out/map/types.d.ts +11 -9
- package/out/map/types.d.ts.map +1 -1
- package/out/map/types.js +2 -2
- package/out/map/types.js.map +1 -1
- package/out/map/useCompareState.d.ts.map +1 -1
- package/out/map/useCompareState.js.map +1 -1
- package/out/map/useDemoGeocode.d.ts +3 -3
- package/out/map/useDemoGeocode.d.ts.map +1 -1
- package/out/map/useDemoGeocode.js +1 -1
- package/out/map/useDemoGeocode.js.map +1 -1
- package/out/map/useMapPlaceRender.d.ts +1 -1
- package/out/map/useMapPlaceRender.d.ts.map +1 -1
- package/out/map/useMapPlaceRender.js +1 -1
- package/out/map/useMapPlaceRender.js.map +1 -1
- package/out/map/usePlaceAutocomplete.d.ts +1 -1
- package/out/map/usePlaceAutocomplete.d.ts.map +1 -1
- package/out/map/usePlaceAutocomplete.js +34 -23
- package/out/map/usePlaceAutocomplete.js.map +1 -1
- package/out/pipeline/CandidatePicker.d.ts +1 -1
- package/out/pipeline/CandidatePicker.d.ts.map +1 -1
- package/out/pipeline/CandidatePicker.js +1 -1
- package/out/pipeline/CandidatePicker.js.map +1 -1
- package/out/pipeline/ComponentTable.d.ts +1 -1
- package/out/pipeline/ComponentTable.d.ts.map +1 -1
- package/out/pipeline/ComponentTable.js.map +1 -1
- package/out/pipeline/ConfidenceCell.d.ts.map +1 -1
- package/out/pipeline/ConfidenceCell.js +1 -1
- package/out/pipeline/ConfidenceCell.js.map +1 -1
- package/out/pipeline/PipelineExplorer.d.ts +1 -1
- package/out/pipeline/PipelineExplorer.d.ts.map +1 -1
- package/out/pipeline/PipelineExplorer.js +3 -3
- package/out/pipeline/PipelineExplorer.js.map +1 -1
- package/out/pipeline/QueryForm.d.ts +2 -2
- package/out/pipeline/QueryForm.d.ts.map +1 -1
- package/out/pipeline/QueryForm.js.map +1 -1
- package/out/pipeline/ResolvedPlace.d.ts +1 -1
- package/out/pipeline/ResolvedPlace.d.ts.map +1 -1
- package/out/pipeline/ResolvedPlace.js.map +1 -1
- package/out/pipeline/copy.d.ts +1 -1
- package/out/pipeline/copy.d.ts.map +1 -1
- package/out/pipeline/copy.js.map +1 -1
- package/out/pipeline/presets.d.ts.map +1 -1
- package/out/pipeline/presets.js +2 -1
- package/out/pipeline/presets.js.map +1 -1
- package/out/pipeline/types.d.ts.map +1 -1
- package/out/pipeline/types.js.map +1 -1
- package/out/pipeline/useParsePipeline.d.ts +1 -1
- package/out/pipeline/useParsePipeline.d.ts.map +1 -1
- package/out/pipeline/useParsePipeline.js.map +1 -1
- package/out/poi/AbstainPanel.d.ts.map +1 -1
- package/out/poi/AbstainPanel.js.map +1 -1
- package/out/poi/LiveResultsBlock.d.ts +1 -1
- package/out/poi/LiveResultsBlock.d.ts.map +1 -1
- package/out/poi/LiveResultsBlock.js +1 -1
- package/out/poi/LiveResultsBlock.js.map +1 -1
- package/out/poi/OverpassBlock.d.ts.map +1 -1
- package/out/poi/OverpassBlock.js.map +1 -1
- package/out/poi/POIExplorer.d.ts +1 -1
- package/out/poi/POIExplorer.d.ts.map +1 -1
- package/out/poi/POIExplorer.js +2 -2
- package/out/poi/POIExplorer.js.map +1 -1
- package/out/poi/QueryInput.d.ts.map +1 -1
- package/out/poi/QueryInput.js.map +1 -1
- package/out/poi/SubjectPanel.d.ts +1 -1
- package/out/poi/SubjectPanel.d.ts.map +1 -1
- package/out/poi/SubjectPanel.js.map +1 -1
- package/out/poi/runtime.d.ts +1 -1
- package/out/poi/runtime.d.ts.map +1 -1
- package/out/poi/runtime.js.map +1 -1
- package/out/poi/types.d.ts +1 -1
- package/out/poi/types.d.ts.map +1 -1
- package/out/poi/types.js +1 -1
- package/out/poi/types.js.map +1 -1
- package/out/poi/usePOISearch.d.ts +1 -1
- package/out/poi/usePOISearch.d.ts.map +1 -1
- package/out/poi/usePOISearch.js +75 -48
- package/out/poi/usePOISearch.js.map +1 -1
- package/out/runtime/useDemoRuntime.d.ts +2 -2
- package/out/runtime/useDemoRuntime.d.ts.map +1 -1
- package/out/runtime/useDemoRuntime.js +7 -5
- package/out/runtime/useDemoRuntime.js.map +1 -1
- package/package.json +338 -18
- package/styles.css +49 -19
- /package/{common → lib/common}/KindBadge.tsx +0 -0
- /package/{common → lib/common}/PresetChips.tsx +0 -0
- /package/{common → lib/common}/cx.ts +0 -0
- /package/{common → lib/common}/useClipboard.ts +0 -0
- /package/{common → lib/common}/useDebouncedValue.ts +0 -0
- /package/{map → lib/map}/BackendControl.tsx +0 -0
- /package/{map → lib/map}/PlaceMarker.tsx +0 -0
- /package/{map → lib/map}/useCompareState.ts +0 -0
- /package/{pipeline → lib/pipeline}/types.ts +0 -0
- /package/{poi → lib/poi}/AbstainPanel.tsx +0 -0
- /package/{poi → lib/poi}/OverpassBlock.tsx +0 -0
- /package/{poi → lib/poi}/QueryInput.tsx +0 -0
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# @mailwoman/react
|
|
2
2
|
|
|
3
|
-
React components + headless hooks for [mailwoman](https://mailwoman.
|
|
3
|
+
React components + headless hooks for [mailwoman](https://mailwoman.ai) — the
|
|
4
4
|
parse/geocode/POI explorers from the docs site, decomposed and packaged for use in any React app.
|
|
5
5
|
|
|
6
6
|
## What's in the box
|
|
@@ -10,7 +10,7 @@ Two composed explorers, plus the small presentational units and headless hooks t
|
|
|
10
10
|
- **`POIExplorer`** — a self-contained POI-intent tester (classify → subject → OverpassQL). The intent
|
|
11
11
|
path runs entirely offline over `@mailwoman/kind-classifier`, `@mailwoman/poi-taxonomy`, and
|
|
12
12
|
`@mailwoman/query-shape` — no weights, no network. A live poi.db search is opt-in via an injected
|
|
13
|
-
`runLiveSearch` probe, so the httpvfs/worker
|
|
13
|
+
`runLiveSearch` probe, so the httpvfs/worker implementation never enters this package's graph.
|
|
14
14
|
- **`PipelineExplorer`** — a parse + resolve tester driven by an **injected `PipelineRuntime`**. The
|
|
15
15
|
host supplies `runParse` (compute shape → classify → resolve) and the heavy visualizers as `panels`,
|
|
16
16
|
keeping onnxruntime-web, sql.js-httpvfs, and node builtins out of this package entirely.
|
|
@@ -8,11 +8,21 @@
|
|
|
8
8
|
* Remix, Docusaurus). It renders `fallback` on the server and the first client paint, then swaps to
|
|
9
9
|
* `children()` once mounted — keeping timers, clipboard, and dynamic imports off the server render.
|
|
10
10
|
*
|
|
11
|
-
* The mount flag
|
|
12
|
-
*
|
|
11
|
+
* The mount flag comes from `useSyncExternalStore` with a constant snapshot pair — `false` on the
|
|
12
|
+
* server, `true` in the browser — which is the store-shaped statement of exactly this boundary. The
|
|
13
|
+
* earlier `useState(false)` + `useEffect(() => setMounted(true))` said the same thing with a
|
|
14
|
+
* render-cascade the react(set-state-in-effect) rule rightly flags: the second render was the
|
|
15
|
+
* mechanism, not an accident, and the store form gets the same second paint without a set-state.
|
|
13
16
|
*/
|
|
14
17
|
|
|
15
|
-
import { type ReactNode,
|
|
18
|
+
import { type ReactNode, useSyncExternalStore } from "react"
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* The boundary never changes after mount, so nothing ever notifies.
|
|
22
|
+
*/
|
|
23
|
+
function subscribeNever(): () => void {
|
|
24
|
+
return () => {}
|
|
25
|
+
}
|
|
16
26
|
|
|
17
27
|
export interface ClientOnlyProps {
|
|
18
28
|
/**
|
|
@@ -26,9 +36,11 @@ export interface ClientOnlyProps {
|
|
|
26
36
|
}
|
|
27
37
|
|
|
28
38
|
export function ClientOnly({ children, fallback = null }: ClientOnlyProps): ReactNode {
|
|
29
|
-
const
|
|
30
|
-
|
|
31
|
-
|
|
39
|
+
const mounted = useSyncExternalStore(
|
|
40
|
+
subscribeNever,
|
|
41
|
+
() => true,
|
|
42
|
+
() => false
|
|
43
|
+
)
|
|
32
44
|
|
|
33
45
|
return mounted ? children() : fallback
|
|
34
46
|
}
|
|
@@ -21,17 +21,17 @@ export { ClientOnly } from "./common/ClientOnly.tsx"
|
|
|
21
21
|
export type { ClientOnlyProps } from "./common/ClientOnly.tsx"
|
|
22
22
|
export { CopyButton } from "./common/CopyButton.tsx"
|
|
23
23
|
export type { CopyButtonProps } from "./common/CopyButton.tsx"
|
|
24
|
-
export { cx } from "
|
|
25
|
-
export type { ClassValue } from "
|
|
24
|
+
export { cx } from "#common/cx"
|
|
25
|
+
export type { ClassValue } from "#common/cx"
|
|
26
26
|
export { KindBadge } from "./common/KindBadge.tsx"
|
|
27
27
|
export type { KindBadgeProps, KindBadgeResult } from "./common/KindBadge.tsx"
|
|
28
28
|
export { LoadingIndicator } from "./common/LoadingIndicator.tsx"
|
|
29
29
|
export type { LoadingIndicatorProps, LoadingMode } from "./common/LoadingIndicator.tsx"
|
|
30
30
|
export { PresetChips } from "./common/PresetChips.tsx"
|
|
31
31
|
export type { Preset, PresetChipsProps } from "./common/PresetChips.tsx"
|
|
32
|
-
export { useClipboard } from "
|
|
33
|
-
export type { UseClipboard } from "
|
|
34
|
-
export { useDebouncedValue } from "
|
|
32
|
+
export { useClipboard } from "#common/useClipboard"
|
|
33
|
+
export type { UseClipboard } from "#common/useClipboard"
|
|
34
|
+
export { useDebouncedValue } from "#common/useDebouncedValue"
|
|
35
35
|
|
|
36
36
|
// ── POI explorer ───────────────────────────────────────────────────────────
|
|
37
37
|
export { AbstainPanel } from "./poi/AbstainPanel.tsx"
|
|
@@ -44,7 +44,7 @@ export { POIExplorer } from "./poi/POIExplorer.tsx"
|
|
|
44
44
|
export type { POIExplorerProps } from "./poi/POIExplorer.tsx"
|
|
45
45
|
export { QueryInput } from "./poi/QueryInput.tsx"
|
|
46
46
|
export type { QueryInputProps } from "./poi/QueryInput.tsx"
|
|
47
|
-
export { formatDistance, loadPOIRuntime, POI_DEFAULT_TEXT, POI_PRESETS } from "
|
|
47
|
+
export { formatDistance, loadPOIRuntime, POI_DEFAULT_TEXT, POI_PRESETS } from "#poi/runtime"
|
|
48
48
|
export { SubjectPanel } from "./poi/SubjectPanel.tsx"
|
|
49
49
|
export type { SubjectPanelProps } from "./poi/SubjectPanel.tsx"
|
|
50
50
|
|
|
@@ -62,10 +62,10 @@ export type {
|
|
|
62
62
|
POISubject,
|
|
63
63
|
POISubjectBase,
|
|
64
64
|
TaxonomyLookup,
|
|
65
|
-
} from "
|
|
65
|
+
} from "#poi/types"
|
|
66
66
|
|
|
67
|
-
export { usePOISearch } from "
|
|
68
|
-
export type { UsePOISearch, UsePOISearchOptions } from "
|
|
67
|
+
export { usePOISearch } from "#poi/usePOISearch"
|
|
68
|
+
export type { UsePOISearch, UsePOISearchOptions } from "#poi/usePOISearch"
|
|
69
69
|
|
|
70
70
|
// ── Pipeline explorer ──────────────────────────────────────────────────────
|
|
71
71
|
export { CandidatePicker } from "./pipeline/CandidatePicker.tsx"
|
|
@@ -74,8 +74,8 @@ export { ComponentTable } from "./pipeline/ComponentTable.tsx"
|
|
|
74
74
|
export type { ComponentTableProps } from "./pipeline/ComponentTable.tsx"
|
|
75
75
|
export { ConfidenceCell } from "./pipeline/ConfidenceCell.tsx"
|
|
76
76
|
export type { ConfidenceCellProps } from "./pipeline/ConfidenceCell.tsx"
|
|
77
|
-
export { buildParsePayload } from "
|
|
78
|
-
export { PIPELINE_DEFAULT_ADDRESS, PIPELINE_PRESETS } from "
|
|
77
|
+
export { buildParsePayload } from "#pipeline/copy"
|
|
78
|
+
export { PIPELINE_DEFAULT_ADDRESS, PIPELINE_PRESETS } from "#pipeline/presets"
|
|
79
79
|
export { PipelineExplorer } from "./pipeline/PipelineExplorer.tsx"
|
|
80
80
|
export type { PipelineExplorerProps } from "./pipeline/PipelineExplorer.tsx"
|
|
81
81
|
export { QueryForm } from "./pipeline/QueryForm.tsx"
|
|
@@ -93,13 +93,13 @@ export type {
|
|
|
93
93
|
PipelineRuntime,
|
|
94
94
|
ResolvedPlaceView,
|
|
95
95
|
StageTiming,
|
|
96
|
-
} from "
|
|
96
|
+
} from "#pipeline/types"
|
|
97
97
|
|
|
98
|
-
export { useParsePipeline } from "
|
|
99
|
-
export type { UseParsePipeline, UseParsePipelineOptions } from "
|
|
98
|
+
export { useParsePipeline } from "#pipeline/useParsePipeline"
|
|
99
|
+
export type { UseParsePipeline, UseParsePipelineOptions } from "#pipeline/useParsePipeline"
|
|
100
100
|
|
|
101
101
|
// ── Demo runtime (shared load orchestration; node-safe — no onnx/httpvfs/maplibre) ──
|
|
102
|
-
export { useDemoRuntime } from "
|
|
102
|
+
export { useDemoRuntime } from "#runtime/useDemoRuntime"
|
|
103
103
|
|
|
104
104
|
export type {
|
|
105
105
|
DemoAssetsLoadContext,
|
|
@@ -107,7 +107,7 @@ export type {
|
|
|
107
107
|
DemoManifest,
|
|
108
108
|
DemoReleaseBase,
|
|
109
109
|
DemoRuntimeConfig,
|
|
110
|
-
} from "
|
|
110
|
+
} from "#runtime/useDemoRuntime"
|
|
111
111
|
|
|
112
112
|
// ── Map (types only from root) ──────────────────────────────────────────────
|
|
113
113
|
// The demo-map SURFACE lives behind the `@mailwoman/react/map` subpath so `maplibre-gl` / `react-map-gl`
|
|
@@ -125,4 +125,4 @@ export type {
|
|
|
125
125
|
MapBias,
|
|
126
126
|
OverlaySpec,
|
|
127
127
|
Suggestion,
|
|
128
|
-
} from "
|
|
128
|
+
} from "#map/index"
|
|
@@ -16,6 +16,11 @@
|
|
|
16
16
|
|
|
17
17
|
import type { ReactNode } from "react"
|
|
18
18
|
|
|
19
|
+
import type { DemoPanels, DemoRuntime } from "#map/types"
|
|
20
|
+
import type { UseCompareState } from "#map/useCompareState"
|
|
21
|
+
import type { UseDemoGeocode } from "#map/useDemoGeocode"
|
|
22
|
+
import type { UsePlaceAutocomplete } from "#map/usePlaceAutocomplete"
|
|
23
|
+
|
|
19
24
|
import { LoadingIndicator } from "../common/LoadingIndicator.tsx"
|
|
20
25
|
import { PresetChips, type Preset } from "../common/PresetChips.tsx"
|
|
21
26
|
import { QueryForm } from "../pipeline/QueryForm.tsx"
|
|
@@ -23,10 +28,6 @@ import { BackendControl } from "./BackendControl.tsx"
|
|
|
23
28
|
import { CompareToggle } from "./CompareToggle.tsx"
|
|
24
29
|
import { PlaceAutocomplete } from "./PlaceAutocomplete.tsx"
|
|
25
30
|
import { ResultPanel } from "./ResultPanel.tsx"
|
|
26
|
-
import type { DemoPanels, DemoRuntime } from "./types.ts"
|
|
27
|
-
import type { UseCompareState } from "./useCompareState.ts"
|
|
28
|
-
import type { UseDemoGeocode } from "./useDemoGeocode.ts"
|
|
29
|
-
import type { UsePlaceAutocomplete } from "./usePlaceAutocomplete.ts"
|
|
30
31
|
import { VersionPicker } from "./VersionPicker.tsx"
|
|
31
32
|
|
|
32
33
|
export interface DemoControlsProps {
|
|
@@ -31,7 +31,7 @@ import type { MapProps, MapRef, ViewStateChangeEvent } from "react-map-gl/maplib
|
|
|
31
31
|
export type DemoMapStyle = NonNullable<MapProps["mapStyle"]>
|
|
32
32
|
|
|
33
33
|
/**
|
|
34
|
-
*
|
|
34
|
+
* Override for the `<Map>` props `<DemoMap>` does not surface explicitly (e.g. `minZoom`, `attributionControl`,
|
|
35
35
|
* `maplibreLogo`). The controlled fields DemoMap owns are omitted so they can't be set twice.
|
|
36
36
|
*/
|
|
37
37
|
export type DemoMapExtraProps = Partial<
|
|
@@ -52,7 +52,7 @@ export interface DemoMapProps {
|
|
|
52
52
|
*/
|
|
53
53
|
viewState?: MapProps["viewState"]
|
|
54
54
|
/**
|
|
55
|
-
* Fired on every camera change (drag/zoom/rotate) — the
|
|
55
|
+
* Fired on every camera change (drag/zoom/rotate) — the hook for viewport-bias persistence.
|
|
56
56
|
*/
|
|
57
57
|
onMove?: (event: ViewStateChangeEvent) => void
|
|
58
58
|
/**
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* @author Teffen Ellis, et al.
|
|
5
5
|
*
|
|
6
6
|
* `<GeocoderDemo>` — the WHOLE geocoder demo, composed. It is the map analogue of `PipelineExplorer`
|
|
7
|
-
* and takes the SAME DI
|
|
7
|
+
* and takes the SAME DI shape: an injected {@link DemoRuntime} (the host owns ONNX / httpvfs / R2 /
|
|
8
8
|
* the composed map style) plus a {@link DemoPanels} bag (the host's ModelVisualizer / VersionCompare /
|
|
9
9
|
* About / Permalink). Everything here is composition + a `ClientOnly` boundary:
|
|
10
10
|
*
|
|
@@ -19,20 +19,21 @@
|
|
|
19
19
|
* over a fake runtime (offline stub style + canned geocode) with no network, no ONNX, no gazetteer.
|
|
20
20
|
*/
|
|
21
21
|
|
|
22
|
-
import { type ReactNode, useCallback, useRef } from "react"
|
|
22
|
+
import { type ReactNode, useCallback, useEffect, useRef } from "react"
|
|
23
23
|
import type { MapRef } from "react-map-gl/maplibre"
|
|
24
24
|
|
|
25
|
+
import type { DemoPanels, DemoRuntime, MapBias } from "#map/types"
|
|
26
|
+
import { useCompareState } from "#map/useCompareState"
|
|
27
|
+
import { useDemoGeocode } from "#map/useDemoGeocode"
|
|
28
|
+
import { useMapPlaceRender } from "#map/useMapPlaceRender"
|
|
29
|
+
import { usePlaceAutocomplete } from "#map/usePlaceAutocomplete"
|
|
30
|
+
|
|
25
31
|
import { ClientOnly } from "../common/ClientOnly.tsx"
|
|
26
32
|
import type { Preset } from "../common/PresetChips.tsx"
|
|
27
33
|
import { DemoControls } from "./DemoControls.tsx"
|
|
28
34
|
import { DemoMap } from "./DemoMap.tsx"
|
|
29
35
|
import { OverlayLayers } from "./OverlayLayers.tsx"
|
|
30
36
|
import { ResolvedPlaceLayers } from "./ResolvedPlaceLayers.tsx"
|
|
31
|
-
import type { DemoPanels, DemoRuntime, MapBias } from "./types.ts"
|
|
32
|
-
import { useCompareState } from "./useCompareState.ts"
|
|
33
|
-
import { useDemoGeocode } from "./useDemoGeocode.ts"
|
|
34
|
-
import { useMapPlaceRender } from "./useMapPlaceRender.ts"
|
|
35
|
-
import { usePlaceAutocomplete } from "./usePlaceAutocomplete.ts"
|
|
36
37
|
|
|
37
38
|
export interface GeocoderDemoProps {
|
|
38
39
|
/**
|
|
@@ -53,7 +54,7 @@ export interface GeocoderDemoProps {
|
|
|
53
54
|
presets?: ReadonlyArray<Preset>
|
|
54
55
|
/**
|
|
55
56
|
* Only hint the viewport bias once the visitor has zoomed past the global view — a whole-globe center is noise.
|
|
56
|
-
* Matches the demo's `map.getZoom() >= 4`
|
|
57
|
+
* Matches the demo's `map.getZoom() >= 4` threshold. @default 4
|
|
57
58
|
*/
|
|
58
59
|
minBiasZoom?: number
|
|
59
60
|
/**
|
|
@@ -81,6 +82,29 @@ function GeocoderDemoInner({
|
|
|
81
82
|
}: GeocoderDemoInnerProps): ReactNode {
|
|
82
83
|
const mapRef = useRef<MapRef>(null)
|
|
83
84
|
|
|
85
|
+
// TEST INJECTION POINT: the e2e viewport-bias suite drives the REAL map (pan + zoom past the bias threshold)
|
|
86
|
+
// before submitting, and a browser test cannot reach a React ref — so the live map handle is
|
|
87
|
+
// republished on `globalThis.__mailwomanDemoMap`, the same global the pre-port demo carried. The
|
|
88
|
+
// ref fills only after react-map-gl instantiates the map, hence the short poll; cleared on
|
|
89
|
+
// unmount so a torn-down demo never leaves a stale handle behind.
|
|
90
|
+
useEffect(() => {
|
|
91
|
+
const host = globalThis as { __mailwomanDemoMap?: ReturnType<MapRef["getMap"]> }
|
|
92
|
+
|
|
93
|
+
const timer = setInterval(() => {
|
|
94
|
+
const map = mapRef.current?.getMap()
|
|
95
|
+
|
|
96
|
+
if (map) {
|
|
97
|
+
host.__mailwomanDemoMap = map
|
|
98
|
+
clearInterval(timer)
|
|
99
|
+
}
|
|
100
|
+
}, 250)
|
|
101
|
+
|
|
102
|
+
return () => {
|
|
103
|
+
clearInterval(timer)
|
|
104
|
+
delete host.__mailwomanDemoMap
|
|
105
|
+
}
|
|
106
|
+
}, [])
|
|
107
|
+
|
|
84
108
|
// Read the viewport bias at submit time — through the map handle, never a threaded state value, so granting/zooming
|
|
85
109
|
// mid-session doesn't re-create the parse callback. Below the min-bias zoom, a whole-globe center is noise → null.
|
|
86
110
|
const getBias = useCallback((): MapBias | null => {
|
|
@@ -5,10 +5,10 @@
|
|
|
5
5
|
*
|
|
6
6
|
* `<OverlayLayers>` — renders the host-supplied {@link OverlaySpec}s (coverage "fog of war",
|
|
7
7
|
* race-dots, …) as declarative `<Source>` + `<Layer>`s. This replaces the demo's imperative
|
|
8
|
-
* `map.addSource` / `map.addLayer` overlay loops (and their `isStyleLoaded()` / `styledata`
|
|
8
|
+
* `map.addSource` / `map.addLayer` overlay loops (and their `isStyleLoaded()` / `styledata` guards):
|
|
9
9
|
* the host composes the specs, the package renders them, react-map-gl owns the add/remove lifecycle.
|
|
10
10
|
*
|
|
11
|
-
* Each overlay's `visible` flag flips the layers' `visibility` layout property — the declarative
|
|
11
|
+
* Each overlay's `visible` flag flips the layers' `visibility` layout property — the declarative control a
|
|
12
12
|
* layer-toggle control drives in a later phase. NODE-IMPORT SAFETY: imports `react-map-gl/maplibre` —
|
|
13
13
|
* reachable only via `@mailwoman/react/map`.
|
|
14
14
|
*/
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
import { Fragment, type ReactNode } from "react"
|
|
17
17
|
import { Layer, Source } from "react-map-gl/maplibre"
|
|
18
18
|
|
|
19
|
-
import type { OverlaySpec } from "
|
|
19
|
+
import type { OverlaySpec } from "#map/types"
|
|
20
20
|
|
|
21
21
|
export interface OverlayLayersProps {
|
|
22
22
|
/**
|
|
@@ -14,8 +14,8 @@
|
|
|
14
14
|
|
|
15
15
|
import type { ReactNode } from "react"
|
|
16
16
|
|
|
17
|
-
import { cx } from "
|
|
18
|
-
import type { Suggestion } from "
|
|
17
|
+
import { cx } from "#common/cx"
|
|
18
|
+
import type { Suggestion } from "#map/types"
|
|
19
19
|
|
|
20
20
|
export interface PlaceAutocompleteProps {
|
|
21
21
|
/**
|
|
@@ -15,7 +15,8 @@
|
|
|
15
15
|
|
|
16
16
|
import type { ReactNode } from "react"
|
|
17
17
|
|
|
18
|
-
import type { MapPlaceRenderSpec } from "
|
|
18
|
+
import type { MapPlaceRenderSpec } from "#map/place-render"
|
|
19
|
+
|
|
19
20
|
import { PlaceMarker } from "./PlaceMarker.tsx"
|
|
20
21
|
import { ResultCamera } from "./ResultCamera.tsx"
|
|
21
22
|
import { ResultOverlay } from "./ResultOverlay.tsx"
|
|
@@ -23,13 +23,13 @@ import type { FitBoundsOptions } from "maplibre-gl"
|
|
|
23
23
|
import { type ReactNode, useEffect } from "react"
|
|
24
24
|
import { useMap } from "react-map-gl/maplibre"
|
|
25
25
|
|
|
26
|
-
import type { MapCameraTarget } from "
|
|
26
|
+
import type { MapCameraTarget } from "#map/place-render"
|
|
27
27
|
|
|
28
28
|
/**
|
|
29
29
|
* The `fitBounds` options for a `bounds` target — and the reason this is a named function rather than an object literal
|
|
30
30
|
* at the call site.
|
|
31
31
|
*
|
|
32
|
-
* `duration` is present ONLY on the non-animated path, and its ABSENCE on the animated one is
|
|
32
|
+
* `duration` is present ONLY on the non-animated path, and its ABSENCE on the animated one is required. maplibre's
|
|
33
33
|
* `Camera.flyTo` (which `fitBounds` funnels into via `_fitInternal`) branches on `'duration' in options`, not on the
|
|
34
34
|
* value: an explicitly-passed `duration: undefined` therefore survives the key test and is coerced with `+undefined` →
|
|
35
35
|
* `NaN`. Every ease frame then computes `k = easing(elapsed / NaN)` → `NaN`, the flight-path math yields a `NaN` world
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* `<ResultOverlay>` — the resolved-place outline (crisp admin polygon, or an approximate/exact-radius
|
|
7
7
|
* circle) as a declarative `<Source>` + fill/line `<Layer>`s. This replaces the demo's imperative
|
|
8
8
|
* `setPlaceOutline` / `drawApproxCircle` / `drawPlaceGeometry` / `clearBbox` helpers and their
|
|
9
|
-
* `whenStyleReady`
|
|
9
|
+
* `whenStyleReady` guard: react-map-gl owns the "add source/layer once the style is loaded, remove on
|
|
10
10
|
* unmount" lifecycle, so the hand-rolled `isStyleLoaded()` / `styledata` races disappear.
|
|
11
11
|
*
|
|
12
12
|
* Pass the `outline` straight from a {@link MapPlaceRenderSpec}; a `null` outline renders nothing (the
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
import type { ReactNode } from "react"
|
|
17
17
|
import { Layer, Source } from "react-map-gl/maplibre"
|
|
18
18
|
|
|
19
|
-
import type { PlaceGeometry } from "
|
|
19
|
+
import type { PlaceGeometry } from "#map/geometry"
|
|
20
20
|
|
|
21
21
|
/**
|
|
22
22
|
* The house pink, matched to {@link PlaceMarker}.
|
|
@@ -16,13 +16,14 @@
|
|
|
16
16
|
|
|
17
17
|
import type { ReactNode } from "react"
|
|
18
18
|
|
|
19
|
+
import { buildParsePayload } from "#pipeline/copy"
|
|
20
|
+
import type { ParseResult, ResolvedPlaceView } from "#pipeline/types"
|
|
21
|
+
|
|
19
22
|
import { CopyButton } from "../common/CopyButton.tsx"
|
|
20
23
|
import { KindBadge } from "../common/KindBadge.tsx"
|
|
21
24
|
import { CandidatePicker } from "../pipeline/CandidatePicker.tsx"
|
|
22
25
|
import { ComponentTable } from "../pipeline/ComponentTable.tsx"
|
|
23
|
-
import { buildParsePayload } from "../pipeline/copy.ts"
|
|
24
26
|
import { ResolvedPlace } from "../pipeline/ResolvedPlace.tsx"
|
|
25
|
-
import type { ParseResult, ResolvedPlaceView } from "../pipeline/types.ts"
|
|
26
27
|
|
|
27
28
|
export interface ResultPanelProps {
|
|
28
29
|
/**
|
|
@@ -56,16 +56,16 @@ function kmPerDegLon(lat: number): number {
|
|
|
56
56
|
}
|
|
57
57
|
|
|
58
58
|
/**
|
|
59
|
-
* A closed 64-segment (65-point) GeoJSON ring of `
|
|
59
|
+
* A closed 64-segment (65-point) GeoJSON ring of `radiusKM` around `[lon, lat]`, with latitude correction.
|
|
60
60
|
*/
|
|
61
|
-
function circleRing(lat: number, lon: number,
|
|
61
|
+
function circleRing(lat: number, lon: number, radiusKM: number): number[][] {
|
|
62
62
|
const perLon = kmPerDegLon(lat)
|
|
63
63
|
const ring: number[][] = []
|
|
64
64
|
|
|
65
65
|
for (let i = 0; i <= CIRCLE_SEGMENTS; i++) {
|
|
66
66
|
const theta = (2 * Math.PI * i) / 64
|
|
67
67
|
|
|
68
|
-
ring.push([lon + (
|
|
68
|
+
ring.push([lon + (radiusKM * Math.cos(theta)) / perLon, lat + (radiusKM * Math.sin(theta)) / KM_PER_DEG_LAT])
|
|
69
69
|
}
|
|
70
70
|
|
|
71
71
|
return ring
|
|
@@ -81,9 +81,9 @@ export function approxCircleGeometry(lat: number, lon: number, bbox?: PlaceBBox)
|
|
|
81
81
|
? Math.hypot((bbox.maxLat - bbox.minLat) * KM_PER_DEG_LAT, (bbox.maxLon - bbox.minLon) * kmPerDegLon(lat)) / 2
|
|
82
82
|
: 3
|
|
83
83
|
|
|
84
|
-
const
|
|
84
|
+
const radiusKM = Math.min(50, Math.max(0.5, halfDiagKm))
|
|
85
85
|
|
|
86
|
-
return { type: "Polygon", coordinates: [circleRing(lat, lon,
|
|
86
|
+
return { type: "Polygon", coordinates: [circleRing(lat, lon, radiusKM)] }
|
|
87
87
|
}
|
|
88
88
|
|
|
89
89
|
/**
|
|
@@ -92,9 +92,9 @@ export function approxCircleGeometry(lat: number, lon: number, bbox?: PlaceBBox)
|
|
|
92
92
|
* honors small radii so an exact building reads as a tight dot (an ~8 m floor keeps a 10 m situs circle visible).
|
|
93
93
|
*/
|
|
94
94
|
export function radiusCircleGeometry(lat: number, lon: number, radiusM: number): PlaceGeometry {
|
|
95
|
-
const
|
|
95
|
+
const radiusKM = Math.max(0.008, radiusM / 1000)
|
|
96
96
|
|
|
97
|
-
return { type: "Polygon", coordinates: [circleRing(lat, lon,
|
|
97
|
+
return { type: "Polygon", coordinates: [circleRing(lat, lon, radiusKM)] }
|
|
98
98
|
}
|
|
99
99
|
|
|
100
100
|
/**
|
package/{map → lib/map}/index.ts
RENAMED
|
@@ -26,14 +26,14 @@ export type {
|
|
|
26
26
|
MapBias,
|
|
27
27
|
OverlaySpec,
|
|
28
28
|
Suggestion,
|
|
29
|
-
} from "
|
|
29
|
+
} from "#map/types"
|
|
30
30
|
|
|
31
31
|
// ── Pure geometry + render spec (node-safe; no react-map-gl at runtime) ──────
|
|
32
|
-
export { approxCircleGeometry, bboxToBounds, geomBounds, radiusCircleGeometry } from "
|
|
33
|
-
export type { BoundsTuple, PlaceBBox, PlaceGeometry } from "
|
|
34
|
-
export { cameraToViewState, computeMapPlaceRenderSpec } from "
|
|
35
|
-
export type { LngLat, MapCameraTarget, MapPlaceRenderSpec, PlaceTier, ResolvedMapPlace } from "
|
|
36
|
-
export { useMapPlaceRender } from "
|
|
32
|
+
export { approxCircleGeometry, bboxToBounds, geomBounds, radiusCircleGeometry } from "#map/geometry"
|
|
33
|
+
export type { BoundsTuple, PlaceBBox, PlaceGeometry } from "#map/geometry"
|
|
34
|
+
export { cameraToViewState, computeMapPlaceRenderSpec } from "#map/place-render"
|
|
35
|
+
export type { LngLat, MapCameraTarget, MapPlaceRenderSpec, PlaceTier, ResolvedMapPlace } from "#map/place-render"
|
|
36
|
+
export { useMapPlaceRender } from "#map/useMapPlaceRender"
|
|
37
37
|
|
|
38
38
|
// ── Declarative overlays (react-map-gl `<Marker>`/`<Source>`/`<Layer>`) ──────
|
|
39
39
|
export { OverlayLayers } from "./OverlayLayers.tsx"
|
|
@@ -60,17 +60,17 @@ export { PlaceAutocomplete } from "./PlaceAutocomplete.tsx"
|
|
|
60
60
|
export type { PlaceAutocompleteProps } from "./PlaceAutocomplete.tsx"
|
|
61
61
|
export { ResultPanel } from "./ResultPanel.tsx"
|
|
62
62
|
export type { ResultPanelProps } from "./ResultPanel.tsx"
|
|
63
|
-
export { useCompareState } from "
|
|
64
|
-
export type { UseCompareState } from "
|
|
65
|
-
export { useDemoGeocode } from "
|
|
66
|
-
export type { UseDemoGeocode, UseDemoGeocodeOptions } from "
|
|
67
|
-
export { usePlaceAutocomplete } from "
|
|
63
|
+
export { useCompareState } from "#map/useCompareState"
|
|
64
|
+
export type { UseCompareState } from "#map/useCompareState"
|
|
65
|
+
export { useDemoGeocode } from "#map/useDemoGeocode"
|
|
66
|
+
export type { UseDemoGeocode, UseDemoGeocodeOptions } from "#map/useDemoGeocode"
|
|
67
|
+
export { usePlaceAutocomplete } from "#map/usePlaceAutocomplete"
|
|
68
68
|
|
|
69
69
|
export type {
|
|
70
70
|
AutocompleteInputProps,
|
|
71
71
|
UsePlaceAutocomplete,
|
|
72
72
|
UsePlaceAutocompleteOptions,
|
|
73
|
-
} from "
|
|
73
|
+
} from "#map/usePlaceAutocomplete"
|
|
74
74
|
|
|
75
75
|
export { VersionPicker } from "./VersionPicker.tsx"
|
|
76
76
|
export type { VersionPickerProps } from "./VersionPicker.tsx"
|
|
@@ -19,9 +19,9 @@
|
|
|
19
19
|
* 5. bare point → no outline, fly to zoom 12
|
|
20
20
|
*/
|
|
21
21
|
|
|
22
|
-
import
|
|
23
|
-
import {
|
|
24
|
-
import type {
|
|
22
|
+
import { approxCircleGeometry, bboxToBounds, geomBounds, radiusCircleGeometry } from "#map/geometry"
|
|
23
|
+
import type { BoundsTuple, PlaceBBox, PlaceGeometry } from "#map/geometry"
|
|
24
|
+
import type { ResolvedPlaceView } from "#pipeline/types"
|
|
25
25
|
|
|
26
26
|
/**
|
|
27
27
|
* `[longitude, latitude]`.
|
package/{map → lib/map}/types.ts
RENAMED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* @license AGPL-3.0
|
|
4
4
|
* @author Teffen Ellis, et al.
|
|
5
5
|
*
|
|
6
|
-
* Types for the geocoder-demo map surface. Mirrors the pipeline
|
|
6
|
+
* Types for the geocoder-demo map surface. Mirrors the pipeline boundary: the package owns the UI state
|
|
7
7
|
* machine + the declarative map, while the host injects a {@link DemoRuntime} that owns ONNX / httpvfs
|
|
8
8
|
* / R2 and the composed map style. {@link DemoRuntime} EXTENDS {@link PipelineRuntime} so the shared
|
|
9
9
|
* `runParse` / `parseStageLabels` / `loading` contract is reused, and adds the map-specific surface
|
|
@@ -12,20 +12,23 @@
|
|
|
12
12
|
*
|
|
13
13
|
* The map-spec types are imported type-only from `react-map-gl/maplibre`; nothing here loads maplibre at
|
|
14
14
|
* runtime, so this module stays node-safe (its concrete-value CONSUMERS — `DemoMap`, `GeocoderDemo` —
|
|
15
|
-
* are the ones
|
|
15
|
+
* are the ones behind the `@mailwoman/react/map` subpath).
|
|
16
16
|
*/
|
|
17
17
|
|
|
18
18
|
import type { ReactNode } from "react"
|
|
19
19
|
import type { LayerSpecification, SourceSpecification } from "react-map-gl/maplibre"
|
|
20
20
|
|
|
21
|
-
import type {
|
|
21
|
+
import type { LngLat, ResolvedMapPlace } from "#map/place-render"
|
|
22
|
+
import type { ParseResult, PipelineRuntime, ResolvedPlaceView } from "#pipeline/types"
|
|
23
|
+
|
|
22
24
|
import type { DemoMapStyle } from "./DemoMap.tsx"
|
|
23
|
-
import type { ResolvedMapPlace } from "./place-render.ts"
|
|
24
25
|
|
|
25
26
|
/**
|
|
26
27
|
* `[longitude, latitude]`.
|
|
28
|
+
*
|
|
29
|
+
* @deprecated Alias kept for existing imports — {@link LngLat} (from `@mailwoman/react/map`) is the canonical name.
|
|
27
30
|
*/
|
|
28
|
-
export type LngLatTuple =
|
|
31
|
+
export type LngLatTuple = LngLat
|
|
29
32
|
|
|
30
33
|
/**
|
|
31
34
|
* A viewport bias handed to `runParse` — the map's current center (and optionally zoom) as a soft prior.
|
|
@@ -34,7 +37,7 @@ export interface MapBias {
|
|
|
34
37
|
/**
|
|
35
38
|
* Map center as `[lon, lat]`, typically read from `map.getCenter()`.
|
|
36
39
|
*/
|
|
37
|
-
center:
|
|
40
|
+
center: LngLat
|
|
38
41
|
/**
|
|
39
42
|
* Current zoom, if the host wants distance-aware biasing.
|
|
40
43
|
*/
|
|
@@ -125,7 +128,7 @@ export interface DemoRuntime extends PipelineRuntime {
|
|
|
125
128
|
/**
|
|
126
129
|
* Initial map center as `[lon, lat]` (the host's browser-geolocation result).
|
|
127
130
|
*/
|
|
128
|
-
initialCenter:
|
|
131
|
+
initialCenter: LngLat
|
|
129
132
|
/**
|
|
130
133
|
* Initial zoom for the first camera.
|
|
131
134
|
*/
|
|
@@ -280,8 +283,8 @@ export interface DemoPanels {
|
|
|
280
283
|
compare?: (context: DemoCompareContext) => ReactNode
|
|
281
284
|
/**
|
|
282
285
|
* The model-visualizer / debug drawer, mounted beside the map (host's ModelVisualizer). A render-prop so the host can
|
|
283
|
-
* trace the CURRENT result (its input) — the package passes the live parse result; the host
|
|
284
|
-
* state and returns `null` when the drawer is closed.
|
|
286
|
+
* trace the CURRENT result (its input) — the package passes the live parse result; the host decides on its own
|
|
287
|
+
* dev-mode state and returns `null` when the drawer is closed.
|
|
285
288
|
*/
|
|
286
289
|
debugDrawer?: (context: { result: ParseResult | null }) => ReactNode
|
|
287
290
|
/**
|
|
@@ -20,10 +20,10 @@
|
|
|
20
20
|
|
|
21
21
|
import { useMemo } from "react"
|
|
22
22
|
|
|
23
|
-
import type {
|
|
24
|
-
import {
|
|
25
|
-
import type {
|
|
26
|
-
import
|
|
23
|
+
import type { ResolvedMapPlace } from "#map/place-render"
|
|
24
|
+
import type { DemoRuntime, MapBias } from "#map/types"
|
|
25
|
+
import type { PipelineRuntime } from "#pipeline/types"
|
|
26
|
+
import { useParsePipeline, type UseParsePipeline } from "#pipeline/useParsePipeline"
|
|
27
27
|
|
|
28
28
|
export interface UseDemoGeocodeOptions {
|
|
29
29
|
/**
|
|
@@ -12,8 +12,8 @@
|
|
|
12
12
|
|
|
13
13
|
import { useMemo } from "react"
|
|
14
14
|
|
|
15
|
-
import { computeMapPlaceRenderSpec } from "
|
|
16
|
-
import type { MapPlaceRenderSpec, ResolvedMapPlace } from "
|
|
15
|
+
import { computeMapPlaceRenderSpec } from "#map/place-render"
|
|
16
|
+
import type { MapPlaceRenderSpec, ResolvedMapPlace } from "#map/place-render"
|
|
17
17
|
|
|
18
18
|
/**
|
|
19
19
|
* Memoize the render spec for a resolved place; `null` in → `null` out (nothing to draw).
|