@detergent-software/atk 9.6.1-dev.8 → 9.6.1
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/CHANGELOG.md +108 -0
- package/README.md +8 -8
- package/build/commands/_app.d.ts +29 -0
- package/build/commands/_app.d.ts.map +1 -1
- package/build/commands/_app.js +62 -21
- package/build/commands/_app.js.map +1 -1
- package/build/commands/browse.d.ts +5 -2
- package/build/commands/browse.d.ts.map +1 -1
- package/build/commands/browse.js +22 -22
- package/build/commands/browse.js.map +1 -1
- package/build/commands/list.d.ts +5 -2
- package/build/commands/list.d.ts.map +1 -1
- package/build/commands/list.js +18 -15
- package/build/commands/list.js.map +1 -1
- package/build/commands/upgrade.d.ts +5 -2
- package/build/commands/upgrade.d.ts.map +1 -1
- package/build/commands/upgrade.js +2 -4
- package/build/commands/upgrade.js.map +1 -1
- package/build/components/BrowseList.d.ts.map +1 -1
- package/build/components/BrowseList.js +25 -33
- package/build/components/BrowseList.js.map +1 -1
- package/build/components/CutDetail.d.ts +14 -0
- package/build/components/CutDetail.d.ts.map +1 -0
- package/build/components/CutDetail.js +14 -0
- package/build/components/CutDetail.js.map +1 -0
- package/build/components/FilterBar.d.ts +17 -0
- package/build/components/FilterBar.d.ts.map +1 -1
- package/build/components/FilterBar.js +54 -6
- package/build/components/FilterBar.js.map +1 -1
- package/build/components/Header.d.ts +3 -1
- package/build/components/Header.d.ts.map +1 -1
- package/build/components/Header.js +4 -1
- package/build/components/Header.js.map +1 -1
- package/build/components/HelpBar.d.ts +24 -2
- package/build/components/HelpBar.d.ts.map +1 -1
- package/build/components/HelpBar.js +54 -16
- package/build/components/HelpBar.js.map +1 -1
- package/build/components/ListBrowseList.d.ts.map +1 -1
- package/build/components/ListBrowseList.js +17 -25
- package/build/components/ListBrowseList.js.map +1 -1
- package/build/components/ListHelpBar.d.ts +5 -5
- package/build/components/ListHelpBar.d.ts.map +1 -1
- package/build/components/ListHelpBar.js +31 -8
- package/build/components/ListHelpBar.js.map +1 -1
- package/build/components/MeasuredBox.d.ts +20 -0
- package/build/components/MeasuredBox.d.ts.map +1 -0
- package/build/components/MeasuredBox.js +14 -0
- package/build/components/MeasuredBox.js.map +1 -0
- package/build/hooks/useListState.d.ts.map +1 -1
- package/build/hooks/useListState.js +17 -15
- package/build/hooks/useListState.js.map +1 -1
- package/build/hooks/useMeasuredRows.d.ts +10 -0
- package/build/hooks/useMeasuredRows.d.ts.map +1 -0
- package/build/hooks/useMeasuredRows.js +23 -0
- package/build/hooks/useMeasuredRows.js.map +1 -0
- package/build/hooks/useRenderOnResize.d.ts +11 -0
- package/build/hooks/useRenderOnResize.d.ts.map +1 -0
- package/build/hooks/useRenderOnResize.js +35 -0
- package/build/hooks/useRenderOnResize.js.map +1 -0
- package/build/hooks/useShell.d.ts +23 -0
- package/build/hooks/useShell.d.ts.map +1 -0
- package/build/hooks/useShell.js +28 -0
- package/build/hooks/useShell.js.map +1 -0
- package/build/lib/atk-api/index.d.ts +2 -2
- package/build/lib/atk-api/index.d.ts.map +1 -1
- package/build/lib/atk-api/index.js +1 -1
- package/build/lib/atk-api/index.js.map +1 -1
- package/build/lib/atk-api/web-routes.d.ts +36 -9
- package/build/lib/atk-api/web-routes.d.ts.map +1 -1
- package/build/lib/atk-api/web-routes.js +59 -10
- package/build/lib/atk-api/web-routes.js.map +1 -1
- package/build/lib/ink-stdout.d.ts +32 -0
- package/build/lib/ink-stdout.d.ts.map +1 -0
- package/build/lib/ink-stdout.js +79 -0
- package/build/lib/ink-stdout.js.map +1 -0
- package/build/lib/list-window.d.ts +43 -0
- package/build/lib/list-window.d.ts.map +1 -0
- package/build/lib/list-window.js +58 -0
- package/build/lib/list-window.js.map +1 -0
- package/build/lib/pastel/read-custom-app.d.ts +11 -1
- package/build/lib/pastel/read-custom-app.d.ts.map +1 -1
- package/build/lib/pastel/read-custom-app.js +2 -1
- package/build/lib/pastel/read-custom-app.js.map +1 -1
- package/build/lib/pastel/render-command.d.ts.map +1 -1
- package/build/lib/pastel/render-command.js +4 -3
- package/build/lib/pastel/render-command.js.map +1 -1
- package/build/lib/screen-rows.d.ts +15 -0
- package/build/lib/screen-rows.d.ts.map +1 -0
- package/build/lib/screen-rows.js +17 -0
- package/build/lib/screen-rows.js.map +1 -0
- package/build/lib/update-check.d.ts +25 -19
- package/build/lib/update-check.d.ts.map +1 -1
- package/build/lib/update-check.js +50 -61
- package/build/lib/update-check.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
2
|
import { Box, Text } from 'ink';
|
|
3
|
+
import { Fragment } from 'react';
|
|
3
4
|
import { TYPE_TAB_LABELS, TYPE_TABS } from '../hooks/useBrowseState.js';
|
|
4
|
-
|
|
5
|
+
/** Browse's tab labels when the full ones don't fit on one line. */
|
|
6
|
+
export const DEFAULT_ABBREVIATED_TAB_LABELS = {
|
|
5
7
|
agent: 'Agent',
|
|
6
8
|
all: 'All',
|
|
7
9
|
bundle: 'Bundle',
|
|
@@ -14,13 +16,12 @@ const DEFAULT_ABBREVIATED_TAB_LABELS = {
|
|
|
14
16
|
};
|
|
15
17
|
export default function FilterBar({ abbreviatedTabLabels = DEFAULT_ABBREVIATED_TAB_LABELS, filterText, inputMode, org, orgOnly = false, resultCount, sortIndicator, terminalWidth, totalCount, typeFilter, typeTabLabels = TYPE_TAB_LABELS, typeTabs = TYPE_TABS, }) {
|
|
16
18
|
const counterLabel = typeFilter === 'bundle' ? 'bundles' : typeFilter === 'all' ? 'items' : 'assets';
|
|
17
|
-
// The tab row is one line in the commands'
|
|
19
|
+
// The tab row is one line in the commands' SCREEN_CHROME_ROWS, so the full labels show only when they fit, and the
|
|
20
|
+
// abbreviated ones show the tabs around the active one when even they don't.
|
|
18
21
|
const tabLabels = tabRowWidth(typeTabs, typeTabLabels) <= terminalWidth ? typeTabLabels : abbreviatedTabLabels;
|
|
22
|
+
const shown = tabWindow(typeTabs, tabLabels, typeFilter, terminalWidth);
|
|
19
23
|
const right = filterBarRightSide({ counterLabel, org, orgOnly, resultCount, sortIndicator, totalCount }, terminalWidth);
|
|
20
|
-
return (_jsxs(Box, { borderColor: 'gray', borderStyle: 'round', flexDirection: 'column', children: [_jsxs(Box, { overflow: 'hidden', children: [_jsxs(Box, { flexGrow: 1, flexShrink: 1, minWidth: 0, overflow: 'hidden', children: [_jsx(Box, { flexShrink: 0, children: _jsx(Text, { dimColor: true, wrap: 'truncate-end', children: FILTER_LABEL }) }), _jsxs(Text, { wrap: inputMode === 'filter' ? 'truncate-start' : 'truncate-end', children: [filterText ? (_jsx(Text, { children: filterText })) : inputMode === 'filter' ? (_jsx(Text, { dimColor: true, children: "type to filter..." })) : (_jsx(Text, { dimColor: true, children: "press / to filter" })), inputMode === 'filter' && _jsx(Text, { color: 'cyan', children: "|" })] })] }), _jsxs(Box, { flexShrink: 0, gap: RIGHT_GAP, marginLeft: RIGHT_MARGIN, children: [right.sort !== null && _jsx(Text, { dimColor: true, children: right.sort }), right.org !== null && (_jsxs(Text, { children: [right.org.prefix && _jsx(Text, { dimColor: true, children: ORG_PREFIX }), right.org.name !== null && (_jsxs(_Fragment, { children: [_jsxs(Text, { color: 'cyan', children: ["@", right.org.name] }), _jsx(Text, { dimColor: true, children: " " })] })), _jsx(Text, { bold: true, color: 'cyan', children: right.org.scope })] })), _jsx(Text, { dimColor: true, children: right.count })] })] }),
|
|
21
|
-
const label = tabLabels[tab];
|
|
22
|
-
return (_jsxs(Text, { bold: tab === typeFilter, color: tab === typeFilter ? 'cyan' : undefined, dimColor: tab !== typeFilter, children: ["[", label, "]"] }, tab));
|
|
23
|
-
}) })] }));
|
|
24
|
+
return (_jsxs(Box, { borderColor: 'gray', borderStyle: 'round', flexDirection: 'column', children: [_jsxs(Box, { overflow: 'hidden', children: [_jsxs(Box, { flexGrow: 1, flexShrink: 1, minWidth: 0, overflow: 'hidden', children: [_jsx(Box, { flexShrink: 0, children: _jsx(Text, { dimColor: true, wrap: 'truncate-end', children: FILTER_LABEL }) }), _jsxs(Text, { wrap: inputMode === 'filter' ? 'truncate-start' : 'truncate-end', children: [filterText ? (_jsx(Text, { children: filterText })) : inputMode === 'filter' ? (_jsx(Text, { dimColor: true, children: "type to filter..." })) : (_jsx(Text, { dimColor: true, children: "press / to filter" })), inputMode === 'filter' && _jsx(Text, { color: 'cyan', children: "|" })] })] }), _jsxs(Box, { flexShrink: 0, gap: RIGHT_GAP, marginLeft: RIGHT_MARGIN, children: [right.sort !== null && _jsx(Text, { dimColor: true, children: right.sort }), right.org !== null && (_jsxs(Text, { children: [right.org.prefix && _jsx(Text, { dimColor: true, children: ORG_PREFIX }), right.org.name !== null && (_jsxs(_Fragment, { children: [_jsxs(Text, { color: 'cyan', children: ["@", right.org.name] }), _jsx(Text, { dimColor: true, children: " " })] })), _jsx(Text, { bold: true, color: 'cyan', children: right.org.scope })] })), _jsx(Text, { dimColor: true, children: right.count })] })] }), _jsxs(Text, { wrap: 'truncate-end', children: [shown.cutStart && _jsxs(Text, { dimColor: true, children: [CUT_MARKER, " "] }), typeTabs.slice(shown.first, shown.last + 1).map((tab, index) => (_jsxs(Fragment, { children: [index > 0 && ' ', _jsxs(Text, { bold: tab === typeFilter, color: tab === typeFilter ? 'cyan' : undefined, dimColor: tab !== typeFilter, children: ["[", tabLabels[tab], "]"] })] }, tab))), shown.cutEnd && _jsxs(Text, { dimColor: true, children: [" ", CUT_MARKER] })] })] }));
|
|
24
25
|
}
|
|
25
26
|
const FILTER_LABEL = 'Filter: ';
|
|
26
27
|
const ORG_PREFIX = 'Org: ';
|
|
@@ -31,6 +32,9 @@ const ORG_NAME_MIN_COLUMNS = 4;
|
|
|
31
32
|
const RIGHT_GAP = 2;
|
|
32
33
|
const RIGHT_MARGIN = 1;
|
|
33
34
|
const BORDER_COLUMNS = 2;
|
|
35
|
+
const CUT_MARKER = '…';
|
|
36
|
+
/** A cut end of the tab row: its `…` and the space beside it. */
|
|
37
|
+
const CUT_COLUMNS = CUT_MARKER.length + 1;
|
|
34
38
|
/**
|
|
35
39
|
* The first line's right side for this width, as `tabRowWidth` picks the tab labels: what fits beside `Filter: `
|
|
36
40
|
* and the filter's minimum. Each step adds to the one before, until the side fits: drop the `Org: ` prefix,
|
|
@@ -65,6 +69,50 @@ export function tabRowWidth(tabs, labels) {
|
|
|
65
69
|
const tabsWidth = tabs.reduce((width, tab) => width + (labels[tab]?.length ?? 0) + 2, 0);
|
|
66
70
|
return tabsWidth + Math.max(0, tabs.length - 1) + BORDER_COLUMNS;
|
|
67
71
|
}
|
|
72
|
+
/**
|
|
73
|
+
* The tabs that fit on one line with these labels: every tab when the row fits, otherwise the active tab and its
|
|
74
|
+
* neighbours, added a right one then a left one while they fit. A side that can't take its next tab leaves the
|
|
75
|
+
* room to the other. A cut end costs its `…` and a space, and only while it is cut; when even the active tab and
|
|
76
|
+
* its `…`s don't fit, it is the active tab alone, with none. An unknown active tab counts as the first.
|
|
77
|
+
*/
|
|
78
|
+
export function tabWindow(tabs, labels, activeTab, terminalWidth) {
|
|
79
|
+
const range = (first, last) => ({
|
|
80
|
+
cutEnd: last < tabs.length - 1,
|
|
81
|
+
cutStart: first > 0,
|
|
82
|
+
first,
|
|
83
|
+
last,
|
|
84
|
+
});
|
|
85
|
+
const fits = ({ cutEnd, cutStart, first, last }) => tabRowWidth(tabs.slice(first, last + 1), labels) + (cutStart ? CUT_COLUMNS : 0) + (cutEnd ? CUT_COLUMNS : 0) <=
|
|
86
|
+
terminalWidth;
|
|
87
|
+
/** The window with one more tab on that side, or null when that end isn't cut or the tab doesn't fit. */
|
|
88
|
+
const grown = (from, toRight) => {
|
|
89
|
+
if (toRight ? !from.cutEnd : !from.cutStart)
|
|
90
|
+
return null;
|
|
91
|
+
const next = toRight ? range(from.first, from.last + 1) : range(from.first - 1, from.last);
|
|
92
|
+
return fits(next) ? next : null;
|
|
93
|
+
};
|
|
94
|
+
const every = range(0, tabs.length - 1);
|
|
95
|
+
if (fits(every))
|
|
96
|
+
return every;
|
|
97
|
+
const active = Math.max(0, tabs.indexOf(activeTab));
|
|
98
|
+
let shown = range(active, active);
|
|
99
|
+
// Too narrow for the active tab and its `…`s: the tab alone, so the cut takes no part of its label
|
|
100
|
+
if (!fits(shown))
|
|
101
|
+
return { cutEnd: false, cutStart: false, first: active, last: active };
|
|
102
|
+
let right = true;
|
|
103
|
+
for (;;) {
|
|
104
|
+
const preferred = grown(shown, right);
|
|
105
|
+
if (preferred) {
|
|
106
|
+
shown = preferred;
|
|
107
|
+
right = !right;
|
|
108
|
+
continue;
|
|
109
|
+
}
|
|
110
|
+
const other = grown(shown, !right);
|
|
111
|
+
if (!other)
|
|
112
|
+
return shown;
|
|
113
|
+
shown = other;
|
|
114
|
+
}
|
|
115
|
+
}
|
|
68
116
|
/** Cuts the org name with `…` to fill the room, or leaves it whole when even its minimum doesn't fit. */
|
|
69
117
|
function cutOrgName(side, room) {
|
|
70
118
|
if (!side.org?.name)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FilterBar.js","sourceRoot":"","sources":["../../src/components/FilterBar.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"FilterBar.js","sourceRoot":"","sources":["../../src/components/FilterBar.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAChC,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEjC,OAAO,EAAwB,eAAe,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAC;AAE9F,oEAAoE;AACpE,MAAM,CAAC,MAAM,8BAA8B,GAAoC;IAC7E,KAAK,EAAE,OAAO;IACd,GAAG,EAAE,KAAK;IACV,MAAM,EAAE,QAAQ;IAChB,IAAI,EAAE,MAAM;IACZ,YAAY,EAAE,KAAK;IACnB,iBAAiB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AAI,CAAC,MAAM,GAAG,CAAC,CAAC;YACvD,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,MAAM;QACvB,CAAC,CAAC,IAAI,CAAC;IACT,MAAM,MAAM,GAAG,CAAC,IAAI,CAAC,IAAI,EAAE,MAAM,IAAI,IAAI,EAAE,GAAG,EAAE,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,MAAM,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,KAAK,IAAI,CAAC,CAAC;IACrG,OAAO,MAAM,CAAC,MAAM,CAAC,CAAC,KAAK,EAAE,KAAK,EAAE,EAAE,CAAC,KAAK,GAAG,KAAK,EAAE,CAAC,CAAC,GAAG,SAAS,GAAG,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;AAC7F,CAAC"}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { ASCII_ART, GRADIENT } from './header-art.js';
|
|
2
2
|
interface HeaderProps {
|
|
3
|
+
/** One line, the name and version without the art, for a screen that sizes itself to the terminal */
|
|
4
|
+
compact?: boolean;
|
|
3
5
|
/** Version string to display (e.g., "0.1.0") */
|
|
4
6
|
version?: string;
|
|
5
7
|
}
|
|
@@ -8,5 +10,5 @@ export { ASCII_ART, GRADIENT };
|
|
|
8
10
|
* Styled app banner with ASCII art and optional version number.
|
|
9
11
|
* Used by the _app.tsx wrapper for consistent branding.
|
|
10
12
|
*/
|
|
11
|
-
export default function Header({ version }: HeaderProps): import("react").JSX.Element;
|
|
13
|
+
export default function Header({ compact, version }: HeaderProps): import("react").JSX.Element;
|
|
12
14
|
//# sourceMappingURL=Header.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Header.d.ts","sourceRoot":"","sources":["../../src/components/Header.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAEtD,UAAU,WAAW;IACnB,gDAAgD;IAChD,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,CAAC;AAE/B;;;GAGG;AACH,MAAM,CAAC,OAAO,UAAU,MAAM,CAAC,EAAE,OAAO,EAAE,EAAE,WAAW,+
|
|
1
|
+
{"version":3,"file":"Header.d.ts","sourceRoot":"","sources":["../../src/components/Header.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAEtD,UAAU,WAAW;IACnB,qGAAqG;IACrG,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,gDAAgD;IAChD,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,CAAC;AAE/B;;;GAGG;AACH,MAAM,CAAC,OAAO,UAAU,MAAM,CAAC,EAAE,OAAe,EAAE,OAAO,EAAE,EAAE,WAAW,+BA6CvE"}
|
|
@@ -6,8 +6,11 @@ export { ASCII_ART, GRADIENT };
|
|
|
6
6
|
* Styled app banner with ASCII art and optional version number.
|
|
7
7
|
* Used by the _app.tsx wrapper for consistent branding.
|
|
8
8
|
*/
|
|
9
|
-
export default function Header({ version }) {
|
|
9
|
+
export default function Header({ compact = false, version }) {
|
|
10
10
|
const isDev = version?.includes('-dev') ?? false;
|
|
11
|
+
if (compact) {
|
|
12
|
+
return (_jsxs(Text, { children: [_jsx(Text, { bold: true, color: '#FF8800', children: "Agentic ToolKit" }), version && _jsxs(Text, { dimColor: true, children: [" v", version] }), isDev && (_jsxs(Text, { bold: true, color: 'yellow', children: [' ', "(dev)"] }))] }));
|
|
13
|
+
}
|
|
11
14
|
return (_jsxs(Box, { flexDirection: 'row', gap: 3, children: [_jsx(Box, { flexDirection: 'column', children: ASCII_ART.map((line, i) => (_jsx(Text, { bold: true, color: GRADIENT[i], children: line }, i))) }), _jsxs(Box, { flexDirection: 'column', justifyContent: 'center', children: [_jsx(Text, { bold: true, color: '#FF8800', children: "Agentic ToolKit" }), _jsxs(Box, { children: [version && _jsxs(Text, { dimColor: true, children: ["v", version] }), isDev && (_jsxs(Text, { bold: true, color: 'yellow', children: [' ', "(dev)"] }))] })] })] }));
|
|
12
15
|
}
|
|
13
16
|
//# sourceMappingURL=Header.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Header.js","sourceRoot":"","sources":["../../src/components/Header.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAEhC,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"Header.js","sourceRoot":"","sources":["../../src/components/Header.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAEhC,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAStD,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,CAAC;AAE/B;;;GAGG;AACH,MAAM,CAAC,OAAO,UAAU,MAAM,CAAC,EAAE,OAAO,GAAG,KAAK,EAAE,OAAO,EAAe;IACtE,MAAM,KAAK,GAAG,OAAO,EAAE,QAAQ,CAAC,MAAM,CAAC,IAAI,KAAK,CAAC;IAEjD,IAAI,OAAO,EAAE,CAAC;QACZ,OAAO,CACL,MAAC,IAAI,eACH,KAAC,IAAI,IAAC,IAAI,QAAC,KAAK,EAAC,SAAS,gCAEnB,EACN,OAAO,IAAI,MAAC,IAAI,IAAC,QAAQ,yBAAI,OAAO,IAAQ,EAC5C,KAAK,IAAI,CACR,MAAC,IAAI,IAAC,IAAI,QAAC,KAAK,EAAC,QAAQ,aACtB,GAAG,aAEC,CACR,IACI,CACR,CAAC;IACJ,CAAC;IAED,OAAO,CACL,MAAC,GAAG,IAAC,aAAa,EAAC,KAAK,EAAC,GAAG,EAAE,CAAC,aAC7B,KAAC,GAAG,IAAC,aAAa,EAAC,QAAQ,YACxB,SAAS,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC,EAAE,EAAE,CAAC,CAC1B,KAAC,IAAI,IAAC,IAAI,QAAC,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC,YAC1B,IAAI,IAD6B,CAAC,CAE9B,CACR,CAAC,GACE,EACN,MAAC,GAAG,IAAC,aAAa,EAAC,QAAQ,EAAC,cAAc,EAAC,QAAQ,aACjD,KAAC,IAAI,IAAC,IAAI,QAAC,KAAK,EAAC,SAAS,gCAEnB,EACP,MAAC,GAAG,eACD,OAAO,IAAI,MAAC,IAAI,IAAC,QAAQ,wBAAG,OAAO,IAAQ,EAC3C,KAAK,IAAI,CACR,MAAC,IAAI,IAAC,IAAI,QAAC,KAAK,EAAC,QAAQ,aACtB,GAAG,aAEC,CACR,IACG,IACF,IACF,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -1,3 +1,15 @@
|
|
|
1
|
+
/** A step that makes a help bar's line narrower: drop a hint, or give it shorter text. */
|
|
2
|
+
export type HintStep = {
|
|
3
|
+
drop: string;
|
|
4
|
+
} | {
|
|
5
|
+
shorten: string;
|
|
6
|
+
text: string;
|
|
7
|
+
};
|
|
8
|
+
/** One hint on a help bar, such as `s: sort`; `id` names it in the steps. */
|
|
9
|
+
export interface KeyHint {
|
|
10
|
+
id: string;
|
|
11
|
+
text: string;
|
|
12
|
+
}
|
|
1
13
|
interface HelpBarProps {
|
|
2
14
|
/** Whether the current item can be installed */
|
|
3
15
|
canInstall: boolean;
|
|
@@ -9,9 +21,19 @@ interface HelpBarProps {
|
|
|
9
21
|
inputMode: 'filter' | 'navigate';
|
|
10
22
|
/** How many rows are marked, which `i` installs together */
|
|
11
23
|
markedCount?: number;
|
|
24
|
+
/** Terminal width, which the line fits */
|
|
25
|
+
terminalWidth: number;
|
|
12
26
|
}
|
|
13
27
|
export default function HelpBar(props: HelpBarProps): import("react").JSX.Element;
|
|
14
|
-
/**
|
|
15
|
-
export declare function
|
|
28
|
+
/** Filter mode's line, the same in browse and list. */
|
|
29
|
+
export declare function filterModeText(terminalWidth: number): string;
|
|
30
|
+
/**
|
|
31
|
+
* A help bar's line for this width. Each step applies on top of the ones before it until the hints fit
|
|
32
|
+
* inside the border. A step for a hint that isn't shown changes nothing. A line still too wide after the
|
|
33
|
+
* last step is cut by the bar (`truncate-end`): the commands reserve one line for it (`SCREEN_CHROME_ROWS`).
|
|
34
|
+
*/
|
|
35
|
+
export declare function fitHints(hints: readonly KeyHint[], steps: readonly HintStep[], terminalWidth: number): string;
|
|
36
|
+
/** The help bar's line, fitted to `terminalWidth` (see `fitHints`). */
|
|
37
|
+
export declare function helpBarText({ canInstall, expanded, hasOrg, inputMode, markedCount, terminalWidth, }: HelpBarProps): string;
|
|
16
38
|
export {};
|
|
17
39
|
//# sourceMappingURL=HelpBar.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HelpBar.d.ts","sourceRoot":"","sources":["../../src/components/HelpBar.tsx"],"names":[],"mappings":"AAEA,UAAU,YAAY;IACpB,gDAAgD;IAChD,UAAU,EAAE,OAAO,CAAC;IACpB,0CAA0C;IAC1C,QAAQ,EAAE,OAAO,CAAC;IAClB,uCAAuC;IACvC,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,yBAAyB;IACzB,SAAS,EAAE,QAAQ,GAAG,UAAU,CAAC;IACjC,4DAA4D;IAC5D,WAAW,CAAC,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"HelpBar.d.ts","sourceRoot":"","sources":["../../src/components/HelpBar.tsx"],"names":[],"mappings":"AAEA,0FAA0F;AAC1F,MAAM,MAAM,QAAQ,GAAG;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,GAAG;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC;AAE5E,6EAA6E;AAC7E,MAAM,WAAW,OAAO;IACtB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;CACd;AAED,UAAU,YAAY;IACpB,gDAAgD;IAChD,UAAU,EAAE,OAAO,CAAC;IACpB,0CAA0C;IAC1C,QAAQ,EAAE,OAAO,CAAC;IAClB,uCAAuC;IACvC,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,yBAAyB;IACzB,SAAS,EAAE,QAAQ,GAAG,UAAU,CAAC;IACjC,4DAA4D;IAC5D,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,0CAA0C;IAC1C,aAAa,EAAE,MAAM,CAAC;CACvB;AAED,MAAM,CAAC,OAAO,UAAU,OAAO,CAAC,KAAK,EAAE,YAAY,+BAQlD;AAKD,uDAAuD;AACvD,wBAAgB,cAAc,CAAC,aAAa,EAAE,MAAM,GAAG,MAAM,CAW5D;AAED;;;;GAIG;AACH,wBAAgB,QAAQ,CAAC,KAAK,EAAE,SAAS,OAAO,EAAE,EAAE,KAAK,EAAE,SAAS,QAAQ,EAAE,EAAE,aAAa,EAAE,MAAM,GAAG,MAAM,CAY7G;AAED,uEAAuE;AACvE,wBAAgB,WAAW,CAAC,EAC1B,UAAU,EACV,QAAQ,EACR,MAAc,EACd,SAAS,EACT,WAAe,EACf,aAAa,GACd,EAAE,YAAY,GAAG,MAAM,CAsBvB"}
|
|
@@ -1,23 +1,61 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { Box, Text } from 'ink';
|
|
3
3
|
export default function HelpBar(props) {
|
|
4
|
-
return (_jsx(Box, { borderColor: 'gray', borderStyle: 'round', children: _jsx(Text, { dimColor: true, children: helpBarText(props) }) }));
|
|
4
|
+
return (_jsx(Box, { borderColor: 'gray', borderStyle: 'round', children: _jsx(Text, { dimColor: true, wrap: 'truncate-end', children: helpBarText(props) }) }));
|
|
5
5
|
}
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
6
|
+
const HINT_GAP = ' ';
|
|
7
|
+
const BORDER_COLUMNS = 2;
|
|
8
|
+
/** Filter mode's line, the same in browse and list. */
|
|
9
|
+
export function filterModeText(terminalWidth) {
|
|
10
|
+
return fitHints([
|
|
11
|
+
{ id: 'navigate', text: '↑↓ navigate' },
|
|
12
|
+
{ id: 'type', text: 'Tab: type' },
|
|
13
|
+
{ id: 'stop', text: 'Esc: stop filter' },
|
|
14
|
+
{ id: 'prompt', text: 'Type to filter...' },
|
|
15
|
+
], [{ drop: 'navigate' }, { drop: 'type' }], terminalWidth);
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* A help bar's line for this width. Each step applies on top of the ones before it until the hints fit
|
|
19
|
+
* inside the border. A step for a hint that isn't shown changes nothing. A line still too wide after the
|
|
20
|
+
* last step is cut by the bar (`truncate-end`): the commands reserve one line for it (`SCREEN_CHROME_ROWS`).
|
|
21
|
+
*/
|
|
22
|
+
export function fitHints(hints, steps, terminalWidth) {
|
|
23
|
+
const room = terminalWidth - BORDER_COLUMNS;
|
|
24
|
+
let shown = [...hints];
|
|
25
|
+
const line = () => shown.map((hint) => hint.text).join(HINT_GAP);
|
|
26
|
+
for (const step of steps) {
|
|
27
|
+
if (line().length <= room)
|
|
28
|
+
break;
|
|
29
|
+
shown =
|
|
30
|
+
'drop' in step
|
|
31
|
+
? shown.filter((hint) => hint.id !== step.drop)
|
|
32
|
+
: shown.map((hint) => (hint.id === step.shorten ? { ...hint, text: step.text } : hint));
|
|
10
33
|
}
|
|
11
|
-
return
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
'
|
|
21
|
-
|
|
34
|
+
return line();
|
|
35
|
+
}
|
|
36
|
+
/** The help bar's line, fitted to `terminalWidth` (see `fitHints`). */
|
|
37
|
+
export function helpBarText({ canInstall, expanded, hasOrg = false, inputMode, markedCount = 0, terminalWidth, }) {
|
|
38
|
+
if (inputMode === 'filter')
|
|
39
|
+
return filterModeText(terminalWidth);
|
|
40
|
+
const hints = [
|
|
41
|
+
{ id: 'navigate', text: '↑↓ navigate' },
|
|
42
|
+
{ id: 'filter', text: '/: filter' },
|
|
43
|
+
{ id: 'type', text: 'Tab: type' },
|
|
44
|
+
{ id: 'sort', text: 's: sort' },
|
|
45
|
+
{ id: 'expand', text: expanded ? 'Esc: collapse' : 'Enter: expand' },
|
|
46
|
+
{ id: 'mark', text: 'Space: mark' },
|
|
47
|
+
...(canInstall ? [{ id: 'install', text: `i: install${markedCount > 0 ? ` ${markedCount} marked` : ''}` }] : []),
|
|
48
|
+
...(hasOrg ? [{ id: 'org', text: 'o: org only' }] : []),
|
|
49
|
+
{ id: 'quit', text: 'q: quit' },
|
|
50
|
+
];
|
|
51
|
+
const steps = [
|
|
52
|
+
{ drop: 'navigate' },
|
|
53
|
+
{ shorten: 'org', text: 'o: org' },
|
|
54
|
+
{ drop: 'type' },
|
|
55
|
+
...(markedCount > 0 ? [{ shorten: 'install', text: `i: install ${markedCount}` }] : []),
|
|
56
|
+
{ drop: 'sort' },
|
|
57
|
+
{ drop: 'org' },
|
|
58
|
+
];
|
|
59
|
+
return fitHints(hints, steps, terminalWidth);
|
|
22
60
|
}
|
|
23
61
|
//# sourceMappingURL=HelpBar.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HelpBar.js","sourceRoot":"","sources":["../../src/components/HelpBar.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"HelpBar.js","sourceRoot":"","sources":["../../src/components/HelpBar.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AA0BhC,MAAM,CAAC,OAAO,UAAU,OAAO,CAAC,KAAmB;IACjD,OAAO,CACL,KAAC,GAAG,IAAC,WAAW,EAAC,MAAM,EAAC,WAAW,EAAC,OAAO,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AE,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,aAAa,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;QACvD,EAAE,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,SAAS,EAAE;KAChC,CAAC;IACF,MAAM,KAAK,GAAe;QACxB,EAAE,IAAI,EAAE,UAAU,EAAE;QACpB,EAAE,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE;QAClC,EAAE,IAAI,EAAE,MAAM,EAAE;QAChB,GAAG,CAAC,WAAW,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,cAAc,WAAW,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;QACvF,EAAE,IAAI,EAAE,MAAM,EAAE;QAChB,EAAE,IAAI,EAAE,KAAK,EAAE;KAChB,CAAC;IACF,OAAO,QAAQ,CAAC,KAAK,EAAE,KAAK,EAAE,aAAa,CAAC,CAAC;AAC/C,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ListBrowseList.d.ts","sourceRoot":"","sources":["../../src/components/ListBrowseList.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,OAAO,EAAc,KAAK,cAAc,EAAE,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"ListBrowseList.d.ts","sourceRoot":"","sources":["../../src/components/ListBrowseList.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,OAAO,EAAc,KAAK,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAIzF,OAAO,EAAe,KAAK,UAAU,EAAE,MAAM,iBAAiB,CAAC;AA0C/D,UAAU,mBAAmB;IAC3B;;;OAGG;IACH,SAAS,CAAC,EAAE,WAAW,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC;IAC5C,6CAA6C;IAC7C,WAAW,EAAE,MAAM,CAAC;IACpB,sCAAsC;IACtC,aAAa,EAAE,IAAI,GAAG,MAAM,CAAC;IAC7B,+CAA+C;IAC/C,SAAS,CAAC,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IACxB,2CAA2C;IAC3C,KAAK,EAAE,OAAO,EAAE,CAAC;IACjB,gEAAgE;IAChE,WAAW,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACjC,+BAA+B;IAC/B,YAAY,EAAE,MAAM,CAAC;IACrB,uEAAuE;IACvE,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,2CAA2C;IAC3C,aAAa,EAAE,MAAM,CAAC;IACtB,6BAA6B;IAC7B,UAAU,EAAE,cAAc,CAAC;IAC3B,iDAAiD;IACjD,cAAc,EAAE,MAAM,CAAC;IACvB,6DAA6D;IAC7D,MAAM,EAAE,IAAI,GAAG,MAAM,CAAC;CACvB;AAED,MAAM,CAAC,OAAO,UAAU,cAAc,CAAC,EACrC,SAAS,EACT,WAAW,EACX,aAAa,EACb,SAAS,EACT,KAAK,EACL,WAAW,EACX,YAAY,EACZ,SAAiB,EACjB,aAAa,EACb,UAAU,EACV,cAAc,EACd,MAAM,GACP,EAAE,mBAAmB,+BAoMrB"}
|
|
@@ -2,8 +2,10 @@ import { jsxs as _jsxs, jsx as _jsx, Fragment as _Fragment } from "react/jsx-run
|
|
|
2
2
|
import { Box, Text } from 'ink';
|
|
3
3
|
import { listRowKey } from '../hooks/useListState.js';
|
|
4
4
|
import { getBreakpoint } from '../lib/breakpoints.js';
|
|
5
|
+
import { fitListWindow } from '../lib/list-window.js';
|
|
5
6
|
import { formatOrgName } from '../lib/org.js';
|
|
6
7
|
import { formatCount } from '../lib/usage.js';
|
|
8
|
+
import CutDetail from './CutDetail.js';
|
|
7
9
|
import ListExpandedRow, { computeExpandedLines } from './ListExpandedRow.js';
|
|
8
10
|
/**
|
|
9
11
|
* Each breakpoint's column widths; Name's is its most, which a terminal too narrow for it cuts
|
|
@@ -60,40 +62,30 @@ export default function ListBrowseList({ countsMap, cursorIndex, expandedIndex,
|
|
|
60
62
|
const nameWidth = Math.max(MIN_NAME_WIDTH, Math.min(mostName, spare));
|
|
61
63
|
const orgMore = bp === 'medium' ? Math.max(0, Math.min(ORG_MORE, spare - nameWidth)) : 0;
|
|
62
64
|
const orgWidth = showOrg ? leastOrg + orgMore : 0;
|
|
63
|
-
const aboveCount = scrollOffset;
|
|
64
65
|
// Helper to check if an asset is frozen via the frozenSet
|
|
65
66
|
const isItemFrozen = (item) => frozenSet?.has(listRowKey(item)) ?? false;
|
|
66
67
|
// Compute expanded row line height for the expanded item (if any)
|
|
67
68
|
const expandedAsset = expandedIndex !== null ? items[expandedIndex] : null;
|
|
68
|
-
const
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
const limit = i < items.length - 1 ? viewportHeight - 1 : viewportHeight;
|
|
82
|
-
if (usedLines + linesNeeded > limit)
|
|
83
|
-
break;
|
|
84
|
-
visibleItems.push({ index: i, item: items[i] });
|
|
85
|
-
usedLines += linesNeeded;
|
|
86
|
-
}
|
|
87
|
-
const lastVisibleIndex = visibleItems.length > 0 ? visibleItems[visibleItems.length - 1].index : scrollOffset;
|
|
88
|
-
const belowCount = items.length - lastVisibleIndex - 1;
|
|
89
|
-
return (_jsxs(Box, { borderColor: 'gray', borderStyle: 'round', flexDirection: 'column', children: [_jsxs(Box, { children: [_jsx(Box, { flexShrink: 0, width: cols.cursor, children: _jsx(Text, { children: " " }) }), _jsx(Box, { flexShrink: 0, marginRight: NAME_GAP, width: nameWidth, children: _jsx(Text, { bold: true, dimColor: true, children: "Name" }) }), showOrg && (_jsx(Box, { flexShrink: 0, width: orgWidth, children: _jsx(Text, { bold: true, dimColor: true, children: "Org" }) })), showType && (_jsx(Box, { flexShrink: 0, width: typeWidth, children: _jsx(Text, { bold: true, dimColor: true, children: "Type" }) })), showScope && (_jsx(Box, { flexShrink: 0, width: SCOPE_WIDTH, children: _jsx(Text, { bold: true, dimColor: true, children: "Scope" }) })), _jsx(Box, { flexShrink: 0, width: versionWidth, children: _jsx(Text, { bold: true, dimColor: true, children: "Version" }) }), showInstalls && (_jsxs(_Fragment, { children: [_jsx(Box, { flexShrink: 0, width: INSTALLS_WIDTH, children: _jsx(Text, { bold: true, dimColor: true, children: "Installs" }) }), _jsx(Box, { flexShrink: 0, width: STARS_WIDTH, children: _jsx(Text, { bold: true, dimColor: true, children: "Stars" }) })] })), _jsx(Box, { flexShrink: 0, width: STATUS_WIDTH, children: _jsx(Text, { bold: true, dimColor: true, children: "Status" }) })] }), aboveCount > 0 && _jsxs(Text, { dimColor: true, children: [" \u25B2 ", aboveCount, " more above"] }), visibleItems.map(({ index, item }) => {
|
|
69
|
+
const expandedLines = expandedAsset
|
|
70
|
+
? computeExpandedLines(expandedAsset, webUrl, isItemFrozen(expandedAsset), terminalWidth)
|
|
71
|
+
: 0;
|
|
72
|
+
const shown = fitListWindow({
|
|
73
|
+
count: items.length,
|
|
74
|
+
cursorIndex,
|
|
75
|
+
expandedIndex,
|
|
76
|
+
expandedLines,
|
|
77
|
+
scrollOffset,
|
|
78
|
+
viewportHeight,
|
|
79
|
+
});
|
|
80
|
+
return (_jsxs(Box, { borderColor: 'gray', borderStyle: 'round', flexDirection: 'column', children: [_jsxs(Box, { children: [_jsx(Box, { flexShrink: 0, width: cols.cursor, children: _jsx(Text, { children: " " }) }), _jsx(Box, { flexShrink: 0, marginRight: NAME_GAP, width: nameWidth, children: _jsx(Text, { bold: true, dimColor: true, children: "Name" }) }), showOrg && (_jsx(Box, { flexShrink: 0, width: orgWidth, children: _jsx(Text, { bold: true, dimColor: true, children: "Org" }) })), showType && (_jsx(Box, { flexShrink: 0, width: typeWidth, children: _jsx(Text, { bold: true, dimColor: true, children: "Type" }) })), showScope && (_jsx(Box, { flexShrink: 0, width: SCOPE_WIDTH, children: _jsx(Text, { bold: true, dimColor: true, children: "Scope" }) })), _jsx(Box, { flexShrink: 0, width: versionWidth, children: _jsx(Text, { bold: true, dimColor: true, children: "Version" }) }), showInstalls && (_jsxs(_Fragment, { children: [_jsx(Box, { flexShrink: 0, width: INSTALLS_WIDTH, children: _jsx(Text, { bold: true, dimColor: true, children: "Installs" }) }), _jsx(Box, { flexShrink: 0, width: STARS_WIDTH, children: _jsx(Text, { bold: true, dimColor: true, children: "Stars" }) })] })), _jsx(Box, { flexShrink: 0, width: STATUS_WIDTH, children: _jsx(Text, { bold: true, dimColor: true, children: "Status" }) })] }), shown.start > 0 && _jsxs(Text, { dimColor: true, children: [" \u25B2 ", shown.start, " more above"] }), shown.indexes.map((index) => {
|
|
81
|
+
const item = items[index];
|
|
90
82
|
const isCursor = index === cursorIndex;
|
|
91
83
|
const isExpanded = index === expandedIndex;
|
|
92
84
|
const assetKey = listRowKey(item);
|
|
93
85
|
const latestVersion = outdatedMap.get(assetKey);
|
|
94
86
|
const isOutdated = latestVersion !== undefined;
|
|
95
|
-
return (_jsxs(Box, { flexDirection: 'column', children: [_jsxs(Box, { children: [_jsx(Box, { flexShrink: 0, width: cols.cursor, children: _jsx(Text, { color: 'cyan', children: isCursor ? ' ▸' : ' ' }) }), _jsx(Box, { flexShrink: 0, marginRight: NAME_GAP, width: nameWidth, children: _jsx(Text, { bold: isCursor, color: 'cyan', wrap: 'truncate', children: showOrg ? item.name : formatOrgName(item.org, item.name) }) }), showOrg && (_jsx(Box, { flexShrink: 0, width: orgWidth, children: _jsx(Text, { dimColor: true, wrap: 'truncate', children: item.org ? `@${item.org}` : '' }) })), showType && (_jsx(Box, { flexShrink: 0, width: typeWidth, children: _jsx(Text, { wrap: 'truncate', children: item.type }) })), showScope && (_jsx(Box, { flexShrink: 0, width: SCOPE_WIDTH, children: _jsx(Text, { dimColor: item.scope === 'project', wrap: 'truncate', children: item.scope }) })), _jsx(Box, { flexShrink: 0, width: versionWidth, children: isOutdated ? (_jsxs(Text, { wrap: 'truncate', children: [item.version, ' ', _jsxs(Text, { color: 'yellow', children: ['→', " ", latestVersion] })] })) : (_jsx(Text, { wrap: 'truncate', children: item.version })) }), showInstalls && (_jsxs(_Fragment, { children: [_jsx(Box, { flexShrink: 0, width: INSTALLS_WIDTH, children: _jsx(Text, { wrap: 'truncate', children: formatCountOrBlank(countsMap?.get(assetKey)?.installs) }) }), _jsx(Box, { flexShrink: 0, width: STARS_WIDTH, children: _jsx(Text, { wrap: 'truncate', children: formatCountOrBlank(countsMap?.get(assetKey)?.stars) }) })] })), _jsx(Box, { flexShrink: 0, width: STATUS_WIDTH, children: _jsxs(Text, { wrap: 'truncate', children: [item.pinnedVersion ? '📌' : '', isItemFrozen(item) ? '🧊' : ''] }) })] }), isExpanded && (_jsx(ListExpandedRow, { asset: item, frozen: isItemFrozen(item), latestVersion: latestVersion, terminalWidth: terminalWidth, webUrl: webUrl }))] }, assetKey));
|
|
96
|
-
}),
|
|
87
|
+
return (_jsxs(Box, { flexDirection: 'column', children: [_jsxs(Box, { children: [_jsx(Box, { flexShrink: 0, width: cols.cursor, children: _jsx(Text, { color: 'cyan', children: isCursor ? ' ▸' : ' ' }) }), _jsx(Box, { flexShrink: 0, marginRight: NAME_GAP, width: nameWidth, children: _jsx(Text, { bold: isCursor, color: 'cyan', wrap: 'truncate', children: showOrg ? item.name : formatOrgName(item.org, item.name) }) }), showOrg && (_jsx(Box, { flexShrink: 0, width: orgWidth, children: _jsx(Text, { dimColor: true, wrap: 'truncate', children: item.org ? `@${item.org}` : '' }) })), showType && (_jsx(Box, { flexShrink: 0, width: typeWidth, children: _jsx(Text, { wrap: 'truncate', children: item.type }) })), showScope && (_jsx(Box, { flexShrink: 0, width: SCOPE_WIDTH, children: _jsx(Text, { dimColor: item.scope === 'project', wrap: 'truncate', children: item.scope }) })), _jsx(Box, { flexShrink: 0, width: versionWidth, children: isOutdated ? (_jsxs(Text, { wrap: 'truncate', children: [item.version, ' ', _jsxs(Text, { color: 'yellow', children: ['→', " ", latestVersion] })] })) : (_jsx(Text, { wrap: 'truncate', children: item.version })) }), showInstalls && (_jsxs(_Fragment, { children: [_jsx(Box, { flexShrink: 0, width: INSTALLS_WIDTH, children: _jsx(Text, { wrap: 'truncate', children: formatCountOrBlank(countsMap?.get(assetKey)?.installs) }) }), _jsx(Box, { flexShrink: 0, width: STARS_WIDTH, children: _jsx(Text, { wrap: 'truncate', children: formatCountOrBlank(countsMap?.get(assetKey)?.stars) }) })] })), _jsx(Box, { flexShrink: 0, width: STATUS_WIDTH, children: _jsxs(Text, { wrap: 'truncate', children: [item.pinnedVersion ? '📌' : '', isItemFrozen(item) ? '🧊' : ''] }) })] }), isExpanded && (_jsx(CutDetail, { lines: shown.detailLines, total: expandedLines, children: _jsx(ListExpandedRow, { asset: item, frozen: isItemFrozen(item), latestVersion: latestVersion, terminalWidth: terminalWidth, webUrl: webUrl }) }))] }, assetKey));
|
|
88
|
+
}), shown.below > 0 && _jsxs(Text, { dimColor: true, children: [" \u25BC ", shown.below, " more below"] })] }));
|
|
97
89
|
}
|
|
98
90
|
/** A row's installs or stars; blank for an asset the registry no longer has. */
|
|
99
91
|
function formatCountOrBlank(count) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ListBrowseList.js","sourceRoot":"","sources":["../../src/components/ListBrowseList.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAEhC,OAAO,EAAgB,UAAU,EAAuB,MAAM,0BAA0B,CAAC;AACzF,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AACtD,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAC9C,OAAO,EAAE,WAAW,EAAmB,MAAM,iBAAiB,CAAC;AAC/D,OAAO,eAAe,EAAE,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAE7E;;;;GAIG;AACH,MAAM,aAAa,GAAG;IACpB,MAAM,EAAE,EAAE,M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AE,GAAG,CAAC,QAAQ,CAAC,EAAE,KAAK,CAAC,GAAQ,GAC9E,IACL,CACJ,EACD,KAAC,GAAG,IAAC,UAAU,EAAE,CAAC,EAAE,KAAK,EAAE,YAAY,YACrC,MAAC,IAAI,IAAC,IAAI,EAAC,UAAU,aAClB,IAAI,CAAC,aAAa,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAC9B,YAAY,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,IAC1B,GACH,IACF,EACL,UAAU,IAAI,CACb,KAAC,SAAS,IAAC,KAAK,EAAE,KAAK,CAAC,WAAW,EAAE,KAAK,EAAE,aAAa,YACvD,KAAC,eAAe,IACd,KAAK,EAAE,IAAI,EACX,MAAM,EAAE,YAAY,CAAC,IAAI,CAAC,EAC1B,aAAa,EAAE,aAAa,EAC5B,aAAa,EAAE,aAAa,EAC5B,MAAM,EAAE,MAAM,GACd,GACQ,CACb,KApE8B,QAAQ,CAqEnC,CACP,CAAC;YACJ,CAAC,CAAC,EACD,KAAK,CAAC,KAAK,GAAG,CAAC,IAAI,MAAC,IAAI,IAAC,QAAQ,+BAAK,KAAK,CAAC,KAAK,mBAAmB,IACjE,CACP,CAAC;AACJ,CAAC;AAED,gFAAgF;AAChF,SAAS,kBAAkB,CAAC,KAAyB;IACnD,OAAO,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;AACvD,CAAC"}
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
interface ListHelpBarProps {
|
|
2
|
-
/** Whether the current asset supports actions (has a selected asset) */
|
|
3
|
-
canAct: boolean;
|
|
4
2
|
/** Whether the current row is expanded */
|
|
5
3
|
expanded: boolean;
|
|
6
4
|
/** Whether the project has an org configured */
|
|
7
5
|
hasOrg?: boolean;
|
|
8
|
-
/** Whether any installed assets have available updates */
|
|
9
|
-
hasOutdated: boolean;
|
|
10
6
|
/** Current input mode */
|
|
11
7
|
inputMode: 'filter' | 'navigate';
|
|
12
8
|
/** Whether the currently selected asset is frozen */
|
|
13
9
|
isFrozen: boolean;
|
|
14
10
|
/** Whether the currently selected asset is pinned */
|
|
15
11
|
isPinned: boolean;
|
|
12
|
+
/** Terminal width, which the line fits */
|
|
13
|
+
terminalWidth: number;
|
|
16
14
|
}
|
|
17
|
-
export default function ListHelpBar(
|
|
15
|
+
export default function ListHelpBar(props: ListHelpBarProps): import("react").JSX.Element;
|
|
16
|
+
/** The list help bar's line, fitted to `terminalWidth` (see `fitHints`). */
|
|
17
|
+
export declare function listHelpBarText({ expanded, hasOrg, inputMode, isFrozen, isPinned, terminalWidth, }: ListHelpBarProps): string;
|
|
18
18
|
export {};
|
|
19
19
|
//# sourceMappingURL=ListHelpBar.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ListHelpBar.d.ts","sourceRoot":"","sources":["../../src/components/ListHelpBar.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ListHelpBar.d.ts","sourceRoot":"","sources":["../../src/components/ListHelpBar.tsx"],"names":[],"mappings":"AAIA,UAAU,gBAAgB;IACxB,0CAA0C;IAC1C,QAAQ,EAAE,OAAO,CAAC;IAClB,gDAAgD;IAChD,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,yBAAyB;IACzB,SAAS,EAAE,QAAQ,GAAG,UAAU,CAAC;IACjC,qDAAqD;IACrD,QAAQ,EAAE,OAAO,CAAC;IAClB,qDAAqD;IACrD,QAAQ,EAAE,OAAO,CAAC;IAClB,0CAA0C;IAC1C,aAAa,EAAE,MAAM,CAAC;CACvB;AAED,MAAM,CAAC,OAAO,UAAU,WAAW,CAAC,KAAK,EAAE,gBAAgB,+BAQ1D;AAWD,4EAA4E;AAC5E,wBAAgB,eAAe,CAAC,EAC9B,QAAQ,EACR,MAAc,EACd,SAAS,EACT,QAAQ,EACR,QAAQ,EACR,aAAa,GACd,EAAE,gBAAgB,GAAG,MAAM,CAgB3B"}
|
|
@@ -1,11 +1,34 @@
|
|
|
1
|
-
import { jsx as _jsx
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { Box, Text } from 'ink';
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
3
|
+
import { filterModeText, fitHints } from './HelpBar.js';
|
|
4
|
+
export default function ListHelpBar(props) {
|
|
5
|
+
return (_jsx(Box, { borderColor: 'gray', borderStyle: 'round', children: _jsx(Text, { dimColor: true, wrap: 'truncate-end', children: listHelpBarText(props) }) }));
|
|
6
|
+
}
|
|
7
|
+
/** At narrow widths the view hints go first: the filter bar shows the type tabs, the sort and the org scope. */
|
|
8
|
+
const LIST_STEPS = [
|
|
9
|
+
{ drop: 'navigate' },
|
|
10
|
+
{ drop: 'type' },
|
|
11
|
+
{ drop: 'sort' },
|
|
12
|
+
{ drop: 'org' },
|
|
13
|
+
{ drop: 'update' },
|
|
14
|
+
];
|
|
15
|
+
/** The list help bar's line, fitted to `terminalWidth` (see `fitHints`). */
|
|
16
|
+
export function listHelpBarText({ expanded, hasOrg = false, inputMode, isFrozen, isPinned, terminalWidth, }) {
|
|
17
|
+
if (inputMode === 'filter')
|
|
18
|
+
return filterModeText(terminalWidth);
|
|
19
|
+
const hints = [
|
|
20
|
+
{ id: 'navigate', text: '↑↓ navigate' },
|
|
21
|
+
{ id: 'filter', text: '/: filter' },
|
|
22
|
+
{ id: 'type', text: 'Tab: type' },
|
|
23
|
+
{ id: 'sort', text: 's: sort' },
|
|
24
|
+
...(hasOrg ? [{ id: 'org', text: 'o: org' }] : []),
|
|
25
|
+
{ id: 'expand', text: expanded ? 'Esc: collapse' : 'Enter: expand' },
|
|
26
|
+
{ id: 'update', text: 'u: update' },
|
|
27
|
+
{ id: 'uninstall', text: 'x: uninstall' },
|
|
28
|
+
{ id: 'pin', text: `p: ${isPinned ? 'unpin' : 'pin'}` },
|
|
29
|
+
{ id: 'freeze', text: `f: ${isFrozen ? 'thaw' : 'freeze'}` },
|
|
30
|
+
{ id: 'quit', text: 'q: quit' },
|
|
31
|
+
];
|
|
32
|
+
return fitHints(hints, LIST_STEPS, terminalWidth);
|
|
10
33
|
}
|
|
11
34
|
//# sourceMappingURL=ListHelpBar.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ListHelpBar.js","sourceRoot":"","sources":["../../src/components/ListHelpBar.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"ListHelpBar.js","sourceRoot":"","sources":["../../src/components/ListHelpBar.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAEhC,OAAO,EAAE,cAAc,EAAE,QAAQ,EAA+B,MAAM,cAAc,CAAC;AAiBrF,MAAM,CAAC,OAAO,UAAU,WAAW,CAAC,KAAuB;IACzD,OAAO,CACL,KAAC,GAAG,IAAC,WAAW,EAAC,MAAM,EAAC,WAAW,EAAC,OAAO,YACzC,KAAC,IAAI,IAAC,QAAQ,QAAC,IAAI,EAAC,cAAc,YAC/B,eAAe,CAAC,KAAK,CAAC,GAClB,GACH,CACP,CAAC;AACJ,CAAC;AAED,gHAAgH;AAChH,MAAM,UAAU,GAAwB;IACtC,EAAE,IAAI,EAAE,UAAU,EAAE;IACpB,EAAE,IAAI,EAAE,MAAM,EAAE;IAChB,EAAE,IAAI,EAAE,MAAM,EAAE;IAChB,EAAE,IAAI,EAAE,KAAK,EAAE;IACf,EAAE,IAAI,EAAE,QAAQ,EAAE;CACnB,CAAC;AAEF,4EAA4E;AAC5E,MAAM,UAAU,eAAe,CAAC,EAC9B,QAAQ,EACR,MAAM,GAAG,KAAK,EACd,SAAS,EACT,QAAQ,EACR,QAAQ,EACR,aAAa,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oxProps {
|
|
4
|
+
children: ReactNode;
|
|
5
|
+
/** Draw only the rows measured so far; false draws everything at once */
|
|
6
|
+
clip?: boolean;
|
|
7
|
+
/** The ref {@link useMeasuredRows} measures: the children's own height, whatever is drawn */
|
|
8
|
+
measureRef: RefObject<DOMElement | null>;
|
|
9
|
+
/** The rows {@link useMeasuredRows} measured */
|
|
10
|
+
rows: number;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* A block a full-screen screen budgets rows for (the shell's header, banner and notices, a warning). It draws only
|
|
14
|
+
* the rows already measured, so when it grows, the new rows show one render later, together with the room the screen
|
|
15
|
+
* makes for them. Drawn at once, they would make one frame as tall as the terminal, and Ink clears the terminal on
|
|
16
|
+
* the render after such a frame (ATK-961).
|
|
17
|
+
*/
|
|
18
|
+
export default function MeasuredBox({ children, clip, measureRef, rows }: MeasuredBoxProps): import("react").JSX.Element;
|
|
19
|
+
export {};
|
|
20
|
+
//# sourceMappingURL=MeasuredBox.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MeasuredBox.d.ts","sourceRoot":"","sources":["../../src/components/MeasuredBox.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAElD,OAAO,EAAO,KAAK,UAAU,EAAE,MAAM,KAAK,CAAC;AAE3C,UAAU,gBAAgB;IACxB,QAAQ,EAAE,SAAS,CAAC;IACpB,yEAAyE;IACzE,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,6FAA6F;IAC7F,UAAU,EAAE,SAAS,CAAC,UAAU,GAAG,IAAI,CAAC,CAAC;IACzC,gDAAgD;IAChD,IAAI,EAAE,MAAM,CAAC;CACd;AAED;;;;;GAKG;AACH,MAAM,CAAC,OAAO,UAAU,WAAW,CAAC,EAAE,QAAQ,EAAE,IAAW,EAAE,UAAU,EAAE,IAAI,EAAE,EAAE,gBAAgB,+BAgBhG"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Box } from 'ink';
|
|
3
|
+
/**
|
|
4
|
+
* A block a full-screen screen budgets rows for (the shell's header, banner and notices, a warning). It draws only
|
|
5
|
+
* the rows already measured, so when it grows, the new rows show one render later, together with the room the screen
|
|
6
|
+
* makes for them. Drawn at once, they would make one frame as tall as the terminal, and Ink clears the terminal on
|
|
7
|
+
* the render after such a frame (ATK-961).
|
|
8
|
+
*/
|
|
9
|
+
export default function MeasuredBox({ children, clip = true, measureRef, rows }) {
|
|
10
|
+
// Clipped, the children sit out of the flow, full width: Yoga gives a box in a 0-row parent no height at all, but an
|
|
11
|
+
// absolute one keeps its own, which the clip hides until the screen has room for it
|
|
12
|
+
return (_jsx(Box, { flexDirection: 'column', flexShrink: 0, height: clip ? rows : undefined, overflow: 'hidden', children: _jsx(Box, { flexDirection: 'column', flexShrink: 0, position: clip ? 'absolute' : 'relative', ref: measureRef, width: '100%', children: children }) }));
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=MeasuredBox.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MeasuredBox.js","sourceRoot":"","sources":["../../src/components/MeasuredBox.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAE,GAAG,EAAmB,MAAM,KAAK,CAAC;AAY3C;;;;;GAKG;AACH,MAAM,CAAC,OAAO,UAAU,WAAW,CAAC,EAAE,QAAQ,EAAE,IAAI,GAAG,IAAI,EAAE,UAAU,EAAE,IAAI,EAAoB;IAC/F,qHAAqH;IACrH,oFAAoF;IACpF,OAAO,CACL,KAAC,GAAG,IAAC,aAAa,EAAC,QAAQ,EAAC,UAAU,EAAE,CAAC,EAAE,MAAM,EAAE,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS,EAAE,QAAQ,EAAC,QAAQ,YAC3F,KAAC,GAAG,IACF,aAAa,EAAC,QAAQ,EACtB,UAAU,EAAE,CAAC,EACb,QAAQ,EAAE,IAAI,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,UAAU,EACxC,GAAG,EAAE,UAAU,EACf,KAAK,EAAC,MAAM,YAEX,QAAQ,GACL,GACF,CACP,CAAC;AACJ,CAAC"}
|