@mailwoman/react 0.0.1 → 7.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/README.md +34 -4
- package/common/ClientOnly.tsx +30 -0
- package/common/CopyButton.tsx +44 -0
- package/common/KindBadge.tsx +44 -0
- package/common/LoadingIndicator.tsx +104 -0
- package/common/PresetChips.tsx +43 -0
- package/common/cx.ts +34 -0
- package/common/useClipboard.ts +73 -0
- package/common/useDebouncedValue.ts +23 -0
- package/index.ts +83 -4
- package/out/common/ClientOnly.d.ts +22 -0
- package/out/common/ClientOnly.d.ts.map +1 -0
- package/out/common/ClientOnly.js +20 -0
- package/out/common/ClientOnly.js.map +1 -0
- package/out/common/CopyButton.d.ts +21 -0
- package/out/common/CopyButton.d.ts.map +1 -0
- package/out/common/CopyButton.js +7 -0
- package/out/common/CopyButton.js.map +1 -0
- package/out/common/KindBadge.d.ts +24 -0
- package/out/common/KindBadge.d.ts.map +1 -0
- package/out/common/KindBadge.js +6 -0
- package/out/common/KindBadge.js.map +1 -0
- package/out/common/LoadingIndicator.d.ts +27 -0
- package/out/common/LoadingIndicator.d.ts.map +1 -0
- package/out/common/LoadingIndicator.js +41 -0
- package/out/common/LoadingIndicator.js.map +1 -0
- package/out/common/PresetChips.d.ts +22 -0
- package/out/common/PresetChips.d.ts.map +1 -0
- package/out/common/PresetChips.js +5 -0
- package/out/common/PresetChips.js.map +1 -0
- package/out/common/cx.d.ts +13 -0
- package/out/common/cx.d.ts.map +1 -0
- package/out/common/cx.js +28 -0
- package/out/common/cx.js.map +1 -0
- package/out/common/useClipboard.d.ts +16 -0
- package/out/common/useClipboard.d.ts.map +1 -0
- package/out/common/useClipboard.js +56 -0
- package/out/common/useClipboard.js.map +1 -0
- package/out/common/useDebouncedValue.d.ts +11 -0
- package/out/common/useDebouncedValue.d.ts.map +1 -0
- package/out/common/useDebouncedValue.js +19 -0
- package/out/common/useDebouncedValue.js.map +1 -0
- package/out/index.d.ts +57 -4
- package/out/index.d.ts.map +1 -1
- package/out/index.js +37 -4
- package/out/index.js.map +1 -1
- package/out/pipeline/CandidatePicker.d.ts +17 -0
- package/out/pipeline/CandidatePicker.d.ts.map +1 -0
- package/out/pipeline/CandidatePicker.js +6 -0
- package/out/pipeline/CandidatePicker.js.map +1 -0
- package/out/pipeline/ComponentTable.d.ts +14 -0
- package/out/pipeline/ComponentTable.d.ts.map +1 -0
- package/out/pipeline/ComponentTable.js +6 -0
- package/out/pipeline/ComponentTable.js.map +1 -0
- package/out/pipeline/ConfidenceCell.d.ts +13 -0
- package/out/pipeline/ConfidenceCell.d.ts.map +1 -0
- package/out/pipeline/ConfidenceCell.js +22 -0
- package/out/pipeline/ConfidenceCell.js.map +1 -0
- package/out/pipeline/PipelineExplorer.d.ts +25 -0
- package/out/pipeline/PipelineExplorer.d.ts.map +1 -0
- package/out/pipeline/PipelineExplorer.js +27 -0
- package/out/pipeline/PipelineExplorer.js.map +1 -0
- package/out/pipeline/QueryForm.d.ts +19 -0
- package/out/pipeline/QueryForm.d.ts.map +1 -0
- package/out/pipeline/QueryForm.js +9 -0
- package/out/pipeline/QueryForm.js.map +1 -0
- package/out/pipeline/ResolvedPlace.d.ts +16 -0
- package/out/pipeline/ResolvedPlace.d.ts.map +1 -0
- package/out/pipeline/ResolvedPlace.js +14 -0
- package/out/pipeline/ResolvedPlace.js.map +1 -0
- package/out/pipeline/copy.d.ts +11 -0
- package/out/pipeline/copy.d.ts.map +1 -0
- package/out/pipeline/copy.js +31 -0
- package/out/pipeline/copy.js.map +1 -0
- package/out/pipeline/presets.d.ts +12 -0
- package/out/pipeline/presets.d.ts.map +1 -0
- package/out/pipeline/presets.js +21 -0
- package/out/pipeline/presets.js.map +1 -0
- package/out/pipeline/types.d.ts +110 -0
- package/out/pipeline/types.d.ts.map +1 -0
- package/out/pipeline/types.js +12 -0
- package/out/pipeline/types.js.map +1 -0
- package/out/pipeline/useParsePipeline.d.ts +34 -0
- package/out/pipeline/useParsePipeline.d.ts.map +1 -0
- package/out/pipeline/useParsePipeline.js +55 -0
- package/out/pipeline/useParsePipeline.js.map +1 -0
- package/out/poi/AbstainPanel.d.ts +14 -0
- package/out/poi/AbstainPanel.d.ts.map +1 -0
- package/out/poi/AbstainPanel.js +5 -0
- package/out/poi/AbstainPanel.js.map +1 -0
- package/out/poi/LiveResultsBlock.d.ts +21 -0
- package/out/poi/LiveResultsBlock.d.ts.map +1 -0
- package/out/poi/LiveResultsBlock.js +7 -0
- package/out/poi/LiveResultsBlock.js.map +1 -0
- package/out/poi/OverpassBlock.d.ts +15 -0
- package/out/poi/OverpassBlock.d.ts.map +1 -0
- package/out/poi/OverpassBlock.js +11 -0
- package/out/poi/OverpassBlock.js.map +1 -0
- package/out/poi/POIExplorer.d.ts +25 -0
- package/out/poi/POIExplorer.d.ts.map +1 -0
- package/out/poi/POIExplorer.js +31 -0
- package/out/poi/POIExplorer.js.map +1 -0
- package/out/poi/QueryInput.d.ts +17 -0
- package/out/poi/QueryInput.d.ts.map +1 -0
- package/out/poi/QueryInput.js +5 -0
- package/out/poi/QueryInput.js.map +1 -0
- package/out/poi/SubjectPanel.d.ts +15 -0
- package/out/poi/SubjectPanel.d.ts.map +1 -0
- package/out/poi/SubjectPanel.js +5 -0
- package/out/poi/SubjectPanel.js.map +1 -0
- package/out/poi/runtime.d.ts +34 -0
- package/out/poi/runtime.d.ts.map +1 -0
- package/out/poi/runtime.js +43 -0
- package/out/poi/runtime.js.map +1 -0
- package/out/poi/types.d.ts +86 -0
- package/out/poi/types.d.ts.map +1 -0
- package/out/poi/types.js +12 -0
- package/out/poi/types.js.map +1 -0
- package/out/poi/usePOISearch.d.ts +35 -0
- package/out/poi/usePOISearch.d.ts.map +1 -0
- package/out/poi/usePOISearch.js +123 -0
- package/out/poi/usePOISearch.js.map +1 -0
- package/package.json +52 -8
- package/pipeline/CandidatePicker.tsx +45 -0
- package/pipeline/ComponentTable.tsx +41 -0
- package/pipeline/ConfidenceCell.tsx +33 -0
- package/pipeline/PipelineExplorer.tsx +148 -0
- package/pipeline/QueryForm.tsx +52 -0
- package/pipeline/ResolvedPlace.tsx +50 -0
- package/pipeline/copy.ts +37 -0
- package/pipeline/presets.ts +24 -0
- package/pipeline/types.ts +118 -0
- package/pipeline/useParsePipeline.ts +84 -0
- package/poi/AbstainPanel.tsx +22 -0
- package/poi/LiveResultsBlock.tsx +70 -0
- package/poi/OverpassBlock.tsx +37 -0
- package/poi/POIExplorer.tsx +102 -0
- package/poi/QueryInput.tsx +26 -0
- package/poi/SubjectPanel.tsx +44 -0
- package/poi/runtime.ts +53 -0
- package/poi/types.ts +82 -0
- package/poi/usePOISearch.ts +183 -0
- package/styles.css +627 -0
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { ClientOnly } from "../common/ClientOnly.js";
|
|
3
|
+
import { CopyButton } from "../common/CopyButton.js";
|
|
4
|
+
import { KindBadge } from "../common/KindBadge.js";
|
|
5
|
+
import { LoadingIndicator } from "../common/LoadingIndicator.js";
|
|
6
|
+
import { PresetChips } from "../common/PresetChips.js";
|
|
7
|
+
import { CandidatePicker } from "./CandidatePicker.js";
|
|
8
|
+
import { ComponentTable } from "./ComponentTable.js";
|
|
9
|
+
import { buildParsePayload } from "./copy.js";
|
|
10
|
+
import { PIPELINE_DEFAULT_ADDRESS, PIPELINE_PRESETS } from "./presets.js";
|
|
11
|
+
import { QueryForm } from "./QueryForm.js";
|
|
12
|
+
import { ResolvedPlace } from "./ResolvedPlace.js";
|
|
13
|
+
import { useParsePipeline } from "./useParsePipeline.js";
|
|
14
|
+
function PipelineExplorerInner({ runtime, defaultAddress, presets, panels }) {
|
|
15
|
+
const pipeline = useParsePipeline({ runtime, defaultText: defaultAddress });
|
|
16
|
+
const { text, setText, busy, parseStage, result, parseError, selectedCandidate } = pipeline;
|
|
17
|
+
const loading = runtime.loading;
|
|
18
|
+
const errorMessage = parseError ?? runtime.errorMessage ?? null;
|
|
19
|
+
return (_jsxs("div", { className: "mw-pipeline-explorer", children: [panels.header, panels.releaseInfo, panels.versionControl, panels.backendControl, _jsx(QueryForm, { value: text, onChange: setText, onSubmit: pipeline.submit, disabled: !runtime.ready, busy: busy, placeholder: PIPELINE_DEFAULT_ADDRESS }), _jsx(PresetChips, { presets: presets, disabled: !runtime.ready || busy, onPick: (value) => {
|
|
20
|
+
setText(value);
|
|
21
|
+
pipeline.reset();
|
|
22
|
+
} }), loading && !runtime.ready ? (_jsx(LoadingIndicator, { mode: "staged", steps: loading.stepLabels.length > 0 ? loading.stepLabels : undefined, activeStep: loading.stepIndex, label: loading.progress })) : null, errorMessage ? _jsx("p", { className: "mw-error", children: errorMessage }) : null, busy ? (_jsx("div", { className: "mw-result", children: _jsx(LoadingIndicator, { mode: "staged", steps: runtime.parseStageLabels, activeStep: parseStage }) })) : result ? (_jsxs("div", { className: "mw-result", children: [_jsxs("div", { className: "mw-result__header", children: [_jsx("h2", { children: "Parsed components" }), _jsx(CopyButton, { value: () => buildParsePayload(result, selectedCandidate), label: "Copy JSON", copiedLabel: "\u2713 Copied" })] }), result.kindResult ? _jsx(KindBadge, { kindResult: result.kindResult }) : null, panels.extras ? panels.extras(result) : null, _jsx(ComponentTable, { nodes: result.nodes }), selectedCandidate ? (_jsxs(_Fragment, { children: [_jsx(ResolvedPlace, { place: selectedCandidate, dualRoles: result.dualRoles }), result.candidates.length > 1 ? (_jsx(CandidatePicker, { candidates: result.candidates, selectedIndex: pipeline.selectedCandidateIndex, onSelect: pipeline.selectCandidate })) : null] })) : panels.failure ? (panels.failure(result)) : null] })) : null, panels.footer] }));
|
|
23
|
+
}
|
|
24
|
+
export function PipelineExplorer({ runtime, defaultAddress = PIPELINE_DEFAULT_ADDRESS, presets = PIPELINE_PRESETS, panels = {}, }) {
|
|
25
|
+
return (_jsx(ClientOnly, { fallback: _jsx("div", { className: "mw-pipeline-explorer", children: _jsx("p", { children: "Loading demo embed\u2026" }) }), children: () => (_jsx(PipelineExplorerInner, { runtime: runtime, defaultAddress: defaultAddress, presets: presets, panels: panels })) }));
|
|
26
|
+
}
|
|
27
|
+
//# sourceMappingURL=PipelineExplorer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PipelineExplorer.js","sourceRoot":"","sources":["../../pipeline/PipelineExplorer.tsx"],"names":[],"mappings":";AAaA,OAAO,EAAE,UAAU,EAAE,MAAM,yBAA0B,CAAA;AACrD,OAAO,EAAE,UAAU,EAAE,MAAM,yBAA0B,CAAA;AACrD,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAyB,CAAA;AACnD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAAgC,CAAA;AACjE,OAAO,EAAE,WAAW,EAAe,MAAM,0BAA2B,CAAA;AACpE,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAuB,CAAA;AACvD,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAsB,CAAA;AACrD,OAAO,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAA;AAC7C,OAAO,EAAE,wBAAwB,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAA;AACzE,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAiB,CAAA;AAC3C,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAqB,CAAA;AAEnD,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAA;AAkBxD,SAAS,qBAAqB,CAAC,EAAE,OAAO,EAAE,cAAc,EAAE,OAAO,EAAE,MAAM,EAA8B;IACtG,MAAM,QAAQ,GAAG,gBAAgB,CAAC,EAAE,OAAO,EAAE,WAAW,EAAE,cAAc,EAAE,CAAC,CAAA;IAC3E,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,EAAE,UAAU,EAAE,iBAAiB,EAAE,GAAG,QAAQ,CAAA;IAE3F,MAAM,OAAO,GAAG,OAAO,CAAC,OAAO,C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AG,wBAAwB,EACzC,OAAO,GAAG,gBAAgB,EAC1B,MAAM,GAAG,EAAE,GACY;IACvB,OAAO,CACN,KAAC,UAAU,IACV,QAAQ,EACP,cAAK,SAAS,EAAC,sBAAsB,YACpC,mDAA0B,GACrB,YAGN,GAAG,EAAE,CAAC,CACN,KAAC,qBAAqB,IAAC,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,GAAI,CAC7G,GACW,CACb,CAAA;AACF,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @copyright Sister Software
|
|
3
|
+
* @license AGPL-3.0
|
|
4
|
+
* @author Teffen Ellis, et al.
|
|
5
|
+
*
|
|
6
|
+
* `QueryForm` — the address input + submit button for the pipeline explorer. Shows a spinner while
|
|
7
|
+
* parsing. Presentational; `onSubmit` fires on form submission.
|
|
8
|
+
*/
|
|
9
|
+
import type { ReactNode } from "react";
|
|
10
|
+
export interface QueryFormProps {
|
|
11
|
+
value: string;
|
|
12
|
+
onChange: (value: string) => void;
|
|
13
|
+
onSubmit: () => void;
|
|
14
|
+
disabled?: boolean;
|
|
15
|
+
busy?: boolean;
|
|
16
|
+
placeholder?: string;
|
|
17
|
+
}
|
|
18
|
+
export declare function QueryForm({ value, onChange, onSubmit, disabled, busy, placeholder }: QueryFormProps): ReactNode;
|
|
19
|
+
//# sourceMappingURL=QueryForm.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"QueryForm.d.ts","sourceRoot":"","sources":["../../pipeline/QueryForm.tsx"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAItC,MAAM,WAAW,cAAc;IAC9B,KAAK,EAAE,MAAM,CAAA;IACb,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAA;IACjC,QAAQ,EAAE,MAAM,IAAI,CAAA;IACpB,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,IAAI,CAAC,EAAE,OAAO,CAAA;IACd,WAAW,CAAC,EAAE,MAAM,CAAA;CACpB;AAED,wBAAgB,SAAS,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,WAAW,EAAE,EAAE,cAAc,GAAG,SAAS,CA6B/G"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { LoadingIndicator } from "../common/LoadingIndicator.js";
|
|
3
|
+
export function QueryForm({ value, onChange, onSubmit, disabled, busy, placeholder }) {
|
|
4
|
+
return (_jsxs("form", { className: "mw-field", onSubmit: (e) => {
|
|
5
|
+
e.preventDefault();
|
|
6
|
+
onSubmit();
|
|
7
|
+
}, children: [_jsx("label", { htmlFor: "mw-pipeline-input", children: "Address" }), _jsx("input", { id: "mw-pipeline-input", type: "text", value: value, onChange: (e) => onChange(e.target.value), disabled: disabled, placeholder: placeholder }), _jsx("button", { type: "submit", disabled: disabled || busy, children: busy ? (_jsxs(_Fragment, { children: [_jsx(LoadingIndicator, { mode: "spinner", size: "small" }), " Parsing\u2026"] })) : ("Parse + resolve") })] }));
|
|
8
|
+
}
|
|
9
|
+
//# sourceMappingURL=QueryForm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"QueryForm.js","sourceRoot":"","sources":["../../pipeline/QueryForm.tsx"],"names":[],"mappings":";AAWA,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAAgC,CAAA;AAWjE,MAAM,UAAU,SAAS,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,WAAW,EAAkB;IACnG,OAAO,CACN,gBACC,SAAS,EAAC,UAAU,EACpB,QAAQ,EAAE,CAAC,CAAC,EAAE,EAAE;YACf,CAAC,CAAC,cAAc,EAAE,CAAA;YAClB,QAAQ,EAAE,CAAA;QACX,CAAC,aAED,gBAAO,OAAO,EAAC,mBAAmB,wBAAgB,EAClD,gBACC,EAAE,EAAC,mBAAmB,EACtB,IAAI,EAAC,MAAM,EACX,KAAK,EAAE,KAAK,EACZ,QAAQ,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,EACzC,QAAQ,EAAE,QAAQ,EAClB,WAAW,EAAE,WAAW,GACvB,EACF,iBAAQ,IAAI,EAAC,QAAQ,EAAC,QAAQ,EAAE,QAAQ,IAAI,IAAI,YAC9C,IAAI,CAAC,CAAC,CAAC,CACP,8BACC,KAAC,gBAAgB,IAAC,IAAI,EAAC,SAAS,EAAC,IAAI,EAAC,OAAO,GAAG,sBAC9C,CACH,CAAC,CAAC,CAAC,CACH,iBAAiB,CACjB,GACO,IACH,CACP,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
|
+
* `ResolvedPlace` — the "Resolved place" detail list (name, placetype, WOF id, coords, score) plus an
|
|
7
|
+
* optional dual-role note. Presentational.
|
|
8
|
+
*/
|
|
9
|
+
import { type ReactNode } from "react";
|
|
10
|
+
import type { DualRoleView, ResolvedPlaceView } from "./types.ts";
|
|
11
|
+
export interface ResolvedPlaceProps {
|
|
12
|
+
place: ResolvedPlaceView;
|
|
13
|
+
dualRoles?: DualRoleView[];
|
|
14
|
+
}
|
|
15
|
+
export declare function ResolvedPlace({ place, dualRoles }: ResolvedPlaceProps): ReactNode;
|
|
16
|
+
//# sourceMappingURL=ResolvedPlace.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ResolvedPlace.d.ts","sourceRoot":"","sources":["../../pipeline/ResolvedPlace.tsx"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAY,KAAK,SAAS,EAAE,MAAM,OAAO,CAAA;AAEhD,OAAO,KAAK,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAA;AAEjE,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,CA+BjF"}
|
|
@@ -0,0 +1,14 @@
|
|
|
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
|
+
*/
|
|
10
|
+
import { Fragment } from "react";
|
|
11
|
+
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 }), _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 > 0 ? (_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.replace(/-/g, " "), ")"] }, `${role.role}-${role.id}`))), "."] })) : null] }));
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=ResolvedPlace.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ResolvedPlace.js","sourceRoot":"","sources":["../../pipeline/ResolvedPlace.tsx"],"names":[],"mappings":";AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,QAAQ,EAAkB,MAAM,OAAO,CAAA;AAShD,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,EAC1B,kCAAe,EACf,uBAAK,KAAK,CAAC,EAAE,GAAM,EACnB,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,GAAG,CAAC,CAAC,CAAC,CAAC,CACpC,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,OAAO,CAAC,IAAI,EAAE,GAAG,CAAC,UAD9E,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,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @copyright Sister Software
|
|
3
|
+
* @license AGPL-3.0
|
|
4
|
+
* @author Teffen Ellis, et al.
|
|
5
|
+
*
|
|
6
|
+
* Builds the "Copy JSON" payload for a parse result — the components + the selected resolved place,
|
|
7
|
+
* pretty-printed. Pure; shared by the explorer's copy button.
|
|
8
|
+
*/
|
|
9
|
+
import type { ParseResult, ResolvedPlaceView } from "./types.ts";
|
|
10
|
+
export declare function buildParsePayload(result: ParseResult, selected: ResolvedPlaceView | null): string;
|
|
11
|
+
//# sourceMappingURL=copy.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"copy.d.ts","sourceRoot":"","sources":["../../pipeline/copy.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAA;AAEhE,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,WAAW,EAAE,QAAQ,EAAE,iBAAiB,GAAG,IAAI,GAAG,MAAM,CAyBjG"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @copyright Sister Software
|
|
3
|
+
* @license AGPL-3.0
|
|
4
|
+
* @author Teffen Ellis, et al.
|
|
5
|
+
*
|
|
6
|
+
* Builds the "Copy JSON" payload for a parse result — the components + the selected resolved place,
|
|
7
|
+
* pretty-printed. Pure; shared by the explorer's copy button.
|
|
8
|
+
*/
|
|
9
|
+
export function buildParsePayload(result, selected) {
|
|
10
|
+
return JSON.stringify({
|
|
11
|
+
input: result.input,
|
|
12
|
+
components: result.nodes.map((node) => ({
|
|
13
|
+
tag: node.tag,
|
|
14
|
+
value: node.value ?? null,
|
|
15
|
+
confidence: node.confidence ?? null,
|
|
16
|
+
start: node.start ?? null,
|
|
17
|
+
end: node.end ?? null,
|
|
18
|
+
})),
|
|
19
|
+
resolved: selected
|
|
20
|
+
? {
|
|
21
|
+
name: selected.name,
|
|
22
|
+
placetype: selected.placetype,
|
|
23
|
+
id: selected.id,
|
|
24
|
+
lat: selected.lat,
|
|
25
|
+
lon: selected.lon,
|
|
26
|
+
score: selected.score,
|
|
27
|
+
}
|
|
28
|
+
: null,
|
|
29
|
+
}, null, 2);
|
|
30
|
+
}
|
|
31
|
+
//# sourceMappingURL=copy.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"copy.js","sourceRoot":"","sources":["../../pipeline/copy.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAIH,MAAM,UAAU,iBAAiB,CAAC,MAAmB,EAAE,QAAkC;IACxF,OAAO,IAAI,CAAC,SAAS,CACpB;QACC,KAAK,EAAE,MAAM,CAAC,KAAK;QACnB,UAAU,EAAE,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;YACvC,GAAG,EAAE,IAAI,CAAC,GAAG;YACb,KAAK,EAAE,IAAI,CAAC,KAAK,IAAI,IAAI;YACzB,UAAU,EAAE,IAAI,CAAC,UAAU,IAAI,IAAI;YACnC,KAAK,EAAE,IAAI,CAAC,KAAK,IAAI,IAAI;YACzB,GAAG,EAAE,IAAI,CAAC,GAAG,IAAI,IAAI;SACrB,CAAC,CAAC;QACH,QAAQ,EAAE,QAAQ;YACjB,CAAC,CAAC;gBACA,IAAI,EAAE,QAAQ,CAAC,IAAI;gBACnB,SAAS,EAAE,QAAQ,CAAC,SAAS;gBAC7B,EAAE,EAAE,QAAQ,CAAC,EAAE;gBACf,GAAG,EAAE,QAAQ,CAAC,GAAG;gBACjB,GAAG,EAAE,QAAQ,CAAC,GAAG;gBACjB,KAAK,EAAE,QAAQ,CAAC,KAAK;aACrB;YACF,CAAC,CAAC,IAAI;KACP,EACD,IAAI,EACJ,CAAC,CACD,CAAA;AACF,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @copyright Sister Software
|
|
3
|
+
* @license AGPL-3.0
|
|
4
|
+
* @author Teffen Ellis, et al.
|
|
5
|
+
*
|
|
6
|
+
* Default query + example addresses for the pipeline explorer. Hosts can override via props; these
|
|
7
|
+
* mirror the docs demo's set so the extracted component looks identical out of the box.
|
|
8
|
+
*/
|
|
9
|
+
import type { Preset } from "../common/PresetChips.tsx";
|
|
10
|
+
export declare const PIPELINE_DEFAULT_ADDRESS = "1600 Pennsylvania Ave NW, Washington, DC 20500";
|
|
11
|
+
export declare const PIPELINE_PRESETS: ReadonlyArray<Preset>;
|
|
12
|
+
//# sourceMappingURL=presets.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"presets.d.ts","sourceRoot":"","sources":["../../pipeline/presets.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,2BAA2B,CAAA;AAEvD,eAAO,MAAM,wBAAwB,mDAAmD,CAAA;AAExF,eAAO,MAAM,gBAAgB,EAAE,aAAa,CAAC,MAAM,CAUlD,CAAA"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @copyright Sister Software
|
|
3
|
+
* @license AGPL-3.0
|
|
4
|
+
* @author Teffen Ellis, et al.
|
|
5
|
+
*
|
|
6
|
+
* Default query + example addresses for the pipeline explorer. Hosts can override via props; these
|
|
7
|
+
* mirror the docs demo's set so the extracted component looks identical out of the box.
|
|
8
|
+
*/
|
|
9
|
+
export const PIPELINE_DEFAULT_ADDRESS = "1600 Pennsylvania Ave NW, Washington, DC 20500";
|
|
10
|
+
export const PIPELINE_PRESETS = [
|
|
11
|
+
{ label: "White House", value: "1600 Pennsylvania Ave NW, Washington, DC 20500" },
|
|
12
|
+
{ label: "Apple Park", value: "1 Apple Park Way, Cupertino, CA 95014" },
|
|
13
|
+
{ label: "30 Rockefeller Plaza", value: "30 Rockefeller Plaza, New York, NY 10112" },
|
|
14
|
+
{ label: "Pier 39 SF", value: "Pier 39, San Francisco, CA 94133" },
|
|
15
|
+
{ label: "Wrigley Field", value: "1060 W Addison St, Chicago, IL 60613" },
|
|
16
|
+
{ label: "Space Needle", value: "400 Broad St, Seattle, WA 98109" },
|
|
17
|
+
{ label: "ZIP only", value: "90210" },
|
|
18
|
+
{ label: "Berlin (native order)", value: "Straußstraße 27, 12623 Berlin" },
|
|
19
|
+
{ label: "Paris (street fall-through)", value: "181 Rue du Chevaleret, Paris" },
|
|
20
|
+
];
|
|
21
|
+
//# sourceMappingURL=presets.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"presets.js","sourceRoot":"","sources":["../../pipeline/presets.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAIH,MAAM,CAAC,MAAM,wBAAwB,GAAG,gDAAgD,CAAA;AAExF,MAAM,CAAC,MAAM,gBAAgB,GAA0B;IACtD,EAAE,KAAK,EAAE,aAAa,EAAE,KAAK,EAAE,gDAAgD,EAAE;IACjF,EAAE,KAAK,EAAE,YAAY,EAAE,KAAK,EAAE,uCAAuC,EAAE;IACvE,EAAE,KAAK,EAAE,sBAAsB,EAAE,KAAK,EAAE,0CAA0C,EAAE;IACpF,EAAE,KAAK,EAAE,YAAY,EAAE,KAAK,EAAE,kCAAkC,EAAE;IAClE,EAAE,KAAK,EAAE,eAAe,EAAE,KAAK,EAAE,sCAAsC,EAAE;IACzE,EAAE,KAAK,EAAE,cAAc,EAAE,KAAK,EAAE,iCAAiC,EAAE;IACnE,EAAE,KAAK,EAAE,UAAU,EAAE,KAAK,EAAE,OAAO,EAAE;IACrC,EAAE,KAAK,EAAE,uBAAuB,EAAE,KAAK,EAAE,+BAA+B,EAAE;IAC1E,EAAE,KAAK,EAAE,6BAA6B,EAAE,KAAK,EAAE,8BAA8B,EAAE;CAC/E,CAAA"}
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @copyright Sister Software
|
|
3
|
+
* @license AGPL-3.0
|
|
4
|
+
* @author Teffen Ellis, et al.
|
|
5
|
+
*
|
|
6
|
+
* Types for the pipeline (parse + resolve) explorer. The model/gazetteer runtime is INJECTED as a
|
|
7
|
+
* {@link PipelineRuntime}: this package owns the UI state machine + presentation, while the host
|
|
8
|
+
* (the docs site's DemoEmbed, or any app) owns loading ONNX/WOF and executing a parse. That keeps
|
|
9
|
+
* onnxruntime-web, sql.js-httpvfs, and node builtins entirely out of this package's browser graph.
|
|
10
|
+
*/
|
|
11
|
+
import type { ReactNode } from "react";
|
|
12
|
+
import type { KindBadgeResult } from "../common/KindBadge.tsx";
|
|
13
|
+
/** One decoded component, as the table + span views render it. Offsets index into `ParseResult.input`. */
|
|
14
|
+
export interface ParsedComponent {
|
|
15
|
+
tag: string;
|
|
16
|
+
value?: unknown;
|
|
17
|
+
confidence?: number;
|
|
18
|
+
start?: number;
|
|
19
|
+
end?: number;
|
|
20
|
+
}
|
|
21
|
+
/** A resolved gazetteer place, projected to what the "Resolved place" panel + copy payload need. */
|
|
22
|
+
export interface ResolvedPlaceView {
|
|
23
|
+
id: number;
|
|
24
|
+
name: string;
|
|
25
|
+
placetype: string;
|
|
26
|
+
lat: number;
|
|
27
|
+
lon: number;
|
|
28
|
+
score: number;
|
|
29
|
+
}
|
|
30
|
+
/** An additional admin role a resolved place also fulfils (the dual-role / city-state relation, #402). */
|
|
31
|
+
export interface DualRoleView {
|
|
32
|
+
id: number;
|
|
33
|
+
name: string;
|
|
34
|
+
placetype: string;
|
|
35
|
+
relationshipType: string;
|
|
36
|
+
role: string;
|
|
37
|
+
}
|
|
38
|
+
/** Per-stage wall-clock (ms) for one parse. `resolve` is absent when the lookup is skipped. */
|
|
39
|
+
export interface StageTiming {
|
|
40
|
+
shape: number;
|
|
41
|
+
classify: number;
|
|
42
|
+
resolve?: number;
|
|
43
|
+
}
|
|
44
|
+
/** FST gazetteer-prior provenance, as the "FST prior" disclosure renders it. */
|
|
45
|
+
export interface FSTProvenance {
|
|
46
|
+
builtAt: string;
|
|
47
|
+
stateCount: number;
|
|
48
|
+
placeCount: number;
|
|
49
|
+
importanceMatches: number;
|
|
50
|
+
}
|
|
51
|
+
/** The presentational projection of one parse+resolve. The host's `runParse` produces it. */
|
|
52
|
+
export interface ParseResult {
|
|
53
|
+
input: string;
|
|
54
|
+
/** Opaque hierarchy — handed straight to a host-injected tree/visualizer panel. */
|
|
55
|
+
tree: unknown;
|
|
56
|
+
nodes: ParsedComponent[];
|
|
57
|
+
kindResult?: KindBadgeResult;
|
|
58
|
+
timing?: StageTiming;
|
|
59
|
+
resolved: ResolvedPlaceView | null;
|
|
60
|
+
candidates: ResolvedPlaceView[];
|
|
61
|
+
fstActive: boolean;
|
|
62
|
+
fstProvenance?: FSTProvenance | null;
|
|
63
|
+
dualRoles?: DualRoleView[];
|
|
64
|
+
}
|
|
65
|
+
/** Bundle-load progress surfaced before the runtime is `ready`. */
|
|
66
|
+
export interface PipelineLoadingState {
|
|
67
|
+
progress?: string;
|
|
68
|
+
stepLabels: string[];
|
|
69
|
+
stepIndex: number;
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* The injected parse runtime. The host implements `runParse` (compute shape → classify → resolve) and reports load
|
|
73
|
+
* progress + errors. This package never imports the model or gazetteer — it only calls this contract.
|
|
74
|
+
*/
|
|
75
|
+
export interface PipelineRuntime {
|
|
76
|
+
/** Whether the model/gazetteer bundle is ready to parse. */
|
|
77
|
+
ready: boolean;
|
|
78
|
+
/** Execute a full parse+resolve, reporting stage progress via `onStage` (0-based index into `parseStageLabels`). */
|
|
79
|
+
runParse: (input: string, hooks: {
|
|
80
|
+
onStage: (stage: number) => void;
|
|
81
|
+
}) => Promise<ParseResult>;
|
|
82
|
+
/** Per-parse progress labels (differ by whether a gazetteer lookup is wired). */
|
|
83
|
+
parseStageLabels: string[];
|
|
84
|
+
/** Bundle-load progress (before `ready`). */
|
|
85
|
+
loading?: PipelineLoadingState | null;
|
|
86
|
+
/** Error surfaced by the bundle load, distinct from a per-parse error. */
|
|
87
|
+
errorMessage?: string | null;
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* Optional host-injected panels. Each is a function of the current parse result returning already-rendered content (the
|
|
91
|
+
* docs site's SpanHighlight, TreeView, TimingPanel, …). Kept as `ReactNode` thunks so this package needs neither those
|
|
92
|
+
* components nor their heavy data types.
|
|
93
|
+
*/
|
|
94
|
+
export interface PipelinePanels {
|
|
95
|
+
/** Rendered above the form (e.g. the docs "About this demo"). */
|
|
96
|
+
header?: ReactNode;
|
|
97
|
+
/** Rendered below everything (e.g. a guided tour). */
|
|
98
|
+
footer?: ReactNode;
|
|
99
|
+
/** Model-version selector, wired to the host's bundle state. */
|
|
100
|
+
versionControl?: ReactNode;
|
|
101
|
+
/** Backend indicator + WASM toggle. */
|
|
102
|
+
backendControl?: ReactNode;
|
|
103
|
+
/** One-line release blurb. */
|
|
104
|
+
releaseInfo?: ReactNode;
|
|
105
|
+
/** Heavy visualizers (span highlight, tree, timing, BIO, …), rendered from the result. */
|
|
106
|
+
extras?: (result: ParseResult) => ReactNode;
|
|
107
|
+
/** Rendered in place of the resolved-place panel when nothing resolved (host's FailureDiagnostic). */
|
|
108
|
+
failure?: (result: ParseResult) => ReactNode;
|
|
109
|
+
}
|
|
110
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../pipeline/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAEtC,OAAO,KAAK,EAAE,eAAe,EAAE,MA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"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @copyright Sister Software
|
|
3
|
+
* @license AGPL-3.0
|
|
4
|
+
* @author Teffen Ellis, et al.
|
|
5
|
+
*
|
|
6
|
+
* Types for the pipeline (parse + resolve) explorer. The model/gazetteer runtime is INJECTED as a
|
|
7
|
+
* {@link PipelineRuntime}: this package owns the UI state machine + presentation, while the host
|
|
8
|
+
* (the docs site's DemoEmbed, or any app) owns loading ONNX/WOF and executing a parse. That keeps
|
|
9
|
+
* onnxruntime-web, sql.js-httpvfs, and node builtins entirely out of this package's browser graph.
|
|
10
|
+
*/
|
|
11
|
+
export {};
|
|
12
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../pipeline/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @copyright Sister Software
|
|
3
|
+
* @license AGPL-3.0
|
|
4
|
+
* @author Teffen Ellis, et al.
|
|
5
|
+
*
|
|
6
|
+
* `useParsePipeline` — the headless core of the pipeline explorer. Owns the query text, the
|
|
7
|
+
* busy/stage flags, the parse result, and the candidate selection; delegates the actual parse+resolve
|
|
8
|
+
* to the injected {@link PipelineRuntime}. No model or gazetteer code lives here — it just drives the
|
|
9
|
+
* contract and shapes the UI state.
|
|
10
|
+
*/
|
|
11
|
+
import type { ParseResult, PipelineRuntime, ResolvedPlaceView } from "./types.ts";
|
|
12
|
+
export interface UseParsePipelineOptions {
|
|
13
|
+
runtime: PipelineRuntime;
|
|
14
|
+
defaultText: string;
|
|
15
|
+
}
|
|
16
|
+
export interface UseParsePipeline {
|
|
17
|
+
text: string;
|
|
18
|
+
setText: (text: string) => void;
|
|
19
|
+
busy: boolean;
|
|
20
|
+
/** 0-based index into `runtime.parseStageLabels`; -1 when idle. */
|
|
21
|
+
parseStage: number;
|
|
22
|
+
result: ParseResult | null;
|
|
23
|
+
parseError: string | null;
|
|
24
|
+
selectedCandidateIndex: number;
|
|
25
|
+
selectCandidate: (index: number) => void;
|
|
26
|
+
/** The currently-selected candidate (falls back to the first), or null. */
|
|
27
|
+
selectedCandidate: ResolvedPlaceView | null;
|
|
28
|
+
/** Run a parse for the current text. Safe to bind to a form's `onSubmit`. */
|
|
29
|
+
submit: () => Promise<void>;
|
|
30
|
+
/** Clear the result (used when a preset replaces the input). */
|
|
31
|
+
reset: () => void;
|
|
32
|
+
}
|
|
33
|
+
export declare function useParsePipeline({ runtime, defaultText }: UseParsePipelineOptions): UseParsePipeline;
|
|
34
|
+
//# sourceMappingURL=useParsePipeline.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useParsePipeline.d.ts","sourceRoot":"","sources":["../../pipeline/useParsePipeline.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAIH,OAAO,KAAK,EAAE,WAAW,EAAE,eAAe,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAA;AAEjF,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,mEAAmE;IACnE,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,2EAA2E;IAC3E,iBAAiB,EAAE,iBAAiB,GAAG,IAAI,CAAA;IAC3C,6EAA6E;IAC7E,MAAM,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAA;IAC3B,gEAAgE;IAChE,KAAK,EAAE,MAAM,IAAI,CAAA;CACjB;AAED,wBAAgB,gBAAgB,CAAC,EAAE,OAAO,EAAE,WAAW,EAAE,EAAE,uBAAuB,GAAG,gBAAgB,CA6CpG"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @copyright Sister Software
|
|
3
|
+
* @license AGPL-3.0
|
|
4
|
+
* @author Teffen Ellis, et al.
|
|
5
|
+
*
|
|
6
|
+
* `useParsePipeline` — the headless core of the pipeline explorer. Owns the query text, the
|
|
7
|
+
* busy/stage flags, the parse result, and the candidate selection; delegates the actual parse+resolve
|
|
8
|
+
* to the injected {@link PipelineRuntime}. No model or gazetteer code lives here — it just drives the
|
|
9
|
+
* contract and shapes the UI state.
|
|
10
|
+
*/
|
|
11
|
+
import { useCallback, useState } from "react";
|
|
12
|
+
export function useParsePipeline({ runtime, defaultText }) {
|
|
13
|
+
const [text, setText] = useState(defaultText);
|
|
14
|
+
const [busy, setBusy] = useState(false);
|
|
15
|
+
const [parseStage, setParseStage] = useState(-1);
|
|
16
|
+
const [result, setResult] = useState(null);
|
|
17
|
+
const [selectedCandidateIndex, setSelectedCandidateIndex] = useState(0);
|
|
18
|
+
const [parseError, setParseError] = useState(null);
|
|
19
|
+
const submit = useCallback(async () => {
|
|
20
|
+
if (!runtime.ready || busy)
|
|
21
|
+
return;
|
|
22
|
+
setBusy(true);
|
|
23
|
+
setParseStage(0);
|
|
24
|
+
setParseError(null);
|
|
25
|
+
try {
|
|
26
|
+
const parsed = await runtime.runParse(text, { onStage: setParseStage });
|
|
27
|
+
setSelectedCandidateIndex(0);
|
|
28
|
+
setResult(parsed);
|
|
29
|
+
}
|
|
30
|
+
catch (err) {
|
|
31
|
+
setParseError(err instanceof Error ? err.message : String(err));
|
|
32
|
+
}
|
|
33
|
+
finally {
|
|
34
|
+
setBusy(false);
|
|
35
|
+
setParseStage(-1);
|
|
36
|
+
}
|
|
37
|
+
}, [runtime, text, busy]);
|
|
38
|
+
const reset = useCallback(() => setResult(null), []);
|
|
39
|
+
// Derived during render — no effect needed.
|
|
40
|
+
const selectedCandidate = result ? (result.candidates[selectedCandidateIndex] ?? result.candidates[0] ?? null) : null;
|
|
41
|
+
return {
|
|
42
|
+
text,
|
|
43
|
+
setText,
|
|
44
|
+
busy,
|
|
45
|
+
parseStage,
|
|
46
|
+
result,
|
|
47
|
+
parseError,
|
|
48
|
+
selectedCandidateIndex,
|
|
49
|
+
selectCandidate: setSelectedCandidateIndex,
|
|
50
|
+
selectedCandidate,
|
|
51
|
+
submit,
|
|
52
|
+
reset,
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
//# sourceMappingURL=useParsePipeline.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useParsePipeline.js","sourceRoot":"","sources":["../../pipeline/useParsePipeline.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AA2B7C,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,CAAC,MAAM,EAAE,SAAS,CAAC,GAAG,QAAQ,CAAqB,IAAI,CAAC,CAAA;IAC9D,MAAM,CAAC,sBAAsB,EAAE,yBAAyB,CAAC,GAAG,QAAQ,CAAC,CAAC,CAAC,CAAA;IACvE,MAAM,CAAC,UAAU,EAAE,aAAa,CAAC,GAAG,QAAQ,CAAgB,IAAI,CAAC,CAAA;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ACN,KAAK;KACL,CAAA;AACF,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @copyright Sister Software
|
|
3
|
+
* @license AGPL-3.0
|
|
4
|
+
* @author Teffen Ellis, et al.
|
|
5
|
+
*
|
|
6
|
+
* `AbstainPanel` — shown when the query carries no POI intent (it parses as an address). Names the
|
|
7
|
+
* classifier's kind so the abstention is legible. Presentational.
|
|
8
|
+
*/
|
|
9
|
+
import type { ReactNode } from "react";
|
|
10
|
+
export interface AbstainPanelProps {
|
|
11
|
+
kind: string;
|
|
12
|
+
}
|
|
13
|
+
export declare function AbstainPanel({ kind }: AbstainPanelProps): ReactNode;
|
|
14
|
+
//# sourceMappingURL=AbstainPanel.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AbstainPanel.d.ts","sourceRoot":"","sources":["../../poi/AbstainPanel.tsx"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAEtC,MAAM,WAAW,iBAAiB;IACjC,IAAI,EAAE,MAAM,CAAA;CACZ;AAED,wBAAgB,YAAY,CAAC,EAAE,IAAI,EAAE,EAAE,iBAAiB,GAAG,SAAS,CAMnE"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
export function AbstainPanel({ kind }) {
|
|
3
|
+
return (_jsxs("p", { className: "mw-muted", children: ["No POI intent detected \u2014 parses as an address (kind ", _jsx("code", { children: kind }), ")."] }));
|
|
4
|
+
}
|
|
5
|
+
//# sourceMappingURL=AbstainPanel.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AbstainPanel.js","sourceRoot":"","sources":["../../poi/AbstainPanel.tsx"],"names":[],"mappings":";AAeA,MAAM,UAAU,YAAY,CAAC,EAAE,IAAI,EAAqB;IACvD,OAAO,CACN,aAAG,SAAS,EAAC,UAAU,0EAC8B,yBAAO,IAAI,GAAQ,UACpE,CACJ,CAAA;AACF,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @copyright Sister Software
|
|
3
|
+
* @license AGPL-3.0
|
|
4
|
+
* @author Teffen Ellis, et al.
|
|
5
|
+
*
|
|
6
|
+
* `LiveResultsBlock` — the on-demand live poi.db search affordance: a "Search live" button plus the
|
|
7
|
+
* idle / loading / error / results states. Presentational — all behavior comes in via props (the
|
|
8
|
+
* `usePOISearch` hook owns the state machine + the injected probe).
|
|
9
|
+
*/
|
|
10
|
+
import type { ReactNode } from "react";
|
|
11
|
+
import type { LiveSearchState } from "./types.ts";
|
|
12
|
+
export interface LiveResultsBlockProps {
|
|
13
|
+
/** Category label for empty-state copy ("No hospital results near …"). */
|
|
14
|
+
categoryLabel: string;
|
|
15
|
+
/** The location anchor the search runs against (empty ⇒ the button is disabled with a hint). */
|
|
16
|
+
anchor: string;
|
|
17
|
+
state: LiveSearchState;
|
|
18
|
+
onSearch: () => void;
|
|
19
|
+
}
|
|
20
|
+
export declare function LiveResultsBlock({ categoryLabel, anchor, state, onSearch }: LiveResultsBlockProps): ReactNode;
|
|
21
|
+
//# sourceMappingURL=LiveResultsBlock.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LiveResultsBlock.d.ts","sourceRoot":"","sources":["../../poi/LiveResultsBlock.tsx"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAGtC,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAA;AAEjD,MAAM,WAAW,qBAAqB;IACrC,0EAA0E;IAC1E,aAAa,EAAE,MAAM,CAAA;IACrB,gGAAgG;IAChG,MAAM,EAAE,MAAM,CAAA;IACd,KAAK,EAAE,eAAe,CAAA;IACtB,QAAQ,EAAE,MAAM,IAAI,CAAA;CACpB;AAED,wBAAgB,gBAAgB,CAAC,EAAE,aAAa,EAAE,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE,qBAAqB,GAAG,SAAS,CA6C7G"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { formatDistance } from "./runtime.js";
|
|
3
|
+
export function LiveResultsBlock({ categoryLabel, anchor, state, onSearch }) {
|
|
4
|
+
const hasAnchor = anchor.trim().length > 0;
|
|
5
|
+
return (_jsxs("div", { className: "mw-live", children: [_jsxs("div", { className: "mw-panel__header", children: [_jsx("h3", { children: "Live results" }), _jsx("button", { type: "button", className: "mw-btn", onClick: onSearch, disabled: !hasAnchor || state.status === "loading", title: hasAnchor ? "Search the published poi.db layer" : 'Needs a location anchor (e.g. "near Springfield")', children: state.status === "loading" ? "Searching…" : "Search live" })] }), !hasAnchor ? (_jsx("p", { className: "mw-muted", children: "Add a location anchor (e.g. \"near Springfield\") to search live." })) : state.status === "error" ? (_jsx("p", { className: "mw-error", children: state.message })) : state.status === "success" ? (state.hits.length === 0 ? (_jsxs("p", { className: "mw-muted", children: ["No ", categoryLabel.toLowerCase(), " results near ", state.centerName, "."] })) : (_jsxs(_Fragment, { children: [_jsxs("p", { className: "mw-live__caption", children: ["Near ", state.centerName, ", ranked by distance:"] }), _jsx("ul", { className: "mw-live__results", children: state.hits.map((hit, i) => (_jsxs("li", { children: [_jsx("span", { className: "mw-live__name", children: hit.name }), _jsxs("span", { className: "mw-live__meta", children: [formatDistance(hit.distanceM), " \u00B7 ", hit.country] })] }, `${hit.name}-${i}`))) })] }))) : null] }));
|
|
6
|
+
}
|
|
7
|
+
//# sourceMappingURL=LiveResultsBlock.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LiveResultsBlock.js","sourceRoot":"","sources":["../../poi/LiveResultsBlock.tsx"],"names":[],"mapp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,GAAG,CAAC,CAAC,GAAG,EAAE,CAAC,EAAE,EAAE,CAAC,CAC3B,yBACC,eAAM,SAAS,EAAC,eAAe,YAAE,GAAG,CAAC,IAAI,GAAQ,EACjD,gBAAM,SAAS,EAAC,eAAe,aAC7B,cAAc,CAAC,GAAG,CAAC,SAAS,CAAC,cAAK,GAAG,CAAC,OAAO,IACxC,KAJC,GAAG,GAAG,CAAC,IAAI,IAAI,CAAC,EAAE,CAKtB,CACL,CAAC,GACE,IACH,CACH,CACD,CAAC,CAAC,CAAC,IAAI,IACH,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
|
+
* `OverpassBlock` — the OverpassQL export panel: a header with a copy button and the query in a code
|
|
7
|
+
* block. Renders the emitter error instead when the export failed. Presentational.
|
|
8
|
+
*/
|
|
9
|
+
import type { ReactNode } from "react";
|
|
10
|
+
export interface OverpassBlockProps {
|
|
11
|
+
overpassQL?: string;
|
|
12
|
+
overpassError?: string;
|
|
13
|
+
}
|
|
14
|
+
export declare function OverpassBlock({ overpassQL, overpassError }: OverpassBlockProps): ReactNode;
|
|
15
|
+
//# sourceMappingURL=OverpassBlock.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"OverpassBlock.d.ts","sourceRoot":"","sources":["../../poi/OverpassBlock.tsx"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAItC,MAAM,WAAW,kBAAkB;IAClC,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,aAAa,CAAC,EAAE,MAAM,CAAA;CACtB;AAED,wBAAgB,aAAa,CAAC,EAAE,UAAU,EAAE,aAAa,EAAE,EAAE,kBAAkB,GAAG,SAAS,CAkB1F"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { CopyButton } from "../common/CopyButton.js";
|
|
3
|
+
export function OverpassBlock({ overpassQL, overpassError }) {
|
|
4
|
+
if (overpassQL) {
|
|
5
|
+
return (_jsxs("div", { className: "mw-overpass", children: [_jsxs("div", { className: "mw-panel__header", children: [_jsx("h3", { children: "OverpassQL export" }), _jsx(CopyButton, { value: overpassQL, className: "mw-btn" })] }), _jsx("pre", { className: "mw-overpass__code", children: _jsx("code", { children: overpassQL }) })] }));
|
|
6
|
+
}
|
|
7
|
+
if (overpassError)
|
|
8
|
+
return _jsx("p", { className: "mw-error", children: overpassError });
|
|
9
|
+
return null;
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=OverpassBlock.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"OverpassBlock.js","sourceRoot":"","sources":["../../poi/OverpassBlock.tsx"],"names":[],"mappings":";AAWA,OAAO,EAAE,UAAU,EAAE,MAAM,yBAA0B,CAAA;AAOrD,MAAM,UAAU,aAAa,CAAC,EAAE,UAAU,EAAE,aAAa,EAAsB;IAC9E,IAAI,UAAU,EAAE,CAAC;QAChB,OAAO,CACN,eAAK,SAAS,EAAC,aAAa,aAC3B,eAAK,SAAS,EAAC,kBAAkB,aAChC,6CAA0B,EAC1B,KAAC,UAAU,IAAC,KAAK,EAAE,UAAU,EAAE,SAAS,EAAC,QAAQ,GAAG,IAC/C,EACN,cAAK,SAAS,EAAC,mBAAmB,YACjC,yBAAO,UAAU,GAAQ,GACpB,IACD,CACN,CAAA;IACF,CAAC;IAED,IAAI,aAAa;QAAE,OAAO,YAAG,SAAS,EAAC,UAAU,YAAE,aAAa,GAAK,CAAA;IAErE,OAAO,IAAI,CAAA;AACZ,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @copyright Sister Software
|
|
3
|
+
* @license AGPL-3.0
|
|
4
|
+
* @author Teffen Ellis, et al.
|
|
5
|
+
*
|
|
6
|
+
* `POIExplorer` — the composed POI-intent tester. Detects a POI subject in free text, shows the
|
|
7
|
+
* category + OverpassQL export, and (when a live-search probe is injected) searches the published
|
|
8
|
+
* poi.db layer. The intent path is self-contained — no weights, no network. All runtime concerns are
|
|
9
|
+
* in {@link usePOISearch}; this file is composition + a `ClientOnly` SSR boundary.
|
|
10
|
+
*/
|
|
11
|
+
import { type ReactNode } from "react";
|
|
12
|
+
import { type Preset } from "../common/PresetChips.tsx";
|
|
13
|
+
import type { LoadPOIRuntime, POILiveSearch } from "./types.ts";
|
|
14
|
+
export interface POIExplorerProps {
|
|
15
|
+
/** Query to pre-fill in the input. */
|
|
16
|
+
defaultText?: string;
|
|
17
|
+
/** Example chips. @default the built-in POI presets */
|
|
18
|
+
presets?: ReadonlyArray<Preset>;
|
|
19
|
+
/** Override the taxonomy-runtime loader (stories/tests inject a mock). */
|
|
20
|
+
loadRuntime?: LoadPOIRuntime;
|
|
21
|
+
/** Live poi.db probe. Absent ⇒ intent-only (no live-results affordance). */
|
|
22
|
+
runLiveSearch?: POILiveSearch;
|
|
23
|
+
}
|
|
24
|
+
export declare function POIExplorer({ defaultText, presets, loadRuntime, runLiveSearch, }: POIExplorerProps): ReactNode;
|
|
25
|
+
//# sourceMappingURL=POIExplorer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"POIExplorer.d.ts","sourceRoot":"","sources":["../../poi/POIExplorer.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAE,KAAK,SAAS,EAAY,MAAM,OAAO,CAAA;AAIhD,OAAO,EAAe,KAAK,MAAM,EAAE,MAAM,2BAA2B,CAAA;AAOpE,OAAO,KAAK,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,YAAY,CAAA;AAG/D,MAAM,WAAW,gBAAgB;IAChC,sCAAsC;IACtC,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,uDAAuD;IACvD,OAAO,CAAC,EAAE,aAAa,CAAC,MAAM,CAAC,CAAA;IAC/B,0EAA0E;IAC1E,WAAW,CAAC,EAAE,cAAc,CAAA;IAC5B,4EAA4E;IAC5E,aAAa,CAAC,EAAE,aAAa,CAAA;CAC7B;AA2CD,wBAAgB,WAAW,CAAC,EAC3B,WAA8B,EAC9B,OAAqB,EACrB,WAAW,EACX,aAAa,GACb,EAAE,gBAAgB,GAAG,SAAS,CAmB9B"}
|