@mailwoman/react 9.3.0 → 9.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/fonts.css +59 -0
- package/lib/common/About.tsx +89 -0
- package/lib/common/KindBadge.tsx +2 -7
- package/lib/common/confidence-tiers.ts +50 -0
- package/lib/common/text-tokens.ts +88 -0
- package/lib/index.ts +30 -28
- package/lib/map/CompareToggle.tsx +2 -2
- package/lib/map/{GeocoderDemo.tsx → Geocoder.tsx} +40 -40
- package/lib/map/{DemoControls.tsx → GeocoderControls.tsx} +16 -17
- package/lib/map/{DemoMap.tsx → MapCanvas.tsx} +15 -15
- package/lib/map/PlaceMarker.tsx +1 -1
- package/lib/map/ResolvedPlaceLayers.tsx +3 -3
- package/lib/map/ResultCamera.tsx +1 -1
- package/lib/map/ResultPanel.tsx +2 -2
- package/lib/map/VersionPicker.tsx +3 -3
- package/lib/map/fake-runtime.ts +122 -0
- package/lib/map/index.ts +16 -16
- package/lib/map/map-debug.ts +51 -0
- package/lib/map/place-render.ts +3 -2
- package/lib/map/types.ts +41 -39
- package/lib/map/{useDemoGeocode.ts → useGeocode.ts} +8 -8
- package/lib/pipeline/CandidatePicker.tsx +1 -1
- package/lib/pipeline/ComponentTable.tsx +1 -2
- package/lib/pipeline/ConfidenceCell.tsx +7 -19
- package/lib/pipeline/FailureDiagnostic.tsx +56 -0
- package/lib/pipeline/ResolvedPlace.tsx +17 -4
- package/lib/pipeline/SpanHighlight.tsx +97 -0
- package/lib/pipeline/TimingPanel.tsx +65 -0
- package/lib/pipeline/TreeView.tsx +55 -0
- package/lib/pipeline/copy.ts +1 -1
- package/lib/pipeline/types.ts +2 -75
- package/lib/pipeline/useParsePipeline.ts +2 -1
- package/lib/poi/types.ts +2 -1
- package/lib/runtime/{useDemoRuntime.ts → useReleaseRuntime.ts} +22 -24
- package/out/common/About.d.ts +12 -0
- package/out/common/About.d.ts.map +1 -0
- package/out/common/About.js +5 -0
- package/out/common/About.js.map +1 -0
- package/out/common/KindBadge.d.ts +2 -9
- package/out/common/KindBadge.d.ts.map +1 -1
- package/out/common/KindBadge.js.map +1 -1
- package/out/common/confidence-tiers.d.ts +36 -0
- package/out/common/confidence-tiers.d.ts.map +1 -0
- package/out/common/confidence-tiers.js +42 -0
- package/out/common/confidence-tiers.js.map +1 -0
- package/out/common/text-tokens.d.ts +46 -0
- package/out/common/text-tokens.d.ts.map +1 -0
- package/out/common/text-tokens.js +52 -0
- package/out/common/text-tokens.js.map +1 -0
- package/out/index.d.ts +14 -5
- package/out/index.d.ts.map +1 -1
- package/out/index.js +8 -2
- package/out/index.js.map +1 -1
- package/out/map/CompareToggle.d.ts +2 -2
- package/out/map/CompareToggle.d.ts.map +1 -1
- package/out/map/{GeocoderDemo.d.ts → Geocoder.d.ts} +17 -17
- package/out/map/Geocoder.d.ts.map +1 -0
- package/out/map/{GeocoderDemo.js → Geocoder.js} +25 -25
- package/out/map/Geocoder.js.map +1 -0
- package/out/map/{DemoControls.d.ts → GeocoderControls.d.ts} +16 -17
- package/out/map/GeocoderControls.d.ts.map +1 -0
- package/out/map/{DemoControls.js → GeocoderControls.js} +2 -2
- package/out/map/GeocoderControls.js.map +1 -0
- package/out/map/{DemoMap.d.ts → MapCanvas.d.ts} +15 -15
- package/out/map/MapCanvas.d.ts.map +1 -0
- package/out/map/{DemoMap.js → MapCanvas.js} +2 -2
- package/out/map/MapCanvas.js.map +1 -0
- package/out/map/PlaceMarker.d.ts +1 -1
- package/out/map/ResolvedPlaceLayers.d.ts +3 -3
- package/out/map/ResultCamera.d.ts +1 -1
- package/out/map/ResultCamera.js +1 -1
- package/out/map/ResultPanel.d.ts +2 -2
- package/out/map/ResultPanel.d.ts.map +1 -1
- package/out/map/ResultPanel.js.map +1 -1
- package/out/map/VersionPicker.d.ts +3 -3
- package/out/map/VersionPicker.d.ts.map +1 -1
- package/out/map/fake-runtime.d.ts +38 -0
- package/out/map/fake-runtime.d.ts.map +1 -0
- package/out/map/fake-runtime.js +107 -0
- package/out/map/fake-runtime.js.map +1 -0
- package/out/map/index.d.ts +10 -10
- 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/map-debug.d.ts +31 -0
- package/out/map/map-debug.d.ts.map +1 -0
- package/out/map/map-debug.js +31 -0
- package/out/map/map-debug.js.map +1 -0
- 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 +41 -39
- package/out/map/types.d.ts.map +1 -1
- package/out/map/types.js +5 -5
- package/out/map/{useDemoGeocode.d.ts → useGeocode.d.ts} +9 -9
- package/out/map/useGeocode.d.ts.map +1 -0
- package/out/map/{useDemoGeocode.js → useGeocode.js} +4 -4
- package/out/map/useGeocode.js.map +1 -0
- package/out/pipeline/CandidatePicker.d.ts +1 -1
- package/out/pipeline/CandidatePicker.d.ts.map +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 +2 -2
- package/out/pipeline/ConfidenceCell.d.ts.map +1 -1
- package/out/pipeline/ConfidenceCell.js +4 -16
- package/out/pipeline/ConfidenceCell.js.map +1 -1
- package/out/pipeline/FailureDiagnostic.d.ts +15 -0
- package/out/pipeline/FailureDiagnostic.d.ts.map +1 -0
- package/out/pipeline/FailureDiagnostic.js +21 -0
- package/out/pipeline/FailureDiagnostic.js.map +1 -0
- package/out/pipeline/ResolvedPlace.d.ts +1 -1
- package/out/pipeline/ResolvedPlace.d.ts.map +1 -1
- package/out/pipeline/ResolvedPlace.js +4 -10
- package/out/pipeline/ResolvedPlace.js.map +1 -1
- package/out/pipeline/SpanHighlight.d.ts +23 -0
- package/out/pipeline/SpanHighlight.d.ts.map +1 -0
- package/out/pipeline/SpanHighlight.js +31 -0
- package/out/pipeline/SpanHighlight.js.map +1 -0
- package/out/pipeline/TimingPanel.d.ts +16 -0
- package/out/pipeline/TimingPanel.d.ts.map +1 -0
- package/out/pipeline/TimingPanel.js +20 -0
- package/out/pipeline/TimingPanel.js.map +1 -0
- package/out/pipeline/TreeView.d.ts +17 -0
- package/out/pipeline/TreeView.d.ts.map +1 -0
- package/out/pipeline/TreeView.js +15 -0
- package/out/pipeline/TreeView.js.map +1 -0
- package/out/pipeline/copy.d.ts +1 -1
- package/out/pipeline/copy.d.ts.map +1 -1
- package/out/pipeline/types.d.ts +2 -68
- package/out/pipeline/types.d.ts.map +1 -1
- package/out/pipeline/types.js +1 -1
- package/out/pipeline/useParsePipeline.d.ts +2 -1
- package/out/pipeline/useParsePipeline.d.ts.map +1 -1
- package/out/pipeline/useParsePipeline.js.map +1 -1
- package/out/poi/types.d.ts +2 -1
- package/out/poi/types.d.ts.map +1 -1
- package/out/runtime/{useDemoRuntime.d.ts → useReleaseRuntime.d.ts} +18 -20
- package/out/runtime/useReleaseRuntime.d.ts.map +1 -0
- package/out/runtime/{useDemoRuntime.js → useReleaseRuntime.js} +4 -4
- package/out/runtime/useReleaseRuntime.js.map +1 -0
- package/package.json +139 -29
- package/styleframe.config.ts +321 -0
- package/styles.css +1074 -664
- package/tokens/index.css +115 -0
- package/tokens/tokens.json +521 -0
- package/tokens/tokens.resolver.json +185 -0
- package/out/map/DemoControls.d.ts.map +0 -1
- package/out/map/DemoControls.js.map +0 -1
- package/out/map/DemoMap.d.ts.map +0 -1
- package/out/map/DemoMap.js.map +0 -1
- package/out/map/GeocoderDemo.d.ts.map +0 -1
- package/out/map/GeocoderDemo.js.map +0 -1
- package/out/map/useDemoGeocode.d.ts.map +0 -1
- package/out/map/useDemoGeocode.js.map +0 -1
- package/out/runtime/useDemoRuntime.d.ts.map +0 -1
- package/out/runtime/useDemoRuntime.js.map +0 -1
|
@@ -3,33 +3,33 @@
|
|
|
3
3
|
* @license AGPL-3.0
|
|
4
4
|
* @author Teffen Ellis, et al.
|
|
5
5
|
*
|
|
6
|
-
* `<
|
|
7
|
-
* and takes the SAME DI shape: an injected {@link
|
|
8
|
-
* the composed map style) plus a {@link
|
|
6
|
+
* `<Geocoder>` — the WHOLE geocoder, composed. It is the map analogue of `PipelineExplorer`
|
|
7
|
+
* and takes the SAME DI shape: an injected {@link GeocoderRuntime} (the host owns ONNX / httpvfs / R2 /
|
|
8
|
+
* the composed map style) plus a {@link GeocoderPanels} bag (the host's ModelVisualizer / VersionCompare /
|
|
9
9
|
* About / Permalink). Everything here is composition + a `ClientOnly` boundary:
|
|
10
10
|
*
|
|
11
|
-
* - the floating {@link
|
|
12
|
-
* - the declarative {@link
|
|
11
|
+
* - the floating {@link GeocoderControls} panel (version / compare / backend / query+autocomplete / result),
|
|
12
|
+
* - the declarative {@link MapCanvas} with the phase-2 overlays ({@link OverlayLayers}) and the
|
|
13
13
|
* resolved-place marker/outline/camera ({@link ResolvedPlaceLayers}) driven by the parse state,
|
|
14
|
-
* - the hooks that wire them: {@link
|
|
14
|
+
* - the hooks that wire them: {@link useGeocode} (parse + viewport bias + map place),
|
|
15
15
|
* {@link usePlaceAutocomplete}, {@link useCompareState}.
|
|
16
16
|
*
|
|
17
|
-
* Because it pulls {@link
|
|
17
|
+
* Because it pulls {@link MapCanvas} (→ `react-map-gl` → `maplibre-gl`, WebGL + DOM at import), it lives on
|
|
18
18
|
* the `@mailwoman/react/map` subpath ONLY — never the package root. The whole thing renders in Storybook
|
|
19
19
|
* over a fake runtime (offline stub style + canned geocode) with no network, no ONNX, no gazetteer.
|
|
20
20
|
*/
|
|
21
21
|
import { type ReactNode } from "react";
|
|
22
|
-
import type {
|
|
22
|
+
import type { GeocoderPanels, GeocoderRuntime } from "#map/types";
|
|
23
23
|
import type { Preset } from "../common/PresetChips.tsx";
|
|
24
|
-
export interface
|
|
24
|
+
export interface GeocoderProps {
|
|
25
25
|
/**
|
|
26
|
-
* The injected
|
|
26
|
+
* The injected geocoder runtime (map style + overlays + parse + version/backend).
|
|
27
27
|
*/
|
|
28
|
-
runtime:
|
|
28
|
+
runtime: GeocoderRuntime;
|
|
29
29
|
/**
|
|
30
30
|
* Host-injected panels (about, release blurb, compare, permalink, debug drawer, map controls, …).
|
|
31
31
|
*/
|
|
32
|
-
panels?:
|
|
32
|
+
panels?: GeocoderPanels;
|
|
33
33
|
/**
|
|
34
34
|
* Address to pre-fill.
|
|
35
35
|
*/
|
|
@@ -40,18 +40,18 @@ export interface GeocoderDemoProps {
|
|
|
40
40
|
presets?: ReadonlyArray<Preset>;
|
|
41
41
|
/**
|
|
42
42
|
* Only hint the viewport bias once the visitor has zoomed past the global view — a whole-globe center is noise.
|
|
43
|
-
* Matches the
|
|
43
|
+
* Matches the `map.getZoom() >= 4` threshold. @default 4
|
|
44
44
|
*/
|
|
45
45
|
minBiasZoom?: number;
|
|
46
46
|
/**
|
|
47
47
|
* Fly/fit the map to the resolved place on each result (via {@link ResolvedPlaceLayers}). @default true. Set false
|
|
48
|
-
* for a host that drives the camera itself (a controlled `<
|
|
48
|
+
* for a host that drives the camera itself (a controlled `<MapCanvas viewState>`), or to keep a headless test
|
|
49
49
|
* deterministic — the marker + outline still render, only the animated camera move is skipped.
|
|
50
50
|
*/
|
|
51
51
|
applyResultCamera?: boolean;
|
|
52
52
|
}
|
|
53
53
|
/**
|
|
54
|
-
* The composed geocoder
|
|
54
|
+
* The composed geocoder, behind a `ClientOnly` SSR boundary (the map is intrinsically a client component).
|
|
55
55
|
*/
|
|
56
|
-
export declare function
|
|
57
|
-
//# sourceMappingURL=
|
|
56
|
+
export declare function Geocoder({ runtime, panels, defaultAddress, presets, minBiasZoom, applyResultCamera, }: GeocoderProps): ReactNode;
|
|
57
|
+
//# sourceMappingURL=Geocoder.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Geocoder.d.ts","sourceRoot":"","sources":["../../lib/map/Geocoder.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EAAE,KAAK,SAAS,EAAkC,MAAM,OAAO,CAAA;AAGtE,OAAO,KAAK,EAAE,cAAc,EAAE,eAAe,EAAW,MAAM,YAAY,CAAA;AAO1E,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,2BAA2B,CAAA;AAMvD,MAAM,WAAW,aAAa;IAC7B;;OAEG;IACH,OAAO,EAAE,eAAe,CAAA;IACxB;;OAEG;IACH,MAAM,CAAC,EAAE,cAAc,CAAA;IACvB;;OAEG;IACH,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB;;OAEG;IACH,OAAO,CAAC,EAAE,aAAa,CAAC,MAAM,CAAC,CAAA;IAC/B;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB;;;;OAIG;IACH,iBAAiB,CAAC,EAAE,OAAO,CAAA;CAC3B;AA0HD;;GAEG;AACH,wBAAgB,QAAQ,CAAC,EACxB,OAAO,EACP,MAAkB,EAClB,cAAmB,EACnB,OAAoB,EACpB,WAAe,EACf,iBAAwB,GACxB,EAAE,aAAa,GAAG,SAAS,CAqB3B"}
|
|
@@ -4,50 +4,50 @@ 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
|
-
* `<
|
|
8
|
-
* and takes the SAME DI shape: an injected {@link
|
|
9
|
-
* the composed map style) plus a {@link
|
|
7
|
+
* `<Geocoder>` — the WHOLE geocoder, composed. It is the map analogue of `PipelineExplorer`
|
|
8
|
+
* and takes the SAME DI shape: an injected {@link GeocoderRuntime} (the host owns ONNX / httpvfs / R2 /
|
|
9
|
+
* the composed map style) plus a {@link GeocoderPanels} bag (the host's ModelVisualizer / VersionCompare /
|
|
10
10
|
* About / Permalink). Everything here is composition + a `ClientOnly` boundary:
|
|
11
11
|
*
|
|
12
|
-
* - the floating {@link
|
|
13
|
-
* - the declarative {@link
|
|
12
|
+
* - the floating {@link GeocoderControls} panel (version / compare / backend / query+autocomplete / result),
|
|
13
|
+
* - the declarative {@link MapCanvas} with the phase-2 overlays ({@link OverlayLayers}) and the
|
|
14
14
|
* resolved-place marker/outline/camera ({@link ResolvedPlaceLayers}) driven by the parse state,
|
|
15
|
-
* - the hooks that wire them: {@link
|
|
15
|
+
* - the hooks that wire them: {@link useGeocode} (parse + viewport bias + map place),
|
|
16
16
|
* {@link usePlaceAutocomplete}, {@link useCompareState}.
|
|
17
17
|
*
|
|
18
|
-
* Because it pulls {@link
|
|
18
|
+
* Because it pulls {@link MapCanvas} (→ `react-map-gl` → `maplibre-gl`, WebGL + DOM at import), it lives on
|
|
19
19
|
* the `@mailwoman/react/map` subpath ONLY — never the package root. The whole thing renders in Storybook
|
|
20
20
|
* over a fake runtime (offline stub style + canned geocode) with no network, no ONNX, no gazetteer.
|
|
21
21
|
*/
|
|
22
22
|
import { useCallback, useEffect, useRef } from "react";
|
|
23
23
|
import { useCompareState } from "#map/useCompareState";
|
|
24
|
-
import {
|
|
24
|
+
import { useGeocode } from "#map/useGeocode";
|
|
25
25
|
import { useMapPlaceRender } from "#map/useMapPlaceRender";
|
|
26
26
|
import { usePlaceAutocomplete } from "#map/usePlaceAutocomplete";
|
|
27
27
|
import { ClientOnly } from "../common/ClientOnly.js";
|
|
28
|
-
import {
|
|
29
|
-
import {
|
|
28
|
+
import { GeocoderControls } from "./GeocoderControls.js";
|
|
29
|
+
import { MapCanvas } from "./MapCanvas.js";
|
|
30
30
|
import { OverlayLayers } from "./OverlayLayers.js";
|
|
31
31
|
import { ResolvedPlaceLayers } from "./ResolvedPlaceLayers.js";
|
|
32
|
-
function
|
|
32
|
+
function GeocoderInner({ runtime, panels, defaultAddress, presets, minBiasZoom, applyResultCamera, }) {
|
|
33
33
|
const mapRef = useRef(null);
|
|
34
34
|
// TEST INJECTION POINT: the e2e viewport-bias suite drives the REAL map (pan + zoom past the bias threshold)
|
|
35
35
|
// before submitting, and a browser test cannot reach a React ref — so the live map handle is
|
|
36
|
-
// republished on `globalThis.
|
|
37
|
-
//
|
|
38
|
-
//
|
|
36
|
+
// republished on `globalThis.__mailwomanMapCanvas`. The ref fills only after react-map-gl instantiates
|
|
37
|
+
// the map, hence the short poll; cleared on unmount so a torn-down geocoder never leaves a stale
|
|
38
|
+
// handle behind.
|
|
39
39
|
useEffect(() => {
|
|
40
40
|
const host = globalThis;
|
|
41
41
|
const timer = setInterval(() => {
|
|
42
42
|
const map = mapRef.current?.getMap();
|
|
43
43
|
if (map) {
|
|
44
|
-
host.
|
|
44
|
+
host.__mailwomanMapCanvas = map;
|
|
45
45
|
clearInterval(timer);
|
|
46
46
|
}
|
|
47
47
|
}, 250);
|
|
48
48
|
return () => {
|
|
49
49
|
clearInterval(timer);
|
|
50
|
-
delete host.
|
|
50
|
+
delete host.__mailwomanMapCanvas;
|
|
51
51
|
};
|
|
52
52
|
}, []);
|
|
53
53
|
// Read the viewport bias at submit time — through the map handle, never a threaded state value, so granting/zooming
|
|
@@ -62,7 +62,7 @@ function GeocoderDemoInner({ runtime, panels, defaultAddress, presets, minBiasZo
|
|
|
62
62
|
const center = map.getCenter();
|
|
63
63
|
return { center: [center.lng, center.lat], zoom };
|
|
64
64
|
}, [minBiasZoom]);
|
|
65
|
-
const geocode =
|
|
65
|
+
const geocode = useGeocode({ runtime, defaultText: defaultAddress, getBias });
|
|
66
66
|
const compare = useCompareState();
|
|
67
67
|
const autocomplete = usePlaceAutocomplete({
|
|
68
68
|
text: geocode.text,
|
|
@@ -75,14 +75,14 @@ function GeocoderDemoInner({ runtime, panels, defaultAddress, presets, minBiasZo
|
|
|
75
75
|
compare.clearIfPrimary(version);
|
|
76
76
|
}, [runtime, compare]);
|
|
77
77
|
const onForceWASMChange = useCallback((forceWASM) => runtime.setForceWASM?.(forceWASM), [runtime]);
|
|
78
|
-
return (_jsxs("div", { className: "mw-geocoder-demo", children: [_jsx("div", { className: "mw-geocoder-demo__map", children: _jsxs(
|
|
78
|
+
return (_jsxs("div", { className: "mw-geocoder-demo", children: [_jsx("div", { className: "mw-geocoder-demo__map", children: _jsxs(MapCanvas, { mapStyle: runtime.mapStyle, mapRef: mapRef, initialViewState: {
|
|
79
79
|
longitude: runtime.initialCenter[0],
|
|
80
80
|
latitude: runtime.initialCenter[1],
|
|
81
81
|
zoom: runtime.initialZoom ?? 3,
|
|
82
82
|
}, style: { width: "100%", height: "100%" },
|
|
83
|
-
//
|
|
84
|
-
//
|
|
85
|
-
mapProps: { attributionControl: { compact: true }, maplibreLogo: false }, children: [_jsx(OverlayLayers, { overlays: runtime.overlays }), _jsx(ResolvedPlaceLayers, { spec: spec, applyCamera: applyResultCamera }), panels.mapControls] }) }), _jsx(
|
|
83
|
+
// One compact attribution pill (the map's own default is a wide, always-open "MapLibre | © …" bar), no
|
|
84
|
+
// maplibre wordmark logo.
|
|
85
|
+
mapProps: { attributionControl: { compact: true }, maplibreLogo: false }, children: [_jsx(OverlayLayers, { overlays: runtime.overlays }), _jsx(ResolvedPlaceLayers, { spec: spec, applyCamera: applyResultCamera }), panels.mapControls] }) }), _jsx(GeocoderControls, { runtime: runtime, geocode: geocode, autocomplete: autocomplete, compare: compare, panels: panels, presets: presets, placeholder: defaultAddress, onSelectVersion: onSelectVersion, onForceWASMChange: onForceWASMChange }), panels.debugDrawer ? panels.debugDrawer({ result: geocode.result }) : null] }));
|
|
86
86
|
}
|
|
87
87
|
/**
|
|
88
88
|
* Stable empty defaults — a fresh `{}`/`[]` per render would churn every downstream memo dep.
|
|
@@ -90,9 +90,9 @@ function GeocoderDemoInner({ runtime, panels, defaultAddress, presets, minBiasZo
|
|
|
90
90
|
const NO_PANELS = {};
|
|
91
91
|
const NO_PRESETS = [];
|
|
92
92
|
/**
|
|
93
|
-
* The composed geocoder
|
|
93
|
+
* The composed geocoder, behind a `ClientOnly` SSR boundary (the map is intrinsically a client component).
|
|
94
94
|
*/
|
|
95
|
-
export function
|
|
96
|
-
return (_jsx(ClientOnly, { fallback: _jsx("div", { className: "mw-geocoder-demo", children: _jsx("p", { children: "Loading
|
|
95
|
+
export function Geocoder({ runtime, panels = NO_PANELS, defaultAddress = "", presets = NO_PRESETS, minBiasZoom = 4, applyResultCamera = true, }) {
|
|
96
|
+
return (_jsx(ClientOnly, { fallback: _jsx("div", { className: "mw-geocoder-demo", children: _jsx("p", { children: "Loading the geocoder\u2026" }) }), children: () => (_jsx(GeocoderInner, { runtime: runtime, panels: panels, defaultAddress: defaultAddress, presets: presets, minBiasZoom: minBiasZoom, applyResultCamera: applyResultCamera })) }));
|
|
97
97
|
}
|
|
98
|
-
//# sourceMappingURL=
|
|
98
|
+
//# sourceMappingURL=Geocoder.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Geocoder.js","sourceRoot":"","sources":["../../lib/map/Geocoder.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EAAkB,WAAW,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,OAAO,CAAA;AAItE,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAA;AACtD,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AAC5C,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAA;AAC1D,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAA;AAEhE,OAAO,EAAE,UAAU,EAAE,MAAM,yBAA0B,CAAA;AAErD,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAwB,CAAA;AACzD,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAiB,CAAA;AAC3C,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAqB,CAAA;AACnD,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA2B,CAAA;AAuC/D,SAAS,aAAa,CAAC,EACtB,OAAO,EACP,MAAM,EACN,cAAc,EACd,OAAO,EACP,WAAW,EACX,iBAAiB,G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ellis, et al.
|
|
5
5
|
*
|
|
6
|
-
* `<
|
|
6
|
+
* `<GeocoderControls>` — the geocoder's floating control panel, assembled from the geocoder-specific units
|
|
7
7
|
* (VersionPicker / CompareToggle / BackendControl / PlaceAutocomplete / ResultPanel) and the REUSED
|
|
8
|
-
* pipeline units (QueryForm / PresetChips / LoadingIndicator). It
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
* + {@link useCompareState} hooks into the controls. Host-specific visualizers arrive via {@link DemoPanels}.
|
|
8
|
+
* pipeline units (QueryForm / PresetChips / LoadingIndicator). It reads the injected {@link GeocoderRuntime}
|
|
9
|
+
* for ready/version/backend/loading state and threads the {@link useGeocode} + {@link usePlaceAutocomplete}
|
|
10
|
+
* + {@link useCompareState} hooks into the controls. Host-specific visualizers arrive via {@link GeocoderPanels}.
|
|
12
11
|
*
|
|
13
|
-
* NODE-SAFE: pure React + the shared/
|
|
14
|
-
*
|
|
12
|
+
* NODE-SAFE: pure React + the shared/geocoder units, no maplibre. It rides `@mailwoman/react/map` as a
|
|
13
|
+
* geocoder-specific control, not for WebGL.
|
|
15
14
|
*/
|
|
16
15
|
import type { ReactNode } from "react";
|
|
17
|
-
import type {
|
|
16
|
+
import type { GeocoderPanels, GeocoderRuntime } from "#map/types";
|
|
18
17
|
import type { UseCompareState } from "#map/useCompareState";
|
|
19
|
-
import type {
|
|
18
|
+
import type { UseGeocode } from "#map/useGeocode";
|
|
20
19
|
import type { UsePlaceAutocomplete } from "#map/usePlaceAutocomplete";
|
|
21
20
|
import { type Preset } from "../common/PresetChips.tsx";
|
|
22
|
-
export interface
|
|
21
|
+
export interface GeocoderControlsProps {
|
|
23
22
|
/**
|
|
24
|
-
* The injected
|
|
23
|
+
* The injected geocoder runtime.
|
|
25
24
|
*/
|
|
26
|
-
runtime:
|
|
25
|
+
runtime: GeocoderRuntime;
|
|
27
26
|
/**
|
|
28
27
|
* The parse+resolve state machine.
|
|
29
28
|
*/
|
|
30
|
-
geocode:
|
|
29
|
+
geocode: UseGeocode;
|
|
31
30
|
/**
|
|
32
31
|
* The place-autocomplete combobox state.
|
|
33
32
|
*/
|
|
@@ -39,7 +38,7 @@ export interface DemoControlsProps {
|
|
|
39
38
|
/**
|
|
40
39
|
* Host-injected panels (about, release blurb, compare, permalink, extras, failure).
|
|
41
40
|
*/
|
|
42
|
-
panels:
|
|
41
|
+
panels: GeocoderPanels;
|
|
43
42
|
/**
|
|
44
43
|
* Example chips.
|
|
45
44
|
*/
|
|
@@ -49,7 +48,7 @@ export interface DemoControlsProps {
|
|
|
49
48
|
*/
|
|
50
49
|
placeholder: string;
|
|
51
50
|
/**
|
|
52
|
-
* Select a model version (the composed
|
|
51
|
+
* Select a model version (the composed geocoder also clears a now-colliding compare selection).
|
|
53
52
|
*/
|
|
54
53
|
onSelectVersion: (version: string) => void;
|
|
55
54
|
/**
|
|
@@ -60,5 +59,5 @@ export interface DemoControlsProps {
|
|
|
60
59
|
/**
|
|
61
60
|
* The floating control panel.
|
|
62
61
|
*/
|
|
63
|
-
export declare function
|
|
64
|
-
//# sourceMappingURL=
|
|
62
|
+
export declare function GeocoderControls({ runtime, geocode, autocomplete, compare, panels, presets, placeholder, onSelectVersion, onForceWASMChange, }: GeocoderControlsProps): ReactNode;
|
|
63
|
+
//# sourceMappingURL=GeocoderControls.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GeocoderControls.d.ts","sourceRoot":"","sources":["../../lib/map/GeocoderControls.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAEtC,OAAO,KAAK,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,YAAY,CAAA;AACjE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAA;AAC3D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AACjD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAA;AAGrE,OAAO,EAAe,KAAK,MAAM,EAAE,MAAM,2BAA2B,CAAA;AAQpE,MAAM,WAAW,qBAAqB;IACrC;;OAEG;IACH,OAAO,EAAE,eAAe,CAAA;IACxB;;OAEG;IACH,OAAO,EAAE,UAAU,CAAA;IACnB;;OAEG;IACH,YAAY,EAAE,oBAAoB,CAAA;IAClC;;OAEG;IACH,OAAO,EAAE,eAAe,CAAA;IACxB;;OAEG;IACH,MAAM,EAAE,cAAc,CAAA;IACtB;;OAEG;IACH,OAAO,EAAE,aAAa,CAAC,MAAM,CAAC,CAAA;IAC9B;;OAEG;IACH,WAAW,EAAE,MAAM,CAAA;IACnB;;OAEG;IACH,eAAe,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAA;IAC1C;;OAEG;IACH,iBAAiB,EAAE,CAAC,SAAS,EAAE,OAAO,KAAK,IAAI,CAAA;CAC/C;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,EAChC,OAAO,EACP,OAAO,EACP,YAAY,EACZ,OAAO,EACP,MAAM,EACN,OAAO,EACP,WAAW,EACX,eAAe,EACf,iBAAiB,GACjB,EAAE,qBAAqB,GAAG,SAAS,CA6GnC"}
|
|
@@ -10,7 +10,7 @@ import { VersionPicker } from "./VersionPicker.js";
|
|
|
10
10
|
/**
|
|
11
11
|
* The floating control panel.
|
|
12
12
|
*/
|
|
13
|
-
export function
|
|
13
|
+
export function GeocoderControls({ runtime, geocode, autocomplete, compare, panels, presets, placeholder, onSelectVersion, onForceWASMChange, }) {
|
|
14
14
|
const versions = runtime.availableVersions ?? [];
|
|
15
15
|
const { busy, result, selectedCandidate } = geocode;
|
|
16
16
|
const loading = runtime.loading;
|
|
@@ -27,4 +27,4 @@ export function DemoControls({ runtime, geocode, autocomplete, compare, panels,
|
|
|
27
27
|
? panels.compare({ result, compareMode: compare.compareMode, compareVersion: compare.compareVersion })
|
|
28
28
|
: null, panels.footer] }));
|
|
29
29
|
}
|
|
30
|
-
//# sourceMappingURL=
|
|
30
|
+
//# sourceMappingURL=GeocoderControls.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GeocoderControls.js","sourceRoot":"","sources":["../../lib/map/GeocoderControls.tsx"],"names":[],"mappings":";AAsBA,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAAgC,CAAA;AACjE,OAAO,EAAE,WAAW,EAAe,MAAM,0BAA2B,CAAA;AACpE,OAAO,EAAE,SAAS,EAAE,MAAM,0BAA2B,CAAA;AACrD,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAsB,CAAA;AACrD,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAqB,CAAA;AACnD,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAyB,CAAA;AAC3D,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAmB,CAAA;AAC/C,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAqB,CAAA;AAyCnD;;GAEG;AACH,MAAM,UAAU,gBAAgB,CAAC,EAChC,OAAO,EACP,OAAO,EACP,YAAY,EACZ,OAAO,EACP,MAAM,EACN,OAAO,EACP,WAAW,EACX,eAAe,EACf,iBAAiB,GACM;IACvB,MAAM,QAAQ,GAAG,OAAO,CAAC,iBAAiB,IAAI,EAAE,CAAA;IAChD,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,iBAAiB,EAAE,GAAG,OAAO,CAAA;IACnD,MAAM,OAAO,GAAG,OAAO,CAAC,OAAO,CAAA;IAC/B,MAAM,YAAY,GAAG,OAAO,CAAC,UAAU,IAAI,OAAO,CAAC,YAAY,IAAI,IAAI,CAAA;IAEvE,OAAO,CACN,mBAAS,SAAS,EAAC,kBAAkB,aACnC,MAAM,CAAC,MAAM,EACb,MAAM,CAAC,WAAW,EAEnB,KAAC,aAAa,IACb,QAAQ,EAAE,QAAQ,EAClB,QAAQ,EAAE,OAAO,CAAC,eAAe,IAAI,IAAI,EACzC,QAAQ,EAAE,eAAe,E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C,sBAAsB,EACtD,iBAAiB,EAAE,OAAO,CAAC,eAAe,EAC1C,MAAM,EAAE,MAAM,CAAC,MAAM,EACrB,OAAO,EAAE,MAAM,CAAC,OAAO,GACtB,CACF,CACD,CAAC,CAAC,CAAC,IAAI,EAEP,MAAM,CAAC,OAAO;gBACd,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,EAAE,MAAM,EAAE,WAAW,EAAE,OAAO,CAAC,WAAW,EAAE,cAAc,EAAE,OAAO,CAAC,cAAc,EAAE,CAAC;gBACtG,CAAC,CAAC,IAAI,EAEN,MAAM,CAAC,MAAM,IACL,CACV,CAAA;AACF,CAAC"}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* @license AGPL-3.0
|
|
4
4
|
* @author Teffen Ellis, et al.
|
|
5
5
|
*
|
|
6
|
-
* `<
|
|
6
|
+
* `<MapCanvas>` — the declarative map shell for the geocoder demo, over `react-map-gl/maplibre` (v8).
|
|
7
7
|
* Phase 1 is the shell only: a `<Map>` that takes a host-composed `mapStyle`, an initial (or
|
|
8
8
|
* controlled) view state, and a `children` slot for the overlays/markers that land in later phases.
|
|
9
9
|
* No overlay/marker/camera logic lives here yet.
|
|
@@ -15,27 +15,27 @@
|
|
|
15
15
|
* the root barrel.
|
|
16
16
|
*
|
|
17
17
|
* CSS: the package imports no CSS from its modules (the node-safe invariant), so a host that renders
|
|
18
|
-
* `<
|
|
19
|
-
* for the `.mw-demo-map` container). `<
|
|
18
|
+
* `<MapCanvas>` must import `maplibre-gl/dist/maplibre-gl.css` itself (plus `@mailwoman/react/styles.css`
|
|
19
|
+
* for the `.mw-demo-map` container). `<MapCanvas>` is intrinsically a client component — a host that
|
|
20
20
|
* server-renders should wrap it in a client boundary (the package's `ClientOnly`), exactly as the
|
|
21
|
-
* composed `
|
|
21
|
+
* composed `Geocoder` will in a later phase.
|
|
22
22
|
*/
|
|
23
23
|
import type { CSSProperties, ReactNode, Ref } from "react";
|
|
24
24
|
import type { MapProps, MapRef, ViewStateChangeEvent } from "react-map-gl/maplibre";
|
|
25
25
|
/**
|
|
26
|
-
* The style a `<
|
|
26
|
+
* The style a `<MapCanvas>` renders — a style URL or an inline/composed `StyleSpecification`.
|
|
27
27
|
*/
|
|
28
|
-
export type
|
|
28
|
+
export type MapCanvasStyle = NonNullable<MapProps["mapStyle"]>;
|
|
29
29
|
/**
|
|
30
|
-
* Override for the `<Map>` props `<
|
|
31
|
-
* `maplibreLogo`). The controlled fields
|
|
30
|
+
* Override for the `<Map>` props `<MapCanvas>` does not surface explicitly (e.g. `minZoom`, `attributionControl`,
|
|
31
|
+
* `maplibreLogo`). The controlled fields MapCanvas owns are omitted so they can't be set twice.
|
|
32
32
|
*/
|
|
33
|
-
export type
|
|
34
|
-
export interface
|
|
33
|
+
export type MapCanvasExtraProps = Partial<Omit<MapProps, "mapStyle" | "initialViewState" | "viewState" | "onMove" | "children" | "style" | "ref">>;
|
|
34
|
+
export interface MapCanvasProps {
|
|
35
35
|
/**
|
|
36
36
|
* The map style — host-composed `StyleSpecification` or a style URL.
|
|
37
37
|
*/
|
|
38
|
-
mapStyle:
|
|
38
|
+
mapStyle: MapCanvasStyle;
|
|
39
39
|
/**
|
|
40
40
|
* Uncontrolled initial camera. Use this OR `viewState`, not both.
|
|
41
41
|
*/
|
|
@@ -69,13 +69,13 @@ export interface DemoMapProps {
|
|
|
69
69
|
*/
|
|
70
70
|
style?: CSSProperties;
|
|
71
71
|
/**
|
|
72
|
-
* Remaining `<Map>` props
|
|
72
|
+
* Remaining `<Map>` props MapCanvas does not surface explicitly.
|
|
73
73
|
*/
|
|
74
|
-
mapProps?:
|
|
74
|
+
mapProps?: MapCanvasExtraProps;
|
|
75
75
|
}
|
|
76
76
|
/**
|
|
77
77
|
* The controlled-viewport map shell. Renders a sized wrapper around a `react-map-gl/maplibre` `<Map>`; everything
|
|
78
78
|
* host-specific (the composed `mapStyle`, the initial center) is injected, and overlays ride in as `children`.
|
|
79
79
|
*/
|
|
80
|
-
export declare function
|
|
81
|
-
//# sourceMappingURL=
|
|
80
|
+
export declare function MapCanvas({ mapStyle, initialViewState, viewState, onMove, projection, mapRef, children, className, style, mapProps, }: MapCanvasProps): ReactNode;
|
|
81
|
+
//# sourceMappingURL=MapCanvas.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MapCanvas.d.ts","sourceRoot":"","sources":["../../lib/map/MapCanvas.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,GAAG,EAAE,MAAM,OAAO,CAAA;AAE1D,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAA;AAEnF;;GAEG;AACH,MAAM,MAAM,cAAc,GAAG,WAAW,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAC,CAAA;AAE9D;;;GAGG;AACH,MAAM,MAAM,mBAAmB,GAAG,OAAO,CACxC,IAAI,CAAC,QAAQ,EAAE,UAAU,GAAG,kBAAkB,GAAG,WAAW,GAAG,QAAQ,GAAG,UAAU,GAAG,OAAO,GAAG,KAAK,CAAC,CACvG,CAAA;AAED,MAAM,WAAW,cAAc;IAC9B;;OAEG;IACH,QAAQ,EAAE,cAAc,CAAA;IACxB;;OAEG;IACH,gBAAgB,CAAC,EAAE,QAAQ,CAAC,kBAAkB,CAAC,CAAA;IAC/C;;OAEG;IACH,SAAS,CAAC,EAAE,QAAQ,CAAC,WAAW,CAAC,CAAA;IACjC;;OAEG;IACH,MAAM,CAAC,EAAE,CAAC,KAAK,EAAE,oBAAoB,KAAK,IAAI,CAAA;IAC9C;;OAEG;IACH,UAAU,CAAC,EAAE,QAAQ,CAAC,YAAY,CAAC,CAAA;IACnC;;OAEG;IACH,MAAM,CAAC,EAAE,GAAG,CAAC,MAAM,CAAC,CAAA;IACpB;;OAEG;IACH,QAAQ,CAAC,EAAE,SAAS,CAAA;IACpB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB;;OAEG;IACH,KAAK,CAAC,EAAE,aAAa,CAAA;IACrB;;OAEG;IACH,QAAQ,CAAC,EAAE,mBAAmB,CAAA;CAC9B;AAID;;;GAGG;AACH,wBAAgB,SAAS,CAAC,EACzB,QAAQ,EACR,gBAAgB,EAChB,SAAS,EACT,MAAM,EACN,UAAoB,EACpB,MAAM,EACN,QAAQ,EACR,SAAS,EACT,KAAK,EACL,QAAQ,GACR,EAAE,cAAc,GAAG,SAAS,CAmB5B"}
|
|
@@ -5,8 +5,8 @@ const FILL = { width: "100%", height: "100%" };
|
|
|
5
5
|
* The controlled-viewport map shell. Renders a sized wrapper around a `react-map-gl/maplibre` `<Map>`; everything
|
|
6
6
|
* host-specific (the composed `mapStyle`, the initial center) is injected, and overlays ride in as `children`.
|
|
7
7
|
*/
|
|
8
|
-
export function
|
|
8
|
+
export function MapCanvas({ mapStyle, initialViewState, viewState, onMove, projection = "globe", mapRef, children, className, style, mapProps, }) {
|
|
9
9
|
const wrapperClassName = className ? `mw-demo-map ${className}` : "mw-demo-map";
|
|
10
10
|
return (_jsx("div", { className: wrapperClassName, style: style, children: _jsx(Map, { ...mapProps, ref: mapRef, mapStyle: mapStyle, initialViewState: initialViewState, viewState: viewState, onMove: onMove, projection: projection, style: FILL, children: children }) }));
|
|
11
11
|
}
|
|
12
|
-
//# sourceMappingURL=
|
|
12
|
+
//# sourceMappingURL=MapCanvas.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MapCanvas.js","sourceRoot":"","sources":["../../lib/map/MapCanvas.tsx"],"names":[],"mappings":";AAwBA,OAAO,EAAE,GAAG,EAAE,MAAM,uBAAuB,CAAA;AA2D3C,MAAM,IAAI,GAAkB,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,CAAA;AAE7D;;;GAGG;AACH,MAAM,UAAU,SAAS,CAAC,EACzB,QAAQ,EACR,gBAAgB,EAChB,SAAS,EACT,MAAM,EACN,UAAU,GAAG,OAAO,EACpB,MAAM,EACN,QAAQ,EACR,SAAS,EACT,KAAK,EACL,QAAQ,GACQ;IAChB,MAAM,gBAAgB,GAAG,SAAS,CAAC,CAAC,CAAC,eAAe,SAAS,EAAE,CAAC,CAAC,CAAC,aAAa,CAAA;IAE/E,OAAO,CACN,cAAK,SAAS,EAAE,gBAAgB,EAAE,KAAK,EAAE,KAAK,YAC7C,KAAC,GAAG,OACC,QAAQ,EACZ,GAAG,EAAE,MAAM,EACX,QAAQ,EAAE,QAAQ,EAClB,gBAAgB,EAAE,gBAAgB,EAClC,SAAS,EAAE,SAAS,EACpB,MAAM,EAAE,MAAM,EACd,UAAU,EAAE,UAAU,EACtB,KAAK,EAAE,IAAI,YAEV,QAAQ,GACJ,GACD,CACN,CAAA;AACF,CAAC"}
|
package/out/map/PlaceMarker.d.ts
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* `<PlaceMarker>` — the resolved-place pin, as a declarative `react-map-gl/maplibre` `<Marker>`. This
|
|
7
7
|
* replaces the old imperative `new maplibre.Marker(...).setLngLat(...).addTo(map)` (+ the manual
|
|
8
8
|
* `markerRef.current.remove()` teardown) from the demo's redraw effect: mounting/unmounting the marker
|
|
9
|
-
* is now React's job, keyed on the resolved candidate. Renders as a child of `<
|
|
9
|
+
* is now React's job, keyed on the resolved candidate. Renders as a child of `<MapCanvas>`.
|
|
10
10
|
*
|
|
11
11
|
* NODE-IMPORT SAFETY: imports `react-map-gl/maplibre` at module scope, so it is reachable ONLY through
|
|
12
12
|
* the `@mailwoman/react/map` subpath, never the package root.
|
|
@@ -3,10 +3,10 @@
|
|
|
3
3
|
* @license AGPL-3.0
|
|
4
4
|
* @author Teffen Ellis, et al.
|
|
5
5
|
*
|
|
6
|
-
* `<ResolvedPlaceLayers>` — the drop-in that renders a whole {@link MapPlaceRenderSpec} as `<
|
|
6
|
+
* `<ResolvedPlaceLayers>` — the drop-in that renders a whole {@link MapPlaceRenderSpec} as `<MapCanvas>`
|
|
7
7
|
* children: the marker(s), the outline, and (optionally) the camera move. This is the declarative
|
|
8
8
|
* replacement for the demo's imperative marker/bbox/camera redraw effect — a consumer computes the spec
|
|
9
|
-
* with `useMapPlaceRender(place)` and drops `<ResolvedPlaceLayers spec={spec} />` inside `<
|
|
9
|
+
* with `useMapPlaceRender(place)` and drops `<ResolvedPlaceLayers spec={spec} />` inside `<MapCanvas>`.
|
|
10
10
|
*
|
|
11
11
|
* `spec = null` (no result / no candidate) renders nothing, which also unmounts the previous marker +
|
|
12
12
|
* outline — the teardown the old effect did by hand (`markerRef.remove()`, `clearBbox`) is now just
|
|
@@ -21,7 +21,7 @@ export interface ResolvedPlaceLayersProps {
|
|
|
21
21
|
spec: MapPlaceRenderSpec | null;
|
|
22
22
|
/**
|
|
23
23
|
* Apply the computed camera target via {@link ResultCamera}. @default true. Set false when the consumer drives the
|
|
24
|
-
* camera itself (e.g. a controlled `<
|
|
24
|
+
* camera itself (e.g. a controlled `<MapCanvas viewState>` fed by {@link cameraToViewState}).
|
|
25
25
|
*/
|
|
26
26
|
applyCamera?: boolean;
|
|
27
27
|
/**
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
* `useMap()` (exactly as `DashboardMap`/`GeoJSONClipboardLayer` reach the map), never a threaded handle.
|
|
12
12
|
*
|
|
13
13
|
* A consumer that prefers a hard, declarative jump can instead feed the target through
|
|
14
|
-
* {@link cameraToViewState} into a controlled `<
|
|
14
|
+
* {@link cameraToViewState} into a controlled `<MapCanvas viewState>` and skip this component — the
|
|
15
15
|
* `center` case has that declarative path; only `bounds` strictly requires this. Renders nothing.
|
|
16
16
|
*
|
|
17
17
|
* `target` is expected to be the STABLE, memoized `camera` off a `useMapPlaceRender` spec, so listing it
|
package/out/map/ResultCamera.js
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
* `useMap()` (exactly as `DashboardMap`/`GeoJSONClipboardLayer` reach the map), never a threaded handle.
|
|
12
12
|
*
|
|
13
13
|
* A consumer that prefers a hard, declarative jump can instead feed the target through
|
|
14
|
-
* {@link cameraToViewState} into a controlled `<
|
|
14
|
+
* {@link cameraToViewState} into a controlled `<MapCanvas viewState>` and skip this component — the
|
|
15
15
|
* `center` case has that declarative path; only `bounds` strictly requires this. Renders nothing.
|
|
16
16
|
*
|
|
17
17
|
* `target` is expected to be the STABLE, memoized `camera` off a `useMapPlaceRender` spec, so listing it
|
package/out/map/ResultPanel.d.ts
CHANGED
|
@@ -7,14 +7,14 @@
|
|
|
7
7
|
* presentational units (it does not re-implement any of them): `KindBadge`, `ComponentTable`,
|
|
8
8
|
* `ResolvedPlace`, `CandidatePicker`, plus the `CopyButton` + `buildParsePayload` copy affordance. This
|
|
9
9
|
* is the standalone, story-testable unit the demo's floating panel renders (the map analogue of the
|
|
10
|
-
* result block PipelineExplorer inlines), so `
|
|
10
|
+
* result block PipelineExplorer inlines), so `Geocoder` composes ONE panel instead of duplicating
|
|
11
11
|
* the marker/table/candidate glue. Heavy host visualizers (span highlight, tree, timing) slot in via
|
|
12
12
|
* `extras`; the no-resolve diagnostic via `failure`.
|
|
13
13
|
*
|
|
14
14
|
* NODE-SAFE: pure React + the shared units, no maplibre.
|
|
15
15
|
*/
|
|
16
|
+
import type { ParseResult, ResolvedPlaceView } from "@mailwoman/core/pipeline/client-result";
|
|
16
17
|
import type { ReactNode } from "react";
|
|
17
|
-
import type { ParseResult, ResolvedPlaceView } from "#pipeline/types";
|
|
18
18
|
export interface ResultPanelProps {
|
|
19
19
|
/**
|
|
20
20
|
* The parse+resolve result to render.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ResultPanel.d.ts","sourceRoot":"","sources":["../../lib/map/ResultPanel.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"ResultPanel.d.ts","sourceRoot":"","sources":["../../lib/map/ResultPanel.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,iBAAiB,EAAE,MAAM,wCAAwC,CAAA;AAC5F,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAUtC,MAAM,WAAW,gBAAgB;IAChC;;OAEG;IACH,MAAM,EAAE,WAAW,CAAA;IACnB;;OAEG;IACH,iBAAiB,EAAE,iBAAiB,GAAG,IAAI,CAAA;IAC3C;;OAEG;IACH,sBAAsB,EAAE,MAAM,CAAA;IAC9B;;OAEG;IACH,iBAAiB,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAA;IAC1C;;OAEG;IACH,MAAM,CAAC,EAAE,CAAC,MAAM,EAAE,WAAW,KAAK,SAAS,CAAA;IAC3C;;OAEG;IACH,OAAO,CAAC,EAAE,CAAC,MAAM,EAAE,WAAW,KAAK,SAAS,CAAA;CAC5C;AAED;;GAEG;AACH,wBAAgB,WAAW,CAAC,EAC3B,MAAM,EACN,iBAAiB,EACjB,sBAAsB,EACtB,iBAAiB,EACjB,MAAM,EACN,OAAO,GACP,EAAE,gBAAgB,GAAG,SAAS,CAkC9B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ResultPanel.js","sourceRoot":"","sources":["../../lib/map/ResultPanel.tsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"ResultPanel.js","sourceRoot":"","sources":["../../lib/map/ResultPanel.tsx"],"names":[],"mappings":";AAmBA,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAA;AAElD,OAAO,EAAE,UAAU,EAAE,MAAM,yBAA0B,CAAA;AACrD,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAyB,CAAA;AACnD,OAAO,EAAE,eAAe,EAAE,MAAM,gCAAiC,CAAA;AACjE,OAAO,EAAE,cAAc,EAAE,MAAM,+BAAgC,CAAA;AAC/D,OAAO,EAAE,aAAa,EAAE,MAA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|
|
7
7
|
* as a dumb presentational unit: the available bundles + current selection come in as props, the choice
|
|
8
|
-
* goes out through `onSelect`. No load state, no manifest fetch — the host (via `
|
|
8
|
+
* goes out through `onSelect`. No load state, no manifest fetch — the host (via `useReleaseRuntime`) owns
|
|
9
9
|
* that. Renders nothing when there is fewer than two versions to choose between.
|
|
10
10
|
*
|
|
11
11
|
* NODE-SAFE: pure React + a `<select>`, no maplibre. It rides the `@mailwoman/react/map` subpath only
|
|
12
12
|
* because it is a demo-specific control, not because it needs WebGL.
|
|
13
13
|
*/
|
|
14
14
|
import type { ReactNode } from "react";
|
|
15
|
-
import type {
|
|
15
|
+
import type { VersionOption } from "#map/types";
|
|
16
16
|
export interface VersionPickerProps {
|
|
17
17
|
/**
|
|
18
18
|
* The selectable model bundles.
|
|
19
19
|
*/
|
|
20
|
-
versions: ReadonlyArray<
|
|
20
|
+
versions: ReadonlyArray<VersionOption>;
|
|
21
21
|
/**
|
|
22
22
|
* The currently-selected version tag.
|
|
23
23
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VersionPicker.d.ts","sourceRoot":"","sources":["../../lib/map/VersionPicker.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAEtC,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"VersionPicker.d.ts","sourceRoot":"","sources":["../../lib/map/VersionPicker.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAEtC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAA;AAE/C,MAAM,WAAW,kBAAkB;IAClC;;OAEG;IACH,QAAQ,EAAE,aAAa,CAAC,aAAa,CAAC,CAAA;IACtC;;OAEG;IACH,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAA;IACvB;;OAEG;IACH,QAAQ,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAA;IACnC;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAA;CACd;AAED;;GAEG;AACH,wBAAgB,aAAa,CAAC,EAC7B,QAAQ,EACR,QAAQ,EACR,QAAQ,EACR,QAAQ,EACR,KAAuB,GACvB,EAAE,kBAAkB,GAAG,SAAS,CAuBhC"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @copyright Sister Software
|
|
3
|
+
* @license AGPL-3.0
|
|
4
|
+
* @author Teffen Ellis, et al.
|
|
5
|
+
*
|
|
6
|
+
* A fake geocoder runtime: canned parse + resolve, an offline stub map style, canned autocomplete, a version list.
|
|
7
|
+
* No network, no ONNX, no maplibre at run time — everything is data. It is what the stories and component tests
|
|
8
|
+
* mount, and what a host mounts to show the UI without the model.
|
|
9
|
+
*/
|
|
10
|
+
import type { ParseResult } from "@mailwoman/core/pipeline/client-result";
|
|
11
|
+
import type { GeocoderRuntime, Suggestion } from "#map/types";
|
|
12
|
+
import type { PipelineRuntime } from "#pipeline/types";
|
|
13
|
+
import type { MapCanvasStyle } from "./MapCanvas.tsx";
|
|
14
|
+
/**
|
|
15
|
+
* An offline stub map style — one solid `background` layer, zero sources, zero network. Safe for headless Storybook.
|
|
16
|
+
*/
|
|
17
|
+
export declare const STUB_MAP_STYLE: MapCanvasStyle;
|
|
18
|
+
/**
|
|
19
|
+
* Canned place-autocomplete suggestions — a synchronous fake for the FST prefix-walk.
|
|
20
|
+
*/
|
|
21
|
+
export declare const FAKE_SUGGESTIONS: Suggestion[];
|
|
22
|
+
/**
|
|
23
|
+
* A fake DEMO runtime — the map analogue of {@link makePipelineRuntime}. It composes the pipeline fake (canned
|
|
24
|
+
* parse+resolve) with the map surface: the offline stub style, a version list, a backend, an injected autocomplete, and
|
|
25
|
+
* a `resolveMapPlace` that hands the selected candidate a bbox so the declarative overlays draw a marker + outline. No
|
|
26
|
+
* network, no ONNX, no maplibre-at-runtime — everything is data. `runParseWithBias` delegates to the base parse (the
|
|
27
|
+
* bias is ignored by the fake but present so the parameter is exercised).
|
|
28
|
+
*/
|
|
29
|
+
export declare function makeFakeGeocoderRuntime(overrides?: Partial<GeocoderRuntime>): GeocoderRuntime;
|
|
30
|
+
/**
|
|
31
|
+
* A fixed, fully-populated parse+resolve result — the shared fixture behind the pipeline runtime + the result panel.
|
|
32
|
+
*/
|
|
33
|
+
export declare function makeFakeParseResult(input?: string): ParseResult;
|
|
34
|
+
/**
|
|
35
|
+
* A fake parse+resolve runtime that returns a fixed, fully-populated result.
|
|
36
|
+
*/
|
|
37
|
+
export declare function makePipelineRuntime(overrides?: Partial<PipelineRuntime>): PipelineRuntime;
|
|
38
|
+
//# sourceMappingURL=fake-runtime.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fake-runtime.d.ts","sourceRoot":"","sources":["../../lib/map/fake-runtime.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,wCAAwC,CAAA;AAGzE,OAAO,KAAK,EAAE,eAAe,EAAE,UAAU,EAAE,MAAM,YAAY,CAAA;AAC7D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA;AAEtD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAA;AAErD;;GAEG;AACH,eAAO,MAAM,cAAc,EAAE,cAK5B,CAAA;AAED;;GAEG;AACH,eAAO,MAAM,gBAAgB,EAAE,UAAU,EAIxC,CAAA;AAED;;;;;;GAMG;AACH,wBAAgB,uBAAuB,CAAC,SAAS,GAAE,OAAO,CAAC,eAAe,CAAM,GAAG,eAAe,CAkCjG;AAED;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,KAAK,SAAoC,GAAG,WAAW,CAmB1F;AAED;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,SAAS,GAAE,OAAO,CAAC,eAAe,CAAM,GAAG,eAAe,CAc7F"}
|