forge-terminal 0.1.0 → 0.2.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/README.md +333 -24
- package/dist/chunks/adm-zip-SQKLKBDP.js +3 -0
- package/dist/chunks/available-HEUREG6L.js +3 -0
- package/dist/chunks/boot-BUGERSEB.js +3 -0
- package/dist/chunks/catalog-NTACQH5V.js +3 -0
- package/dist/chunks/cfb-V6M2PYOD.js +13 -0
- package/dist/chunks/chunk-2WYHI73Y.js +3 -0
- package/dist/chunks/chunk-4YCO7S4K.js +3 -0
- package/dist/chunks/chunk-5B7WODWH.js +3 -0
- package/dist/chunks/chunk-C2WYXNRM.js +4 -0
- package/dist/chunks/chunk-C7OOWUMU.js +3 -0
- package/dist/chunks/chunk-EOYBXOCV.js +4 -0
- package/dist/chunks/chunk-G2D6BKOS.js +4 -0
- package/dist/chunks/chunk-HUAEVW2A.js +3 -0
- package/dist/chunks/chunk-J7FLFHQJ.js +3 -0
- package/dist/chunks/chunk-L76Q54MB.js +3 -0
- package/dist/chunks/chunk-LFE3WRU4.js +3 -0
- package/dist/chunks/chunk-PBIS2ONZ.js +3 -0
- package/dist/chunks/chunk-PD5DFBCU.js +3 -0
- package/dist/chunks/chunk-PN73WK2S.js +3 -0
- package/dist/chunks/chunk-QVACE4IE.js +3 -0
- package/dist/chunks/chunk-TEGB7JRM.js +3 -0
- package/dist/chunks/chunk-TMUK2DD3.js +3 -0
- package/dist/chunks/chunk-UNVHKJW4.js +41 -0
- package/dist/chunks/chunk-VH5RWPGZ.js +10 -0
- package/dist/chunks/chunk-XFEHJ4C7.js +3 -0
- package/dist/chunks/chunk-YXDEOLNA.js +3 -0
- package/dist/chunks/colour-DE6N6AZO.js +3 -0
- package/dist/chunks/config-command-SQXRTBRO.js +3 -0
- package/dist/chunks/dist-J2V6ITHG.js +29 -0
- package/dist/chunks/es-T2U7NBLD.js +3 -0
- package/dist/chunks/execute-M3C3TTWB.js +3 -0
- package/dist/chunks/extensions-command-HJDBUBYO.js +3 -0
- package/dist/chunks/image-GYUUMS6H.js +3 -0
- package/dist/chunks/launch-WBUFRVQ7.js +65 -0
- package/dist/chunks/lib-TPEJ5CJJ.js +46 -0
- package/dist/chunks/lock-XD4L3WFM.js +3 -0
- package/dist/chunks/manager-KBJTXZ27.js +4 -0
- package/dist/chunks/paths-JUM6GKQU.js +3 -0
- package/dist/chunks/pdf-compress-IMRFBLZF.js +3 -0
- package/dist/chunks/react-devtools-core-UM4FS6CU.js +3 -0
- package/dist/chunks/run-RXVQD4DZ.js +4 -0
- package/dist/chunks/server-DU7QWDAH.js +73 -0
- package/dist/chunks/theme-DESCJOCE.js +3 -0
- package/dist/chunks/word-OGQ2KZAJ.js +24 -0
- package/dist/index.js +67 -95
- package/dist/third-party-licenses.txt +2856 -0
- package/package.json +28 -21
- package/skills/forge/SKILL.md +149 -0
- package/dist/cli/args.js +0 -278
- package/dist/cli/args.js.map +0 -1
- package/dist/cli/config-command.js +0 -55
- package/dist/cli/config-command.js.map +0 -1
- package/dist/cli/execute.js +0 -377
- package/dist/cli/execute.js.map +0 -1
- package/dist/cli/report.js +0 -123
- package/dist/cli/report.js.map +0 -1
- package/dist/cli/spinner.js +0 -60
- package/dist/cli/spinner.js.map +0 -1
- package/dist/cli/stdin.js +0 -47
- package/dist/cli/stdin.js.map +0 -1
- package/dist/config/preferences.js +0 -143
- package/dist/config/preferences.js.map +0 -1
- package/dist/core/actions/compress.js +0 -157
- package/dist/core/actions/compress.js.map +0 -1
- package/dist/core/actions/convert.js +0 -270
- package/dist/core/actions/convert.js.map +0 -1
- package/dist/core/actions/extract.js +0 -94
- package/dist/core/actions/extract.js.map +0 -1
- package/dist/core/actions/index.js +0 -23
- package/dist/core/actions/index.js.map +0 -1
- package/dist/core/actions/merge.js +0 -16
- package/dist/core/actions/merge.js.map +0 -1
- package/dist/core/actions/rotate.js +0 -36
- package/dist/core/actions/rotate.js.map +0 -1
- package/dist/core/actions/split.js +0 -65
- package/dist/core/actions/split.js.map +0 -1
- package/dist/core/atomic.js +0 -61
- package/dist/core/atomic.js.map +0 -1
- package/dist/core/capabilities.js +0 -59
- package/dist/core/capabilities.js.map +0 -1
- package/dist/core/compress.js +0 -76
- package/dist/core/compress.js.map +0 -1
- package/dist/core/describe.js +0 -49
- package/dist/core/describe.js.map +0 -1
- package/dist/core/errors.js +0 -469
- package/dist/core/errors.js.map +0 -1
- package/dist/core/execute-jobs.js +0 -122
- package/dist/core/execute-jobs.js.map +0 -1
- package/dist/core/formats.js +0 -108
- package/dist/core/formats.js.map +0 -1
- package/dist/core/order.js +0 -44
- package/dist/core/order.js.map +0 -1
- package/dist/core/output-path.js +0 -176
- package/dist/core/output-path.js.map +0 -1
- package/dist/core/pages.js +0 -107
- package/dist/core/pages.js.map +0 -1
- package/dist/core/pdf-compress.js +0 -206
- package/dist/core/pdf-compress.js.map +0 -1
- package/dist/core/plan.js +0 -42
- package/dist/core/plan.js.map +0 -1
- package/dist/core/resolve.js +0 -115
- package/dist/core/resolve.js.map +0 -1
- package/dist/core/run.js +0 -66
- package/dist/core/run.js.map +0 -1
- package/dist/core/suggest.js +0 -50
- package/dist/core/suggest.js.map +0 -1
- package/dist/core/types.js +0 -2
- package/dist/core/types.js.map +0 -1
- package/dist/core/units.js +0 -94
- package/dist/core/units.js.map +0 -1
- package/dist/core/write-safety.js +0 -128
- package/dist/core/write-safety.js.map +0 -1
- package/dist/engines/heic.js +0 -166
- package/dist/engines/heic.js.map +0 -1
- package/dist/engines/image.js +0 -342
- package/dist/engines/image.js.map +0 -1
- package/dist/engines/pdf.js +0 -444
- package/dist/engines/pdf.js.map +0 -1
- package/dist/engines/pdfium.js +0 -161
- package/dist/engines/pdfium.js.map +0 -1
- package/dist/engines/registry.js +0 -65
- package/dist/engines/registry.js.map +0 -1
- package/dist/engines/types.js +0 -2
- package/dist/engines/types.js.map +0 -1
- package/dist/engines/word.js +0 -385
- package/dist/engines/word.js.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/shell/App.js +0 -1972
- package/dist/shell/App.js.map +0 -1
- package/dist/shell/ClickTargets.js +0 -183
- package/dist/shell/ClickTargets.js.map +0 -1
- package/dist/shell/ThemeContext.js +0 -21
- package/dist/shell/ThemeContext.js.map +0 -1
- package/dist/shell/blocks.js +0 -160
- package/dist/shell/blocks.js.map +0 -1
- package/dist/shell/clipboard.js +0 -64
- package/dist/shell/clipboard.js.map +0 -1
- package/dist/shell/commands.js +0 -51
- package/dist/shell/commands.js.map +0 -1
- package/dist/shell/components/Banner.js +0 -73
- package/dist/shell/components/Banner.js.map +0 -1
- package/dist/shell/components/CommandPalette.js +0 -37
- package/dist/shell/components/CommandPalette.js.map +0 -1
- package/dist/shell/components/FileCard.js +0 -59
- package/dist/shell/components/FileCard.js.map +0 -1
- package/dist/shell/components/HintBar.js +0 -18
- package/dist/shell/components/HintBar.js.map +0 -1
- package/dist/shell/components/Hints.js +0 -21
- package/dist/shell/components/Hints.js.map +0 -1
- package/dist/shell/components/MergeList.js +0 -268
- package/dist/shell/components/MergeList.js.map +0 -1
- package/dist/shell/components/ModeHeader.js +0 -21
- package/dist/shell/components/ModeHeader.js.map +0 -1
- package/dist/shell/components/PageGrid.js +0 -324
- package/dist/shell/components/PageGrid.js.map +0 -1
- package/dist/shell/components/PathInput.js +0 -147
- package/dist/shell/components/PathInput.js.map +0 -1
- package/dist/shell/components/Progress.js +0 -43
- package/dist/shell/components/Progress.js.map +0 -1
- package/dist/shell/components/Prompt.js +0 -667
- package/dist/shell/components/Prompt.js.map +0 -1
- package/dist/shell/components/ResultLinks.js +0 -26
- package/dist/shell/components/ResultLinks.js.map +0 -1
- package/dist/shell/components/Select.js +0 -152
- package/dist/shell/components/Select.js.map +0 -1
- package/dist/shell/components/Slider.js +0 -48
- package/dist/shell/components/Slider.js.map +0 -1
- package/dist/shell/components/StagedFiles.js +0 -92
- package/dist/shell/components/StagedFiles.js.map +0 -1
- package/dist/shell/components/ThemePicker.js +0 -18
- package/dist/shell/components/ThemePicker.js.map +0 -1
- package/dist/shell/components/UnitRow.js +0 -30
- package/dist/shell/components/UnitRow.js.map +0 -1
- package/dist/shell/flows/pdf.js +0 -424
- package/dist/shell/flows/pdf.js.map +0 -1
- package/dist/shell/frame-geometry.js +0 -56
- package/dist/shell/frame-geometry.js.map +0 -1
- package/dist/shell/hyperlink.js +0 -27
- package/dist/shell/hyperlink.js.map +0 -1
- package/dist/shell/intro.js +0 -101
- package/dist/shell/intro.js.map +0 -1
- package/dist/shell/launch.js +0 -75
- package/dist/shell/launch.js.map +0 -1
- package/dist/shell/mark.js +0 -134
- package/dist/shell/mark.js.map +0 -1
- package/dist/shell/mouse.js +0 -209
- package/dist/shell/mouse.js.map +0 -1
- package/dist/shell/redraw.js +0 -36
- package/dist/shell/redraw.js.map +0 -1
- package/dist/shell/reveal.js +0 -24
- package/dist/shell/reveal.js.map +0 -1
- package/dist/shell/stage.js +0 -34
- package/dist/shell/stage.js.map +0 -1
- package/dist/shell/terminal-write.js +0 -16
- package/dist/shell/terminal-write.js.map +0 -1
- package/dist/shell/theme.js +0 -178
- package/dist/shell/theme.js.map +0 -1
- package/dist/shell/useFrameOrigin.js +0 -175
- package/dist/shell/useFrameOrigin.js.map +0 -1
- package/dist/shell/useKeys.js +0 -28
- package/dist/shell/useKeys.js.map +0 -1
- package/dist/shell/useMouse.js +0 -150
- package/dist/shell/useMouse.js.map +0 -1
- package/dist/shell/useMouseRouting.js +0 -69
- package/dist/shell/useMouseRouting.js.map +0 -1
- package/dist/shell/width.js +0 -62
- package/dist/shell/width.js.map +0 -1
- package/dist/utils/display-path.js +0 -31
- package/dist/utils/display-path.js.map +0 -1
- package/dist/utils/unescape-path.js +0 -68
- package/dist/utils/unescape-path.js.map +0 -1
|
@@ -1,324 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { Box, Text } from 'ink';
|
|
3
|
-
import { useRef, useState } from 'react';
|
|
4
|
-
import { useTheme } from '../ThemeContext.js';
|
|
5
|
-
import { colourProp, SYMBOLS } from '../theme.js';
|
|
6
|
-
import { useKeys } from '../useKeys.js';
|
|
7
|
-
const GAP = 3; // columns between cells, on all three lines
|
|
8
|
-
/**
|
|
9
|
-
* How the grid fits the terminal.
|
|
10
|
-
*
|
|
11
|
-
* `cellWidth` is fixed by the *document's* largest page number, not the
|
|
12
|
-
* visible page's, so the grid does not resize under the cursor when paging
|
|
13
|
-
* past 99.
|
|
14
|
-
*/
|
|
15
|
-
export function gridLayout(pageCount, width, height) {
|
|
16
|
-
const cellWidth = String(pageCount).length + 4; // '│', pad, digits, ' ', '│'
|
|
17
|
-
const usable = Math.max(cellWidth, width - 4);
|
|
18
|
-
const perRow = Math.max(1, Math.floor((usable + GAP) / (cellWidth + GAP)));
|
|
19
|
-
// Three lines a row, plus header, footer, hints and the prompt below.
|
|
20
|
-
const rowsPerPage = Math.max(1, Math.floor((height - 8) / 3));
|
|
21
|
-
return { perRow, rowsPerPage, cellWidth };
|
|
22
|
-
}
|
|
23
|
-
/**
|
|
24
|
-
* Every page of the document as a small framed cell, with two cursor modes:
|
|
25
|
-
*
|
|
26
|
-
* - `cell` — the cursor sits on a page; space selects it. Used by extract
|
|
27
|
-
* and delete. A selected page is marked in its top border (`╭─✓─╮`).
|
|
28
|
-
* - `gap` — the cursor sits between two pages; space cuts there. Used by
|
|
29
|
-
* split. `┃` is a cut, `┆` is an uncut gap. Never `✂` — `string-width`
|
|
30
|
-
* reports it as one column, but it is a Dingbat that many terminals give
|
|
31
|
-
* emoji presentation at two, which would shear the row exactly like a
|
|
32
|
-
* mis-sized card.
|
|
33
|
-
*
|
|
34
|
-
* `selected`/`cuts` are seeded from props once, the way an uncontrolled
|
|
35
|
-
* input takes a `defaultValue` — there is no `onChange`, only `onSubmit` on
|
|
36
|
-
* Enter, so after mount this component is the arrays' sole owner.
|
|
37
|
-
*
|
|
38
|
-
* In gap mode, a row is `cell gap cell gap … cell gap` — every cell gets a
|
|
39
|
-
* gap immediately after it, including a trailing one after the row's last
|
|
40
|
-
* cell that reaches the first page of the next row. That trailing gap is
|
|
41
|
-
* the row-boundary cut point: without it, a page count that does not divide
|
|
42
|
-
* evenly into whole rows would have cut positions no cursor could ever
|
|
43
|
-
* reach. The one row that omits it is whichever row holds the document's
|
|
44
|
-
* very last page, since there is no next page left to cut against. Cursor
|
|
45
|
-
* columns line up with gaps this way too — column `c` in gap mode is always
|
|
46
|
-
* "the gap after cell `c`" — so right-arrow off a row's last gap and
|
|
47
|
-
* left-arrow off a row's first gap simply continue into the neighbouring
|
|
48
|
-
* row rather than clamping, the one place this component's cursor wraps.
|
|
49
|
-
*/
|
|
50
|
-
export function PageGrid({ mode, pageCount, selected: initialSelected, cuts: initialCuts, onSubmit, onCancel, onToggleView, width, height, }) {
|
|
51
|
-
const palette = useTheme();
|
|
52
|
-
const { perRow, rowsPerPage, cellWidth } = gridLayout(pageCount, width, height);
|
|
53
|
-
const pagesPerScreen = Math.max(1, perRow * rowsPerPage);
|
|
54
|
-
const totalScreens = Math.max(1, Math.ceil(pageCount / pagesPerScreen));
|
|
55
|
-
const [selectedPages, setSelectedPages] = useState(initialSelected);
|
|
56
|
-
const [cutGaps, setCutGaps] = useState(initialCuts);
|
|
57
|
-
const [screen, setScreen] = useState(0);
|
|
58
|
-
const [cursor, setCursor] = useState({ row: 0, col: 0 });
|
|
59
|
-
/**
|
|
60
|
-
* `useInput` handlers are synchronous, but `useState` updates are not —
|
|
61
|
-
* several keypresses can be delivered through the same handler closure
|
|
62
|
-
* before React re-renders, so `useState` cannot be the source of truth for
|
|
63
|
-
* what to act on *right now* (see the same comment in `Select.tsx`). These
|
|
64
|
-
* refs are that source of truth; the `useState` pair above exists only to
|
|
65
|
-
* trigger a render with the latest value.
|
|
66
|
-
*/
|
|
67
|
-
const selectedRef = useRef(selectedPages);
|
|
68
|
-
const cutsRef = useRef(cutGaps);
|
|
69
|
-
const screenRef = useRef(screen);
|
|
70
|
-
const cursorRef = useRef(cursor);
|
|
71
|
-
const visibleCount = (s) => Math.min(pagesPerScreen, Math.max(0, pageCount - s * pagesPerScreen));
|
|
72
|
-
const rowsInScreen = (s) => Math.max(1, Math.ceil(visibleCount(s) / perRow));
|
|
73
|
-
const cellsInRow = (r, s) => Math.max(0, Math.min(perRow, visibleCount(s) - r * perRow));
|
|
74
|
-
/** Whether this row's last cell has a next page to cut against. */
|
|
75
|
-
const hasTrailingGap = (r, s) => {
|
|
76
|
-
const n = cellsInRow(r, s);
|
|
77
|
-
if (n === 0)
|
|
78
|
-
return false;
|
|
79
|
-
const lastPageIndex = s * pagesPerScreen + r * perRow + (n - 1);
|
|
80
|
-
return lastPageIndex < pageCount - 1;
|
|
81
|
-
};
|
|
82
|
-
/** Gaps in this row: one per cell, minus one unless the row has a trailing gap. */
|
|
83
|
-
const gapCount = (r, s) => {
|
|
84
|
-
const n = cellsInRow(r, s);
|
|
85
|
-
if (n === 0)
|
|
86
|
-
return 0;
|
|
87
|
-
return hasTrailingGap(r, s) ? n : Math.max(0, n - 1);
|
|
88
|
-
};
|
|
89
|
-
const maxCol = (r, s) => {
|
|
90
|
-
// cell mode: one cursor stop per cell. gap mode: one per gap (see
|
|
91
|
-
// `gapCount` — this is what makes the trailing, row-boundary gap a
|
|
92
|
-
// reachable cursor stop).
|
|
93
|
-
if (mode === 'cell')
|
|
94
|
-
return Math.max(0, cellsInRow(r, s) - 1);
|
|
95
|
-
return Math.max(0, gapCount(r, s) - 1);
|
|
96
|
-
};
|
|
97
|
-
const clampCursor = (row, col, s) => {
|
|
98
|
-
const r = Math.min(Math.max(row, 0), rowsInScreen(s) - 1);
|
|
99
|
-
const c = Math.min(Math.max(col, 0), maxCol(r, s));
|
|
100
|
-
return { row: r, col: c };
|
|
101
|
-
};
|
|
102
|
-
const moveCursor = (dRow, dCol) => {
|
|
103
|
-
const next = clampCursor(cursorRef.current.row + dRow, cursorRef.current.col + dCol, screenRef.current);
|
|
104
|
-
if (next.row === cursorRef.current.row && next.col === cursorRef.current.col)
|
|
105
|
-
return;
|
|
106
|
-
cursorRef.current = next;
|
|
107
|
-
setCursor(next);
|
|
108
|
-
};
|
|
109
|
-
const setCursorTo = (next) => {
|
|
110
|
-
cursorRef.current = next;
|
|
111
|
-
setCursor(next);
|
|
112
|
-
};
|
|
113
|
-
/**
|
|
114
|
-
* Left/right in gap mode continue into the neighbouring row rather than
|
|
115
|
-
* clamping at the row's edge — otherwise the trailing gap at the end of a
|
|
116
|
-
* row (the row-boundary cut point) would be a dead end you could reach
|
|
117
|
-
* but never leave, and the gap at the start of the next row would be
|
|
118
|
-
* unreachable by arrow key at all. Cell mode keeps the plain clamp: every
|
|
119
|
-
* cell already has its own reachable cursor stop, so there is nothing a
|
|
120
|
-
* wrap would add.
|
|
121
|
-
*/
|
|
122
|
-
const stepRight = () => {
|
|
123
|
-
if (mode !== 'gap') {
|
|
124
|
-
moveCursor(0, 1);
|
|
125
|
-
return;
|
|
126
|
-
}
|
|
127
|
-
const { row, col } = cursorRef.current;
|
|
128
|
-
const s = screenRef.current;
|
|
129
|
-
if (col < maxCol(row, s)) {
|
|
130
|
-
moveCursor(0, 1);
|
|
131
|
-
return;
|
|
132
|
-
}
|
|
133
|
-
if (row < rowsInScreen(s) - 1)
|
|
134
|
-
setCursorTo({ row: row + 1, col: 0 });
|
|
135
|
-
};
|
|
136
|
-
const stepLeft = () => {
|
|
137
|
-
if (mode !== 'gap') {
|
|
138
|
-
moveCursor(0, -1);
|
|
139
|
-
return;
|
|
140
|
-
}
|
|
141
|
-
const { row, col } = cursorRef.current;
|
|
142
|
-
const s = screenRef.current;
|
|
143
|
-
if (col > 0) {
|
|
144
|
-
moveCursor(0, -1);
|
|
145
|
-
return;
|
|
146
|
-
}
|
|
147
|
-
if (row > 0)
|
|
148
|
-
setCursorTo({ row: row - 1, col: maxCol(row - 1, s) });
|
|
149
|
-
};
|
|
150
|
-
const goToScreen = (s) => {
|
|
151
|
-
const next = Math.min(Math.max(s, 0), totalScreens - 1);
|
|
152
|
-
const alreadyHome = next === screenRef.current && cursorRef.current.row === 0 && cursorRef.current.col === 0;
|
|
153
|
-
// No-op at an end (pgup/pgdn already at the boundary, cursor already
|
|
154
|
-
// home): nothing moved, nothing to report — the same rule `Select.tsx`
|
|
155
|
-
// follows. `g` from elsewhere on screen 0 still needs to land the
|
|
156
|
-
// cursor home, which is why this isn't just `next !== screenRef.current`.
|
|
157
|
-
if (alreadyHome)
|
|
158
|
-
return;
|
|
159
|
-
if (next !== screenRef.current) {
|
|
160
|
-
screenRef.current = next;
|
|
161
|
-
setScreen(next);
|
|
162
|
-
}
|
|
163
|
-
const resetCursor = { row: 0, col: 0 };
|
|
164
|
-
cursorRef.current = resetCursor;
|
|
165
|
-
setCursor(resetCursor);
|
|
166
|
-
};
|
|
167
|
-
const toggleAll = () => {
|
|
168
|
-
if (mode === 'cell') {
|
|
169
|
-
const all = selectedRef.current.length === pageCount;
|
|
170
|
-
const next = all ? [] : Array.from({ length: pageCount }, (_, i) => i);
|
|
171
|
-
selectedRef.current = next;
|
|
172
|
-
setSelectedPages(next);
|
|
173
|
-
}
|
|
174
|
-
else {
|
|
175
|
-
const totalGaps = Math.max(0, pageCount - 1);
|
|
176
|
-
const all = cutsRef.current.length === totalGaps;
|
|
177
|
-
const next = all ? [] : Array.from({ length: totalGaps }, (_, i) => i);
|
|
178
|
-
cutsRef.current = next;
|
|
179
|
-
setCutGaps(next);
|
|
180
|
-
}
|
|
181
|
-
};
|
|
182
|
-
const toggleCurrent = () => {
|
|
183
|
-
const offset = screenRef.current * pagesPerScreen;
|
|
184
|
-
const { row, col } = cursorRef.current;
|
|
185
|
-
if (mode === 'cell') {
|
|
186
|
-
if (col >= cellsInRow(row, screenRef.current))
|
|
187
|
-
return;
|
|
188
|
-
const pageIndex = offset + row * perRow + col;
|
|
189
|
-
const next = selectedRef.current.includes(pageIndex)
|
|
190
|
-
? selectedRef.current.filter((p) => p !== pageIndex)
|
|
191
|
-
: [...selectedRef.current, pageIndex];
|
|
192
|
-
selectedRef.current = next;
|
|
193
|
-
setSelectedPages(next);
|
|
194
|
-
}
|
|
195
|
-
else {
|
|
196
|
-
if (col >= gapCount(row, screenRef.current))
|
|
197
|
-
return;
|
|
198
|
-
const gapIndex = offset + row * perRow + col;
|
|
199
|
-
const next = cutsRef.current.includes(gapIndex)
|
|
200
|
-
? cutsRef.current.filter((g) => g !== gapIndex)
|
|
201
|
-
: [...cutsRef.current, gapIndex];
|
|
202
|
-
cutsRef.current = next;
|
|
203
|
-
setCutGaps(next);
|
|
204
|
-
}
|
|
205
|
-
};
|
|
206
|
-
useKeys((input, key) => {
|
|
207
|
-
if (key.leftArrow)
|
|
208
|
-
stepLeft();
|
|
209
|
-
if (key.rightArrow)
|
|
210
|
-
stepRight();
|
|
211
|
-
if (key.upArrow)
|
|
212
|
-
moveCursor(-1, 0);
|
|
213
|
-
if (key.downArrow)
|
|
214
|
-
moveCursor(1, 0);
|
|
215
|
-
if (input === ' ')
|
|
216
|
-
toggleCurrent();
|
|
217
|
-
if (input === 'a')
|
|
218
|
-
toggleAll();
|
|
219
|
-
if ((input === 'r' || input === 'g') && onToggleView) {
|
|
220
|
-
onToggleView(mode === 'cell' ? selectedRef.current : cutsRef.current);
|
|
221
|
-
}
|
|
222
|
-
if (key.pageUp)
|
|
223
|
-
goToScreen(screenRef.current - 1);
|
|
224
|
-
if (key.pageDown)
|
|
225
|
-
goToScreen(screenRef.current + 1);
|
|
226
|
-
if (key.return)
|
|
227
|
-
onSubmit(mode === 'cell' ? selectedRef.current : cutsRef.current);
|
|
228
|
-
if (key.escape && onCancel)
|
|
229
|
-
onCancel();
|
|
230
|
-
});
|
|
231
|
-
// --- rendering ---
|
|
232
|
-
const selectedSet = new Set(selectedPages);
|
|
233
|
-
const cutsSet = new Set(cutGaps);
|
|
234
|
-
const offset = screen * pagesPerScreen;
|
|
235
|
-
const cursorBg = colourProp(palette.selectionBg);
|
|
236
|
-
const border = colourProp(palette.border);
|
|
237
|
-
/**
|
|
238
|
-
* The focused cell is drawn in a heavy frame, every other in the light one.
|
|
239
|
-
* The background tint alone used to be the only sign of focus, and
|
|
240
|
-
* `NO_COLOR` strips it — leaving a row of identical boxes and no cursor at
|
|
241
|
-
* all (spec §13: "not colour alone"). Heavy box-drawing is one column per
|
|
242
|
-
* glyph like the light set, so the row's width does not move with focus.
|
|
243
|
-
* Cell mode only, where `┃` is never a cut mark — gaps there are blank.
|
|
244
|
-
*/
|
|
245
|
-
const LIGHT = { tl: '╭', tr: '╮', bl: '╰', br: '╯', h: '─', v: '│' };
|
|
246
|
-
const HEAVY = { tl: '┏', tr: '┓', bl: '┗', br: '┛', h: '━', v: '┃' };
|
|
247
|
-
// Centres a single-column mark in the top border's inner run, the same
|
|
248
|
-
// width the plain border's dashes fill.
|
|
249
|
-
const innerWidth = Math.max(0, cellWidth - 2);
|
|
250
|
-
const leftPad = Math.max(0, Math.floor((innerWidth - 1) / 2));
|
|
251
|
-
const rightPad = Math.max(0, innerWidth - 1 - leftPad);
|
|
252
|
-
const gapSegment = (lineKind, r, c, gapIndex, isTrailing) => {
|
|
253
|
-
const cursorHere = mode === 'gap' && cursor.row === r && cursor.col === c;
|
|
254
|
-
const bg = cursorHere ? cursorBg : undefined;
|
|
255
|
-
if (mode === 'gap' && lineKind === 'number') {
|
|
256
|
-
const cut = cutsSet.has(gapIndex);
|
|
257
|
-
const glyph = cut ? '┃' : '┆';
|
|
258
|
-
const glyphColour = cut ? colourProp(palette.accent) : border;
|
|
259
|
-
// A trailing gap is a row's last rendered content. Ink trims trailing
|
|
260
|
-
// whitespace from every line (see `Select.tsx`), so a centred
|
|
261
|
-
// " <glyph> " would lose its final space there and shear this row
|
|
262
|
-
// against ones without a trailing gap. Right-aligning it — no
|
|
263
|
-
// trailing space — keeps all three columns; a non-trailing gap can
|
|
264
|
-
// stay centred, since a cell always follows it on the line.
|
|
265
|
-
return isTrailing ? (_jsxs(Text, { backgroundColor: bg, children: [_jsx(Text, { color: border, children: ' ' }), _jsx(Text, { color: glyphColour, children: glyph })] }, `${lineKind}${c}`)) : (_jsxs(Text, { backgroundColor: bg, children: [_jsx(Text, { color: border, children: " " }), _jsx(Text, { color: glyphColour, children: glyph }), _jsx(Text, { color: border, children: " " })] }, `${lineKind}${c}`));
|
|
266
|
-
}
|
|
267
|
-
// The focused gap is pointed at from above and below — the tint alone
|
|
268
|
-
// vanishes under `NO_COLOR`. The marks sit in the gap's glyph column:
|
|
269
|
-
// the middle of an ordinary gap, the last column of a trailing one
|
|
270
|
-
// (right-aligned above for the same Ink trim reason).
|
|
271
|
-
if (cursorHere) {
|
|
272
|
-
const mark = lineKind === 'top' ? '▼' : '▲';
|
|
273
|
-
const pad = isTrailing ? '─'.repeat(GAP - 1) : ' ';
|
|
274
|
-
return (_jsxs(Text, { backgroundColor: bg, children: [_jsx(Text, { color: border, children: pad }), _jsx(Text, { bold: true, color: colourProp(palette.accent), children: mark }), isTrailing ? null : _jsx(Text, { color: border, children: " " })] }, `${lineKind}${c}`));
|
|
275
|
-
}
|
|
276
|
-
// Border lines: blank for an ordinary gap. The row's trailing gap would
|
|
277
|
-
// otherwise be three whitespace columns at the very end of the line —
|
|
278
|
-
// exactly what Ink's trim removes — vanishing from the printed width
|
|
279
|
-
// entirely rather than just losing one column like the number line
|
|
280
|
-
// above. Dashes avoid that (no invented glyph, no trim) and read as the
|
|
281
|
-
// frame continuing into the next row, which is what a trailing gap is.
|
|
282
|
-
const fill = isTrailing ? '─'.repeat(GAP) : ' '.repeat(GAP);
|
|
283
|
-
return (_jsx(Text, { backgroundColor: bg, color: border, children: fill }, `${lineKind}${c}`));
|
|
284
|
-
};
|
|
285
|
-
const buildRow = (r) => {
|
|
286
|
-
const n = cellsInRow(r, screen);
|
|
287
|
-
if (n <= 0)
|
|
288
|
-
return null;
|
|
289
|
-
const topSegs = [];
|
|
290
|
-
const numSegs = [];
|
|
291
|
-
const bottomSegs = [];
|
|
292
|
-
for (let c = 0; c < n; c++) {
|
|
293
|
-
const pageIndex = offset + r * perRow + c;
|
|
294
|
-
const pageNumber = pageIndex + 1;
|
|
295
|
-
const cellCursor = mode === 'cell' && cursor.row === r && cursor.col === c;
|
|
296
|
-
const cellBg = cellCursor ? cursorBg : undefined;
|
|
297
|
-
const isSelected = selectedSet.has(pageIndex);
|
|
298
|
-
const g = cellCursor ? HEAVY : LIGHT;
|
|
299
|
-
topSegs.push(isSelected ? (_jsxs(Text, { backgroundColor: cellBg, children: [_jsx(Text, { color: border, children: `${g.tl}${g.h.repeat(leftPad)}` }), _jsx(Text, { color: colourProp(palette.ok), children: SYMBOLS.ok }), _jsx(Text, { color: border, children: `${g.h.repeat(rightPad)}${g.tr}` })] }, `t${c}`)) : (_jsx(Text, { backgroundColor: cellBg, color: border, children: `${g.tl}${g.h.repeat(innerWidth)}${g.tr}` }, `t${c}`)));
|
|
300
|
-
numSegs.push(_jsxs(Text, { backgroundColor: cellBg, children: [_jsx(Text, { color: border, children: g.v }), _jsx(Text, { bold: cellCursor, color: colourProp(palette.fg), children: `${String(pageNumber).padStart(Math.max(0, cellWidth - 3))} ` }), _jsx(Text, { color: border, children: g.v })] }, `n${c}`));
|
|
301
|
-
bottomSegs.push(_jsx(Text, { backgroundColor: cellBg, color: border, children: `${g.bl}${g.h.repeat(innerWidth)}${g.br}` }, `b${c}`));
|
|
302
|
-
// A gap follows every cell except a row's last one — unless this is
|
|
303
|
-
// gap mode and the row has a trailing gap (see `hasTrailingGap`), in
|
|
304
|
-
// which case the last cell gets one too: the row-boundary cut point.
|
|
305
|
-
const isLastInRow = c === n - 1;
|
|
306
|
-
const isTrailing = isLastInRow && mode === 'gap' && hasTrailingGap(r, screen);
|
|
307
|
-
if (!isLastInRow || isTrailing) {
|
|
308
|
-
const gapIndex = pageIndex; // the gap right after this page
|
|
309
|
-
topSegs.push(gapSegment('top', r, c, gapIndex, isTrailing));
|
|
310
|
-
numSegs.push(gapSegment('number', r, c, gapIndex, isTrailing));
|
|
311
|
-
bottomSegs.push(gapSegment('bottom', r, c, gapIndex, isTrailing));
|
|
312
|
-
}
|
|
313
|
-
}
|
|
314
|
-
return (_jsxs(Box, { flexDirection: "column", children: [_jsx(Text, { children: topSegs }), _jsx(Text, { children: numSegs }), _jsx(Text, { children: bottomSegs })] }, `row${r}`));
|
|
315
|
-
};
|
|
316
|
-
const rows = Array.from({ length: rowsInScreen(screen) }, (_, r) => buildRow(r));
|
|
317
|
-
const fileCount = cutGaps.length + 1;
|
|
318
|
-
const header = mode === 'cell'
|
|
319
|
-
? `${selectedPages.length} of ${pageCount} selected`
|
|
320
|
-
: `${fileCount} ${fileCount === 1 ? 'file' : 'files'}`;
|
|
321
|
-
const footer = totalScreens > 1 ? `pages ${offset + 1}–${offset + visibleCount(screen)} of ${pageCount}` : null;
|
|
322
|
-
return (_jsxs(Box, { flexDirection: "column", children: [_jsx(Text, { color: colourProp(palette.dim), children: header }), _jsx(Box, { flexDirection: "column", marginTop: 1, children: rows }), footer ? (_jsx(Box, { marginTop: 1, children: _jsx(Text, { color: colourProp(palette.dim), children: footer }) })) : null] }));
|
|
323
|
-
}
|
|
324
|
-
//# sourceMappingURL=PageGrid.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"PageGrid.js","sourceRoot":"","sources":["../../../src/shell/components/PageGrid.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAA;AAE/B,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AACxC,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAA;AAC7C,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,aAAa,CAAA;AACjD,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAA;AAEvC,MAAM,GAAG,GAAG,CAAC,CAAA,CAAC,4CAA4C;AAE1D;;;;;;GAMG;AACH,MAAM,UAAU,UAAU,CACxB,SAAiB,EACjB,KAAa,EACb,MAAc;IAEd,MAAM,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AC,CACR,KAAC,GAAG,IAAC,SAAS,EAAE,CAAC,YACf,KAAC,IAAI,IAAC,KAAK,EAAE,UAAU,CAAC,OAAO,CAAC,GAAG,CAAC,YAAG,MAAM,GAAQ,GACjD,CACP,CAAC,CAAC,CAAC,IAAI,IACJ,CACP,CAAA;AACH,CAAC"}
|
|
@@ -1,147 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { Box, Text } from 'ink';
|
|
3
|
-
import { useRef, useState } from 'react';
|
|
4
|
-
import stringWidth from 'string-width';
|
|
5
|
-
import { unescapePath } from '../../utils/unescape-path.js';
|
|
6
|
-
import { isStrayEscapeSequence } from '../mouse.js';
|
|
7
|
-
import { useTheme } from '../ThemeContext.js';
|
|
8
|
-
import { colourProp, SYMBOLS } from '../theme.js';
|
|
9
|
-
import { useKeys } from '../useKeys.js';
|
|
10
|
-
import { middleEllipsis } from '../width.js';
|
|
11
|
-
import { Select } from './Select.js';
|
|
12
|
-
const TYPE_IT = '__type__';
|
|
13
|
-
/**
|
|
14
|
-
* A destination picker: preset folders via `Select`, plus a "type a path"
|
|
15
|
-
* escape hatch that swaps in a free-text field. The preview follows
|
|
16
|
-
* whichever preset is highlighted, driven entirely by `Select`'s
|
|
17
|
-
* `onHighlight` — this component never registers its own arrow-key
|
|
18
|
-
* handler, since Ink delivers input to every mounted `useInput` hook and
|
|
19
|
-
* two handlers would both move on one keypress.
|
|
20
|
-
*/
|
|
21
|
-
export function PathInput({ label, presets, preview, onSubmit, onCancel, width, showHints, defaultPath, onMakeDefault, onRename, }) {
|
|
22
|
-
const palette = useTheme();
|
|
23
|
-
const [typing, setTyping] = useState(false);
|
|
24
|
-
const [text, setText] = useState('');
|
|
25
|
-
const [highlight, setHighlight] = useState(0);
|
|
26
|
-
/**
|
|
27
|
-
* As in Select.tsx: `useInput` handlers are synchronous but `useState`
|
|
28
|
-
* updates are not, so a whole dropped/pasted path — and, close behind
|
|
29
|
-
* it, the Enter that submits — can be delivered through this handler
|
|
30
|
-
* before React re-renders in between. `textRef` is the source of truth
|
|
31
|
-
* Enter reads from; `text`/`setText` exist only to trigger a render with
|
|
32
|
-
* the latest value for display.
|
|
33
|
-
*/
|
|
34
|
-
const textRef = useRef('');
|
|
35
|
-
const labels = [...presets.map((p) => p.label), 'Type a path…'];
|
|
36
|
-
// Mirrors the row `Select` actually draws: two columns of cursor gutter,
|
|
37
|
-
// the padded label column, then two columns of gap before the hint.
|
|
38
|
-
const labelColumn = Math.max(0, ...labels.map((l) => stringWidth(l)));
|
|
39
|
-
const hintBudget = Math.max(8, width - labelColumn - 4);
|
|
40
|
-
const items = [
|
|
41
|
-
...presets.map((p) => {
|
|
42
|
-
const isDefault = p.path === defaultPath;
|
|
43
|
-
// The badge has its own column, so the path is given a smaller budget
|
|
44
|
-
// when one is present rather than letting the row grow past the width.
|
|
45
|
-
const budget = isDefault ? Math.max(8, hintBudget - 12) : hintBudget;
|
|
46
|
-
return {
|
|
47
|
-
value: p.path,
|
|
48
|
-
label: p.label,
|
|
49
|
-
hint: middleEllipsis(p.path, budget),
|
|
50
|
-
...(isDefault ? { badge: 'default' } : {}),
|
|
51
|
-
};
|
|
52
|
-
}),
|
|
53
|
-
{ value: TYPE_IT, label: 'Type a path…' },
|
|
54
|
-
];
|
|
55
|
-
/**
|
|
56
|
-
* Separate from the typing handler below and gated on `!typing`, because
|
|
57
|
-
* Ink delivers input to every mounted `useInput` hook: without the gate a
|
|
58
|
-
* `d` typed into the free-text path field would also fire this and quietly
|
|
59
|
-
* rewrite the user's default.
|
|
60
|
-
*/
|
|
61
|
-
useKeys((input) => {
|
|
62
|
-
const item = items[highlight];
|
|
63
|
-
if (!item || item.value === TYPE_IT)
|
|
64
|
-
return;
|
|
65
|
-
if (input === 'r' && onRename) {
|
|
66
|
-
onRename(item.value);
|
|
67
|
-
return;
|
|
68
|
-
}
|
|
69
|
-
if (input !== 'd' || !onMakeDefault)
|
|
70
|
-
return;
|
|
71
|
-
// Already the default: a no-op, not an error. Pressing d twice is a
|
|
72
|
-
// reasonable thing for someone to do.
|
|
73
|
-
if (item.value === defaultPath)
|
|
74
|
-
return;
|
|
75
|
-
onMakeDefault(item.value);
|
|
76
|
-
}, { isActive: !typing });
|
|
77
|
-
useKeys((input, key) => {
|
|
78
|
-
// Clears first, same as `Prompt`: only once the field is already
|
|
79
|
-
// empty does escape fall through to backing out of typing mode.
|
|
80
|
-
if (key.escape) {
|
|
81
|
-
if (textRef.current !== '') {
|
|
82
|
-
textRef.current = '';
|
|
83
|
-
setText('');
|
|
84
|
-
return;
|
|
85
|
-
}
|
|
86
|
-
onCancel?.();
|
|
87
|
-
return;
|
|
88
|
-
}
|
|
89
|
-
if (key.return) {
|
|
90
|
-
onSubmit(unescapePath(textRef.current));
|
|
91
|
-
return;
|
|
92
|
-
}
|
|
93
|
-
if (key.backspace || key.delete) {
|
|
94
|
-
textRef.current = textRef.current.slice(0, -1);
|
|
95
|
-
setText(textRef.current);
|
|
96
|
-
return;
|
|
97
|
-
}
|
|
98
|
-
// An unhandled Ctrl chord (e.g. Ctrl+N) is not text — without this an
|
|
99
|
-
// unclaimed one would fall through and type its bare letter.
|
|
100
|
-
if (key.ctrl)
|
|
101
|
-
return;
|
|
102
|
-
if (input) {
|
|
103
|
-
/**
|
|
104
|
-
* A DSR reply or a mouse report Ink could not resolve reaches here
|
|
105
|
-
* looking like ordinary text starting with `[` — its leading ESC is
|
|
106
|
-
* already gone. See `isStrayEscapeSequence` in mouse.ts for why the
|
|
107
|
-
* match is this narrow: brackets are legal in filenames, and
|
|
108
|
-
* `shot[1].png` must still type.
|
|
109
|
-
*/
|
|
110
|
-
if (isStrayEscapeSequence(input))
|
|
111
|
-
return;
|
|
112
|
-
/**
|
|
113
|
-
* Ink does not split a chunk that contains both text and a line
|
|
114
|
-
* ending: a dropped path with a trailing newline — e.g. one copied
|
|
115
|
-
* from a file listing or an editor's multi-line selection — and the
|
|
116
|
-
* terminal's own Enter land in the same `stdin` chunk as one event,
|
|
117
|
-
* whose `input` is `"path\r"` (or `\n`, or `\r\n`) and whose
|
|
118
|
-
* `key.return` is false. Checking `key.return` alone would silently
|
|
119
|
-
* bake a raw CR/LF into the buffer and never submit. So an embedded
|
|
120
|
-
* CR/LF is treated as an inline Enter: everything before it is the
|
|
121
|
-
* final text, everything from it onward — the line ending and
|
|
122
|
-
* anything after — is discarded, and submission follows the same
|
|
123
|
-
* path as the `key.return` branch above.
|
|
124
|
-
*/
|
|
125
|
-
const breakIndex = input.search(/[\r\n]/);
|
|
126
|
-
if (breakIndex !== -1) {
|
|
127
|
-
textRef.current += input.slice(0, breakIndex);
|
|
128
|
-
setText(textRef.current);
|
|
129
|
-
onSubmit(unescapePath(textRef.current));
|
|
130
|
-
return;
|
|
131
|
-
}
|
|
132
|
-
textRef.current += input;
|
|
133
|
-
setText(textRef.current);
|
|
134
|
-
}
|
|
135
|
-
}, { isActive: typing });
|
|
136
|
-
if (typing) {
|
|
137
|
-
return (_jsxs(Box, { flexDirection: "column", children: [_jsx(Text, { color: colourProp(palette.dim), children: label }), _jsxs(Text, { children: [_jsx(Text, { color: colourProp(palette.accent), children: '› ' }), _jsx(Text, { color: colourProp(palette.fg), children: text })] })] }));
|
|
138
|
-
}
|
|
139
|
-
const highlighted = items[highlight];
|
|
140
|
-
return (_jsxs(Box, { flexDirection: "column", children: [_jsx(Text, { color: colourProp(palette.label), children: label }), _jsx(Select, { width: width, items: items, onHighlight: setHighlight, onSubmit: (value) => {
|
|
141
|
-
if (value === TYPE_IT)
|
|
142
|
-
setTyping(true);
|
|
143
|
-
else
|
|
144
|
-
onSubmit(value);
|
|
145
|
-
}, showHints: showHints, ...(onCancel ? { onCancel } : {}) }), highlighted && highlighted.value !== TYPE_IT ? (_jsx(Box, { marginTop: 1, children: _jsxs(Text, { color: colourProp(palette.dim), children: [' ', SYMBOLS.arrow, " ", preview(highlighted.value)] }) })) : null] }));
|
|
146
|
-
}
|
|
147
|
-
//# sourceMappingUR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Z,KAAK,EAAE,KAAK,EACZ,WAAW,EAAE,YAAY,EACzB,QAAQ,EAAE,CAAC,KAAK,EAAE,EAAE;oBAClB,IAAI,KAAK,KAAK,OAAO;wBAAE,SAAS,CAAC,IAAI,CAAC,CAAA;;wBACjC,QAAQ,CAAC,KAAK,CAAC,CAAA;gBACtB,CAAC,EACD,SAAS,EAAE,SAAS,KAChB,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,QAAQ,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,GAClC,EACD,WAAW,IAAI,WAAW,CAAC,KAAK,KAAK,OAAO,CAAC,CAAC,CAAC,CAC9C,KAAC,GAAG,IAAC,SAAS,EAAE,CAAC,YACf,MAAC,IAAI,IAAC,KAAK,EAAE,UAAU,CAAC,OAAO,CAAC,GAAG,CAAC,aACjC,IAAI,EACJ,OAAO,CAAC,KAAK,OAAG,OAAO,CAAC,WAAW,CAAC,KAAK,CAAC,IACtC,GACH,CACP,CAAC,CAAC,CAAC,IAAI,IACJ,CACP,CAAA;AACH,CAAC"}
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { Box, Text } from 'ink';
|
|
3
|
-
import { useTheme } from '../ThemeContext.js';
|
|
4
|
-
import { BAR, colourProp } from '../theme.js';
|
|
5
|
-
import { middleEllipsis } from '../width.js';
|
|
6
|
-
/**
|
|
7
|
-
* A determinate bar.
|
|
8
|
-
*
|
|
9
|
-
* Determinate is honest here and nowhere else so far: the page total is known
|
|
10
|
-
* before the first page renders. Invariant 7 forbids inventing progress, not
|
|
11
|
-
* showing it — an operation whose length is unknown must report phases only
|
|
12
|
-
* and must not mount this component.
|
|
13
|
-
*
|
|
14
|
-
* `BAR.filled` and `BAR.empty` are the same glyph, so the fill reads by
|
|
15
|
-
* colour, not shape — like `Slider`. In a monochrome terminal the bar itself
|
|
16
|
-
* conveys nothing, which is why the counter is plain text rather than part of
|
|
17
|
-
* the bar: it carries the meaning the colour cannot.
|
|
18
|
-
*/
|
|
19
|
-
export function Progress({ label, done, total, detail, width }) {
|
|
20
|
-
const palette = useTheme();
|
|
21
|
-
const counter = `page ${done} of ${total}`;
|
|
22
|
-
// The track needs at least 4 columns to show real movement — fewer than
|
|
23
|
-
// that and the knob barely shifts, so the bar would read as decoration
|
|
24
|
-
// claiming a precision it doesn't have. `width - counter.length - 6` is
|
|
25
|
-
// the track this width affords, with 2 columns of margin against the
|
|
26
|
-
// frame edge. When that budget doesn't reach 4, there is no room left for
|
|
27
|
-
// an honest bar next to this counter at this width. The counter is what
|
|
28
|
-
// carries the meaning in a monochrome terminal (see the doc comment
|
|
29
|
-
// above), so it is the bar that gives way, not the count: `showBar` false
|
|
30
|
-
// falls back to the counter alone rather than forcing a floor that would
|
|
31
|
-
// push the line past `width`.
|
|
32
|
-
const trackBudget = width - counter.length - 6;
|
|
33
|
-
const showBar = trackBudget >= 4;
|
|
34
|
-
const track = Math.min(24, trackBudget);
|
|
35
|
-
const rawFilled = total === 0 ? 0 : Math.round((done / total) * (track - 1));
|
|
36
|
-
// Clamped the way Slider.tsx:69-70 clamps its own `filled`: `done` can
|
|
37
|
-
// arrive greater than `total` — a stale event, an off-by-one upstream —
|
|
38
|
-
// and an unclamped `filled` would repeat past the track with nothing to
|
|
39
|
-
// catch it, overflowing the line well past `width`.
|
|
40
|
-
const filled = Math.max(0, Math.min(track - 1, rawFilled));
|
|
41
|
-
return (_jsxs(Box, { flexDirection: "column", children: [_jsx(Text, { color: colourProp(palette.label), children: label }), showBar ? (_jsxs(Text, { children: [_jsx(Text, { color: colourProp(palette.border), children: '├' }), _jsx(Text, { color: colourProp(palette.accent), children: BAR.filled.repeat(filled) }), _jsx(Text, { bold: true, color: colourProp(palette.accent), children: BAR.knob }), _jsxs(Text, { color: colourProp(palette.border), children: [BAR.empty.repeat(Math.max(0, track - 1 - filled)), '┤'] }), _jsx(Text, { color: colourProp(palette.dim), children: ` ${counter}` })] })) : (_jsx(Text, { color: colourProp(palette.dim), children: counter })), detail ? (_jsx(Text, { color: colourProp(palette.dim), children: middleEllipsis(detail, width - 2) })) : null] }));
|
|
42
|
-
}
|
|
43
|
-
//# sourceMappingURL=Progress.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Progress.js","sourceRoot":"","sources":["../../../src/shell/components/Progress.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAA;AAC/B,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAA;AAC7C,OAAO,EAAE,GAAG,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AAC7C,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAA;AAU5C;;;;;;;;;;;;GAYG;AACH,MAAM,UAAU,QAAQ,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAiB;IAC3E,MAAM,OAAO,GAAG,QAAQ,EAAE,CAAA;IAC1B,MAAM,OAAO,GAAG,QAAQ,IAAI,OAAO,KAAK,EAAE,CAAA;IAE1C,wEAAwE;IACxE,uEAAuE;IACvE,wEAAwE;IACxE,qEAAqE;IACrE,0EAA0E;IAC1E,wEAAwE;IACxE,oEAAoE;IACpE,0EAA0E;IAC1E,yEAAyE;IACzE,8BAA8B;IAC9B,MAAM,WAAW,GAAG,KAAK,GAAG,OAAO,CAAC,MAAM,GAAG,CAAC,CAAA;IAC9C,MAAM,OAAO,GAAG,WAAW,IAAI,CAAC,CAAA;IAChC,MAAM,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,EAAE,EAAE,WAAW,CAAC,CAAA;IACvC,MAAM,SAAS,GAAG,KAAK,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,IAAI,GAAG,KAAK,CAAC,GAAG,CAAC,KAAK,GAAG,CAAC,CAAC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