@mailwoman/react 9.3.0 → 10.0.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 +105 -0
- package/lib/common/KindBadge.tsx +2 -7
- package/lib/common/confidence-tiers.ts +50 -0
- package/lib/common/index.ts +22 -0
- package/lib/common/text-tokens.ts +88 -0
- package/lib/index.ts +10 -103
- package/lib/map/BackendControl.tsx +7 -3
- package/lib/map/CompareToggle.tsx +5 -4
- package/lib/map/{GeocoderDemo.tsx → Geocoder.tsx} +81 -61
- package/lib/map/GeocoderControls.tsx +352 -0
- package/lib/map/{DemoMap.tsx → MapCanvas.tsx} +15 -15
- package/lib/map/MapChipRow.tsx +77 -0
- package/lib/map/MapCompass.tsx +77 -0
- package/lib/map/MapControlStack.tsx +98 -0
- package/lib/map/MapFooter.tsx +115 -0
- package/lib/map/MapProgressBar.tsx +58 -0
- package/lib/map/MapSearchBar.tsx +68 -0
- package/lib/map/MapSheet.tsx +62 -0
- 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 +35 -16
- package/lib/map/map-debug.ts +51 -0
- package/lib/map/place-render.ts +3 -2
- package/lib/map/types.ts +58 -42
- package/lib/map/{useDemoGeocode.ts → useGeocode.ts} +8 -8
- package/lib/map/useMapBearing.ts +56 -0
- package/lib/map/useMapLabelPick.ts +123 -0
- 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/index.ts +36 -0
- package/lib/pipeline/types.ts +2 -75
- package/lib/pipeline/useParsePipeline.ts +31 -19
- package/lib/poi/index.ts +39 -0
- package/lib/poi/types.ts +2 -1
- package/lib/runtime/index.ts +16 -0
- package/lib/runtime/{useDemoRuntime.ts → useReleaseRuntime.ts} +22 -24
- package/out/common/About.d.ts +21 -0
- package/out/common/About.d.ts.map +1 -0
- package/out/common/About.js +8 -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/index.d.ts +22 -0
- package/out/common/index.d.ts.map +1 -0
- package/out/common/index.js +15 -0
- package/out/common/index.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 +5 -51
- package/out/index.d.ts.map +1 -1
- package/out/index.js +4 -30
- package/out/index.js.map +1 -1
- package/out/map/BackendControl.d.ts.map +1 -1
- package/out/map/BackendControl.js +1 -1
- package/out/map/BackendControl.js.map +1 -1
- package/out/map/CompareToggle.d.ts +2 -2
- package/out/map/CompareToggle.d.ts.map +1 -1
- package/out/map/CompareToggle.js +1 -1
- package/out/map/CompareToggle.js.map +1 -1
- package/out/map/Geocoder.d.ts +67 -0
- package/out/map/Geocoder.d.ts.map +1 -0
- package/out/map/Geocoder.js +98 -0
- package/out/map/Geocoder.js.map +1 -0
- package/out/map/GeocoderControls.d.ts +81 -0
- package/out/map/GeocoderControls.d.ts.map +1 -0
- package/out/map/GeocoderControls.js +79 -0
- 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/MapChipRow.d.ts +47 -0
- package/out/map/MapChipRow.d.ts.map +1 -0
- package/out/map/MapChipRow.js +12 -0
- package/out/map/MapChipRow.js.map +1 -0
- package/out/map/MapCompass.d.ts +42 -0
- package/out/map/MapCompass.d.ts.map +1 -0
- package/out/map/MapCompass.js +11 -0
- package/out/map/MapCompass.js.map +1 -0
- package/out/map/MapControlStack.d.ts +57 -0
- package/out/map/MapControlStack.d.ts.map +1 -0
- package/out/map/MapControlStack.js +15 -0
- package/out/map/MapControlStack.js.map +1 -0
- package/out/map/MapFooter.d.ts +40 -0
- package/out/map/MapFooter.d.ts.map +1 -0
- package/out/map/MapFooter.js +51 -0
- package/out/map/MapFooter.js.map +1 -0
- package/out/map/MapProgressBar.d.ts +34 -0
- package/out/map/MapProgressBar.d.ts.map +1 -0
- package/out/map/MapProgressBar.js +8 -0
- package/out/map/MapProgressBar.js.map +1 -0
- package/out/map/MapSearchBar.d.ts +49 -0
- package/out/map/MapSearchBar.d.ts.map +1 -0
- package/out/map/MapSearchBar.js +6 -0
- package/out/map/MapSearchBar.js.map +1 -0
- package/out/map/MapSheet.d.ts +32 -0
- package/out/map/MapSheet.d.ts.map +1 -0
- package/out/map/MapSheet.js +33 -0
- package/out/map/MapSheet.js.map +1 -0
- package/out/map/OverlayLayers.js +1 -1
- package/out/map/PlaceMarker.d.ts +1 -1
- package/out/map/ResolvedPlaceLayers.d.ts +3 -3
- package/out/map/ResolvedPlaceLayers.js +1 -1
- 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 +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 +27 -10
- package/out/map/index.d.ts.map +1 -1
- package/out/map/index.js +16 -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 +60 -42
- 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/map/useMapBearing.d.ts +28 -0
- package/out/map/useMapBearing.d.ts.map +1 -0
- package/out/map/useMapBearing.js +35 -0
- package/out/map/useMapBearing.js.map +1 -0
- package/out/map/useMapLabelPick.d.ts +23 -0
- package/out/map/useMapLabelPick.d.ts.map +1 -0
- package/out/map/useMapLabelPick.js +104 -0
- package/out/map/useMapLabelPick.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 +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/PipelineExplorer.js +1 -1
- package/out/pipeline/QueryForm.js +1 -1
- 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/index.d.ts +33 -0
- package/out/pipeline/index.d.ts.map +1 -0
- package/out/pipeline/index.js +21 -0
- package/out/pipeline/index.js.map +1 -0
- 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 +7 -3
- package/out/pipeline/useParsePipeline.d.ts.map +1 -1
- package/out/pipeline/useParsePipeline.js +6 -2
- package/out/pipeline/useParsePipeline.js.map +1 -1
- package/out/poi/LiveResultsBlock.js +1 -1
- package/out/poi/POIExplorer.js +1 -1
- package/out/poi/SubjectPanel.js +1 -1
- package/out/poi/index.d.ts +23 -0
- package/out/poi/index.d.ts.map +1 -0
- package/out/poi/index.js +15 -0
- package/out/poi/index.js.map +1 -0
- package/out/poi/runtime.d.ts.map +1 -1
- package/out/poi/types.d.ts +2 -1
- package/out/poi/types.d.ts.map +1 -1
- package/out/runtime/index.d.ts +9 -0
- package/out/runtime/index.d.ts.map +1 -0
- package/out/runtime/index.js +8 -0
- package/out/runtime/index.js.map +1 -0
- 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 +222 -31
- package/styleframe.config.ts +329 -0
- package/styles.css +1995 -663
- package/tokens/index.css +116 -0
- package/tokens/tokens.json +528 -0
- package/tokens/tokens.resolver.json +185 -0
- package/lib/map/DemoControls.tsx +0 -194
- package/out/map/DemoControls.d.ts +0 -64
- package/out/map/DemoControls.d.ts.map +0 -1
- package/out/map/DemoControls.js +0 -30
- 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 +0 -57
- package/out/map/GeocoderDemo.d.ts.map +0 -1
- package/out/map/GeocoderDemo.js +0 -98
- 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,8 +3,8 @@
|
|
|
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.
|
|
7
|
-
*
|
|
6
|
+
* `ConfidenceCell` — a compact confidence bar + value for the component table. The fill colour follows the shared
|
|
7
|
+
* confidence tiers. Presentational.
|
|
8
8
|
*/
|
|
9
9
|
export interface ConfidenceCellProps {
|
|
10
10
|
confidence?: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ConfidenceCell.d.ts","sourceRoot":"","sources":["../../lib/pipeline/ConfidenceCell.tsx"],"names":[],"mappings":"AAAA;;;;;;;GAOG;
|
|
1
|
+
{"version":3,"file":"ConfidenceCell.d.ts","sourceRoot":"","sources":["../../lib/pipeline/ConfidenceCell.tsx"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAKH,MAAM,WAAW,mBAAmB;IACnC,UAAU,CAAC,EAAE,MAAM,CAAA;CACnB;AAED,wBAAgB,cAAc,CAAC,EAAE,UAAU,EAAE,EAAE,mBAAmB,+BAcjE"}
|
|
@@ -4,27 +4,15 @@ 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.
|
|
8
|
-
*
|
|
7
|
+
* `ConfidenceCell` — a compact confidence bar + value for the component table. The fill colour follows the shared
|
|
8
|
+
* confidence tiers. Presentational.
|
|
9
9
|
*/
|
|
10
|
+
import { confidenceTierOrMid } from "#common/confidence-tiers";
|
|
10
11
|
import { cx } from "#common/cx";
|
|
11
|
-
/**
|
|
12
|
-
* At or above this the cell is drawn as high-confidence. Presentation only — see docs/src/shared/confidence-tiers.ts.
|
|
13
|
-
*/
|
|
14
|
-
const HIGH_CONFIDENCE_MIN = 0.8;
|
|
15
|
-
/**
|
|
16
|
-
* At or above this the cell is drawn as medium-confidence; below it, low.
|
|
17
|
-
*/
|
|
18
|
-
const MID_CONFIDENCE_MIN = 0.5;
|
|
19
|
-
function tier(confidence) {
|
|
20
|
-
if (confidence == null)
|
|
21
|
-
return "mid";
|
|
22
|
-
return confidence >= HIGH_CONFIDENCE_MIN ? "high" : confidence >= MID_CONFIDENCE_MIN ? "mid" : "low";
|
|
23
|
-
}
|
|
24
12
|
export function ConfidenceCell({ confidence }) {
|
|
25
13
|
if (confidence == null)
|
|
26
14
|
return _jsx("span", { className: "mw-conf__dash", children: "\u2014" });
|
|
27
15
|
const pct = Math.max(0, Math.min(1, confidence)) * 100;
|
|
28
|
-
return (_jsxs("div", { className: "mw-conf", children: [_jsx("div", { className: cx("mw-conf__bar", `mw-conf__bar--${
|
|
16
|
+
return (_jsxs("div", { className: "mw-conf", children: [_jsx("div", { className: cx("mw-conf__bar", `mw-conf__bar--${confidenceTierOrMid(confidence)}`), style: { width: `${pct}%` } }), _jsx("span", { className: "mw-conf__value", children: confidence.toFixed(2) })] }));
|
|
29
17
|
}
|
|
30
18
|
//# sourceMappingURL=ConfidenceCell.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ConfidenceCell.js","sourceRoot":"","sources":["../../lib/pipeline/ConfidenceCell.tsx"],"names":[],"mappings":";AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"ConfidenceCell.js","sourceRoot":"","sources":["../../lib/pipeline/ConfidenceCell.tsx"],"names":[],"mappings":";AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAA;AAC9D,OAAO,EAAE,EAAE,EAAE,MAAM,YAAY,CAAA;AAM/B,MAAM,UAAU,cAAc,CAAC,EAAE,UAAU,EAAuB;IACjE,IAAI,UAAU,IAAI,IAAI;QAAE,OAAO,eAAM,SAAS,EAAC,eAAe,uBAAS,CAAA;IAEvE,MAAM,GAAG,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,UAAU,CAAC,CAAC,GAAG,GAAG,CAAA;IAEtD,OAAO,CACN,eAAK,SAAS,EAAC,SAAS,aACvB,cACC,SAAS,EAAE,EAAE,CAAC,cAAc,EAAE,iBAAiB,mBAAmB,CAAC,UAAU,CAAC,EAAE,CAAC,EACjF,KAAK,EAAE,EAAE,KAAK,EAAE,GAAG,GAAG,GAAG,EAAE,GAC1B,EACF,eAAM,SAAS,EAAC,gBAAgB,YAAE,UAAU,CAAC,OAAO,CAAC,CAAC,CAAC,GAAQ,IAC1D,CACN,CAAA;AACF,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @copyright Sister Software
|
|
3
|
+
* @license AGPL-3.0
|
|
4
|
+
* @author Teffen Ellis, et al.
|
|
5
|
+
*
|
|
6
|
+
* `FailureDiagnostic` — what to say when nothing resolved. It reads the parsed components and names the missing
|
|
7
|
+
* piece a person can add (a city, a state), so the answer is a next step rather than "no hit".
|
|
8
|
+
*/
|
|
9
|
+
import type { ParsedComponent } from "@mailwoman/core/pipeline/client-result";
|
|
10
|
+
import type { ReactNode } from "react";
|
|
11
|
+
export interface FailureDiagnosticProps {
|
|
12
|
+
nodes: ParsedComponent[];
|
|
13
|
+
}
|
|
14
|
+
export declare function FailureDiagnostic({ nodes }: FailureDiagnosticProps): ReactNode;
|
|
15
|
+
//# sourceMappingURL=FailureDiagnostic.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FailureDiagnostic.d.ts","sourceRoot":"","sources":["../../lib/pipeline/FailureDiagnostic.tsx"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,wCAAwC,CAAA;AAC7E,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAEtC,MAAM,WAAW,sBAAsB;IACtC,KAAK,EAAE,eAAe,EAAE,CAAA;CACxB;AAED,wBAAgB,iBAAiB,CAAC,EAAE,KAAK,EAAE,EAAE,sBAAsB,GAAG,SAAS,CAuC9E"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
export function FailureDiagnostic({ nodes }) {
|
|
3
|
+
const hasLocality = nodes.some((n) => n.tag === "locality");
|
|
4
|
+
const hasPostcode = nodes.some((n) => n.tag === "postcode");
|
|
5
|
+
const hasRegion = nodes.some((n) => n.tag === "region");
|
|
6
|
+
const hints = [];
|
|
7
|
+
if (!hasLocality && !hasPostcode) {
|
|
8
|
+
hints.push("The parser found no city or postcode in this input. Try adding one — e.g. append ', Chicago, IL 60613'.");
|
|
9
|
+
}
|
|
10
|
+
if (hasPostcode && !hasLocality) {
|
|
11
|
+
hints.push("Only a postcode was extracted. WOF ships placeholder coordinates (0, 0) for about 22% of US postcodes, and the cascade drops those.");
|
|
12
|
+
}
|
|
13
|
+
if (hasLocality && !hasRegion) {
|
|
14
|
+
hints.push("No state in the parse. US localities share names across states (Springfield, Portland, …); add a state to disambiguate.");
|
|
15
|
+
}
|
|
16
|
+
if (!hints.length) {
|
|
17
|
+
hints.push("The parsed components look reasonable, but the gazetteer does not index this entry.");
|
|
18
|
+
}
|
|
19
|
+
return (_jsxs("div", { className: "mw-failure", children: [_jsx("h2", { children: "No gazetteer hit" }), _jsx("ul", { children: hints.map((hint, i) => (_jsx("li", { children: hint }, i))) })] }));
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=FailureDiagnostic.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FailureDiagnostic.js","sourceRoot":"","sources":["../../lib/pipeline/FailureDiagnostic.tsx"],"names":[],"mappings":";AAgBA,MAAM,UAAU,iBAAiB,CAAC,EAAE,KAAK,EAA0B;IAClE,MAAM,WAAW,GAAG,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,GAAG,KAAK,UAAU,CAAC,CAAA;IAC3D,MAAM,WAAW,GAAG,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,GAAG,KAAK,UAAU,CAAC,CAAA;IAC3D,MAAM,SAAS,GAAG,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,GAAG,KAAK,QAAQ,CAAC,CAAA;IAEvD,MAAM,KAAK,GAAa,EAAE,CAAA;IAE1B,IAAI,CAAC,WAAW,IAAI,CAAC,WAAW,EAAE,CAAC;QAClC,KAAK,CAAC,IAAI,CACT,yGAAyG,CACzG,CAAA;IACF,CAAC;IAED,IAAI,WAAW,IAAI,CAAC,WAAW,EAAE,CAAC;QACjC,KAAK,CAAC,IAAI,CACT,qIAAqI,CACrI,CAAA;IACF,CAAC;IAED,IAAI,WAAW,IAAI,CAAC,SAAS,EAAE,CAAC;QAC/B,KAAK,CAAC,IAAI,CACT,yHAAyH,CACzH,CAAA;IACF,CAAC;IAED,IAAI,CAAC,KAAK,CAAC,MAAM,EAAE,CAAC;QACnB,KAAK,CAAC,IAAI,CAAC,qFAAqF,CAAC,CAAA;IAClG,CAAC;IAED,OAAO,CACN,eAAK,SAAS,EAAC,YAAY,aAC1B,4CAAyB,EACzB,uBACE,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC,EAAE,EAAE,CAAC,CACvB,uBAAa,IAAI,IAAR,CAAC,CAAa,CACvB,CAAC,GACE,IACA,CACN,CAAA;AACF,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { buildParsePayload } from "#pipeline/copy";
|
|
3
3
|
import { PIPELINE_DEFAULT_ADDRESS, PIPELINE_PRESETS } from "#pipeline/presets";
|
|
4
4
|
import { useParsePipeline } from "#pipeline/useParsePipeline";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { LoadingIndicator } from "../common/LoadingIndicator.js";
|
|
3
3
|
export function QueryForm({ value, onChange, onSubmit, disabled, busy, placeholder, onKeyDown, inputProps, }) {
|
|
4
4
|
return (_jsxs("form", { className: "mw-field", onSubmit: (e) => {
|
|
@@ -6,8 +6,8 @@
|
|
|
6
6
|
* `ResolvedPlace` — the "Resolved place" detail list (name, placetype, WOF id, coords, score) plus an
|
|
7
7
|
* optional dual-role note. Presentational.
|
|
8
8
|
*/
|
|
9
|
+
import type { DualRoleView, ResolvedPlaceView } from "@mailwoman/core/pipeline/client-result";
|
|
9
10
|
import { type ReactNode } from "react";
|
|
10
|
-
import type { DualRoleView, ResolvedPlaceView } from "#pipeline/types";
|
|
11
11
|
export interface ResolvedPlaceProps {
|
|
12
12
|
place: ResolvedPlaceView;
|
|
13
13
|
dualRoles?: DualRoleView[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ResolvedPlace.d.ts","sourceRoot":"","sources":["../../lib/pipeline/ResolvedPlace.tsx"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,
|
|
1
|
+
{"version":3,"file":"ResolvedPlace.d.ts","sourceRoot":"","sources":["../../lib/pipeline/ResolvedPlace.tsx"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,wCAAwC,CAAA;AAC7F,OAAO,EAAY,KAAK,SAAS,EAAE,MAAM,OAAO,CAAA;AAEhD,MAAM,WAAW,kBAAkB;IAClC,KAAK,EAAE,iBAAiB,CAAA;IACxB,SAAS,CAAC,EAAE,YAAY,EAAE,CAAA;CAC1B;AAED,wBAAgB,aAAa,CAAC,EAAE,KAAK,EAAE,SAAS,EAAE,EAAE,kBAAkB,GAAG,SAAS,CA6CjF"}
|
|
@@ -1,14 +1,8 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
/**
|
|
3
|
-
* @copyright Sister Software
|
|
4
|
-
* @license AGPL-3.0
|
|
5
|
-
* @author Teffen Ellis, et al.
|
|
6
|
-
*
|
|
7
|
-
* `ResolvedPlace` — the "Resolved place" detail list (name, placetype, WOF id, coords, score) plus an
|
|
8
|
-
* optional dual-role note. Presentational.
|
|
9
|
-
*/
|
|
1
|
+
import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
10
2
|
import { Fragment } from "react";
|
|
11
3
|
export function ResolvedPlace({ place, dualRoles }) {
|
|
12
|
-
return (_jsxs("div", { className: "mw-resolved", children: [_jsx("h2", { children: "Resolved place" }), _jsxs("dl", { children: [_jsx("dt", { children: "name" }), _jsx("dd", { children: place.name }), _jsx("dt", { children: "placetype" }), _jsx("dd", { children: place.placetype }),
|
|
4
|
+
return (_jsxs("div", { className: "mw-resolved", children: [_jsx("h2", { children: "Resolved place" }), _jsxs("dl", { children: [_jsx("dt", { children: "name" }), _jsx("dd", { children: place.name }), _jsx("dt", { children: "placetype" }), _jsx("dd", { children: place.placetype }), place.tier ? (_jsxs(_Fragment, { children: [_jsx("dt", { children: "precision" }), _jsx("dd", { children: place.tier === "address_point"
|
|
5
|
+
? "📍 exact address point (≤10 m)"
|
|
6
|
+
: `≈ interpolated · ±${place.uncertaintyM ?? "?"} m` })] })) : (_jsxs(_Fragment, { children: [_jsx("dt", { children: "WOF id" }), _jsx("dd", { children: place.id })] })), _jsx("dt", { children: "coords" }), _jsxs("dd", { children: [place.lat.toFixed(4), ", ", place.lon.toFixed(4)] }), _jsx("dt", { children: "score" }), _jsx("dd", { children: place.score.toFixed(3) })] }), dualRoles && dualRoles.length ? (_jsxs("p", { className: "mw-resolved__dual", children: ["\uD83C\uDFDB\uFE0F ", _jsx("strong", { children: "Dual-role place." }), " ", place.name, " also resolves as", " ", dualRoles.map((role, i) => (_jsxs(Fragment, { children: [i > 0 ? ", " : "", "a ", _jsx("strong", { children: role.role }), " (", role.relationshipType.replaceAll("-", " "), ")"] }, `${role.role}-${role.id}`))), "."] })) : null] }));
|
|
13
7
|
}
|
|
14
8
|
//# sourceMappingURL=ResolvedPlace.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ResolvedPlace.js","sourceRoot":"","sources":["../../lib/pipeline/ResolvedPlace.tsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"ResolvedPlace.js","sourceRoot":"","sources":["../../lib/pipeline/ResolvedPlace.tsx"],"names":[],"mappings":";AAUA,OAAO,EAAE,QAAQ,EAAkB,MAAM,OAAO,CAAA;AAOhD,MAAM,UAAU,aAAa,CAAC,EAAE,KAAK,EAAE,SAAS,EAAsB;IACrE,OAAO,CACN,eAAK,SAAS,EAAC,aAAa,aAC3B,0CAAuB,EACvB,yBACC,gCAAa,EACb,uBAAK,KAAK,CAAC,IAAI,GAAM,EACrB,qCAAkB,EAClB,uBAAK,KAAK,CAAC,SAAS,GAAM,EACzB,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CAEb,8BACC,qCAAkB,EAClB,uBACE,KAAK,CAAC,IAAI,KAAK,eAAe;oCAC9B,CAAC,CAAC,gCAAgC;oCAClC,CAAC,CAAC,qBAAqB,KAAK,CAAC,YAAY,IAAI,GAAG,IAAI,GACjD,IACH,CACH,CAAC,CAAC,CAAC,CACH,8BACC,kCAAe,EACf,uBAAK,KAAK,CAAC,EAAE,GAAM,IACjB,CACH,EACD,kCAAe,EACf,yBACE,KAAK,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,QAAI,KAAK,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,IACzC,EACL,iCAAc,EACd,uBAAK,KAAK,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,GAAM,IAC7B,EACJ,SAAS,IAAI,SAAS,CAAC,MAAM,CAAC,CAAC,CAAC,CAChC,aAAG,SAAS,EAAC,mBAAmB,oCAC3B,gDAAiC,OAAE,KAAK,CAAC,IAAI,uBAAmB,GAAG,EACtE,SAAS,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC,EAAE,EAAE,CAAC,CAC3B,MAAC,QAAQ,eACP,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,QAAG,2BAAS,IAAI,CAAC,IAAI,GAAU,QAAG,IAAI,CAAC,gBAAgB,CAAC,UAAU,CAAC,GAAG,EAAE,GAAG,CAAC,UADhF,GAAG,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC,EAAE,EAAE,CAE7B,CACX,CAAC,SAEC,CACJ,CAAC,CAAC,CAAC,IAAI,IACH,CACN,CAAA;AACF,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @copyright Sister Software
|
|
3
|
+
* @license AGPL-3.0
|
|
4
|
+
* @author Teffen Ellis, et al.
|
|
5
|
+
*
|
|
6
|
+
* `SpanHighlight` — a displaCy-style span ribbon over the raw input: each tagged span is a column with the text on
|
|
7
|
+
* top, tinted by its confidence tier, and the tag beneath. Gaps (delimiters, unparsed characters) fall through as
|
|
8
|
+
* plain text, so a dropped span is visible as a literal break in the colour.
|
|
9
|
+
*/
|
|
10
|
+
import type { ParsedComponent } from "@mailwoman/core/pipeline/client-result";
|
|
11
|
+
import type { ReactNode } from "react";
|
|
12
|
+
export interface SpanHighlightProps {
|
|
13
|
+
/**
|
|
14
|
+
* The raw text handed to the parser — `nodes[].start/end` index into this.
|
|
15
|
+
*/
|
|
16
|
+
input: string;
|
|
17
|
+
/**
|
|
18
|
+
* Flattened parse nodes; only those with numeric `start`/`end` are rendered.
|
|
19
|
+
*/
|
|
20
|
+
nodes: ParsedComponent[];
|
|
21
|
+
}
|
|
22
|
+
export declare function SpanHighlight({ input, nodes }: SpanHighlightProps): ReactNode;
|
|
23
|
+
//# sourceMappingURL=SpanHighlight.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SpanHighlight.d.ts","sourceRoot":"","sources":["../../lib/pipeline/SpanHighlight.tsx"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,wCAAwC,CAAA;AAC7E,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAKtC,MAAM,WAAW,kBAAkB;IAClC;;OAEG;IACH,KAAK,EAAE,MAAM,CAAA;IACb;;OAEG;IACH,KAAK,EAAE,eAAe,EAAE,CAAA;CACxB;AASD,wBAAgB,aAAa,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE,kBAAkB,GAAG,SAAS,CA8D7E"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { confidenceTierOrMid } from "#common/confidence-tiers";
|
|
3
|
+
import { shortestSpanOwners } from "#common/text-tokens";
|
|
4
|
+
export function SpanHighlight({ input, nodes }) {
|
|
5
|
+
if (!input)
|
|
6
|
+
return null;
|
|
7
|
+
// Keep only well-formed spans that index into the input.
|
|
8
|
+
const spans = nodes.filter((n) => typeof n.start === "number" &&
|
|
9
|
+
typeof n.end === "number" &&
|
|
10
|
+
n.start >= 0 &&
|
|
11
|
+
n.end > n.start &&
|
|
12
|
+
n.end <= input.length);
|
|
13
|
+
if (!spans.length)
|
|
14
|
+
return null;
|
|
15
|
+
// Per-character owner: the most specific (shortest) span covering it, the same rule the word-level panels apply
|
|
16
|
+
// per word. The leaf always wins whatever nesting the tree hands over, so every character renders once.
|
|
17
|
+
const characters = Array.from({ length: input.length }, (_, i) => ({ start: i, end: i + 1 }));
|
|
18
|
+
const owner = shortestSpanOwners(characters, spans);
|
|
19
|
+
// Coalesce runs of the same owner into segments.
|
|
20
|
+
const segments = [];
|
|
21
|
+
let from = 0;
|
|
22
|
+
for (let i = 1; i <= input.length; i++) {
|
|
23
|
+
if (i === input.length || owner[i] !== owner[from]) {
|
|
24
|
+
const ownerIndex = owner[from] ?? -1;
|
|
25
|
+
segments.push({ text: input.slice(from, i), node: ownerIndex === -1 ? null : (spans[ownerIndex] ?? null) });
|
|
26
|
+
from = i;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
return (_jsxs("div", { className: "mw-spans", children: [_jsxs("div", { className: "mw-spans__legend", children: [_jsx("span", { children: "confidence" }), _jsx("span", { className: "mw-spans__swatch mw-spans__swatch--low" }), " low", _jsx("span", { className: "mw-spans__swatch mw-spans__swatch--mid" }), " mid", _jsx("span", { className: "mw-spans__swatch mw-spans__swatch--high" }), " high"] }), _jsx("div", { className: "mw-spans__track", children: segments.map((seg, i) => seg.node ? (_jsxs("span", { className: `mw-spans__seg mw-spans__seg--${confidenceTierOrMid(seg.node.confidence)}`, title: `${seg.node.tag}${seg.node.confidence != null ? ` · ${seg.node.confidence.toFixed(2)}` : ""}`, children: [_jsx("span", { className: "mw-spans__text", children: seg.text }), _jsx("span", { className: "mw-spans__tag", children: seg.node.tag })] }, i)) : (_jsx("span", { className: "mw-spans__gap", children: seg.text }, i))) })] }));
|
|
30
|
+
}
|
|
31
|
+
//# sourceMappingURL=SpanHighlight.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SpanHighlight.js","sourceRoot":"","sources":["../../lib/pipeline/SpanHighlight.tsx"],"names":[],"mappings":";AAaA,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAA;AAC9D,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAA;AAoBxD,MAAM,UAAU,aAAa,CAAC,EAAE,KAAK,EAAE,KAAK,EAAsB;IACjE,IAAI,CAAC,KAAK;QAAE,OAAO,IAAI,CAAA;IAEvB,yDAAyD;IACzD,MAAM,KAAK,GAAG,KAAK,CAAC,MAAM,CACzB,CAAC,CAAC,EAAa,EAAE,CAChB,OAAO,CAAC,CAAC,KAAK,KAAK,QAAQ;QAC3B,OAAO,CAAC,CAAC,GAAG,KAAK,QAAQ;QACzB,CAAC,CAA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AAU,aACxB,eAAK,SAAS,EAAC,kBAAkB,aAChC,wCAAuB,EACvB,eAAM,SAAS,EAAC,wCAAwC,GAAG,UAC3D,eAAM,SAAS,EAAC,wCAAwC,GAAG,UAC3D,eAAM,SAAS,EAAC,yCAAyC,GAAG,aACvD,EACN,cAAK,SAAS,EAAC,iBAAiB,YAC9B,QAAQ,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,CAAC,EAAE,EAAE,CACxB,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,CACV,gBAEC,SAAS,EAAE,gCAAgC,mBAAmB,CAAC,GAAG,CAAC,IAAI,CAAC,UAAU,CAAC,EAAE,EACrF,KAAK,EAAE,GAAG,GAAG,CAAC,IAAI,CAAC,GAAG,GAAG,GAAG,CAAC,IAAI,CAAC,UAAU,IAAI,IAAI,CAAC,CAAC,CAAC,MAAM,GAAG,CAAC,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,EAAE,aAEpG,eAAM,SAAS,EAAC,gBAAgB,YAAE,GAAG,CAAC,IAAI,GAAQ,EAClD,eAAM,SAAS,EAAC,eAAe,YAAE,GAAG,CAAC,IAAI,CAAC,GAAG,GAAQ,KALhD,CAAC,CAMA,CACP,CAAC,CAAC,CAAC,CACH,eAAc,SAAS,EAAC,eAAe,YACrC,GAAG,CAAC,IAAI,IADC,CAAC,CAEL,CACP,CACD,GACI,IACD,CACN,CAAA;AACF,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @copyright Sister Software
|
|
3
|
+
* @license AGPL-3.0
|
|
4
|
+
* @author Teffen Ellis, et al.
|
|
5
|
+
*
|
|
6
|
+
* `TimingPanel` — the per-stage timing breakdown: a stacked bar sized by each stage's wall-clock, plus a legend.
|
|
7
|
+
* Stage colours are distinct hues, never the confidence red/amber/green, because they encode the pipeline stage and
|
|
8
|
+
* not quality.
|
|
9
|
+
*/
|
|
10
|
+
import type { StageTiming } from "@mailwoman/core/pipeline/client-result";
|
|
11
|
+
import type { ReactNode } from "react";
|
|
12
|
+
export interface TimingPanelProps {
|
|
13
|
+
timing: StageTiming;
|
|
14
|
+
}
|
|
15
|
+
export declare function TimingPanel({ timing }: TimingPanelProps): ReactNode;
|
|
16
|
+
//# sourceMappingURL=TimingPanel.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TimingPanel.d.ts","sourceRoot":"","sources":["../../lib/pipeline/TimingPanel.tsx"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,wCAAwC,CAAA;AACzE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAEtC,MAAM,WAAW,gBAAgB;IAChC,MAAM,EAAE,WAAW,CAAA;CACnB;AAYD,wBAAgB,WAAW,CAAC,EAAE,MAAM,EAAE,EAAE,gBAAgB,GAAG,SAAS,CAqCnE"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
const STAGES = [
|
|
3
|
+
{ key: "shape", label: "shape + kind" },
|
|
4
|
+
{ key: "classify", label: "classify" },
|
|
5
|
+
{ key: "resolve", label: "resolve" },
|
|
6
|
+
];
|
|
7
|
+
function formatMilliseconds(ms) {
|
|
8
|
+
return ms >= 100 ? `${Math.round(ms)} ms` : `${ms.toFixed(1)} ms`;
|
|
9
|
+
}
|
|
10
|
+
export function TimingPanel({ timing }) {
|
|
11
|
+
const present = STAGES.flatMap((stage) => {
|
|
12
|
+
const ms = timing[stage.key];
|
|
13
|
+
return typeof ms === "number" ? [{ ...stage, ms }] : [];
|
|
14
|
+
});
|
|
15
|
+
const total = present.reduce((sum, stage) => sum + stage.ms, 0);
|
|
16
|
+
if (total <= 0)
|
|
17
|
+
return null;
|
|
18
|
+
return (_jsxs("div", { className: "mw-timing", children: [_jsxs("div", { className: "mw-timing__heading", children: ["Timing ", _jsxs("span", { className: "mw-timing__total", children: [formatMilliseconds(total), " total"] })] }), _jsx("div", { className: "mw-timing__bar", children: present.map((stage) => (_jsx("div", { className: `mw-timing__seg mw-timing__seg--${stage.key}`, style: { width: `${Math.max((stage.ms / total) * 100, 1.5)}%` }, title: `${stage.label}: ${formatMilliseconds(stage.ms)}` }, stage.key))) }), _jsx("div", { className: "mw-timing__legend", children: present.map((stage) => (_jsxs("span", { className: "mw-timing__item", children: [_jsx("span", { className: `mw-timing__swatch mw-timing__seg--${stage.key}` }), stage.label, " ", _jsx("span", { className: "mw-timing__ms", children: formatMilliseconds(stage.ms) })] }, stage.key))) })] }));
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=TimingPanel.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TimingPanel.js","sourceRoot":"","sources":["../../lib/pipeline/TimingPanel.tsx"],"names":[],"mappings":";AAiBA,MAAM,MAAM,GAA6D;IACxE,EAAE,GAAG,EAAE,OAAO,EAAE,KAAK,EAAE,cAAc,EAAE;IACvC,EAAE,GAAG,EAAE,UAAU,EAAE,KAAK,EAAE,UAAU,EAAE;IACtC,EAAE,GAAG,EAAE,SAAS,EAAE,KAAK,EAAE,SAAS,EAAE;CACpC,CAAA;AAED,SAAS,kBAAkB,CAAC,EAAU;IACrC,OAAO,EAAE,IAAI,GAAG,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC,OAAO,CAAC,CAAC,CAAC,KAAK,CAAA;AAClE,CAAC;AAED,MAAM,UAAU,WAAW,CAAC,EAAE,MAAM,EAAoB;IACvD,MAAM,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC,CAAC,KAAK,EAAE,EAAE;QACxC,MAAM,EAAE,GAAG,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,CAAA;QAE5B,OAAO,O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AQ,KAFzE,KAAK,CAAC,GAAG,CAGb,CACP,CAAC,GACG,IACD,CACN,CAAA;AACF,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @copyright Sister Software
|
|
3
|
+
* @license AGPL-3.0
|
|
4
|
+
* @author Teffen Ellis, et al.
|
|
5
|
+
*
|
|
6
|
+
* `TreeView` — the parse's containment tree as nested lists with a guide rail per level. The tag tint follows the
|
|
7
|
+
* confidence tier; the value and score render in monospace.
|
|
8
|
+
*/
|
|
9
|
+
import type { ReactNode } from "react";
|
|
10
|
+
export interface TreeViewProps {
|
|
11
|
+
/**
|
|
12
|
+
* The parser's `AddressTree` (`result.tree`): the view reads `.roots` and recurses `.children`.
|
|
13
|
+
*/
|
|
14
|
+
tree: unknown;
|
|
15
|
+
}
|
|
16
|
+
export declare function TreeView({ tree }: TreeViewProps): ReactNode;
|
|
17
|
+
//# sourceMappingURL=TreeView.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TreeView.d.ts","sourceRoot":"","sources":["../../lib/pipeline/TreeView.tsx"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAWtC,MAAM,WAAW,aAAa;IAC7B;;OAEG;IACH,IAAI,EAAE,OAAO,CAAA;CACb;AAuBD,wBAAgB,QAAQ,CAAC,EAAE,IAAI,EAAE,EAAE,aAAa,GAAG,SAAS,CAM3D"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { confidenceTierOrMid } from "#common/confidence-tiers";
|
|
3
|
+
function renderNode(node, path) {
|
|
4
|
+
if (typeof node.tag !== "string")
|
|
5
|
+
return null;
|
|
6
|
+
const kids = Array.isArray(node.children) ? node.children : [];
|
|
7
|
+
return (_jsxs("li", { className: "mw-tree__node", children: [_jsxs("span", { className: "mw-tree__row", children: [_jsx("span", { className: `mw-tree__tag mw-tree__tag--${confidenceTierOrMid(node.confidence)}`, children: node.tag }), node.value != null && String(node.value) !== "" ? (_jsx("span", { className: "mw-tree__value", children: String(node.value) })) : null, typeof node.confidence === "number" ? (_jsx("span", { className: "mw-tree__conf", children: node.confidence.toFixed(2) })) : null] }), kids.length ? _jsx("ul", { className: "mw-tree__children", children: kids.map((c, i) => renderNode(c, `${path}.${i}`)) }) : null] }, path));
|
|
8
|
+
}
|
|
9
|
+
export function TreeView({ tree }) {
|
|
10
|
+
const roots = tree?.roots;
|
|
11
|
+
if (!Array.isArray(roots) || !roots.length)
|
|
12
|
+
return null;
|
|
13
|
+
return _jsx("ul", { className: "mw-tree mw-tree__children", children: roots.map((n, i) => renderNode(n, String(i))) });
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=TreeView.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TreeView.js","sourceRoot":"","sources":["../../lib/pipeline/TreeView.tsx"],"names":[],"mappings":";AAWA,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAA;AAgB9D,SAAS,UAAU,CAAC,IAAc,EAAE,IAAY;IAC/C,IAAI,OAAO,IAAI,CAAC,GAAG,KAAK,QAAQ;QAAE,OAAO,IAAI,CAAA;IAE7C,MAAM,IAAI,GAAG,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAA;IAE9D,OAAO,CACN,cAAe,SAAS,EAAC,eAAe,aACvC,gBAAM,SAAS,EAAC,cAAc,aAC7B,eAAM,SAAS,EAAE,8BAA8B,mBAAmB,CAAC,IAAI,CAAC,UAAU,CAAC,EAAE,YAAG,IAAI,CAAC,GAAG,GAAQ,EACvG,IAAI,CAAC,KAAK,IAAI,IAAI,IAAI,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC,CAClD,eAAM,SAAS,EAAC,gBAAgB,YAAE,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,GAAQ,CAC5D,CAAC,CAAC,CAAC,IAAI,EACP,OAAO,IAAI,CAAC,UAAU,KAAK,QAAQ,CAAC,CAAC,CAAC,CACtC,eAAM,SAAS,EAAC,eAAe,YAAE,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC,CAAC,GAAQ,CACnE,CAAC,CAAC,CAAC,IAAI,IACF,EACN,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,aAAI,SAAS,EAAC,mBAAmB,YAAE,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,UAAU,CAAC,CAAC,EAAE,GAAG,IAAI,IAAI,CAAC,EAAE,CAAC,CAAC,GAAM,CAAC,CAAC,CAAC,IAAI,KAVxG,IAAI,CAWR,CACL,CAAA;AACF,CAAC;AAED,MAAM,UAAU,QAAQ,CAAC,EAAE,IAAI,EAAiB;IAC/C,MAAM,KAAK,GAAI,IAAiD,EAAE,KAAK,CAAA;IAEvE,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM;QAAE,OAAO,IAAI,CAAA;IAEvD,OAAO,aAAI,SAAS,EAAC,2BAA2B,YAAG,KAAoB,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,UAAU,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,GAAM,CAAA;AACtH,CAAC"}
|
package/out/pipeline/copy.d.ts
CHANGED
|
@@ -6,6 +6,6 @@
|
|
|
6
6
|
* Builds the "Copy JSON" payload for a parse result — the components + the selected resolved place,
|
|
7
7
|
* pretty-printed. Pure; shared by the explorer's copy button.
|
|
8
8
|
*/
|
|
9
|
-
import type { ParseResult, ResolvedPlaceView } from "
|
|
9
|
+
import type { ParseResult, ResolvedPlaceView } from "@mailwoman/core/pipeline/client-result";
|
|
10
10
|
export declare function buildParsePayload(result: ParseResult, selected: ResolvedPlaceView | null): string;
|
|
11
11
|
//# sourceMappingURL=copy.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"copy.d.ts","sourceRoot":"","sources":["../../lib/pipeline/copy.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,iBAAiB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"copy.d.ts","sourceRoot":"","sources":["../../lib/pipeline/copy.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,iBAAiB,EAAE,MAAM,wCAAwC,CAAA;AAE5F,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,WAAW,EAAE,QAAQ,EAAE,iBAAiB,GAAG,IAAI,GAAG,MAAM,CAyBjG"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @copyright Sister Software
|
|
3
|
+
* @license AGPL-3.0
|
|
4
|
+
* @author Teffen Ellis, et al.
|
|
5
|
+
* @file Pipeline explorer components, visualizers, hooks, and contracts.
|
|
6
|
+
*/
|
|
7
|
+
export { About } from "../common/About.tsx";
|
|
8
|
+
export { FailureDiagnostic } from "./FailureDiagnostic.tsx";
|
|
9
|
+
export type { FailureDiagnosticProps } from "./FailureDiagnostic.tsx";
|
|
10
|
+
export { SpanHighlight } from "./SpanHighlight.tsx";
|
|
11
|
+
export type { SpanHighlightProps } from "./SpanHighlight.tsx";
|
|
12
|
+
export { TimingPanel } from "./TimingPanel.tsx";
|
|
13
|
+
export type { TimingPanelProps } from "./TimingPanel.tsx";
|
|
14
|
+
export { TreeView } from "./TreeView.tsx";
|
|
15
|
+
export type { TreeViewProps } from "./TreeView.tsx";
|
|
16
|
+
export { CandidatePicker } from "./CandidatePicker.tsx";
|
|
17
|
+
export type { CandidatePickerProps } from "./CandidatePicker.tsx";
|
|
18
|
+
export { ComponentTable } from "./ComponentTable.tsx";
|
|
19
|
+
export type { ComponentTableProps } from "./ComponentTable.tsx";
|
|
20
|
+
export { ConfidenceCell } from "./ConfidenceCell.tsx";
|
|
21
|
+
export type { ConfidenceCellProps } from "./ConfidenceCell.tsx";
|
|
22
|
+
export { buildParsePayload } from "#pipeline/copy";
|
|
23
|
+
export { PIPELINE_DEFAULT_ADDRESS, PIPELINE_PRESETS } from "#pipeline/presets";
|
|
24
|
+
export { PipelineExplorer } from "./PipelineExplorer.tsx";
|
|
25
|
+
export type { PipelineExplorerProps } from "./PipelineExplorer.tsx";
|
|
26
|
+
export { QueryForm } from "./QueryForm.tsx";
|
|
27
|
+
export type { QueryFormProps } from "./QueryForm.tsx";
|
|
28
|
+
export { ResolvedPlace } from "./ResolvedPlace.tsx";
|
|
29
|
+
export type { ResolvedPlaceProps } from "./ResolvedPlace.tsx";
|
|
30
|
+
export type { PipelineLoadingState, PipelinePanels, PipelineRuntime } from "#pipeline/types";
|
|
31
|
+
export { useParsePipeline } from "#pipeline/useParsePipeline";
|
|
32
|
+
export type { UseParsePipeline, UseParsePipelineOptions } from "#pipeline/useParsePipeline";
|
|
33
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../lib/pipeline/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAA;AAC3C,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAA;AAC3D,YAAY,EAAE,sBAAsB,EAAE,MAAM,yBAAyB,CAAA;AACrE,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAA;AACnD,YAAY,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAA;AAC7D,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAA;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|
|
5
|
+
* @file Pipeline explorer components, visualizers, hooks, and contracts.
|
|
6
|
+
*/
|
|
7
|
+
export { About } from "../common/About.js";
|
|
8
|
+
export { FailureDiagnostic } from "./FailureDiagnostic.js";
|
|
9
|
+
export { SpanHighlight } from "./SpanHighlight.js";
|
|
10
|
+
export { TimingPanel } from "./TimingPanel.js";
|
|
11
|
+
export { TreeView } from "./TreeView.js";
|
|
12
|
+
export { CandidatePicker } from "./CandidatePicker.js";
|
|
13
|
+
export { ComponentTable } from "./ComponentTable.js";
|
|
14
|
+
export { ConfidenceCell } from "./ConfidenceCell.js";
|
|
15
|
+
export { buildParsePayload } from "#pipeline/copy";
|
|
16
|
+
export { PIPELINE_DEFAULT_ADDRESS, PIPELINE_PRESETS } from "#pipeline/presets";
|
|
17
|
+
export { PipelineExplorer } from "./PipelineExplorer.js";
|
|
18
|
+
export { QueryForm } from "./QueryForm.js";
|
|
19
|
+
export { ResolvedPlace } from "./ResolvedPlace.js";
|
|
20
|
+
export { useParsePipeline } from "#pipeline/useParsePipeline";
|
|
21
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../lib/pipeline/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAqB,CAAA;AAC3C,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAyB,CAAA;AAE3D,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAqB,CAAA;AAEnD,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAmB,CAAA;AAE/C,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAgB,CAAA;AAGzC,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAuB,CAAA;AAEvD,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAsB,CAAA;AAErD,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAsB,CAAA;AAErD,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAA;AAClD,OAAO,EAAE,wBAAwB,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAA;AAC9E,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAwB,CAAA;AAEzD,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAiB,CAAA;AAE3C,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAqB,CAAA;AAKnD,OAAO,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAA"}
|
package/out/pipeline/types.d.ts
CHANGED
|
@@ -5,77 +5,11 @@
|
|
|
5
5
|
*
|
|
6
6
|
* Types for the pipeline (parse + resolve) explorer. The model/gazetteer runtime is INJECTED as a
|
|
7
7
|
* {@link PipelineRuntime}: this package owns the UI state machine + presentation, while the host
|
|
8
|
-
* (the docs site's
|
|
8
|
+
* (the docs site's RuntimeEmbed, or any app) owns loading ONNX/WOF and executing a parse. That keeps
|
|
9
9
|
* onnxruntime-web, sql.js-httpvfs, and node builtins entirely out of this package's browser graph.
|
|
10
10
|
*/
|
|
11
|
+
import type { ParseResult } from "@mailwoman/core/pipeline/client-result";
|
|
11
12
|
import type { ReactNode } from "react";
|
|
12
|
-
import type { KindBadgeResult } from "../common/KindBadge.tsx";
|
|
13
|
-
/**
|
|
14
|
-
* One decoded component, as the table + span views render it. Offsets index into `ParseResult.input`.
|
|
15
|
-
*/
|
|
16
|
-
export interface ParsedComponent {
|
|
17
|
-
tag: string;
|
|
18
|
-
value?: unknown;
|
|
19
|
-
confidence?: number;
|
|
20
|
-
start?: number;
|
|
21
|
-
end?: number;
|
|
22
|
-
}
|
|
23
|
-
/**
|
|
24
|
-
* A resolved gazetteer place, projected to what the "Resolved place" panel + copy payload need.
|
|
25
|
-
*/
|
|
26
|
-
export interface ResolvedPlaceView {
|
|
27
|
-
id: number;
|
|
28
|
-
name: string;
|
|
29
|
-
placetype: string;
|
|
30
|
-
lat: number;
|
|
31
|
-
lon: number;
|
|
32
|
-
score: number;
|
|
33
|
-
}
|
|
34
|
-
/**
|
|
35
|
-
* An additional admin role a resolved place also fulfils (the dual-role / city-state relation, #402).
|
|
36
|
-
*/
|
|
37
|
-
export interface DualRoleView {
|
|
38
|
-
id: number;
|
|
39
|
-
name: string;
|
|
40
|
-
placetype: string;
|
|
41
|
-
relationshipType: string;
|
|
42
|
-
role: string;
|
|
43
|
-
}
|
|
44
|
-
/**
|
|
45
|
-
* Per-stage wall-clock (ms) for one parse. `resolve` is absent when the lookup is skipped.
|
|
46
|
-
*/
|
|
47
|
-
export interface StageTiming {
|
|
48
|
-
shape: number;
|
|
49
|
-
classify: number;
|
|
50
|
-
resolve?: number;
|
|
51
|
-
}
|
|
52
|
-
/**
|
|
53
|
-
* FST gazetteer-prior provenance, as the "FST prior" disclosure renders it.
|
|
54
|
-
*/
|
|
55
|
-
export interface FSTProvenance {
|
|
56
|
-
builtAt: string;
|
|
57
|
-
stateCount: number;
|
|
58
|
-
placeCount: number;
|
|
59
|
-
importanceMatches: number;
|
|
60
|
-
}
|
|
61
|
-
/**
|
|
62
|
-
* The presentational projection of one parse+resolve. The host's `runParse` produces it.
|
|
63
|
-
*/
|
|
64
|
-
export interface ParseResult {
|
|
65
|
-
input: string;
|
|
66
|
-
/**
|
|
67
|
-
* Opaque hierarchy — handed straight to a host-injected tree/visualizer panel.
|
|
68
|
-
*/
|
|
69
|
-
tree: unknown;
|
|
70
|
-
nodes: ParsedComponent[];
|
|
71
|
-
kindResult?: KindBadgeResult;
|
|
72
|
-
timing?: StageTiming;
|
|
73
|
-
resolved: ResolvedPlaceView | null;
|
|
74
|
-
candidates: ResolvedPlaceView[];
|
|
75
|
-
fstActive: boolean;
|
|
76
|
-
fstProvenance?: FSTProvenance | null;
|
|
77
|
-
dualRoles?: DualRoleView[];
|
|
78
|
-
}
|
|
79
13
|
/**
|
|
80
14
|
* Bundle-load progress surfaced before the runtime is `ready`.
|
|
81
15
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../lib/pipeline/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../lib/pipeline/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,wCAAwC,CAAA;AACzE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAEtC;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACpC,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,UAAU,EAAE,MAAM,EAAE,CAAA;IACpB,SAAS,EAAE,MAAM,CAAA;CACjB;AAED;;;GAGG;AACH,MAAM,WAAW,eAAe;IAC/B;;OAEG;IACH,KAAK,EAAE,OAAO,CAAA;IACd;;OAEG;IACH,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE;QAAE,OAAO,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAA;KAAE,KAAK,OAAO,CAAC,WAAW,CAAC,CAAA;IAC9F;;OAEG;IACH,gBAAgB,EAAE,MAAM,EAAE,CAAA;IAC1B;;OAEG;IACH,OAAO,CAAC,EAAE,oBAAoB,GAAG,IAAI,CAAA;IACrC;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;CAC5B;AAED;;;;GAIG;AACH,MAAM,WAAW,cAAc;IAC9B;;OAEG;IACH,MAAM,CAAC,EAAE,SAAS,CAAA;IAClB;;OAEG;IACH,MAAM,CAAC,EAAE,SAAS,CAAA;IAClB;;OAEG;IACH,cAAc,CAAC,EAAE,SAAS,CAAA;IAC1B;;OAEG;IACH,cAAc,CAAC,EAAE,SAAS,CAAA;IAC1B;;OAEG;IACH,WAAW,CAAC,EAAE,SAAS,CAAA;IACvB;;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"}
|
package/out/pipeline/types.js
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
*
|
|
6
6
|
* Types for the pipeline (parse + resolve) explorer. The model/gazetteer runtime is INJECTED as a
|
|
7
7
|
* {@link PipelineRuntime}: this package owns the UI state machine + presentation, while the host
|
|
8
|
-
* (the docs site's
|
|
8
|
+
* (the docs site's RuntimeEmbed, or any app) owns loading ONNX/WOF and executing a parse. That keeps
|
|
9
9
|
* onnxruntime-web, sql.js-httpvfs, and node builtins entirely out of this package's browser graph.
|
|
10
10
|
*/
|
|
11
11
|
export {};
|
|
@@ -8,7 +8,8 @@
|
|
|
8
8
|
* to the injected {@link PipelineRuntime}. No model or gazetteer code lives here — it just drives the
|
|
9
9
|
* contract and shapes the UI state.
|
|
10
10
|
*/
|
|
11
|
-
import type { ParseResult,
|
|
11
|
+
import type { ParseResult, ResolvedPlaceView } from "@mailwoman/core/pipeline/client-result";
|
|
12
|
+
import type { PipelineRuntime } from "#pipeline/types";
|
|
12
13
|
export interface UseParsePipelineOptions {
|
|
13
14
|
runtime: PipelineRuntime;
|
|
14
15
|
defaultText: string;
|
|
@@ -30,9 +31,12 @@ export interface UseParsePipeline {
|
|
|
30
31
|
*/
|
|
31
32
|
selectedCandidate: ResolvedPlaceView | null;
|
|
32
33
|
/**
|
|
33
|
-
*
|
|
34
|
+
* Parse and resolve the current text. Safe to bind to a form's `onSubmit`.
|
|
35
|
+
*
|
|
36
|
+
* Pass `query` to submit a value the field has not re-rendered with yet — a preset press sets the text and submits in
|
|
37
|
+
* one handler, and that state update is not visible to this call.
|
|
34
38
|
*/
|
|
35
|
-
submit: () => Promise<void>;
|
|
39
|
+
submit: (query?: string) => Promise<void>;
|
|
36
40
|
/**
|
|
37
41
|
* Clear the result (used when a preset replaces the input).
|
|
38
42
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useParsePipeline.d.ts","sourceRoot":"","sources":["../../lib/pipeline/useParsePipeline.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;
|
|
1
|
+
{"version":3,"file":"useParsePipeline.d.ts","sourceRoot":"","sources":["../../lib/pipeline/useParsePipeline.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,iBAAiB,EAAE,MAAM,wCAAwC,CAAA;AAG5F,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA;AAEtD,MAAM,WAAW,uBAAuB;IACvC,OAAO,EAAE,eAAe,CAAA;IACxB,WAAW,EAAE,MAAM,CAAA;CACnB;AAED,MAAM,WAAW,gBAAgB;IAChC,IAAI,EAAE,MAAM,CAAA;IACZ,OAAO,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAA;IAC/B,IAAI,EAAE,OAAO,CAAA;IACb;;OAEG;IACH,UAAU,EAAE,MAAM,CAAA;IAClB,MAAM,EAAE,WAAW,GAAG,IAAI,CAAA;IAC1B,UAAU,EAAE,MAAM,GAAG,IAAI,CAAA;IACzB,sBAAsB,EAAE,MAAM,CAAA;IAC9B,eAAe,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAA;IACxC;;OAEG;IACH,iBAAiB,EAAE,iBAAiB,GAAG,IAAI,CAAA;IAC3C;;;;;OAKG;IACH,MAAM,EAAE,CAAC,KAAK,CAAC,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAA;IACzC;;OAEG;IACH,KAAK,EAAE,MAAM,IAAI,CAAA;CACjB;AAED,wBAAgB,gBAAgB,CAAC,EAAE,OAAO,EAAE,WAAW,EAAE,EAAE,uBAAuB,GAAG,gBAAgB,CAqDpG"}
|
|
@@ -16,14 +16,18 @@ export function useParsePipeline({ runtime, defaultText }) {
|
|
|
16
16
|
const [result, setResult] = useState(null);
|
|
17
17
|
const [selectedCandidateIndex, setSelectedCandidateIndex] = useState(0);
|
|
18
18
|
const [parseError, setParseError] = useState(null);
|
|
19
|
-
|
|
19
|
+
// `query` exists because `setText` does not reach this closure before the call after it runs. A preset that called
|
|
20
|
+
// `setText(value)` then `submit()` parsed the PREVIOUS text — the field showed the preset and the map answered the
|
|
21
|
+
// address before it. A caller that already knows the query passes it; the field's own submit passes nothing.
|
|
22
|
+
const submit = useCallback(async (query) => {
|
|
20
23
|
if (!runtime.ready || busy)
|
|
21
24
|
return;
|
|
25
|
+
const input = query ?? text;
|
|
22
26
|
setBusy(true);
|
|
23
27
|
setParseStage(0);
|
|
24
28
|
setParseError(null);
|
|
25
29
|
try {
|
|
26
|
-
const parsed = await runtime.runParse(
|
|
30
|
+
const parsed = await runtime.runParse(input, { onStage: setParseStage });
|
|
27
31
|
setSelectedCandidateIndex(0);
|
|
28
32
|
setResult(parsed);
|
|
29
33
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useParsePipeline.js","sourceRoot":"","sources":["../../lib/pipeline/useParsePipeline.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;
|
|
1
|
+
{"version":3,"file":"useParsePipeline.js","sourceRoot":"","sources":["../../lib/pipeline/useParsePipeline.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAGH,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AAsC7C,MAAM,UAAU,gBAAgB,CAAC,EAAE,OAAO,EAAE,WAAW,EAA2B;IACjF,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,GAAG,QAAQ,CAAC,WAAW,CAAC,CAAA;IAC7C,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAA;IACvC,MAAM,CAAC,UAAU,EAAE,aAAa,CAAC,GAAG,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAA;IAChD,MAAM,CAA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IAC5C,MAAM,iBAAiB,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,UAAU,CAAC,sBAAsB,CAAC,IAAI,MAAM,CAAC,UAAU,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAA;IAErH,OAAO;QACN,IAAI;QACJ,OAAO;QACP,IAAI;QACJ,UAAU;QACV,MAAM;QACN,UAAU;QACV,sBAAsB;QACtB,eAAe,EAAE,yBAAyB;QAC1C,iBAAiB;QACjB,MAAM;QACN,KAAK;KACL,CAAA;AACF,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { formatDistance } from "#poi/runtime";
|
|
3
3
|
export function LiveResultsBlock({ subjectLabel, anchor, state, onSearch }) {
|
|
4
4
|
const hasAnchor = anchor.trim().length > 0;
|
package/out/poi/POIExplorer.js
CHANGED