@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,6 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
const formatPct = (n) => `${Math.round(n * 100)}%`;
|
|
3
|
+
export function KindBadge({ kindResult }) {
|
|
4
|
+
return (_jsxs("details", { className: "mw-kind", children: [_jsxs("summary", { className: "mw-kind__summary", children: [_jsx("strong", { children: "Kind:" }), " ", _jsx("code", { children: kindResult.kind }), " ", _jsxs("span", { className: "mw-kind__confidence", children: ["(", formatPct(kindResult.confidence), ")"] })] }), kindResult.alternatives.length > 0 ? (_jsx("ul", { className: "mw-kind__alternatives", children: kindResult.alternatives.map((alt) => (_jsxs("li", { children: [_jsx("code", { children: alt.kind }), " ", _jsxs("span", { className: "mw-kind__confidence", children: ["(", formatPct(alt.confidence), ")"] })] }, alt.kind))) })) : null] }));
|
|
5
|
+
}
|
|
6
|
+
//# sourceMappingURL=KindBadge.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"KindBadge.js","sourceRoot":"","sources":["../../common/KindBadge.tsx"],"names":[],"mappings":";AAuBA,MAAM,SAAS,GAAG,CAAC,CAAS,EAAU,EAAE,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,GAAG,GAAG,CAAC,GAAG,CAAA;AAElE,MAAM,UAAU,SAAS,CAAC,EAAE,UAAU,EAAkB;IACvD,OAAO,CACN,mBAAS,SAAS,EAAC,SAAS,aAC3B,mBAAS,SAAS,EAAC,kBAAkB,aACpC,qCAAsB,OAAC,yBAAO,UAAU,CAAC,IAAI,GAAQ,EAAC,GAAG,EACzD,gBAAM,SAAS,EAAC,qBAAqB,kBAAG,SAAS,CAAC,UAAU,CAAC,UAAU,CAAC,SAAS,IACxE,EACT,UAAU,CAAC,YAAY,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,CACrC,aAAI,SAAS,EAAC,uBAAuB,YACnC,UAAU,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,CACrC,yBACC,yBAAO,GAAG,CAAC,IAAI,GAAQ,OAAC,gBAAM,SAAS,EAAC,qBAAqB,kBAAG,SAAS,CAAC,GAAG,CAAC,UAAU,CAAC,SAAS,KAD1F,GAAG,CAAC,IAAI,CAEZ,CACL,CAAC,GACE,CACL,CAAC,CAAC,CAAC,IAAI,IACC,CACV,CAAA;AACF,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @copyright Sister Software
|
|
3
|
+
* @license AGPL-3.0
|
|
4
|
+
* @author Teffen Ellis, et al.
|
|
5
|
+
*
|
|
6
|
+
* LoadingIndicator — pure-CSS loading states for three UX patterns: `pulse` (skeleton bars),
|
|
7
|
+
* `spinner` (rotation ring), and `staged` (a step list with checkmarks). SSR-safe: every animation
|
|
8
|
+
* is CSS-driven, so the component renders identically on server and client. Ported from the docs
|
|
9
|
+
* component onto plain (`mw-`-prefixed) class names.
|
|
10
|
+
*/
|
|
11
|
+
export type LoadingMode = "pulse" | "spinner" | "staged";
|
|
12
|
+
export interface LoadingIndicatorProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
13
|
+
/** @default "spinner" */
|
|
14
|
+
mode?: LoadingMode;
|
|
15
|
+
/** Optional label; in staged mode it renders above the step list. */
|
|
16
|
+
label?: string;
|
|
17
|
+
/** Number of skeleton bars (pulse mode). @default 3 */
|
|
18
|
+
barCount?: number;
|
|
19
|
+
/** Spinner ring size. @default "medium" */
|
|
20
|
+
size?: "small" | "medium" | "large";
|
|
21
|
+
/** Step labels (staged mode) — one row each. */
|
|
22
|
+
steps?: string[];
|
|
23
|
+
/** 0-based index of the active step; earlier steps are complete, later ones pending. @default -1 */
|
|
24
|
+
activeStep?: number;
|
|
25
|
+
}
|
|
26
|
+
export declare const LoadingIndicator: import("react").NamedExoticComponent<LoadingIndicatorProps>;
|
|
27
|
+
//# sourceMappingURL=LoadingIndicator.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LoadingIndicator.d.ts","sourceRoot":"","sources":["../../common/LoadingIndicator.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAMH,MAAM,MAAM,WAAW,GAAG,OAAO,GAAG,SAAS,GAAG,QAAQ,CAAA;AAExD,MAAM,WAAW,qBAAsB,SAAQ,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC;IAClF,yBAAyB;IACzB,IAAI,CAAC,EAAE,WAAW,CAAA;IAClB,qEAAqE;IACrE,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,uDAAuD;IACvD,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,2CAA2C;IAC3C,IAAI,CAAC,EAAE,OAAO,GAAG,QAAQ,GAAG,OAAO,CAAA;IACnC,gDAAgD;IAChD,KAAK,CAAC,EAAE,MAAM,EAAE,CAAA;IAChB,oGAAoG;IACpG,UAAU,CAAC,EAAE,MAAM,CAAA;CACnB;AAQD,eAAO,MAAM,gBAAgB,6DAkB3B,CAAA"}
|
|
@@ -0,0 +1,41 @@
|
|
|
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
|
+
* LoadingIndicator — pure-CSS loading states for three UX patterns: `pulse` (skeleton bars),
|
|
8
|
+
* `spinner` (rotation ring), and `staged` (a step list with checkmarks). SSR-safe: every animation
|
|
9
|
+
* is CSS-driven, so the component renders identically on server and client. Ported from the docs
|
|
10
|
+
* component onto plain (`mw-`-prefixed) class names.
|
|
11
|
+
*/
|
|
12
|
+
import { memo } from "react";
|
|
13
|
+
import { cx } from "./cx.js";
|
|
14
|
+
const SIZE_CLASS = {
|
|
15
|
+
small: "mw-spinner--small",
|
|
16
|
+
medium: "",
|
|
17
|
+
large: "mw-spinner--large",
|
|
18
|
+
};
|
|
19
|
+
export const LoadingIndicator = memo(function LoadingIndicator({ mode = "spinner", label, barCount = 3, size = "medium", steps, activeStep = -1, className, ...rest }) {
|
|
20
|
+
return (_jsxs("div", { className: cx("mw-loading", className), role: "status", "aria-label": label ?? "Loading", ...rest, children: [mode === "pulse" ? _jsx(PulseBars, { count: barCount }) : null, mode === "spinner" ? _jsx(SpinnerRing, { size: size }) : null, mode === "staged" ? _jsx(StagedProgress, { steps: steps, activeStep: activeStep }) : null, label ? _jsx("span", { className: "mw-loading__label", children: label }) : null] }));
|
|
21
|
+
});
|
|
22
|
+
const PulseBars = memo(function PulseBars({ count }) {
|
|
23
|
+
return (_jsx("div", { className: "mw-pulse", children: Array.from({ length: count }, (_, i) => (_jsx("div", { className: "mw-pulse__bar" }, i))) }));
|
|
24
|
+
});
|
|
25
|
+
const SpinnerRing = memo(function SpinnerRing({ size }) {
|
|
26
|
+
return _jsx("div", { className: cx("mw-spinner", SIZE_CLASS[size]) });
|
|
27
|
+
});
|
|
28
|
+
const StagedProgress = memo(function StagedProgress({ steps, activeStep }) {
|
|
29
|
+
if (!steps || steps.length === 0)
|
|
30
|
+
return null;
|
|
31
|
+
return (_jsx("ul", { className: "mw-staged", children: steps.map((step, i) => {
|
|
32
|
+
const isComplete = i < activeStep;
|
|
33
|
+
const isActive = i === activeStep;
|
|
34
|
+
return (_jsxs("li", { className: cx("mw-staged__step", {
|
|
35
|
+
"mw-staged__step--complete": isComplete,
|
|
36
|
+
"mw-staged__step--active": isActive,
|
|
37
|
+
"mw-staged__step--pending": !isComplete && !isActive,
|
|
38
|
+
}), children: [_jsx("span", { className: "mw-staged__icon", children: isComplete ? (_jsx("span", { className: "mw-staged__check" })) : isActive ? (_jsx("span", { className: "mw-staged__dot" })) : null }), _jsx("span", { children: step })] }, i));
|
|
39
|
+
}) }));
|
|
40
|
+
});
|
|
41
|
+
//# sourceMappingURL=LoadingIndicator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LoadingIndicator.js","sourceRoot":"","sources":["../../common/LoadingIndicator.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAE,IAAI,EAAkB,MAAM,OAAO,CAAA;AAE5C,OAAO,EAAE,EAAE,EAAE,MAAM,SAAS,CAAA;AAmB5B,MAAM,UAAU,GAA+D;IAC9E,KAAK,EAAE,mBAAmB;IAC1B,MAAM,EAAE,EAAE;IACV,KAAK,EAAE,mBAAmB;CAC1B,CAAA;AAED,MAAM,CAAC,MAAM,gBAAgB,GAAG,IAAI,CAAwB,SAAS,gBAAgB,CAAC,EACrF,IAAI,GAAG,SAAS,EAChB,KAAK,EACL,QAAQ,GAAG,CAAC,EACZ,IAAI,GAAG,QAAQ,EACf,KAAK,EACL,UAAU,GAAG,CAAC,CAAC,EACf,SAAS,EACT,GAAG,IAAI,EACP;IACA,OAAO,CACN,eAAK,SAAS,EAAE,EAAE,CAAC,YAAY,EAAE,SAAS,CAAC,EAAE,IAAI,EAAC,QAAQ,gBAAa,KAAK,IAAI,SAAS,KAAM,IAAI,aACjG,IAAI,KAAK,OAAO,CAAC,CAAC,CAAC,KAAC,SAAS,IAAC,KAAK,EAAE,QAAQ,GAAI,CAAC,CAAC,CAAC,IAAI,EACxD,IAAI,KAAK,SAAS,CAAC,CAAC,C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U,CAAA;YAEjC,OAAO,CACN,cAEC,SAAS,EAAE,EAAE,CAAC,iBAAiB,EAAE;oBAChC,2BAA2B,EAAE,UAAU;oBACvC,yBAAyB,EAAE,QAAQ;oBACnC,0BAA0B,EAAE,CAAC,UAAU,IAAI,CAAC,QAAQ;iBACpD,CAAC,aAEF,eAAM,SAAS,EAAC,iBAAiB,YAC/B,UAAU,CAAC,CAAC,CAAC,CACb,eAAM,SAAS,EAAC,kBAAkB,GAAG,CACrC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,CACd,eAAM,SAAS,EAAC,gBAAgB,GAAG,CACnC,CAAC,CAAC,CAAC,IAAI,GACF,EACP,yBAAO,IAAI,GAAQ,KAdd,CAAC,CAeF,CACL,CAAA;QACF,CAAC,CAAC,GACE,CACL,CAAA;AACF,CAAC,CAAC,CAAA"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @copyright Sister Software
|
|
3
|
+
* @license AGPL-3.0
|
|
4
|
+
* @author Teffen Ellis, et al.
|
|
5
|
+
*
|
|
6
|
+
* `PresetChips` — the "Try:" row of example buttons shared by both explorers. Presentational: it
|
|
7
|
+
* renders a labelled list and calls `onPick` with the chosen preset's value.
|
|
8
|
+
*/
|
|
9
|
+
import type { ReactNode } from "react";
|
|
10
|
+
export interface Preset {
|
|
11
|
+
label: string;
|
|
12
|
+
value: string;
|
|
13
|
+
}
|
|
14
|
+
export interface PresetChipsProps {
|
|
15
|
+
presets: ReadonlyArray<Preset>;
|
|
16
|
+
onPick: (value: string) => void;
|
|
17
|
+
disabled?: boolean;
|
|
18
|
+
/** Leading label. @default "Try:" */
|
|
19
|
+
caption?: string;
|
|
20
|
+
}
|
|
21
|
+
export declare function PresetChips({ presets, onPick, disabled, caption }: PresetChipsProps): ReactNode;
|
|
22
|
+
//# sourceMappingURL=PresetChips.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PresetChips.d.ts","sourceRoot":"","sources":["../../common/PresetChips.tsx"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAEtC,MAAM,WAAW,MAAM;IACtB,KAAK,EAAE,MAAM,CAAA;IACb,KAAK,EAAE,MAAM,CAAA;CACb;AAED,MAAM,WAAW,gBAAgB;IAChC,OAAO,EAAE,aAAa,CAAC,MAAM,CAAC,CAAA;IAC9B,MAAM,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAA;IAC/B,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,qCAAqC;IACrC,OAAO,CAAC,EAAE,MAAM,CAAA;CAChB;AAED,wBAAgB,WAAW,CAAC,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,OAAgB,EAAE,EAAE,gBAAgB,GAAG,SAAS,CAkBxG"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
export function PresetChips({ presets, onPick, disabled, caption = "Try:" }) {
|
|
3
|
+
return (_jsxs("div", { className: "mw-presets", children: [_jsx("span", { className: "mw-presets__label", children: caption }), presets.map((preset) => (_jsx("button", { type: "button", className: "mw-chip", disabled: disabled, onClick: () => onPick(preset.value), title: preset.value, children: preset.label }, preset.label)))] }));
|
|
4
|
+
}
|
|
5
|
+
//# sourceMappingURL=PresetChips.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PresetChips.js","sourceRoot":"","sources":["../../common/PresetChips.tsx"],"names":[],"mappings":";AAwBA,MAAM,UAAU,WAAW,CAAC,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,OAAO,GAAG,MAAM,EAAoB;IAC5F,OAAO,CACN,eAAK,SAAS,EAAC,YAAY,aAC1B,eAAM,SAAS,EAAC,mBAAmB,YAAE,OAAO,GAAQ,EACnD,OAAO,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CACxB,iBAEC,IAAI,EAAC,QAAQ,EACb,SAAS,EAAC,SAAS,EACnB,QAAQ,EAAE,QAAQ,EAClB,OAAO,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,EACnC,KAAK,EAAE,MAAM,CAAC,KAAK,YAElB,MAAM,CAAC,KAAK,IAPR,MAAM,CAAC,KAAK,CAQT,CACT,CAAC,IACG,CACN,CAAA;AACF,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @copyright Sister Software
|
|
3
|
+
* @license AGPL-3.0
|
|
4
|
+
* @author Teffen Ellis, et al.
|
|
5
|
+
*
|
|
6
|
+
* Tiny classname joiner — the only utility the presentational units need. Kept in-package (rather
|
|
7
|
+
* than pulling `classnames`) so `@mailwoman/react` ships zero runtime deps beyond its `@mailwoman/*`
|
|
8
|
+
* siblings and the React peer.
|
|
9
|
+
*/
|
|
10
|
+
export type ClassValue = string | number | false | null | undefined | Record<string, boolean>;
|
|
11
|
+
/** Join truthy class tokens; object entries contribute their key when the value is truthy. */
|
|
12
|
+
export declare function cx(...values: ClassValue[]): string;
|
|
13
|
+
//# sourceMappingURL=cx.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cx.d.ts","sourceRoot":"","sources":["../../common/cx.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,MAAM,MAAM,UAAU,GAAG,MAAM,GAAG,MAAM,GAAG,KAAK,GAAG,IAAI,GAAG,SAAS,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;AAE7F,8FAA8F;AAC9F,wBAAgB,EAAE,CAAC,GAAG,MAAM,EAAE,UAAU,EAAE,GAAG,MAAM,CAoBlD"}
|
package/out/common/cx.js
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @copyright Sister Software
|
|
3
|
+
* @license AGPL-3.0
|
|
4
|
+
* @author Teffen Ellis, et al.
|
|
5
|
+
*
|
|
6
|
+
* Tiny classname joiner — the only utility the presentational units need. Kept in-package (rather
|
|
7
|
+
* than pulling `classnames`) so `@mailwoman/react` ships zero runtime deps beyond its `@mailwoman/*`
|
|
8
|
+
* siblings and the React peer.
|
|
9
|
+
*/
|
|
10
|
+
/** Join truthy class tokens; object entries contribute their key when the value is truthy. */
|
|
11
|
+
export function cx(...values) {
|
|
12
|
+
const out = [];
|
|
13
|
+
for (const value of values) {
|
|
14
|
+
if (!value)
|
|
15
|
+
continue;
|
|
16
|
+
if (typeof value === "string" || typeof value === "number") {
|
|
17
|
+
out.push(String(value));
|
|
18
|
+
continue;
|
|
19
|
+
}
|
|
20
|
+
for (const [key, on] of Object.entries(value)) {
|
|
21
|
+
if (on) {
|
|
22
|
+
out.push(key);
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
return out.join(" ");
|
|
27
|
+
}
|
|
28
|
+
//# sourceMappingURL=cx.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cx.js","sourceRoot":"","sources":["../../common/cx.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAIH,8FAA8F;AAC9F,MAAM,UAAU,EAAE,CAAC,GAAG,MAAoB;IACzC,MAAM,GAAG,GAAa,EAAE,CAAA;IAExB,KAAK,MAAM,KAAK,IAAI,MAAM,EAAE,CAAC;QAC5B,IAAI,CAAC,KAAK;YAAE,SAAQ;QAEpB,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;YAC5D,GAAG,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAA;YAEvB,SAAQ;QACT,CAAC;QAED,KAAK,MAAM,CAAC,GAAG,EAAE,EAAE,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;YAC/C,IAAI,EAAE,EAAE,CAAC;gBACR,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;YACd,CAAC;QACF,CAAC;IACF,CAAC;IAED,OAAO,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;AACrB,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @copyright Sister Software
|
|
3
|
+
* @license AGPL-3.0
|
|
4
|
+
* @author Teffen Ellis, et al.
|
|
5
|
+
*
|
|
6
|
+
* `useClipboard` — headless copy-to-clipboard with the async Clipboard API and a legacy
|
|
7
|
+
* `execCommand` fallback (for insecure contexts / older browsers), plus a transient "copied" flag
|
|
8
|
+
* that auto-resets. Extracted from the two explorers' duplicated `onCopy` handlers.
|
|
9
|
+
*/
|
|
10
|
+
export interface UseClipboard {
|
|
11
|
+
copied: boolean;
|
|
12
|
+
copy: (value: string) => Promise<void>;
|
|
13
|
+
}
|
|
14
|
+
/** @param resetMs - How long the `copied` flag stays true after a successful copy. */
|
|
15
|
+
export declare function useClipboard(resetMs?: number): UseClipboard;
|
|
16
|
+
//# sourceMappingURL=useClipboard.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useClipboard.d.ts","sourceRoot":"","sources":["../../common/useClipboard.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AA8BH,MAAM,WAAW,YAAY;IAC5B,MAAM,EAAE,OAAO,CAAA;IACf,IAAI,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAA;CACtC;AAED,sFAAsF;AACtF,wBAAgB,YAAY,CAAC,OAAO,SAAO,GAAG,YAAY,CA4BzD"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @copyright Sister Software
|
|
3
|
+
* @license AGPL-3.0
|
|
4
|
+
* @author Teffen Ellis, et al.
|
|
5
|
+
*
|
|
6
|
+
* `useClipboard` — headless copy-to-clipboard with the async Clipboard API and a legacy
|
|
7
|
+
* `execCommand` fallback (for insecure contexts / older browsers), plus a transient "copied" flag
|
|
8
|
+
* that auto-resets. Extracted from the two explorers' duplicated `onCopy` handlers.
|
|
9
|
+
*/
|
|
10
|
+
import { useCallback, useEffect, useRef, useState } from "react";
|
|
11
|
+
/** Best-effort clipboard write: async Clipboard API first, hidden-textarea `execCommand` fallback. */
|
|
12
|
+
async function writeToClipboard(value) {
|
|
13
|
+
try {
|
|
14
|
+
await navigator.clipboard.writeText(value);
|
|
15
|
+
return;
|
|
16
|
+
}
|
|
17
|
+
catch {
|
|
18
|
+
// Fall through to the legacy path below.
|
|
19
|
+
}
|
|
20
|
+
const textarea = document.createElement("textarea");
|
|
21
|
+
textarea.value = value;
|
|
22
|
+
textarea.style.position = "fixed";
|
|
23
|
+
textarea.style.opacity = "0";
|
|
24
|
+
document.body.appendChild(textarea);
|
|
25
|
+
textarea.select();
|
|
26
|
+
try {
|
|
27
|
+
document.execCommand("copy");
|
|
28
|
+
}
|
|
29
|
+
catch {
|
|
30
|
+
// Nothing else to try — leave `copied` false via the caller's error path.
|
|
31
|
+
}
|
|
32
|
+
finally {
|
|
33
|
+
document.body.removeChild(textarea);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
/** @param resetMs - How long the `copied` flag stays true after a successful copy. */
|
|
37
|
+
export function useClipboard(resetMs = 1500) {
|
|
38
|
+
const [copied, setCopied] = useState(false);
|
|
39
|
+
const timer = useRef(null);
|
|
40
|
+
// Clear a pending reset timer on unmount so it never fires against a torn-down component.
|
|
41
|
+
useEffect(() => () => {
|
|
42
|
+
if (timer.current) {
|
|
43
|
+
clearTimeout(timer.current);
|
|
44
|
+
}
|
|
45
|
+
}, []);
|
|
46
|
+
const copy = useCallback(async (value) => {
|
|
47
|
+
await writeToClipboard(value);
|
|
48
|
+
setCopied(true);
|
|
49
|
+
if (timer.current) {
|
|
50
|
+
clearTimeout(timer.current);
|
|
51
|
+
}
|
|
52
|
+
timer.current = setTimeout(() => setCopied(false), resetMs);
|
|
53
|
+
}, [resetMs]);
|
|
54
|
+
return { copied, copy };
|
|
55
|
+
}
|
|
56
|
+
//# sourceMappingURL=useClipboard.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useClipboard.js","sourceRoot":"","sources":["../../common/useClipboard.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AAEhE,sGAAsG;AACtG,KAAK,UAAU,gBAAgB,CAAC,KAAa;IAC5C,IAAI,CAAC;QACJ,MAAM,SAAS,CAAC,SAAS,CAAC,SAAS,CAAC,KAAK,CAAC,CAAA;QAE1C,OAAM;IACP,CAAC;IAAC,MAAM,CAAC;QACR,yCAAyC;IAC1C,CAAC;IAED,MAAM,QAAQ,GAAG,QAAQ,CAAC,aAAa,CAAC,UAAU,CAAC,CAAA;IACnD,QAAQ,CAAC,KAAK,GAAG,KAAK,CAAA;IACtB,QAAQ,CAAC,KAAK,CAAC,QAAQ,GAAG,OAAO,CAAA;IACjC,QAAQ,CAAC,KAAK,CAAC,OAAO,GAAG,GAAG,CAAA;IAC5B,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,QAAQ,CAAC,CAAA;IACnC,QAAQ,CAAC,MAAM,EAAE,CAAA;IAEjB,IAAI,CAAC;QACJ,QAAQ,CAAC,WAAW,CAAC,MAAM,CAAC,CAAA;IAC7B,CAAC;IAAC,MAAM,CAAC;QACR,0EAA0E;IAC3E,CAAC;YAAS,CAAC;QACV,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,QAAQ,CAAC,CAAA;IACpC,CAAC;AACF,CAAC;AAOD,sFAAsF;AACtF,MAAM,UAAU,YAAY,CAAC,OAAO,GAAG,IAAI;IAC1C,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAA;IAC3C,MAAM,KAAK,GAAG,MAAM,CAAuC,IAAI,CAAC,CAAA;IAEhE,0FAA0F;IAC1F,SAAS,CACR,GAAG,EAAE,CAAC,GAAG,EAAE;QACV,IAAI,KAAK,CAAC,OAAO,EAAE,CAAC;YACnB,YAAY,CAAC,KAAK,CAAC,OAAO,CAAC,CAAA;QAC5B,CAAC;IACF,CAAC,EACD,EAAE,CACF,CAAA;IAED,MAAM,IAAI,GAAG,WAAW,CACvB,KAAK,EAAE,KAAa,EAAE,EAAE;QACvB,MAAM,gBAAgB,CAAC,KAAK,CAAC,CAAA;QAC7B,SAAS,CAAC,IAAI,CAAC,CAAA;QAEf,IAAI,KAAK,CAAC,OAAO,EAAE,CAAC;YACnB,YAAY,CAAC,KAAK,CAAC,OAAO,CAAC,CAAA;QAC5B,CAAC;QACD,KAAK,CAAC,OAAO,GAAG,UAAU,CAAC,GAAG,EAAE,CAAC,SAAS,CAAC,KAAK,CAAC,EAAE,OAAO,CAAC,CAAA;IAC5D,CAAC,EACD,CAAC,OAAO,CAAC,CACT,CAAA;IAED,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,CAAA;AACxB,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @copyright Sister Software
|
|
3
|
+
* @license AGPL-3.0
|
|
4
|
+
* @author Teffen Ellis, et al.
|
|
5
|
+
*
|
|
6
|
+
* `useDebouncedValue` — returns a copy of `value` that only updates after `delayMs` of quiet. Used by
|
|
7
|
+
* the POI explorer to avoid re-classifying on every keystroke. The timer is a genuine external-sync
|
|
8
|
+
* effect (a scheduled clock), so it belongs in an effect.
|
|
9
|
+
*/
|
|
10
|
+
export declare function useDebouncedValue<T>(value: T, delayMs: number): T;
|
|
11
|
+
//# sourceMappingURL=useDebouncedValue.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useDebouncedValue.d.ts","sourceRoot":"","sources":["../../common/useDebouncedValue.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAIH,wBAAgB,iBAAiB,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,OAAO,EAAE,MAAM,GAAG,CAAC,CAUjE"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @copyright Sister Software
|
|
3
|
+
* @license AGPL-3.0
|
|
4
|
+
* @author Teffen Ellis, et al.
|
|
5
|
+
*
|
|
6
|
+
* `useDebouncedValue` — returns a copy of `value` that only updates after `delayMs` of quiet. Used by
|
|
7
|
+
* the POI explorer to avoid re-classifying on every keystroke. The timer is a genuine external-sync
|
|
8
|
+
* effect (a scheduled clock), so it belongs in an effect.
|
|
9
|
+
*/
|
|
10
|
+
import { useEffect, useState } from "react";
|
|
11
|
+
export function useDebouncedValue(value, delayMs) {
|
|
12
|
+
const [debounced, setDebounced] = useState(value);
|
|
13
|
+
useEffect(() => {
|
|
14
|
+
const id = setTimeout(() => setDebounced(value), delayMs);
|
|
15
|
+
return () => clearTimeout(id);
|
|
16
|
+
}, [value, delayMs]);
|
|
17
|
+
return debounced;
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=useDebouncedValue.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useDebouncedValue.js","sourceRoot":"","sources":["../../common/useDebouncedValue.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AAE3C,MAAM,UAAU,iBAAiB,CAAI,KAAQ,EAAE,OAAe;IAC7D,MAAM,CAAC,SAAS,EAAE,YAAY,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAA;IAEjD,SAAS,CAAC,GAAG,EAAE;QACd,MAAM,EAAE,GAAG,UAAU,CAAC,GAAG,EAAE,CAAC,YAAY,CAAC,KAAK,CAAC,EAAE,OAAO,CAAC,CAAA;QAEzD,OAAO,GAAG,EAAE,CAAC,YAAY,CAAC,EAAE,CAAC,CAAA;IAC9B,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC,CAAA;IAEpB,OAAO,SAAS,CAAA;AACjB,CAAC"}
|
package/out/index.d.ts
CHANGED
|
@@ -5,9 +5,62 @@
|
|
|
5
5
|
*
|
|
6
6
|
* `@mailwoman/react` — React components + headless hooks for mailwoman.
|
|
7
7
|
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
8
|
+
* Two composed explorers plus the small presentational units and headless hooks they decompose into:
|
|
9
|
+
*
|
|
10
|
+
* - `POIExplorer` — a self-contained POI-intent tester (classify → subject → OverpassQL), with an
|
|
11
|
+
* optional injected live poi.db search. No weights, no network on the intent path.
|
|
12
|
+
* - `PipelineExplorer` — a parse+resolve tester driven by an INJECTED `PipelineRuntime`, so the
|
|
13
|
+
* model/gazetteer plumbing (ONNX, httpvfs, node builtins) stays in the host, never in this graph.
|
|
14
|
+
*
|
|
15
|
+
* Styling ships separately as `@mailwoman/react/styles.css` (plain, `mw-`-prefixed, Infima-token
|
|
16
|
+
* aware) — no CSS is imported by the component modules, so the bare package import is node-safe.
|
|
11
17
|
*/
|
|
12
|
-
export
|
|
18
|
+
export { ClientOnly } from "./common/ClientOnly.tsx";
|
|
19
|
+
export type { ClientOnlyProps } from "./common/ClientOnly.tsx";
|
|
20
|
+
export { CopyButton } from "./common/CopyButton.tsx";
|
|
21
|
+
export type { CopyButtonProps } from "./common/CopyButton.tsx";
|
|
22
|
+
export { cx } from "./common/cx.ts";
|
|
23
|
+
export type { ClassValue } from "./common/cx.ts";
|
|
24
|
+
export { KindBadge } from "./common/KindBadge.tsx";
|
|
25
|
+
export type { KindBadgeProps, KindBadgeResult } from "./common/KindBadge.tsx";
|
|
26
|
+
export { LoadingIndicator } from "./common/LoadingIndicator.tsx";
|
|
27
|
+
export type { LoadingIndicatorProps, LoadingMode } from "./common/LoadingIndicator.tsx";
|
|
28
|
+
export { PresetChips } from "./common/PresetChips.tsx";
|
|
29
|
+
export type { Preset, PresetChipsProps } from "./common/PresetChips.tsx";
|
|
30
|
+
export { useClipboard } from "./common/useClipboard.ts";
|
|
31
|
+
export type { UseClipboard } from "./common/useClipboard.ts";
|
|
32
|
+
export { useDebouncedValue } from "./common/useDebouncedValue.ts";
|
|
33
|
+
export { AbstainPanel } from "./poi/AbstainPanel.tsx";
|
|
34
|
+
export type { AbstainPanelProps } from "./poi/AbstainPanel.tsx";
|
|
35
|
+
export { LiveResultsBlock } from "./poi/LiveResultsBlock.tsx";
|
|
36
|
+
export type { LiveResultsBlockProps } from "./poi/LiveResultsBlock.tsx";
|
|
37
|
+
export { OverpassBlock } from "./poi/OverpassBlock.tsx";
|
|
38
|
+
export type { OverpassBlockProps } from "./poi/OverpassBlock.tsx";
|
|
39
|
+
export { POIExplorer } from "./poi/POIExplorer.tsx";
|
|
40
|
+
export type { POIExplorerProps } from "./poi/POIExplorer.tsx";
|
|
41
|
+
export { QueryInput } from "./poi/QueryInput.tsx";
|
|
42
|
+
export type { QueryInputProps } from "./poi/QueryInput.tsx";
|
|
43
|
+
export { formatDistance, loadPOIRuntime, POI_DEFAULT_TEXT, POI_PRESETS } from "./poi/runtime.ts";
|
|
44
|
+
export { SubjectPanel } from "./poi/SubjectPanel.tsx";
|
|
45
|
+
export type { SubjectPanelProps } from "./poi/SubjectPanel.tsx";
|
|
46
|
+
export type { CategoryRecord, LiveSearchState, LoadPOIRuntime, POIExplorerResult, POILiveSearch, POILiveSearchResult, POIRuntime, POISearchHit, POISubject, TaxonomyLookup, } from "./poi/types.ts";
|
|
47
|
+
export { usePOISearch } from "./poi/usePOISearch.ts";
|
|
48
|
+
export type { UsePOISearch, UsePOISearchOptions } from "./poi/usePOISearch.ts";
|
|
49
|
+
export { CandidatePicker } from "./pipeline/CandidatePicker.tsx";
|
|
50
|
+
export type { CandidatePickerProps } from "./pipeline/CandidatePicker.tsx";
|
|
51
|
+
export { ComponentTable } from "./pipeline/ComponentTable.tsx";
|
|
52
|
+
export type { ComponentTableProps } from "./pipeline/ComponentTable.tsx";
|
|
53
|
+
export { ConfidenceCell } from "./pipeline/ConfidenceCell.tsx";
|
|
54
|
+
export type { ConfidenceCellProps } from "./pipeline/ConfidenceCell.tsx";
|
|
55
|
+
export { buildParsePayload } from "./pipeline/copy.ts";
|
|
56
|
+
export { PIPELINE_DEFAULT_ADDRESS, PIPELINE_PRESETS } from "./pipeline/presets.ts";
|
|
57
|
+
export { PipelineExplorer } from "./pipeline/PipelineExplorer.tsx";
|
|
58
|
+
export type { PipelineExplorerProps } from "./pipeline/PipelineExplorer.tsx";
|
|
59
|
+
export { QueryForm } from "./pipeline/QueryForm.tsx";
|
|
60
|
+
export type { QueryFormProps } from "./pipeline/QueryForm.tsx";
|
|
61
|
+
export { ResolvedPlace } from "./pipeline/ResolvedPlace.tsx";
|
|
62
|
+
export type { ResolvedPlaceProps } from "./pipeline/ResolvedPlace.tsx";
|
|
63
|
+
export type { DualRoleView, FSTProvenance, ParsedComponent, ParseResult, PipelineLoadingState, PipelinePanels, PipelineRuntime, ResolvedPlaceView, StageTiming, } from "./pipeline/types.ts";
|
|
64
|
+
export { useParsePipeline } from "./pipeline/useParsePipeline.ts";
|
|
65
|
+
export type { UseParsePipeline, UseParsePipelineOptions } from "./pipeline/useParsePipeline.ts";
|
|
13
66
|
//# sourceMappingURL=index.d.ts.map
|
package/out/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAGH,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAA;AACpD,YAAY,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAA;AAC9D,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAA;AACpD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AAc,EACd,eAAe,EACf,iBAAiB,EACjB,WAAW,GACX,MAAM,qBAAqB,CAAA;AAC5B,OAAO,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAA;AACjE,YAAY,EAAE,gBAAgB,EAAE,uBAAuB,EAAE,MAAM,gCAAgC,CAAA"}
|
package/out/index.js
CHANGED
|
@@ -5,9 +5,42 @@
|
|
|
5
5
|
*
|
|
6
6
|
* `@mailwoman/react` — React components + headless hooks for mailwoman.
|
|
7
7
|
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
8
|
+
* Two composed explorers plus the small presentational units and headless hooks they decompose into:
|
|
9
|
+
*
|
|
10
|
+
* - `POIExplorer` — a self-contained POI-intent tester (classify → subject → OverpassQL), with an
|
|
11
|
+
* optional injected live poi.db search. No weights, no network on the intent path.
|
|
12
|
+
* - `PipelineExplorer` — a parse+resolve tester driven by an INJECTED `PipelineRuntime`, so the
|
|
13
|
+
* model/gazetteer plumbing (ONNX, httpvfs, node builtins) stays in the host, never in this graph.
|
|
14
|
+
*
|
|
15
|
+
* Styling ships separately as `@mailwoman/react/styles.css` (plain, `mw-`-prefixed, Infima-token
|
|
16
|
+
* aware) — no CSS is imported by the component modules, so the bare package import is node-safe.
|
|
11
17
|
*/
|
|
12
|
-
|
|
18
|
+
// ── Common primitives ──────────────────────────────────────────────────────
|
|
19
|
+
export { ClientOnly } from "./common/ClientOnly.js";
|
|
20
|
+
export { CopyButton } from "./common/CopyButton.js";
|
|
21
|
+
export { cx } from "./common/cx.js";
|
|
22
|
+
export { KindBadge } from "./common/KindBadge.js";
|
|
23
|
+
export { LoadingIndicator } from "./common/LoadingIndicator.js";
|
|
24
|
+
export { PresetChips } from "./common/PresetChips.js";
|
|
25
|
+
export { useClipboard } from "./common/useClipboard.js";
|
|
26
|
+
export { useDebouncedValue } from "./common/useDebouncedValue.js";
|
|
27
|
+
// ── POI explorer ───────────────────────────────────────────────────────────
|
|
28
|
+
export { AbstainPanel } from "./poi/AbstainPanel.js";
|
|
29
|
+
export { LiveResultsBlock } from "./poi/LiveResultsBlock.js";
|
|
30
|
+
export { OverpassBlock } from "./poi/OverpassBlock.js";
|
|
31
|
+
export { POIExplorer } from "./poi/POIExplorer.js";
|
|
32
|
+
export { QueryInput } from "./poi/QueryInput.js";
|
|
33
|
+
export { formatDistance, loadPOIRuntime, POI_DEFAULT_TEXT, POI_PRESETS } from "./poi/runtime.js";
|
|
34
|
+
export { SubjectPanel } from "./poi/SubjectPanel.js";
|
|
35
|
+
export { usePOISearch } from "./poi/usePOISearch.js";
|
|
36
|
+
// ── Pipeline explorer ──────────────────────────────────────────────────────
|
|
37
|
+
export { CandidatePicker } from "./pipeline/CandidatePicker.js";
|
|
38
|
+
export { ComponentTable } from "./pipeline/ComponentTable.js";
|
|
39
|
+
export { ConfidenceCell } from "./pipeline/ConfidenceCell.js";
|
|
40
|
+
export { buildParsePayload } from "./pipeline/copy.js";
|
|
41
|
+
export { PIPELINE_DEFAULT_ADDRESS, PIPELINE_PRESETS } from "./pipeline/presets.js";
|
|
42
|
+
export { PipelineExplorer } from "./pipeline/PipelineExplorer.js";
|
|
43
|
+
export { QueryForm } from "./pipeline/QueryForm.js";
|
|
44
|
+
export { ResolvedPlace } from "./pipeline/ResolvedPlace.js";
|
|
45
|
+
export { useParsePipeline } from "./pipeline/useParsePipeline.js";
|
|
13
46
|
//# sourceMappingURL=index.js.map
|
package/out/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,8EAA8E;AAC9E,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAyB,CAAA;AAEpD,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAyB,CAAA;AAEpD,OAAO,EAAE,EAAE,EAAE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,MAAM,gCAAgC,CAAA"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @copyright Sister Software
|
|
3
|
+
* @license AGPL-3.0
|
|
4
|
+
* @author Teffen Ellis, et al.
|
|
5
|
+
*
|
|
6
|
+
* `CandidatePicker` — the ranked list of alternate gazetteer candidates; clicking one selects it.
|
|
7
|
+
* Presentational; the selected index is owned by the caller (the pipeline hook).
|
|
8
|
+
*/
|
|
9
|
+
import type { ReactNode } from "react";
|
|
10
|
+
import type { ResolvedPlaceView } from "./types.ts";
|
|
11
|
+
export interface CandidatePickerProps {
|
|
12
|
+
candidates: ResolvedPlaceView[];
|
|
13
|
+
selectedIndex: number;
|
|
14
|
+
onSelect: (index: number) => void;
|
|
15
|
+
}
|
|
16
|
+
export declare function CandidatePicker({ candidates, selectedIndex, onSelect }: CandidatePickerProps): ReactNode;
|
|
17
|
+
//# sourceMappingURL=CandidatePicker.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CandidatePicker.d.ts","sourceRoot":"","sources":["../../pipeline/CandidatePicker.tsx"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAGtC,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAA;AAEnD,MAAM,WAAW,oBAAoB;IACpC,UAAU,EAAE,iBAAiB,EAAE,CAAA;IAC/B,aAAa,EAAE,MAAM,CAAA;IACrB,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAA;CACjC;AAED,wBAAgB,eAAe,CAAC,EAAE,UAAU,EAAE,aAAa,EAAE,QAAQ,EAAE,EAAE,oBAAoB,GAAG,SAAS,CAwBxG"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { cx } from "../common/cx.js";
|
|
3
|
+
export function CandidatePicker({ candidates, selectedIndex, onSelect }) {
|
|
4
|
+
return (_jsxs("div", { className: "mw-candidates", children: [_jsxs("h2", { children: ["Other candidates (", candidates.length - 1, ")"] }), _jsx("ol", { className: "mw-candidates__list", children: candidates.map((candidate, i) => (_jsx("li", { children: _jsxs("button", { type: "button", className: cx("mw-candidates__btn", { "mw-candidates__btn--active": i === selectedIndex }), onClick: () => onSelect(i), title: `${candidate.placetype} • WOF ${candidate.id} • score ${candidate.score.toFixed(3)}`, children: [_jsxs("span", { className: "mw-candidates__rank", children: ["#", i + 1] }), _jsx("span", { className: "mw-candidates__name", children: candidate.name }), _jsxs("span", { className: "mw-candidates__meta", children: [candidate.placetype, " \u00B7 ", candidate.score.toFixed(2)] })] }) }, `${candidate.id}-${i}`))) })] }));
|
|
5
|
+
}
|
|
6
|
+
//# sourceMappingURL=CandidatePicker.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CandidatePicker.js","sourceRoot":"","sources":["../../pipeline/CandidatePicker.tsx"],"names":[],"mappings":";AAWA,OAAO,EAAE,EAAE,EAAE,MAAM,iBAAiB,CAAA;AASpC,MAAM,UAAU,eAAe,CAAC,EAAE,UAAU,EAAE,aAAa,EAAE,QAAQ,EAAwB;IAC5F,OAAO,CACN,eAAK,SAAS,EAAC,eAAe,aAC7B,+CAAuB,UAAU,CAAC,MAAM,GAAG,CAAC,SAAO,EACnD,aAAI,SAAS,EAAC,qBAAqB,YACjC,UAAU,CAAC,GAAG,CAAC,CAAC,SAAS,EAAE,CAAC,EAAE,EAAE,CAAC,CACjC,uBACC,kBACC,IAAI,EAAC,QAAQ,EACb,SAAS,EAAE,EAAE,CAAC,oBAAoB,EAAE,EAAE,4BAA4B,EAAE,CAAC,KAAK,aAAa,EAAE,CAAC,EAC1F,OAAO,EAAE,GAAG,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC,EAC1B,KAAK,EAAE,GAAG,SAAS,CAAC,SAAS,UAAU,SAAS,CAAC,EAAE,YAAY,SAAS,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,aAE3F,gBAAM,SAAS,EAAC,qBAAqB,kBAAG,CAAC,GAAG,CAAC,IAAQ,EACrD,eAAM,SAAS,EAAC,qBAAqB,YAAE,SAAS,CAAC,IAAI,GAAQ,EAC7D,gBAAM,SAAS,EAAC,qBAAqB,aACnC,SAAS,CAAC,SAAS,cAAK,SAAS,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,IAC7C,IACC,IAZD,GAAG,SAAS,CAAC,EAAE,IAAI,CAAC,EAAE,CAa1B,CACL,CAAC,GACE,IACA,CACN,CAAA;AACF,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @copyright Sister Software
|
|
3
|
+
* @license AGPL-3.0
|
|
4
|
+
* @author Teffen Ellis, et al.
|
|
5
|
+
*
|
|
6
|
+
* `ComponentTable` — the tag / value / confidence table of decoded components. Presentational.
|
|
7
|
+
*/
|
|
8
|
+
import type { ReactNode } from "react";
|
|
9
|
+
import type { ParsedComponent } from "./types.ts";
|
|
10
|
+
export interface ComponentTableProps {
|
|
11
|
+
nodes: ParsedComponent[];
|
|
12
|
+
}
|
|
13
|
+
export declare function ComponentTable({ nodes }: ComponentTableProps): ReactNode;
|
|
14
|
+
//# sourceMappingURL=ComponentTable.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ComponentTable.d.ts","sourceRoot":"","sources":["../../pipeline/ComponentTable.tsx"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAGtC,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAA;AAEjD,MAAM,WAAW,mBAAmB;IACnC,KAAK,EAAE,eAAe,EAAE,CAAA;CACxB;AAED,wBAAgB,cAAc,CAAC,EAAE,KAAK,EAAE,EAAE,mBAAmB,GAAG,SAAS,CAuBxE"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { ConfidenceCell } from "./ConfidenceCell.js";
|
|
3
|
+
export function ComponentTable({ nodes }) {
|
|
4
|
+
return (_jsxs("table", { className: "mw-components", children: [_jsx("thead", { children: _jsxs("tr", { children: [_jsx("th", { children: "tag" }), _jsx("th", { children: "value" }), _jsx("th", { children: "confidence" })] }) }), _jsx("tbody", { children: nodes.map((node, i) => (_jsxs("tr", { children: [_jsx("td", { children: node.tag }), _jsx("td", { children: String(node.value ?? "") }), _jsx("td", { children: _jsx(ConfidenceCell, { confidence: node.confidence }) })] }, i))) })] }));
|
|
5
|
+
}
|
|
6
|
+
//# sourceMappingURL=ComponentTable.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ComponentTable.js","sourceRoot":"","sources":["../../pipeline/ComponentTable.tsx"],"names":[],"mappings":";AAUA,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAsB,CAAA;AAOrD,MAAM,UAAU,cAAc,CAAC,EAAE,KAAK,EAAuB;IAC5D,OAAO,CACN,iBAAO,SAAS,EAAC,eAAe,aAC/B,0BACC,yBACC,+BAAY,EACZ,iCAAc,EACd,sCAAmB,IACf,GACE,EACR,0BACE,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC,EAAE,EAAE,CAAC,CACvB,yBACC,uBAAK,IAAI,CAAC,GAAG,GAAM,EACnB,uBAAK,MAAM,CAAC,IAAI,CAAC,KAAK,IAAI,EAAE,CAAC,GAAM,EACnC,uBACC,KAAC,cAAc,IAAC,UAAU,EAAE,IAAI,CAAC,UAAU,GAAI,GAC3C,KALG,CAAC,CAML,CACL,CAAC,GACK,IACD,CACR,CAAA;AACF,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @copyright Sister Software
|
|
3
|
+
* @license AGPL-3.0
|
|
4
|
+
* @author Teffen Ellis, et al.
|
|
5
|
+
*
|
|
6
|
+
* `ConfidenceCell` — a compact confidence bar + value for the component table. Tiers the fill colour
|
|
7
|
+
* at 0.8 / 0.5. Presentational.
|
|
8
|
+
*/
|
|
9
|
+
export interface ConfidenceCellProps {
|
|
10
|
+
confidence?: number;
|
|
11
|
+
}
|
|
12
|
+
export declare function ConfidenceCell({ confidence }: ConfidenceCellProps): import("react").JSX.Element;
|
|
13
|
+
//# sourceMappingURL=ConfidenceCell.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ConfidenceCell.d.ts","sourceRoot":"","sources":["../../pipeline/ConfidenceCell.tsx"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAUH,MAAM,WAAW,mBAAmB;IACnC,UAAU,CAAC,EAAE,MAAM,CAAA;CACnB;AAED,wBAAgB,cAAc,CAAC,EAAE,UAAU,EAAE,EAAE,mBAAmB,+BAWjE"}
|
|
@@ -0,0 +1,22 @@
|
|
|
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
|
+
* `ConfidenceCell` — a compact confidence bar + value for the component table. Tiers the fill colour
|
|
8
|
+
* at 0.8 / 0.5. Presentational.
|
|
9
|
+
*/
|
|
10
|
+
import { cx } from "../common/cx.js";
|
|
11
|
+
function tier(confidence) {
|
|
12
|
+
if (confidence == null)
|
|
13
|
+
return "mid";
|
|
14
|
+
return confidence >= 0.8 ? "high" : confidence >= 0.5 ? "mid" : "low";
|
|
15
|
+
}
|
|
16
|
+
export function ConfidenceCell({ confidence }) {
|
|
17
|
+
if (confidence == null)
|
|
18
|
+
return _jsx("span", { className: "mw-conf__dash", children: "\u2014" });
|
|
19
|
+
const pct = Math.max(0, Math.min(1, confidence)) * 100;
|
|
20
|
+
return (_jsxs("div", { className: "mw-conf", children: [_jsx("div", { className: cx("mw-conf__bar", `mw-conf__bar--${tier(confidence)}`), style: { width: `${pct}%` } }), _jsx("span", { className: "mw-conf__value", children: confidence.toFixed(2) })] }));
|
|
21
|
+
}
|
|
22
|
+
//# sourceMappingURL=ConfidenceCell.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ConfidenceCell.js","sourceRoot":"","sources":["../../pipeline/ConfidenceCell.tsx"],"names":[],"mappings":";AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,EAAE,EAAE,MAAM,iBAAiB,CAAA;AAEpC,SAAS,IAAI,CAAC,UAAmB;IAChC,IAAI,UAAU,IAAI,IAAI;QAAE,OAAO,KAAK,CAAA;IAEpC,OAAO,UAAU,IAAI,GAAG,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,UAAU,IAAI,GAAG,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,CAAA;AACtE,CAAC;AAMD,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,cAAK,SAAS,EAAE,EAAE,CAAC,cAAc,EAAE,iBAAiB,IAAI,CAAC,UAAU,CAAC,EAAE,CAAC,EAAE,KAAK,EAAE,EAAE,KAAK,EAAE,GAAG,GAAG,GAAG,EAAE,GAAI,EACxG,eAAM,SAAS,EAAC,gBAAgB,YAAE,UAAU,CAAC,OAAO,CAAC,CAAC,CAAC,GAAQ,IAC1D,CACN,CAAA;AACF,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @copyright Sister Software
|
|
3
|
+
* @license AGPL-3.0
|
|
4
|
+
* @author Teffen Ellis, et al.
|
|
5
|
+
*
|
|
6
|
+
* `PipelineExplorer` — the composed parse+resolve tester. Drives the injected {@link PipelineRuntime}
|
|
7
|
+
* through {@link useParsePipeline}, renders the core result (kind badge, component table, resolved
|
|
8
|
+
* place, candidate picker), and slots host-supplied panels (span highlight, tree, timing, …) around
|
|
9
|
+
* it. No model/gazetteer code here — composition + a `ClientOnly` SSR boundary only.
|
|
10
|
+
*/
|
|
11
|
+
import type { ReactNode } from "react";
|
|
12
|
+
import { type Preset } from "../common/PresetChips.tsx";
|
|
13
|
+
import type { PipelinePanels, PipelineRuntime } from "./types.ts";
|
|
14
|
+
export interface PipelineExplorerProps {
|
|
15
|
+
/** The injected model/gazetteer runtime (the host wires this to its bundle). */
|
|
16
|
+
runtime: PipelineRuntime;
|
|
17
|
+
/** Address to pre-fill. @default the White House */
|
|
18
|
+
defaultAddress?: string;
|
|
19
|
+
/** Example chips. @default the built-in address presets */
|
|
20
|
+
presets?: ReadonlyArray<Preset>;
|
|
21
|
+
/** Host-injected panels + controls (version selector, span highlight, tree, …). */
|
|
22
|
+
panels?: PipelinePanels;
|
|
23
|
+
}
|
|
24
|
+
export declare function PipelineExplorer({ runtime, defaultAddress, presets, panels, }: PipelineExplorerProps): ReactNode;
|
|
25
|
+
//# sourceMappingURL=PipelineExplorer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PipelineExplorer.d.ts","sourceRoot":"","sources":["../../pipeline/PipelineExplorer.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAMtC,OAAO,EAAe,KAAK,MAAM,EAAE,MAAM,2BAA2B,CAAA;AAOpE,OAAO,KAAK,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,YAAY,CAAA;AAGjE,MAAM,WAAW,qBAAqB;IACrC,gFAAgF;IAChF,OAAO,EAAE,eAAe,CAAA;IACxB,oDAAoD;IACpD,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB,2DAA2D;IAC3D,OAAO,CAAC,EAAE,aAAa,CAAC,MAAM,CAAC,CAAA;IAC/B,mFAAmF;IACnF,MAAM,CAAC,EAAE,cAAc,CAAA;CACvB;AA4FD,wBAAgB,gBAAgB,CAAC,EAChC,OAAO,EACP,cAAyC,EACzC,OAA0B,EAC1B,MAAW,GACX,EAAE,qBAAqB,GAAG,SAAS,CAcnC"}
|