@gzeoneth/gov-tracker 0.2.1-alpha.cli-preview.f8c3a87 → 0.2.1-alpha.cli-preview.a5817b4
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/dist/cli/cli.js +23 -5
- package/dist/cli/cli.js.map +1 -1
- package/dist/cli/lib/cli.d.ts.map +1 -1
- package/dist/cli/lib/cli.js +27 -5
- package/dist/cli/lib/cli.js.map +1 -1
- package/dist/cli/tui/App.d.ts.map +1 -1
- package/dist/cli/tui/App.js +60 -6
- package/dist/cli/tui/App.js.map +1 -1
- package/dist/cli/tui/components/CollapsibleSection.d.ts +20 -0
- package/dist/cli/tui/components/CollapsibleSection.d.ts.map +1 -0
- package/dist/cli/tui/components/CollapsibleSection.js +29 -0
- package/dist/cli/tui/components/CollapsibleSection.js.map +1 -0
- package/dist/cli/tui/components/ConfirmDialog.d.ts +14 -0
- package/dist/cli/tui/components/ConfirmDialog.d.ts.map +1 -0
- package/dist/cli/tui/components/ConfirmDialog.js +29 -0
- package/dist/cli/tui/components/ConfirmDialog.js.map +1 -0
- package/dist/cli/tui/components/CopyableText.d.ts +23 -0
- package/dist/cli/tui/components/CopyableText.d.ts.map +1 -0
- package/dist/cli/tui/components/CopyableText.js +49 -0
- package/dist/cli/tui/components/CopyableText.js.map +1 -0
- package/dist/cli/tui/components/EmptyState.d.ts +11 -0
- package/dist/cli/tui/components/EmptyState.d.ts.map +1 -0
- package/dist/cli/tui/components/EmptyState.js +34 -0
- package/dist/cli/tui/components/EmptyState.js.map +1 -0
- package/dist/cli/tui/components/ErrorDisplay.d.ts +17 -0
- package/dist/cli/tui/components/ErrorDisplay.d.ts.map +1 -0
- package/dist/cli/tui/components/ErrorDisplay.js +66 -0
- package/dist/cli/tui/components/ErrorDisplay.js.map +1 -0
- package/dist/cli/tui/components/Header.d.ts +4 -2
- package/dist/cli/tui/components/Header.d.ts.map +1 -1
- package/dist/cli/tui/components/Header.js +20 -4
- package/dist/cli/tui/components/Header.js.map +1 -1
- package/dist/cli/tui/components/KeyHelp.d.ts +11 -2
- package/dist/cli/tui/components/KeyHelp.d.ts.map +1 -1
- package/dist/cli/tui/components/KeyHelp.js +63 -9
- package/dist/cli/tui/components/KeyHelp.js.map +1 -1
- package/dist/cli/tui/components/ProposalRow.d.ts.map +1 -1
- package/dist/cli/tui/components/ProposalRow.js +46 -6
- package/dist/cli/tui/components/ProposalRow.js.map +1 -1
- package/dist/cli/tui/components/ScrollIndicator.d.ts +26 -0
- package/dist/cli/tui/components/ScrollIndicator.d.ts.map +1 -0
- package/dist/cli/tui/components/ScrollIndicator.js +59 -0
- package/dist/cli/tui/components/ScrollIndicator.js.map +1 -0
- package/dist/cli/tui/components/SearchBar.d.ts +12 -0
- package/dist/cli/tui/components/SearchBar.d.ts.map +1 -0
- package/dist/cli/tui/components/SearchBar.js +36 -0
- package/dist/cli/tui/components/SearchBar.js.map +1 -0
- package/dist/cli/tui/components/Skeleton.d.ts +22 -0
- package/dist/cli/tui/components/Skeleton.d.ts.map +1 -0
- package/dist/cli/tui/components/Skeleton.js +35 -0
- package/dist/cli/tui/components/Skeleton.js.map +1 -0
- package/dist/cli/tui/components/Spinner.d.ts +10 -0
- package/dist/cli/tui/components/Spinner.d.ts.map +1 -0
- package/dist/cli/tui/components/Spinner.js +24 -0
- package/dist/cli/tui/components/Spinner.js.map +1 -0
- package/dist/cli/tui/components/StageProgress.d.ts +12 -0
- package/dist/cli/tui/components/StageProgress.d.ts.map +1 -0
- package/dist/cli/tui/components/StageProgress.js +72 -0
- package/dist/cli/tui/components/StageProgress.js.map +1 -0
- package/dist/cli/tui/components/StageRow.d.ts.map +1 -1
- package/dist/cli/tui/components/StageRow.js +33 -10
- package/dist/cli/tui/components/StageRow.js.map +1 -1
- package/dist/cli/tui/components/StatusBar.d.ts +12 -0
- package/dist/cli/tui/components/StatusBar.d.ts.map +1 -0
- package/dist/cli/tui/components/StatusBar.js +14 -0
- package/dist/cli/tui/components/StatusBar.js.map +1 -0
- package/dist/cli/tui/components/Timeline.d.ts +12 -0
- package/dist/cli/tui/components/Timeline.d.ts.map +1 -0
- package/dist/cli/tui/components/Timeline.js +91 -0
- package/dist/cli/tui/components/Timeline.js.map +1 -0
- package/dist/cli/tui/components/Toast.d.ts +13 -0
- package/dist/cli/tui/components/Toast.d.ts.map +1 -0
- package/dist/cli/tui/components/Toast.js +35 -0
- package/dist/cli/tui/components/Toast.js.map +1 -0
- package/dist/cli/tui/components/TrackingProgress.d.ts +24 -0
- package/dist/cli/tui/components/TrackingProgress.d.ts.map +1 -0
- package/dist/cli/tui/components/TrackingProgress.js +82 -0
- package/dist/cli/tui/components/TrackingProgress.js.map +1 -0
- package/dist/cli/tui/components/ViewLayout.d.ts +9 -1
- package/dist/cli/tui/components/ViewLayout.d.ts.map +1 -1
- package/dist/cli/tui/components/ViewLayout.js +43 -7
- package/dist/cli/tui/components/ViewLayout.js.map +1 -1
- package/dist/cli/tui/components/VotingStats.d.ts +11 -0
- package/dist/cli/tui/components/VotingStats.d.ts.map +1 -0
- package/dist/cli/tui/components/VotingStats.js +87 -0
- package/dist/cli/tui/components/VotingStats.js.map +1 -0
- package/dist/cli/tui/config.d.ts +42 -0
- package/dist/cli/tui/config.d.ts.map +1 -0
- package/dist/cli/tui/config.js +144 -0
- package/dist/cli/tui/config.js.map +1 -0
- package/dist/cli/tui/hooks/index.d.ts +3 -1
- package/dist/cli/tui/hooks/index.d.ts.map +1 -1
- package/dist/cli/tui/hooks/index.js +5 -1
- package/dist/cli/tui/hooks/index.js.map +1 -1
- package/dist/cli/tui/hooks/useCache.d.ts.map +1 -1
- package/dist/cli/tui/hooks/useCache.js +32 -8
- package/dist/cli/tui/hooks/useCache.js.map +1 -1
- package/dist/cli/tui/hooks/useCliProcess.d.ts +19 -0
- package/dist/cli/tui/hooks/useCliProcess.d.ts.map +1 -0
- package/dist/cli/tui/hooks/useCliProcess.js +135 -0
- package/dist/cli/tui/hooks/useCliProcess.js.map +1 -0
- package/dist/cli/tui/hooks/useNavigation.d.ts +7 -1
- package/dist/cli/tui/hooks/useNavigation.d.ts.map +1 -1
- package/dist/cli/tui/hooks/useNavigation.js +73 -9
- package/dist/cli/tui/hooks/useNavigation.js.map +1 -1
- package/dist/cli/tui/hooks/useProposals.d.ts +2 -2
- package/dist/cli/tui/hooks/useProposals.d.ts.map +1 -1
- package/dist/cli/tui/hooks/useProposals.js +92 -27
- package/dist/cli/tui/hooks/useProposals.js.map +1 -1
- package/dist/cli/tui/hooks/useStageCalldata.d.ts +1 -1
- package/dist/cli/tui/hooks/useStageCalldata.d.ts.map +1 -1
- package/dist/cli/tui/hooks/useStageCalldata.js +45 -18
- package/dist/cli/tui/hooks/useStageCalldata.js.map +1 -1
- package/dist/cli/tui/hooks/useTracker.d.ts +4 -5
- package/dist/cli/tui/hooks/useTracker.d.ts.map +1 -1
- package/dist/cli/tui/hooks/useTracker.js +118 -78
- package/dist/cli/tui/hooks/useTracker.js.map +1 -1
- package/dist/cli/tui/index.d.ts +1 -0
- package/dist/cli/tui/index.d.ts.map +1 -1
- package/dist/cli/tui/index.js +38 -6
- package/dist/cli/tui/index.js.map +1 -1
- package/dist/cli/tui/types.d.ts +4 -1
- package/dist/cli/tui/types.d.ts.map +1 -1
- package/dist/cli/tui/utils/clipboard.d.ts +7 -0
- package/dist/cli/tui/utils/clipboard.d.ts.map +1 -0
- package/dist/cli/tui/utils/clipboard.js +46 -0
- package/dist/cli/tui/utils/clipboard.js.map +1 -0
- package/dist/cli/tui/utils/index.d.ts +1 -0
- package/dist/cli/tui/utils/index.d.ts.map +1 -1
- package/dist/cli/tui/utils/index.js +4 -1
- package/dist/cli/tui/utils/index.js.map +1 -1
- package/dist/cli/tui/utils/text.d.ts.map +1 -1
- package/dist/cli/tui/utils/text.js +2 -0
- package/dist/cli/tui/utils/text.js.map +1 -1
- package/dist/cli/tui/views/CalldataView.d.ts.map +1 -1
- package/dist/cli/tui/views/CalldataView.js +35 -21
- package/dist/cli/tui/views/CalldataView.js.map +1 -1
- package/dist/cli/tui/views/DescriptionView.d.ts.map +1 -1
- package/dist/cli/tui/views/DescriptionView.js +29 -21
- package/dist/cli/tui/views/DescriptionView.js.map +1 -1
- package/dist/cli/tui/views/ElectionView.d.ts.map +1 -1
- package/dist/cli/tui/views/ElectionView.js +64 -26
- package/dist/cli/tui/views/ElectionView.js.map +1 -1
- package/dist/cli/tui/views/HelpView.d.ts +10 -0
- package/dist/cli/tui/views/HelpView.d.ts.map +1 -0
- package/dist/cli/tui/views/HelpView.js +159 -0
- package/dist/cli/tui/views/HelpView.js.map +1 -0
- package/dist/cli/tui/views/ProposalDetail.d.ts +1 -1
- package/dist/cli/tui/views/ProposalDetail.d.ts.map +1 -1
- package/dist/cli/tui/views/ProposalDetail.js +45 -50
- package/dist/cli/tui/views/ProposalDetail.js.map +1 -1
- package/dist/cli/tui/views/ProposalList.d.ts.map +1 -1
- package/dist/cli/tui/views/ProposalList.js +47 -32
- package/dist/cli/tui/views/ProposalList.js.map +1 -1
- package/dist/cli/tui/views/SettingsView.d.ts +12 -0
- package/dist/cli/tui/views/SettingsView.d.ts.map +1 -0
- package/dist/cli/tui/views/SettingsView.js +203 -0
- package/dist/cli/tui/views/SettingsView.js.map +1 -0
- package/dist/cli/tui/views/SimulationView.d.ts.map +1 -1
- package/dist/cli/tui/views/SimulationView.js +26 -7
- package/dist/cli/tui/views/SimulationView.js.map +1 -1
- package/dist/cli/tui/views/StageView.d.ts.map +1 -1
- package/dist/cli/tui/views/StageView.js +34 -18
- package/dist/cli/tui/views/StageView.js.map +1 -1
- package/dist/stages/timelock.d.ts.map +1 -1
- package/dist/stages/timelock.js +5 -4
- package/dist/stages/timelock.js.map +1 -1
- package/dist/tracker/cache.d.ts.map +1 -1
- package/dist/tracker/cache.js +4 -0
- package/dist/tracker/cache.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Text component that can be copied to clipboard
|
|
3
|
+
*/
|
|
4
|
+
interface CopyableTextProps {
|
|
5
|
+
value: string;
|
|
6
|
+
label?: string;
|
|
7
|
+
color?: string;
|
|
8
|
+
showHint?: boolean;
|
|
9
|
+
onCopy?: (success: boolean) => void;
|
|
10
|
+
}
|
|
11
|
+
export declare function CopyableText({ value, label, color, showHint, }: CopyableTextProps): React.ReactElement;
|
|
12
|
+
interface CopyFeedbackProps {
|
|
13
|
+
message: string;
|
|
14
|
+
type: "success" | "error";
|
|
15
|
+
}
|
|
16
|
+
export declare function CopyFeedback({ message, type }: CopyFeedbackProps): React.ReactElement;
|
|
17
|
+
export declare function useCopyState(): {
|
|
18
|
+
feedback: string | null;
|
|
19
|
+
feedbackType: "success" | "error";
|
|
20
|
+
copy: (text: string, label?: string) => void;
|
|
21
|
+
};
|
|
22
|
+
export {};
|
|
23
|
+
//# sourceMappingURL=CopyableText.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CopyableText.d.ts","sourceRoot":"","sources":["../../../../src/cli/tui/components/CopyableText.tsx"],"names":[],"mappings":"AAAA;;GAEG;AAKH,UAAU,iBAAiB;IACzB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,MAAM,CAAC,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,CAAC;CACrC;AAED,wBAAgB,YAAY,CAAC,EAC3B,KAAK,EACL,KAAK,EACL,KAAc,EACd,QAAgB,GACjB,EAAE,iBAAiB,GAAG,KAAK,CAAC,YAAY,CAQxC;AAED,UAAU,iBAAiB;IACzB,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,SAAS,GAAG,OAAO,CAAC;CAC3B;AAED,wBAAgB,YAAY,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE,iBAAiB,GAAG,KAAK,CAAC,YAAY,CAQrF;AAED,wBAAgB,YAAY,IAAI;IAC9B,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,YAAY,EAAE,SAAS,GAAG,OAAO,CAAC;IAClC,IAAI,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;CAC9C,CAwBA"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Text component that can be copied to clipboard
|
|
4
|
+
*/
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.CopyableText = CopyableText;
|
|
7
|
+
exports.CopyFeedback = CopyFeedback;
|
|
8
|
+
exports.useCopyState = useCopyState;
|
|
9
|
+
const ink_wrapper_js_1 = require("../ink-wrapper.js");
|
|
10
|
+
const index_js_1 = require("../utils/index.js");
|
|
11
|
+
function CopyableText({ value, label, color = "blue", showHint = false, }) {
|
|
12
|
+
return (ink_wrapper_js_1.React.createElement(ink_wrapper_js_1.Box, null,
|
|
13
|
+
label && ink_wrapper_js_1.React.createElement(ink_wrapper_js_1.Text, { color: "gray" },
|
|
14
|
+
label,
|
|
15
|
+
": "),
|
|
16
|
+
ink_wrapper_js_1.React.createElement(ink_wrapper_js_1.Text, { color: color }, value),
|
|
17
|
+
showHint && ink_wrapper_js_1.React.createElement(ink_wrapper_js_1.Text, { color: "gray" }, " (y to copy)")));
|
|
18
|
+
}
|
|
19
|
+
function CopyFeedback({ message, type }) {
|
|
20
|
+
return (ink_wrapper_js_1.React.createElement(ink_wrapper_js_1.Box, null,
|
|
21
|
+
ink_wrapper_js_1.React.createElement(ink_wrapper_js_1.Text, { color: type === "success" ? "green" : "red" },
|
|
22
|
+
type === "success" ? "✓" : "✗",
|
|
23
|
+
" ",
|
|
24
|
+
message)));
|
|
25
|
+
}
|
|
26
|
+
function useCopyState() {
|
|
27
|
+
const [feedback, setFeedback] = (0, ink_wrapper_js_1.useState)(null);
|
|
28
|
+
const [feedbackType, setFeedbackType] = (0, ink_wrapper_js_1.useState)("success");
|
|
29
|
+
(0, ink_wrapper_js_1.useEffect)(() => {
|
|
30
|
+
if (feedback) {
|
|
31
|
+
const timer = setTimeout(() => setFeedback(null), 2000);
|
|
32
|
+
return () => clearTimeout(timer);
|
|
33
|
+
}
|
|
34
|
+
return undefined;
|
|
35
|
+
}, [feedback]);
|
|
36
|
+
const copy = (text, label = "Text") => {
|
|
37
|
+
const success = (0, index_js_1.copyToClipboard)(text);
|
|
38
|
+
if (success) {
|
|
39
|
+
setFeedback(`${label} copied to clipboard`);
|
|
40
|
+
setFeedbackType("success");
|
|
41
|
+
}
|
|
42
|
+
else {
|
|
43
|
+
setFeedback("Failed to copy - clipboard not available");
|
|
44
|
+
setFeedbackType("error");
|
|
45
|
+
}
|
|
46
|
+
};
|
|
47
|
+
return { feedback, feedbackType, copy };
|
|
48
|
+
}
|
|
49
|
+
//# sourceMappingURL=CopyableText.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CopyableText.js","sourceRoot":"","sources":["../../../../src/cli/tui/components/CopyableText.tsx"],"names":[],"mappings":";AAAA;;GAEG;;AAaH,oCAaC;AAOD,oCAQC;AAED,oCA4BC;AArED,sDAA0E;AAC1E,gDAAoD;AAUpD,SAAgB,YAAY,CAAC,EAC3B,KAAK,EACL,KAAK,EACL,KAAK,GAAG,MAAM,EACd,QAAQ,GAAG,KAAK,GACE;IAClB,OAAO,CACL,qCAAC,oBAAG;QACD,KAAK,IAAI,qCAAC,qBAAI,IAAC,KAAK,EAAC,MAAM;YAAE,KAAK;iBAAU;QAC7C,qCAAC,qBAAI,IAAC,KAAK,EAAE,KAAwE,IAAG,KAAK,CAAQ;QACpG,QAAQ,IAAI,qCAAC,qBAAI,IAAC,KAAK,EAAC,MAAM,mBAAoB,CAC/C,CACP,CAAC;AACJ,CAAC;AAOD,SAAgB,YAAY,CAAC,EAAE,OAAO,EAAE,IAAI,EAAqB;IAC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0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Empty state component for when no data is available
|
|
3
|
+
*/
|
|
4
|
+
interface EmptyStateProps {
|
|
5
|
+
title: string;
|
|
6
|
+
message?: string;
|
|
7
|
+
hint?: string;
|
|
8
|
+
}
|
|
9
|
+
export declare function EmptyState({ title, message, hint }: EmptyStateProps): React.ReactElement;
|
|
10
|
+
export {};
|
|
11
|
+
//# sourceMappingURL=EmptyState.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EmptyState.d.ts","sourceRoot":"","sources":["../../../../src/cli/tui/components/EmptyState.tsx"],"names":[],"mappings":"AAAA;;GAEG;AAIH,UAAU,eAAe;IACvB,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,wBAAgB,UAAU,CAAC,EAAE,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE,eAAe,GAAG,KAAK,CAAC,YAAY,CAoBxF"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Empty state component for when no data is available
|
|
4
|
+
*/
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.EmptyState = EmptyState;
|
|
7
|
+
const ink_wrapper_js_1 = require("../ink-wrapper.js");
|
|
8
|
+
function EmptyState({ title, message, hint }) {
|
|
9
|
+
return (ink_wrapper_js_1.React.createElement(ink_wrapper_js_1.Box, { flexDirection: "column", alignItems: "center", marginY: 2 },
|
|
10
|
+
ink_wrapper_js_1.React.createElement(ink_wrapper_js_1.Text, { color: "gray" },
|
|
11
|
+
" ",
|
|
12
|
+
"____",
|
|
13
|
+
"\n",
|
|
14
|
+
" ",
|
|
15
|
+
"/ __ \\\\",
|
|
16
|
+
"\n",
|
|
17
|
+
" ",
|
|
18
|
+
"| | | |",
|
|
19
|
+
"\n",
|
|
20
|
+
" ",
|
|
21
|
+
"| | | |",
|
|
22
|
+
"\n",
|
|
23
|
+
" ",
|
|
24
|
+
"| |__| |",
|
|
25
|
+
"\n",
|
|
26
|
+
" ",
|
|
27
|
+
"\\\\____/",
|
|
28
|
+
"\n"),
|
|
29
|
+
ink_wrapper_js_1.React.createElement(ink_wrapper_js_1.Text, { bold: true, color: "yellow" }, title),
|
|
30
|
+
message && ink_wrapper_js_1.React.createElement(ink_wrapper_js_1.Text, { color: "gray" }, message),
|
|
31
|
+
hint && (ink_wrapper_js_1.React.createElement(ink_wrapper_js_1.Box, { marginTop: 1 },
|
|
32
|
+
ink_wrapper_js_1.React.createElement(ink_wrapper_js_1.Text, { color: "cyan" }, hint)))));
|
|
33
|
+
}
|
|
34
|
+
//# sourceMappingURL=EmptyState.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EmptyState.js","sourceRoot":"","sources":["../../../../src/cli/tui/components/EmptyState.tsx"],"names":[],"mappings":";AAAA;;GAEG;;AAUH,gCAoBC;AA5BD,sDAAqD;AAQrD,SAAgB,UAAU,CAAC,EAAE,KAAK,EAAE,OAAO,EAAE,IAAI,EAAmB;IAClE,OAAO,CACL,qCAAC,oBAAG,IAAC,aAAa,EAAC,QAAQ,EAAC,UAAU,EAAC,QAAQ,EAAC,OAAO,EAAE,CAAC;QACxD,qCAAC,qBAAI,IAAC,KAAK,EAAC,MAAM;YACf,MAAM;;YAAM,IAAI;YAChB,KAAK;;YAAS,IAAI;YAClB,IAAI;;YAAU,IAAI;YAClB,IAAI;;YAAU,IAAI;YAClB,IAAI;;YAAU,IAAI;YAClB,KAAK;;YAAS,IAAI,CACd;QACP,qCAAC,qBAAI,IAAC,IAAI,QAAC,KAAK,EAAC,QAAQ,IAAE,KAAK,CAAQ;QACvC,OAAO,IAAI,qCAAC,qBAAI,IAAC,KAAK,EAAC,MAAM,IAAE,OAAO,CAAQ;QAC9C,IAAI,IAAI,CACP,qCAAC,oBAAG,IAAC,SAAS,EAAE,CAAC;YACf,qCAAC,qBAAI,IAAC,KAAK,EAAC,MAAM,IAAE,IAAI,CAAQ,CAC5B,CACP,CACG,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Error display component with retry option
|
|
3
|
+
*/
|
|
4
|
+
interface ErrorDisplayProps {
|
|
5
|
+
error: string;
|
|
6
|
+
title?: string;
|
|
7
|
+
onRetry?: () => void;
|
|
8
|
+
retryKey?: string;
|
|
9
|
+
}
|
|
10
|
+
export declare function ErrorDisplay({ error, title, onRetry, retryKey, }: ErrorDisplayProps): React.ReactElement;
|
|
11
|
+
interface ErrorBannerProps {
|
|
12
|
+
error: string;
|
|
13
|
+
compact?: boolean;
|
|
14
|
+
}
|
|
15
|
+
export declare function ErrorBanner({ error, compact }: ErrorBannerProps): React.ReactElement;
|
|
16
|
+
export {};
|
|
17
|
+
//# sourceMappingURL=ErrorDisplay.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ErrorDisplay.d.ts","sourceRoot":"","sources":["../../../../src/cli/tui/components/ErrorDisplay.tsx"],"names":[],"mappings":"AAAA;;GAEG;AAIH,UAAU,iBAAiB;IACzB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAkCD,wBAAgB,YAAY,CAAC,EAC3B,KAAK,EACL,KAAK,EACL,OAAO,EACP,QAAc,GACf,EAAE,iBAAiB,GAAG,KAAK,CAAC,YAAY,CAmBxC;AAED,UAAU,gBAAgB;IACxB,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED,wBAAgB,WAAW,CAAC,EAAE,KAAK,EAAE,OAAe,EAAE,EAAE,gBAAgB,GAAG,KAAK,CAAC,YAAY,CAkB5F"}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Error display component with retry option
|
|
4
|
+
*/
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.ErrorDisplay = ErrorDisplay;
|
|
7
|
+
exports.ErrorBanner = ErrorBanner;
|
|
8
|
+
const ink_wrapper_js_1 = require("../ink-wrapper.js");
|
|
9
|
+
function categorizeError(error) {
|
|
10
|
+
const lowerError = error.toLowerCase();
|
|
11
|
+
// Network errors: connection issues, DNS failures, timeouts
|
|
12
|
+
if (lowerError.includes("network") ||
|
|
13
|
+
lowerError.includes("timeout") ||
|
|
14
|
+
lowerError.includes("etimedout") ||
|
|
15
|
+
lowerError.includes("econnrefused") ||
|
|
16
|
+
lowerError.includes("econnreset") ||
|
|
17
|
+
lowerError.includes("enotfound") ||
|
|
18
|
+
lowerError.includes("ehostunreach") ||
|
|
19
|
+
lowerError.includes("enetunreach")) {
|
|
20
|
+
return { type: "Network", color: "yellow" };
|
|
21
|
+
}
|
|
22
|
+
if (lowerError.includes("rpc") || lowerError.includes("provider")) {
|
|
23
|
+
return { type: "RPC", color: "yellow" };
|
|
24
|
+
}
|
|
25
|
+
if (lowerError.includes("permission") || lowerError.includes("unauthorized") || lowerError.includes("forbidden")) {
|
|
26
|
+
return { type: "Permission", color: "red" };
|
|
27
|
+
}
|
|
28
|
+
if (lowerError.includes("not found") || lowerError.includes("404")) {
|
|
29
|
+
return { type: "Not Found", color: "gray" };
|
|
30
|
+
}
|
|
31
|
+
if (lowerError.includes("rate limit") || lowerError.includes("throttl")) {
|
|
32
|
+
return { type: "Rate Limit", color: "yellow" };
|
|
33
|
+
}
|
|
34
|
+
return { type: "Error", color: "red" };
|
|
35
|
+
}
|
|
36
|
+
function ErrorDisplay({ error, title, onRetry, retryKey = "r", }) {
|
|
37
|
+
const { type, color } = categorizeError(error);
|
|
38
|
+
const displayTitle = title ?? type;
|
|
39
|
+
return (ink_wrapper_js_1.React.createElement(ink_wrapper_js_1.Box, { flexDirection: "column", borderStyle: "round", borderColor: color, paddingX: 1, paddingY: 0 },
|
|
40
|
+
ink_wrapper_js_1.React.createElement(ink_wrapper_js_1.Box, null,
|
|
41
|
+
ink_wrapper_js_1.React.createElement(ink_wrapper_js_1.Text, { color: color, bold: true },
|
|
42
|
+
displayTitle,
|
|
43
|
+
": "),
|
|
44
|
+
ink_wrapper_js_1.React.createElement(ink_wrapper_js_1.Text, { color: "white" }, error)),
|
|
45
|
+
onRetry && (ink_wrapper_js_1.React.createElement(ink_wrapper_js_1.Box, { marginTop: 1 },
|
|
46
|
+
ink_wrapper_js_1.React.createElement(ink_wrapper_js_1.Text, { color: "gray" }, "Press "),
|
|
47
|
+
ink_wrapper_js_1.React.createElement(ink_wrapper_js_1.Text, { color: "cyan" }, retryKey),
|
|
48
|
+
ink_wrapper_js_1.React.createElement(ink_wrapper_js_1.Text, { color: "gray" }, " to retry")))));
|
|
49
|
+
}
|
|
50
|
+
function ErrorBanner({ error, compact = false }) {
|
|
51
|
+
const { type, color } = categorizeError(error);
|
|
52
|
+
if (compact) {
|
|
53
|
+
return (ink_wrapper_js_1.React.createElement(ink_wrapper_js_1.Box, null,
|
|
54
|
+
ink_wrapper_js_1.React.createElement(ink_wrapper_js_1.Text, { color: color },
|
|
55
|
+
"[",
|
|
56
|
+
type,
|
|
57
|
+
"] "),
|
|
58
|
+
ink_wrapper_js_1.React.createElement(ink_wrapper_js_1.Text, { color: "gray" }, error.length > 50 ? error.slice(0, 50) + "..." : error)));
|
|
59
|
+
}
|
|
60
|
+
return (ink_wrapper_js_1.React.createElement(ink_wrapper_js_1.Box, null,
|
|
61
|
+
ink_wrapper_js_1.React.createElement(ink_wrapper_js_1.Text, { color: color, bold: true },
|
|
62
|
+
type,
|
|
63
|
+
": "),
|
|
64
|
+
ink_wrapper_js_1.React.createElement(ink_wrapper_js_1.Text, null, error)));
|
|
65
|
+
}
|
|
66
|
+
//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gB,WAAW,CAAC,EAAE,KAAK,EAAE,OAAO,GAAG,KAAK,EAAoB;IACtE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,GAAG,eAAe,CAAC,KAAK,CAAC,CAAC;IAE/C,IAAI,OAAO,EAAE,CAAC;QACZ,OAAO,CACL,qCAAC,oBAAG;YACF,qCAAC,qBAAI,IAAC,KAAK,EAAE,KAAK;;gBAAI,IAAI;qBAAU;YACpC,qCAAC,qBAAI,IAAC,KAAK,EAAC,MAAM,IAAE,KAAK,CAAC,MAAM,GAAG,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC,KAAK,CAAQ,CAC9E,CACP,CAAC;IACJ,CAAC;IAED,OAAO,CACL,qCAAC,oBAAG;QACF,qCAAC,qBAAI,IAAC,KAAK,EAAE,KAAK,EAAE,IAAI;YAAE,IAAI;iBAAU;QACxC,qCAAC,qBAAI,QAAE,KAAK,CAAQ,CAChB,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -2,10 +2,11 @@
|
|
|
2
2
|
* Header component showing title and stats
|
|
3
3
|
*/
|
|
4
4
|
import type { TrackerStats } from "../../../types/index.js";
|
|
5
|
-
import type { ViewType, FilterType } from "../types.js";
|
|
5
|
+
import type { ViewType, FilterType, SortType } from "../types.js";
|
|
6
6
|
interface HeaderProps {
|
|
7
7
|
view: ViewType;
|
|
8
8
|
filter: FilterType;
|
|
9
|
+
sort?: SortType;
|
|
9
10
|
stats: TrackerStats | null;
|
|
10
11
|
hasProviders: boolean;
|
|
11
12
|
isTracking: boolean;
|
|
@@ -14,7 +15,8 @@ interface HeaderProps {
|
|
|
14
15
|
current: number;
|
|
15
16
|
total: number;
|
|
16
17
|
};
|
|
18
|
+
breadcrumb?: string[];
|
|
17
19
|
}
|
|
18
|
-
export declare function Header({ view, filter, stats, hasProviders, isTracking, title, position, }: HeaderProps): React.ReactElement;
|
|
20
|
+
export declare function Header({ view, filter, sort, stats, hasProviders, isTracking, title, position, breadcrumb, }: HeaderProps): React.ReactElement;
|
|
19
21
|
export {};
|
|
20
22
|
//# sourceMappingURL=Header.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Header.d.ts","sourceRoot":"","sources":["../../../../src/cli/tui/components/Header.tsx"],"names":[],"mappings":"AAAA;;GAEG;AAGH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAC5D,OAAO,KAAK,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"Header.d.ts","sourceRoot":"","sources":["../../../../src/cli/tui/components/Header.tsx"],"names":[],"mappings":"AAAA;;GAEG;AAGH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAC5D,OAAO,KAAK,EAAE,QAAQ,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAElE,UAAU,WAAW;IACnB,IAAI,EAAE,QAAQ,CAAC;IACf,MAAM,EAAE,UAAU,CAAC;IACnB,IAAI,CAAC,EAAE,QAAQ,CAAC;IAChB,KAAK,EAAE,YAAY,GAAG,IAAI,CAAC;IAC3B,YAAY,EAAE,OAAO,CAAC;IACtB,UAAU,EAAE,OAAO,CAAC;IACpB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE;QAAE,OAAO,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC;IAC9C,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;CACvB;AASD,wBAAgB,MAAM,CAAC,EACrB,IAAI,EACJ,MAAM,EACN,IAAI,EACJ,KAAK,EACL,YAAY,EACZ,UAAU,EACV,KAAK,EACL,QAAQ,EACR,UAAU,GACX,EAAE,WAAW,GAAG,KAAK,CAAC,YAAY,CAqFlC"}
|
|
@@ -5,7 +5,13 @@
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.Header = Header;
|
|
7
7
|
const ink_wrapper_js_1 = require("../ink-wrapper.js");
|
|
8
|
-
|
|
8
|
+
const SORT_LABELS = {
|
|
9
|
+
newest: "↓New",
|
|
10
|
+
oldest: "↑Old",
|
|
11
|
+
progress: "↓Prog",
|
|
12
|
+
status: "Status",
|
|
13
|
+
};
|
|
14
|
+
function Header({ view, filter, sort, stats, hasProviders, isTracking, title, position, breadcrumb, }) {
|
|
9
15
|
const getViewTitle = () => {
|
|
10
16
|
switch (view) {
|
|
11
17
|
case "list":
|
|
@@ -26,10 +32,11 @@ function Header({ view, filter, stats, hasProviders, isTracking, title, position
|
|
|
26
32
|
};
|
|
27
33
|
const getRightSide = () => {
|
|
28
34
|
if (view === "list" && stats) {
|
|
35
|
+
const totalActive = stats.proposals.active + stats.timelocks.active + (stats.elections.total - stats.elections.complete);
|
|
29
36
|
return (ink_wrapper_js_1.React.createElement(ink_wrapper_js_1.Text, { color: "gray" },
|
|
30
37
|
stats.total,
|
|
31
|
-
"
|
|
32
|
-
|
|
38
|
+
" items | ",
|
|
39
|
+
totalActive,
|
|
33
40
|
" active",
|
|
34
41
|
hasProviders && ink_wrapper_js_1.React.createElement(ink_wrapper_js_1.Text, { color: "green" }, " [RPC]"),
|
|
35
42
|
isTracking && ink_wrapper_js_1.React.createElement(ink_wrapper_js_1.Text, { color: "yellow" }, " [Tracking...]")));
|
|
@@ -39,13 +46,22 @@ function Header({ view, filter, stats, hasProviders, isTracking, title, position
|
|
|
39
46
|
}
|
|
40
47
|
return null;
|
|
41
48
|
};
|
|
49
|
+
const renderBreadcrumb = () => {
|
|
50
|
+
if (!breadcrumb || breadcrumb.length === 0)
|
|
51
|
+
return null;
|
|
52
|
+
return (ink_wrapper_js_1.React.createElement(ink_wrapper_js_1.Box, null, breadcrumb.map((item, i) => (ink_wrapper_js_1.React.createElement(ink_wrapper_js_1.Text, { key: i },
|
|
53
|
+
i > 0 && ink_wrapper_js_1.React.createElement(ink_wrapper_js_1.Text, { color: "gray" }, " \u203A "),
|
|
54
|
+
ink_wrapper_js_1.React.createElement(ink_wrapper_js_1.Text, { color: i === breadcrumb.length - 1 ? "cyan" : "gray" }, item))))));
|
|
55
|
+
};
|
|
42
56
|
return (ink_wrapper_js_1.React.createElement(ink_wrapper_js_1.Box, { borderStyle: "single", borderColor: "cyan", paddingX: 1 },
|
|
43
57
|
ink_wrapper_js_1.React.createElement(ink_wrapper_js_1.Box, { flexGrow: 1 },
|
|
44
|
-
ink_wrapper_js_1.React.createElement(ink_wrapper_js_1.Text, { bold: true, color: "cyan" }, getViewTitle()),
|
|
58
|
+
breadcrumb && breadcrumb.length > 0 ? (renderBreadcrumb()) : (ink_wrapper_js_1.React.createElement(ink_wrapper_js_1.Text, { bold: true, color: "cyan" }, getViewTitle())),
|
|
45
59
|
view === "list" && (ink_wrapper_js_1.React.createElement(ink_wrapper_js_1.Text, { color: "gray" },
|
|
46
60
|
" ",
|
|
47
61
|
"[",
|
|
48
62
|
filter.toUpperCase(),
|
|
63
|
+
"] [",
|
|
64
|
+
sort ? SORT_LABELS[sort] : "↓New",
|
|
49
65
|
"]")),
|
|
50
66
|
position && position.total > 0 && (ink_wrapper_js_1.React.createElement(ink_wrapper_js_1.Text, { color: "yellow" },
|
|
51
67
|
" ",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Header.js","sourceRoot":"","sources":["../../../../src/cli/tui/components/Header.tsx"],"names":[],"mappings":";AAAA;;GAEG;;
|
|
1
|
+
{"version":3,"file":"Header.js","sourceRoot":"","sources":["../../../../src/cli/tui/components/Header.tsx"],"names":[],"mappings":";AAAA;;GAEG;;AAyBH,wBA+FC;AAtHD,sDAAqD;AAgBrD,MAAM,WAAW,GAA6B;IAC5C,MAAM,EAAE,MAAM;IACd,MAAM,EAAE,MAAM;IACd,QAAQ,EAAE,OAAO;IACjB,MAAM,EAAE,QAAQ;CACjB,CAAC;AAEF,SAAgB,MAA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C,IAAI,CAAC,CAAC,CAAC,CAAC,MAAM;oBACvD,CACR;YACA,QAAQ,IAAI,QAAQ,CAAC,KAAK,GAAG,CAAC,IAAI,CACjC,qCAAC,qBAAI,IAAC,KAAK,EAAC,QAAQ;;gBAAG,QAAQ,CAAC,OAAO;;gBAAG,QAAQ,CAAC,KAAK,CAAQ,CACjE,CACG;QACL,YAAY,EAAE,CACX,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -1,11 +1,20 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Keyboard shortcuts help footer
|
|
3
3
|
*/
|
|
4
|
-
import type { ViewType } from "../types.js";
|
|
4
|
+
import type { ViewType, FilterType, SortType } from "../types.js";
|
|
5
|
+
interface ContextInfo {
|
|
6
|
+
filter?: FilterType;
|
|
7
|
+
sort?: SortType;
|
|
8
|
+
isSearching?: boolean;
|
|
9
|
+
hasSearch?: boolean;
|
|
10
|
+
calldataActionCount?: number;
|
|
11
|
+
currentActionIndex?: number;
|
|
12
|
+
}
|
|
5
13
|
interface KeyHelpProps {
|
|
6
14
|
view: ViewType;
|
|
7
15
|
hasProviders: boolean;
|
|
16
|
+
context?: ContextInfo;
|
|
8
17
|
}
|
|
9
|
-
export declare function KeyHelp({ view, hasProviders }: KeyHelpProps): React.ReactElement;
|
|
18
|
+
export declare function KeyHelp({ view, hasProviders, context }: KeyHelpProps): React.ReactElement;
|
|
10
19
|
export {};
|
|
11
20
|
//# sourceMappingURL=KeyHelp.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"KeyHelp.d.ts","sourceRoot":"","sources":["../../../../src/cli/tui/components/KeyHelp.tsx"],"names":[],"mappings":"AAAA;;GAEG;AAGH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"KeyHelp.d.ts","sourceRoot":"","sources":["../../../../src/cli/tui/components/KeyHelp.tsx"],"names":[],"mappings":"AAAA;;GAEG;AAGH,OAAO,KAAK,EAAE,QAAQ,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAElE,UAAU,WAAW;IACnB,MAAM,CAAC,EAAE,UAAU,CAAC;IACpB,IAAI,CAAC,EAAE,QAAQ,CAAC;IAChB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,kBAAkB,CAAC,EAAE,MAAM,CAAC;CAC7B;AAED,UAAU,YAAY;IACpB,IAAI,EAAE,QAAQ,CAAC;IACf,YAAY,EAAE,OAAO,CAAC;IACtB,OAAO,CAAC,EAAE,WAAW,CAAC;CACvB;AAsJD,wBAAgB,OAAO,CAAC,EAAE,IAAI,EAAE,YAAY,EAAE,OAAO,EAAE,EAAE,YAAY,GAAG,KAAK,CAAC,YAAY,CAezF"}
|
|
@@ -6,23 +6,28 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
exports.KeyHelp = KeyHelp;
|
|
7
7
|
const ink_wrapper_js_1 = require("../ink-wrapper.js");
|
|
8
8
|
const LIST_KEYS = [
|
|
9
|
-
{ key: "
|
|
9
|
+
{ key: "j/k", action: "Navigate" },
|
|
10
10
|
{ key: "g/G", action: "Top/Bottom" },
|
|
11
11
|
{ key: "/", action: "Search" },
|
|
12
12
|
{ key: "Enter", action: "View" },
|
|
13
13
|
{ key: "Tab", action: "Filter" },
|
|
14
|
+
{ key: "o", action: "Sort" },
|
|
14
15
|
{ key: "R", action: "Reload" },
|
|
15
16
|
{ key: "e", action: "Elections" },
|
|
16
17
|
{ key: "d", action: "Discover" },
|
|
18
|
+
{ key: "S", action: "Settings" },
|
|
19
|
+
{ key: "?", action: "Help" },
|
|
17
20
|
{ key: "q", action: "Quit" },
|
|
18
21
|
];
|
|
19
22
|
const DETAIL_KEYS_BASE = [
|
|
20
|
-
{ key: "
|
|
23
|
+
{ key: "j/k", action: "Stage" },
|
|
21
24
|
{ key: "1-7", action: "Jump" },
|
|
22
25
|
{ key: "Enter", action: "Details" },
|
|
26
|
+
{ key: "y/Y", action: "Copy ID/TX" },
|
|
23
27
|
{ key: "d", action: "Description" },
|
|
24
28
|
{ key: "c", action: "Calldata" },
|
|
25
29
|
{ key: "s", action: "Simulate" },
|
|
30
|
+
{ key: "?", action: "Help" },
|
|
26
31
|
];
|
|
27
32
|
const DETAIL_RETRACK = { key: "r", action: "Re-track" };
|
|
28
33
|
const DETAIL_BACK = { key: "b", action: "Back" };
|
|
@@ -52,7 +57,8 @@ const ELECTION_KEYS = [
|
|
|
52
57
|
function getKeysForView(view, hasProviders) {
|
|
53
58
|
switch (view) {
|
|
54
59
|
case "list":
|
|
55
|
-
|
|
60
|
+
// Always show all keys - discover/election use default public RPCs if none configured
|
|
61
|
+
return LIST_KEYS;
|
|
56
62
|
case "detail":
|
|
57
63
|
return hasProviders
|
|
58
64
|
? [...DETAIL_KEYS_BASE, DETAIL_RETRACK, DETAIL_BACK]
|
|
@@ -71,12 +77,60 @@ function getKeysForView(view, hasProviders) {
|
|
|
71
77
|
return [];
|
|
72
78
|
}
|
|
73
79
|
}
|
|
74
|
-
|
|
80
|
+
const SORT_DISPLAY = {
|
|
81
|
+
newest: "Newest",
|
|
82
|
+
oldest: "Oldest",
|
|
83
|
+
progress: "Progress",
|
|
84
|
+
status: "Status",
|
|
85
|
+
};
|
|
86
|
+
function ContextIndicators({ view, context }) {
|
|
87
|
+
if (view !== "list" || !context)
|
|
88
|
+
return null;
|
|
89
|
+
const indicators = [];
|
|
90
|
+
if (context.isSearching) {
|
|
91
|
+
indicators.push(ink_wrapper_js_1.React.createElement(ink_wrapper_js_1.Text, { key: "search", color: "yellow" }, "[SEARCHING] "));
|
|
92
|
+
}
|
|
93
|
+
else if (context.hasSearch) {
|
|
94
|
+
indicators.push(ink_wrapper_js_1.React.createElement(ink_wrapper_js_1.Box, { key: "search-active", marginRight: 1 },
|
|
95
|
+
ink_wrapper_js_1.React.createElement(ink_wrapper_js_1.Text, { color: "green" }, "\u26B2 "),
|
|
96
|
+
ink_wrapper_js_1.React.createElement(ink_wrapper_js_1.Text, { color: "gray" }, "Esc:Clear")));
|
|
97
|
+
}
|
|
98
|
+
if (context.filter && context.filter !== "all") {
|
|
99
|
+
indicators.push(ink_wrapper_js_1.React.createElement(ink_wrapper_js_1.Box, { key: "filter", marginRight: 1 },
|
|
100
|
+
ink_wrapper_js_1.React.createElement(ink_wrapper_js_1.Text, { color: "magenta" }, context.filter.toUpperCase())));
|
|
101
|
+
}
|
|
102
|
+
if (context.sort && context.sort !== "newest") {
|
|
103
|
+
indicators.push(ink_wrapper_js_1.React.createElement(ink_wrapper_js_1.Box, { key: "sort", marginRight: 1 },
|
|
104
|
+
ink_wrapper_js_1.React.createElement(ink_wrapper_js_1.Text, { color: "blue" },
|
|
105
|
+
"\u2195",
|
|
106
|
+
SORT_DISPLAY[context.sort])));
|
|
107
|
+
}
|
|
108
|
+
if (indicators.length === 0)
|
|
109
|
+
return null;
|
|
110
|
+
return (ink_wrapper_js_1.React.createElement(ink_wrapper_js_1.Box, { marginRight: 2 },
|
|
111
|
+
indicators,
|
|
112
|
+
ink_wrapper_js_1.React.createElement(ink_wrapper_js_1.Text, { color: "gray" }, "\u2502")));
|
|
113
|
+
}
|
|
114
|
+
function CalldataIndicator({ context }) {
|
|
115
|
+
if (!context?.calldataActionCount || context.calldataActionCount <= 1)
|
|
116
|
+
return null;
|
|
117
|
+
return (ink_wrapper_js_1.React.createElement(ink_wrapper_js_1.Box, { marginRight: 2 },
|
|
118
|
+
ink_wrapper_js_1.React.createElement(ink_wrapper_js_1.Text, { color: "yellow" },
|
|
119
|
+
"Action ",
|
|
120
|
+
(context.currentActionIndex ?? 0) + 1,
|
|
121
|
+
"/",
|
|
122
|
+
context.calldataActionCount),
|
|
123
|
+
ink_wrapper_js_1.React.createElement(ink_wrapper_js_1.Text, { color: "gray" }, " \u2502")));
|
|
124
|
+
}
|
|
125
|
+
function KeyHelp({ view, hasProviders, context }) {
|
|
75
126
|
const keys = getKeysForView(view, hasProviders);
|
|
76
|
-
return (ink_wrapper_js_1.React.createElement(ink_wrapper_js_1.Box, { borderStyle: "single", borderColor: "gray", paddingX: 1 },
|
|
77
|
-
ink_wrapper_js_1.React.createElement(
|
|
78
|
-
ink_wrapper_js_1.React.createElement(
|
|
79
|
-
|
|
80
|
-
binding.
|
|
127
|
+
return (ink_wrapper_js_1.React.createElement(ink_wrapper_js_1.Box, { borderStyle: "single", borderColor: "gray", paddingX: 1 },
|
|
128
|
+
ink_wrapper_js_1.React.createElement(ContextIndicators, { view: view, context: context }),
|
|
129
|
+
view === "calldata" && ink_wrapper_js_1.React.createElement(CalldataIndicator, { context: context }),
|
|
130
|
+
keys.map((binding) => (ink_wrapper_js_1.React.createElement(ink_wrapper_js_1.Box, { key: binding.key, marginRight: 2 },
|
|
131
|
+
ink_wrapper_js_1.React.createElement(ink_wrapper_js_1.Text, { color: "cyan" }, binding.key),
|
|
132
|
+
ink_wrapper_js_1.React.createElement(ink_wrapper_js_1.Text, { color: "gray" },
|
|
133
|
+
": ",
|
|
134
|
+
binding.action))))));
|
|
81
135
|
}
|
|
82
136
|
//# sourceMappingURL=KeyHelp.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"KeyHelp.js","sourceRoot":"","sources":["../../../../src/cli/tui/components/KeyHelp.tsx"],"names":[],"mappings":";AAAA;;GAEG;;
|
|
1
|
+
{"version":3,"file":"KeyHelp.js","sourceRoot":"","sources":["../../../../src/cli/tui/components/KeyHelp.tsx"],"names":[],"mappings":";AAAA;;GAEG;;AAwKH,0BAeC;AArLD,sDAAqD;AAuBrD,MAAM,SAAS,GAAiB;IAC9B,EAAE,GAAG,EAAE,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE;IAClC,EAAE,GAAG,EAAE,KAAK,EAAE,MAAM,EAAE,YAAY,EAAE;IACpC,EAAE,GAAG,EAAE,GAAG,EAAE,MAAM,EAAE,QAAQ,EA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ACL,qCAAC,oBAAG,IAAC,WAAW,EAAC,QAAQ,EAAC,WAAW,EAAC,MAAM,EAAC,QAAQ,EAAE,CAAC;QACtD,qCAAC,iBAAiB,IAAC,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,GAAI;QAClD,IAAI,KAAK,UAAU,IAAI,qCAAC,iBAAiB,IAAC,OAAO,EAAE,OAAO,GAAI;QAC9D,IAAI,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,CACrB,qCAAC,oBAAG,IAAC,GAAG,EAAE,OAAO,CAAC,GAAG,EAAE,WAAW,EAAE,CAAC;YACnC,qCAAC,qBAAI,IAAC,KAAK,EAAC,MAAM,IAAE,OAAO,CAAC,GAAG,CAAQ;YACvC,qCAAC,qBAAI,IAAC,KAAK,EAAC,MAAM;;gBAAI,OAAO,CAAC,MAAM,CAAQ,CACxC,CACP,CAAC,CACE,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ProposalRow.d.ts","sourceRoot":"","sources":["../../../../src/cli/tui/components/ProposalRow.tsx"],"names":[],"mappings":"AAAA;;GAEG;AAGH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"ProposalRow.d.ts","sourceRoot":"","sources":["../../../../src/cli/tui/components/ProposalRow.tsx"],"names":[],"mappings":"AAAA;;GAEG;AAGH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAIpD,UAAU,gBAAgB;IACxB,IAAI,EAAE,gBAAgB,CAAC;IACvB,UAAU,EAAE,OAAO,CAAC;CACrB;AAuDD,wBAAgB,WAAW,CAAC,EAAE,IAAI,EAAE,UAAU,EAAE,EAAE,gBAAgB,GAAG,KAAK,CAAC,YAAY,CA2CtF"}
|
|
@@ -6,6 +6,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
exports.ProposalRow = ProposalRow;
|
|
7
7
|
const ink_wrapper_js_1 = require("../ink-wrapper.js");
|
|
8
8
|
const StatusBadge_js_1 = require("./StatusBadge.js");
|
|
9
|
+
const index_js_1 = require("../utils/index.js");
|
|
9
10
|
function getTypeLabel(item) {
|
|
10
11
|
if (item.type === "election")
|
|
11
12
|
return "EL";
|
|
@@ -47,20 +48,59 @@ function formatAge(timestamp) {
|
|
|
47
48
|
const years = Math.floor(diffDays / 365);
|
|
48
49
|
return `${years}y ago`;
|
|
49
50
|
}
|
|
51
|
+
function parseProgress(stageProgress) {
|
|
52
|
+
const match = stageProgress.match(/(\d+)\/(\d+)/);
|
|
53
|
+
if (!match)
|
|
54
|
+
return null;
|
|
55
|
+
const current = parseInt(match[1], 10);
|
|
56
|
+
const total = parseInt(match[2], 10);
|
|
57
|
+
if (total <= 0 || current < 0)
|
|
58
|
+
return null;
|
|
59
|
+
return { current, total };
|
|
60
|
+
}
|
|
61
|
+
function renderProgressBar(progress) {
|
|
62
|
+
const filled = Math.max(0, Math.min(progress.current, progress.total));
|
|
63
|
+
const empty = Math.max(0, progress.total - filled);
|
|
64
|
+
return "█".repeat(filled) + "░".repeat(empty);
|
|
65
|
+
}
|
|
66
|
+
const FIXED_COLS_WIDTH = 1 + 4 + 1 + 1 + 8 + 1 + 1 + 1 + 7 + 2;
|
|
67
|
+
const SAFETY_MARGIN = 4;
|
|
68
|
+
const MIN_COMPACT_WIDTH = 50;
|
|
50
69
|
function ProposalRow({ item, isSelected }) {
|
|
51
70
|
const typeLabel = getTypeLabel(item);
|
|
52
71
|
const typeColor = getTypeColor(item);
|
|
53
72
|
const age = formatAge(item.createdAt);
|
|
73
|
+
const progress = parseProgress(item.stageProgress);
|
|
74
|
+
const progressBar = progress ? renderProgressBar(progress) : null;
|
|
75
|
+
const { width } = (0, index_js_1.getTerminalSize)();
|
|
76
|
+
const isNarrow = width < MIN_COMPACT_WIDTH;
|
|
77
|
+
// In narrow mode, hide age and progress columns to prevent overflow
|
|
78
|
+
const effectiveFixedWidth = isNarrow ? 1 + 4 + 1 + 1 + 1 + 2 : FIXED_COLS_WIDTH;
|
|
79
|
+
const maxTitleWidth = Math.max(10, width - effectiveFixedWidth - SAFETY_MARGIN);
|
|
80
|
+
const title = (0, index_js_1.truncate)(item.title, maxTitleWidth);
|
|
81
|
+
const titlePadded = title.padEnd(maxTitleWidth);
|
|
82
|
+
const progressDisplay = progressBar ?? item.stageProgress;
|
|
83
|
+
const progressColor = progressBar
|
|
84
|
+
? item.status === "complete"
|
|
85
|
+
? "green"
|
|
86
|
+
: "yellow"
|
|
87
|
+
: "gray";
|
|
54
88
|
return (ink_wrapper_js_1.React.createElement(ink_wrapper_js_1.Box, null,
|
|
55
89
|
ink_wrapper_js_1.React.createElement(ink_wrapper_js_1.Text, { color: isSelected ? "cyan" : undefined, bold: isSelected }, isSelected ? ">" : " "),
|
|
56
|
-
ink_wrapper_js_1.React.createElement(ink_wrapper_js_1.Text, { color: typeColor },
|
|
90
|
+
ink_wrapper_js_1.React.createElement(ink_wrapper_js_1.Text, { color: typeColor },
|
|
91
|
+
"[",
|
|
92
|
+
typeLabel,
|
|
93
|
+
"]"),
|
|
57
94
|
ink_wrapper_js_1.React.createElement(ink_wrapper_js_1.Text, null, " "),
|
|
58
|
-
ink_wrapper_js_1.React.createElement(ink_wrapper_js_1.Text, { color: isSelected ? "cyan" : undefined },
|
|
59
|
-
ink_wrapper_js_1.React.createElement(ink_wrapper_js_1.Text, { color: "gray" }, " "),
|
|
60
|
-
ink_wrapper_js_1.React.createElement(ink_wrapper_js_1.Text, { color: "gray" }, age.padStart(8)),
|
|
95
|
+
ink_wrapper_js_1.React.createElement(ink_wrapper_js_1.Text, { color: isSelected ? "cyan" : undefined }, titlePadded),
|
|
61
96
|
ink_wrapper_js_1.React.createElement(ink_wrapper_js_1.Text, null, " "),
|
|
97
|
+
!isNarrow && (ink_wrapper_js_1.React.createElement(ink_wrapper_js_1.React.Fragment, null,
|
|
98
|
+
ink_wrapper_js_1.React.createElement(ink_wrapper_js_1.Text, { color: "gray" }, age.padStart(8)),
|
|
99
|
+
ink_wrapper_js_1.React.createElement(ink_wrapper_js_1.Text, null, " "))),
|
|
62
100
|
ink_wrapper_js_1.React.createElement(StatusBadge_js_1.StatusBadge, { status: item.status, compact: true }),
|
|
63
|
-
ink_wrapper_js_1.React.createElement(ink_wrapper_js_1.Text, { color:
|
|
64
|
-
|
|
101
|
+
!isNarrow && ink_wrapper_js_1.React.createElement(ink_wrapper_js_1.Text, { color: progressColor },
|
|
102
|
+
" ",
|
|
103
|
+
progressDisplay.padEnd(7)),
|
|
104
|
+
ink_wrapper_js_1.React.createElement(ink_wrapper_js_1.Text, { color: "green" }, item.hasExecutable ? " ▶" : " ")));
|
|
65
105
|
}
|
|
66
106
|
//# sourceMappingURL=ProposalRow.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ProposalRow.js","sourceRoot":"","sources":["../../../../src/cli/tui/components/ProposalRow.tsx"],"names":[],"mappings":";AAAA;;GAEG;;
|
|
1
|
+
{"version":3,"file":"ProposalRow.js","sourceRoot":"","sources":["../../../../src/cli/tui/components/ProposalRow.tsx"],"names":[],"mappings":";AAAA;;GAEG;;AAiEH,kCA2CC;AA1GD,sDAAqD;AAErD,qDAA+C;AAC/C,gDAA8D;AAO9D,SAAS,YAAY,CAAC,IAAsB;IAC1C,IAAI,IAAI,CAAC,IAAI,KAAK,UAAU;QAAE,OAAO,IAAI,CAAC;IAC1C,IAAI,IAAI,CAAC,IAAI,KAAK,UAAU;QAAE,OAAO,IAAI,CAAC;IAC1C,IAAI,IAAI,CAAC,YAAY,KAAK,gBAAgB;QAAE,OAAO,IAAI,CAAC;IACxD,IAAI,IAAI,CAAC,YAAY,KAAK,oBAAoB;QAAE,OAAO,IAAI,CAAC;IAC5D,OAAO,IAAI,CAAC;AACd,CAAC;AAED,SAAS,YAAY,CAAC,IAAsB;IAC1C,IAAI,IAAI,CAAC,IAAI,KAAK,UAAU;QAAE,OAAO,SAA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CAAC,qBAAI,YAAS;QACb,CAAC,QAAQ,IAAI,CACZ;YACE,qCAAC,qBAAI,IAAC,KAAK,EAAC,MAAM,IAAE,GAAG,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAQ;YAC3C,qCAAC,qBAAI,YAAS,CACb,CACJ;QACD,qCAAC,4BAAW,IAAC,MAAM,EAAE,IAAI,CAAC,MAAM,EAAE,OAAO,SAAG;QAC3C,CAAC,QAAQ,IAAI,qCAAC,qBAAI,IAAC,KAAK,EAAE,aAAa;;YAAI,eAAe,CAAC,MAAM,CAAC,CAAC,CAAC,CAAQ;QAC7E,qCAAC,qBAAI,IAAC,KAAK,EAAC,OAAO,IAAE,IAAI,CAAC,aAAa,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAQ,CACzD,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Scroll indicator component for views with scrollable content
|
|
3
|
+
*/
|
|
4
|
+
interface ScrollIndicatorProps {
|
|
5
|
+
scrollOffset: number;
|
|
6
|
+
visibleRows: number;
|
|
7
|
+
totalItems: number;
|
|
8
|
+
unit?: string;
|
|
9
|
+
}
|
|
10
|
+
export declare function ScrollIndicatorTop({ scrollOffset, unit, }: Pick<ScrollIndicatorProps, "scrollOffset" | "unit">): React.ReactElement | null;
|
|
11
|
+
export declare function ScrollIndicatorBottom({ scrollOffset, visibleRows, totalItems, unit, }: ScrollIndicatorProps): React.ReactElement | null;
|
|
12
|
+
interface ScrollBarProps {
|
|
13
|
+
scrollOffset: number;
|
|
14
|
+
visibleRows: number;
|
|
15
|
+
totalItems: number;
|
|
16
|
+
height?: number;
|
|
17
|
+
}
|
|
18
|
+
export declare function ScrollBar({ scrollOffset, visibleRows, totalItems, height, }: ScrollBarProps): React.ReactElement | null;
|
|
19
|
+
interface ScrollPositionProps {
|
|
20
|
+
scrollOffset: number;
|
|
21
|
+
visibleRows: number;
|
|
22
|
+
totalItems: number;
|
|
23
|
+
}
|
|
24
|
+
export declare function ScrollPosition({ scrollOffset, visibleRows, totalItems, }: ScrollPositionProps): React.ReactElement | null;
|
|
25
|
+
export {};
|
|
26
|
+
//# sourceMappingURL=ScrollIndicator.d.ts.map
|