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
package/dist/shell/commands.js
DELETED
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Every command the shell knows, in the order the palette lists them.
|
|
3
|
-
*
|
|
4
|
-
* A list rather than a switch: the palette renders it, `/help` prints it, and
|
|
5
|
-
* a new action adds one entry instead of touching three places. This is where
|
|
6
|
-
* `/merge` and `/split` land when the PDF engine arrives, which is the reason
|
|
7
|
-
* commands were chosen over an action menu in the first place.
|
|
8
|
-
*/
|
|
9
|
-
export const COMMANDS = [
|
|
10
|
-
{ name: 'convert', description: "change a file's format", needsSource: true },
|
|
11
|
-
{ name: 'compress', description: 'make a file smaller', needsSource: true },
|
|
12
|
-
{ name: 'pdf', description: 'page operations on a PDF', needsSource: true },
|
|
13
|
-
{ name: 'theme', description: 'switch between light and dark', needsSource: false },
|
|
14
|
-
{ name: 'help', description: 'list these commands', needsSource: false },
|
|
15
|
-
];
|
|
16
|
-
/**
|
|
17
|
-
* Whether what has been typed is the start of a command rather than a path.
|
|
18
|
-
*
|
|
19
|
-
* A leading slash alone is not enough: `/Users/me/photo.png` is an absolute
|
|
20
|
-
* path and the most common thing anyone types at this prompt. A command has
|
|
21
|
-
* no further slashes and no spaces, which no absolute path to a real file can
|
|
22
|
-
* satisfy — and a dragged path arrives with its spaces escaped, so it carries
|
|
23
|
-
* both.
|
|
24
|
-
*/
|
|
25
|
-
export function isCommandBuffer(text) {
|
|
26
|
-
if (!text.startsWith('/'))
|
|
27
|
-
return false;
|
|
28
|
-
const rest = text.slice(1);
|
|
29
|
-
return !rest.includes('/') && !rest.includes(' ');
|
|
30
|
-
}
|
|
31
|
-
/** Commands whose name begins with `fragment`, for the palette to list. */
|
|
32
|
-
export function matchCommands(fragment) {
|
|
33
|
-
const needle = fragment.trim().toLowerCase();
|
|
34
|
-
if (needle === '')
|
|
35
|
-
return COMMANDS;
|
|
36
|
-
return COMMANDS.filter((c) => c.name.startsWith(needle));
|
|
37
|
-
}
|
|
38
|
-
/**
|
|
39
|
-
* The command a fully typed input names, exactly. Prefixes are deliberately
|
|
40
|
-
* not resolved here — the palette disambiguates by highlighting, and guessing
|
|
41
|
-
* which of `/convert` and `/compress` someone meant by `/co` is exactly the
|
|
42
|
-
* kind of silent choice that surprises people.
|
|
43
|
-
*/
|
|
44
|
-
export function parseCommand(input) {
|
|
45
|
-
const trimmed = input.trim().toLowerCase();
|
|
46
|
-
if (!trimmed.startsWith('/'))
|
|
47
|
-
return undefined;
|
|
48
|
-
const name = trimmed.slice(1);
|
|
49
|
-
return COMMANDS.find((c) => c.name === name);
|
|
50
|
-
}
|
|
51
|
-
//# sourceMappingURL=commands.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"commands.js","sourceRoot":"","sources":["../../src/shell/commands.ts"],"names":[],"mappings":"AASA;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,QAAQ,GAAc;IACjC,EAAE,IAAI,EAAE,SAAS,EAAE,WAAW,EAAE,wBAAwB,EAAE,WAAW,EAAE,IAAI,EAAE;IAC7E,EAAE,IAAI,EAAE,UAAU,EAAE,WAAW,EAAE,qBAAqB,EAAE,WAAW,EAAE,IAAI,EAAE;IAC3E,EAAE,IAAI,EAAE,KAAK,EAAE,WAAW,EAAE,0BAA0B,EAAE,WAAW,EAAE,IAAI,EAAE;IAC3E,EAAE,IAAI,EAAE,OAAO,EAAE,WAAW,EAAE,+BAA+B,EAAE,WAAW,EAAE,KAAK,EAAE;IACnF,EAAE,IAAI,EAAE,MAAM,EAAE,WAAW,EAAE,qBAAqB,EAAE,WAAW,EAAE,KAAK,EAAE;CACzE,CAAA;AAED;;;;;;;;GAQG;AACH,MAAM,UAAU,eAAe,CAAC,IAAY;IAC1C,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC;QAAE,OAAO,KAAK,CAAA;IACvC,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAA;IAC1B,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAA;AACnD,CAAC;AAED,2EAA2E;AAC3E,MAAM,UAAU,aAAa,CAAC,QAAgB;IAC5C,MAAM,MAAM,GAAG,QAAQ,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,CAAA;IAC5C,IAAI,MAAM,KAAK,EAAE;QAAE,OAAO,QAAQ,CAAA;IAClC,OAAO,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,CAAA;AAC1D,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,YAAY,CAAC,KAAa;IACxC,MAAM,OAAO,GAAG,KAAK,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,CAAA;IAC1C,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,GAAG,CAAC;QAAE,OAAO,SAAS,CAAA;IAC9C,MAAM,IAAI,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAA;IAC7B,OAAO,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,IAAI,CAAC,CAAA;AAC9C,CAAC"}
|
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { Box, Text } from 'ink';
|
|
3
|
-
import { glyphColour, HEAT, MARK_AT_REST, MARK_WIDTH, REST_STEP } from '../mark.js';
|
|
4
|
-
import { useTheme } from '../ThemeContext.js';
|
|
5
|
-
import { colourProp } from '../theme.js';
|
|
6
|
-
import { bandFor } from '../width.js';
|
|
7
|
-
/**
|
|
8
|
-
* `█` is the letter face; `╔═╗║╚╝` is its edge. The edge is the whole point:
|
|
9
|
-
* solid-slab block letters leave O and G, and E and F, with near-identical
|
|
10
|
-
* silhouettes at this size, and the outline is what tells them apart. Six
|
|
11
|
-
* rows rather than five, because five does not leave enough vertical room to
|
|
12
|
-
* describe a letterform.
|
|
13
|
-
*
|
|
14
|
-
* Every row must be exactly the same length or the letters shear. Trailing
|
|
15
|
-
* spaces are therefore significant, and a test pins it.
|
|
16
|
-
*/
|
|
17
|
-
export const WORDMARK = [
|
|
18
|
-
'███████╗ ██████╗ ██████╗ ██████╗ ███████╗',
|
|
19
|
-
'██╔════╝██╔═══██╗██╔══██╗██╔════╝ ██╔════╝',
|
|
20
|
-
'█████╗ ██║ ██║██████╔╝██║ ███╗█████╗ ',
|
|
21
|
-
'██╔══╝ ██║ ██║██╔══██╗██║ ██║██╔══╝ ',
|
|
22
|
-
'██║ ╚██████╔╝██║ ██║╚██████╔╝███████╗',
|
|
23
|
-
'╚═╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝ ╚══════╝',
|
|
24
|
-
];
|
|
25
|
-
/** Re-exported so callers that only need the still mark do not reach past this. */
|
|
26
|
-
export const MARK = MARK_AT_REST;
|
|
27
|
-
const GAP = ' ';
|
|
28
|
-
/** Columns the mark, gap and wordmark need before any padding. */
|
|
29
|
-
export const FULL_WIDTH = MARK_WIDTH + GAP.length + (WORDMARK[0]?.length ?? 0);
|
|
30
|
-
/** Sparks and heat are their own colours; everything else is the anvil. */
|
|
31
|
-
function markRow(row, index, anvil) {
|
|
32
|
-
const step = REST_STEP;
|
|
33
|
-
const heat = HEAT[4] ?? HEAT[0];
|
|
34
|
-
return (_jsx(_Fragment, { children: Array.from(row).map((ch, i) => (_jsx(Text, { color: glyphColour(ch, index, step, heat, anvil ?? '') ?? undefined, children: ch }, i))) }));
|
|
35
|
-
}
|
|
36
|
-
/**
|
|
37
|
-
* Splits a wordmark row into face runs and edge runs so each takes its own
|
|
38
|
-
* colour. The face uses the palette's plain foreground — by construction it
|
|
39
|
-
* contrasts with the user's background in either theme — and the accent sits
|
|
40
|
-
* on the edge only, where it reads as an accent rather than as the letterform
|
|
41
|
-
* itself. A wordmark drawn entirely in the accent is a mid-tone against both
|
|
42
|
-
* backgrounds and reads muddy.
|
|
43
|
-
*/
|
|
44
|
-
function splitFace(row) {
|
|
45
|
-
const runs = [];
|
|
46
|
-
for (const ch of row) {
|
|
47
|
-
const edge = ch !== '█';
|
|
48
|
-
const last = runs.at(-1);
|
|
49
|
-
if (last && last.edge === edge)
|
|
50
|
-
last.text += ch;
|
|
51
|
-
else
|
|
52
|
-
runs.push({ text: ch, edge });
|
|
53
|
-
}
|
|
54
|
-
return runs;
|
|
55
|
-
}
|
|
56
|
-
/**
|
|
57
|
-
* Shown on every shell launch. The status line carries the default output
|
|
58
|
-
* folder, which is what makes that setting discoverable without a settings
|
|
59
|
-
* screen — and it follows `d` immediately, so the change is visible where it
|
|
60
|
-
* was made.
|
|
61
|
-
*/
|
|
62
|
-
export function Banner({ width, version, defaultOutput, }) {
|
|
63
|
-
const palette = useTheme();
|
|
64
|
-
// Below the compact band the art does not fit: 42 columns of wordmark plus
|
|
65
|
-
// 11 of mark needs 55 before any padding at all.
|
|
66
|
-
if (bandFor(width) === 'compact' || width < FULL_WIDTH) {
|
|
67
|
-
return (_jsx(Box, { marginTop: 1, marginBottom: 1, children: _jsxs(Text, { children: [_jsx(Text, { color: colourProp(palette.accent), children: '⚒ ' }), _jsx(Text, { color: colourProp(palette.fg), bold: true, children: "Forge" }), _jsx(Text, { color: colourProp(palette.dim), children: ` ${version}` })] }) }));
|
|
68
|
-
}
|
|
69
|
-
const status = ` Convert ${version} · image`;
|
|
70
|
-
const gap = Math.max(2, width - status.length - defaultOutput.length - 1);
|
|
71
|
-
return (_jsxs(Box, { flexDirection: "column", marginTop: 1, marginBottom: 2, children: [WORDMARK.map((word, i) => (_jsxs(Text, { children: [markRow(MARK[i] ?? '', i, colourProp(palette.dim)), _jsx(Text, { children: GAP }), splitFace(word).map((run, j) => (_jsx(Text, { color: colourProp(run.edge ? palette.accent : palette.fg), children: run.text }, j)))] }, i))), _jsx(Text, { children: '' }), _jsxs(Text, { children: [_jsx(Text, { color: colourProp(palette.dim), children: status }), _jsx(Text, { children: ' '.repeat(gap) }), _jsx(Text, { color: colourProp(palette.dim), children: defaultOutput })] })] }));
|
|
72
|
-
}
|
|
73
|
-
//#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-1,37 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { Box, Text } from 'ink';
|
|
3
|
-
import { matchCommands } from '../commands.js';
|
|
4
|
-
import { useTheme } from '../ThemeContext.js';
|
|
5
|
-
import { colourProp } from '../theme.js';
|
|
6
|
-
import { Select } from './Select.js';
|
|
7
|
-
/**
|
|
8
|
-
* The list that opens when the prompt buffer starts with `/`.
|
|
9
|
-
*
|
|
10
|
-
* Commands are only worth having if they can be found, and this is the whole
|
|
11
|
-
* discovery mechanism — typing `/` is how anyone learns Forge does more than
|
|
12
|
-
* convert. It was the deciding objection to choosing commands over an action
|
|
13
|
-
* menu, and this answers it.
|
|
14
|
-
*
|
|
15
|
-
* Reuses `Select`, so the cursor, the selection band and the width budgeting
|
|
16
|
-
* are the same ones every other list in the shell uses. Rendered only while
|
|
17
|
-
* the buffer opens a command, so it costs nothing on the ordinary path of
|
|
18
|
-
* dropping a file.
|
|
19
|
-
*/
|
|
20
|
-
export function CommandPalette({ fragment, width, onRun, onCancel, }) {
|
|
21
|
-
const palette = useTheme();
|
|
22
|
-
const matches = matchCommands(fragment);
|
|
23
|
-
if (matches.length === 0) {
|
|
24
|
-
return (_jsx(Box, { marginBottom: 1, children: _jsx(Text, { color: colourProp(palette.dim), children: ` no command matches /${fragment}` }) }));
|
|
25
|
-
}
|
|
26
|
-
const items = matches.map((c) => ({
|
|
27
|
-
value: c.name,
|
|
28
|
-
label: `/${c.name}`,
|
|
29
|
-
hint: c.description,
|
|
30
|
-
}));
|
|
31
|
-
return (_jsx(Box, { flexDirection: "column", marginBottom: 1, children: _jsx(Select, { width: width, items: items, onSubmit: (name) => {
|
|
32
|
-
const command = matches.find((c) => c.name === name);
|
|
33
|
-
if (command)
|
|
34
|
-
onRun(command);
|
|
35
|
-
}, onCancel: onCancel }) }));
|
|
36
|
-
}
|
|
37
|
-
//# sourceMappingURL=CommandPalette.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
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AG,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,IAAI,CAAC,CAAA;gBACpD,IAAI,OAAO;oBAAE,KAAK,CAAC,OAAO,CAAC,CAAA;YAC7B,CAAC,EACD,QAAQ,EAAE,QAAQ,GAClB,GACE,CACP,CAAA;AACH,CAAC"}
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { Box, Text } from 'ink';
|
|
3
|
-
import stringWidth from 'string-width';
|
|
4
|
-
import { FORMATS } from '../../core/formats.js';
|
|
5
|
-
import { formatBytes } from '../../core/units.js';
|
|
6
|
-
import { useTheme } from '../ThemeContext.js';
|
|
7
|
-
import { colourProp } from '../theme.js';
|
|
8
|
-
import { bandFor, middleEllipsis } from '../width.js';
|
|
9
|
-
/** The card never grows past this, however wide the terminal is. */
|
|
10
|
-
const MAX_CARD = 52;
|
|
11
|
-
/**
|
|
12
|
-
* A dropped file, framed, with its format inlined into the top border as a
|
|
13
|
-
* tag.
|
|
14
|
-
*
|
|
15
|
-
* Below the compact band (<60 columns) the frame is dropped entirely rather
|
|
16
|
-
* than spending four of the columns the filename needs — spec §13 says
|
|
17
|
-
* content is truncated rather than wrapped, and a border is not content.
|
|
18
|
-
*/
|
|
19
|
-
export function FileCard({ source, width }) {
|
|
20
|
-
const palette = useTheme();
|
|
21
|
-
const band = bandFor(width);
|
|
22
|
-
const name = source.path.split('/').pop() ?? source.path;
|
|
23
|
-
const label = FORMATS[source.format].label;
|
|
24
|
-
const facts = (source.kind === 'image'
|
|
25
|
-
? [
|
|
26
|
-
`${source.width}×${source.height}`,
|
|
27
|
-
formatBytes(source.bytes),
|
|
28
|
-
// Only claimed when the source genuinely carries alpha — saying
|
|
29
|
-
// "transparent" about an opaque JPEG would be a plain lie about the file.
|
|
30
|
-
...(source.hasAlpha ? ['transparent'] : []),
|
|
31
|
-
]
|
|
32
|
-
: [
|
|
33
|
-
// 0 means "unknown" (a `.doc` file, or a `.docx` that never cached a
|
|
34
|
-
// page count) — showing "0 pages" would read as a real, wrong fact.
|
|
35
|
-
...(source.pages > 0 ? [`${source.pages} pages`] : []),
|
|
36
|
-
formatBytes(source.bytes),
|
|
37
|
-
]).join(' · ');
|
|
38
|
-
// Spec §13: the compact band drops the frame *and* the format and
|
|
39
|
-
// dimensions, keeping only what identifies the file and how big it is.
|
|
40
|
-
// Two lines of metadata is exactly what there is no room for here.
|
|
41
|
-
if (band === 'compact') {
|
|
42
|
-
return (_jsxs(Text, { children: [_jsx(Text, { color: colourProp(palette.fg), children: middleEllipsis(name, Math.max(8, width - 12)) }), _jsx(Text, { color: colourProp(palette.dim), children: ` · ${formatBytes(source.bytes)}` })] }));
|
|
43
|
-
}
|
|
44
|
-
// Total drawn width, borders included. Capped so a wide terminal gets a
|
|
45
|
-
// card rather than a rule stretching to the far edge.
|
|
46
|
-
const outer = Math.min(width, MAX_CARD);
|
|
47
|
-
const inner = outer - 2; // the two vertical border glyphs
|
|
48
|
-
const textWidth = inner - 2; // one column of padding on each side
|
|
49
|
-
// The top border's inner run is '─ ' + tag + ' ' + rule, so the rule takes
|
|
50
|
-
// whatever those three columns and the tag leave. Getting this wrong by one
|
|
51
|
-
// shears the frame — there is a test pinning every line to one width.
|
|
52
|
-
const rule = '─'.repeat(Math.max(0, inner - stringWidth(label) - 3));
|
|
53
|
-
const row = (text) => {
|
|
54
|
-
const shown = middleEllipsis(text, textWidth);
|
|
55
|
-
return `${shown}${' '.repeat(Math.max(0, textWidth - stringWidth(shown)))}`;
|
|
56
|
-
};
|
|
57
|
-
return (_jsxs(Box, { flexDirection: "column", children: [_jsxs(Text, { children: [_jsx(Text, { color: colourProp(palette.border), children: '╭─ ' }), _jsx(Text, { color: colourProp(palette.tag), children: label }), _jsx(Text, { color: colourProp(palette.border), children: ` ${rule}╮` })] }), _jsxs(Text, { children: [_jsx(Text, { color: colourProp(palette.border), children: '│ ' }), _jsx(Text, { color: colourProp(palette.fg), children: row(name) }), _jsx(Text, { color: colourProp(palette.border), children: ' │' })] }), _jsxs(Text, { children: [_jsx(Text, { color: colourProp(palette.border), children: '│ ' }), _jsx(Text, { color: colourProp(palette.dim), children: row(facts) }), _jsx(Text, { color: colourProp(palette.border), children: ' │' })] }), _jsx(Text, { color: colourProp(palette.border), children: `╰${'─'.repeat(inner)}╯` })] }));
|
|
58
|
-
}
|
|
59
|
-
//# sourceMappingURL=FileCard.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"FileCard.js","sourceRoot":"","sources":["../../../src/shell/components/FileCard.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAA;AAC/B,OAAO,WAAW,MAAM,cAAc,CAAA;AACtC,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAA;AAE/C,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAA;AACjD,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAA;AAC7C,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AACxC,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAA;AAErD,oEAAoE;AACpE,MAAM,QAAQ,GAAG,EAAE,CAAA;AAEnB;;;;;;;GAOG;AACH,MAAM,UAAU,QAAQ,CAAC,EAAE,MAAM,EAAE,KAAK,EAAyC;IAC/E,MAAM,OAAO,GAAG,QAAQ,EAAE,CAAA;IAC1B,MAAM,IAAI,GAAG,OAAO,CAAC,KAAK,CAAC,CAAA;IAC3B,MAAM,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,IAAI,MAAM,CAAC,IAAI,CAAA;IACxD,MAAM,KAAK,GAAG,OAAO,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,KAAK,CAAA;IAE1C,MAAM,KA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,KAAK,EAAE,UAAU,CAAC,OAAO,CAAC,MAAM,CAAC,YAAG,IAAI,GAAQ,EACtD,KAAC,IAAI,IAAC,KAAK,EAAE,UAAU,CAAC,OAAO,CAAC,GAAG,CAAC,YAAG,GAAG,CAAC,KAAK,CAAC,GAAQ,EACzD,KAAC,IAAI,IAAC,KAAK,EAAE,UAAU,CAAC,OAAO,CAAC,MAAM,CAAC,YAAG,IAAI,GAAQ,IACjD,EACP,KAAC,IAAI,IAAC,KAAK,EAAE,UAAU,CAAC,OAAO,CAAC,MAAM,CAAC,YAAG,IAAI,GAAG,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,GAAQ,IACtE,CACP,CAAA;AACH,CAAC"}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { Box } from 'ink';
|
|
3
|
-
import { useTheme } from '../ThemeContext.js';
|
|
4
|
-
import { colourProp } from '../theme.js';
|
|
5
|
-
import { Hints } from './Hints.js';
|
|
6
|
-
/**
|
|
7
|
-
* A step's keyboard hints, with a rule above them.
|
|
8
|
-
*
|
|
9
|
-
* The rule is Ink's own top border rather than a row of repeated `─`: Ink
|
|
10
|
-
* sizes a border to the box it is drawn on, so it tracks the terminal without
|
|
11
|
-
* anything computing a width — which is what "scalable" asks for, and one
|
|
12
|
-
* fewer place for a width to be got wrong.
|
|
13
|
-
*/
|
|
14
|
-
export function HintBar({ pairs, width }) {
|
|
15
|
-
const palette = useTheme();
|
|
16
|
-
return (_jsx(Box, { width: width, borderStyle: "single", borderColor: colourProp(palette.border), borderBottom: false, borderLeft: false, borderRight: false, paddingTop: 0, children: _jsx(Hints, { pairs: pairs }) }));
|
|
17
|
-
}
|
|
18
|
-
//# sourceMappingURL=HintBar.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"HintBar.js","sourceRoot":"","sources":["../../../src/shell/components/HintBar.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAA;AACzB,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAA;AAC7C,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AACxC,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAA;AAElC;;;;;;;GAOG;AACH,MAAM,UAAU,OAAO,CAAC,EAAE,KAAK,EAAE,KAAK,EAAqD;IACzF,MAAM,OAAO,GAAG,QAAQ,EAAE,CAAA;IAC1B,OAAO,CACL,KAAC,GAAG,IACF,KAAK,EAAE,KAAK,EACZ,WAAW,EAAC,QAAQ,EACpB,WAAW,EAAE,UAAU,CAAC,OAAO,CAAC,MAAM,CAAC,EACvC,YAAY,EAAE,KAAK,EACnB,UAAU,EAAE,KAAK,EACjB,WAAW,EAAE,KAAK,EAClB,UAAU,EAAE,CAAC,YAEb,KAAC,KAAK,IAAC,KAAK,EAAE,KAAK,GAAI,GACnB,CACP,CAAA;AACH,CAAC"}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { Text } from 'ink';
|
|
3
|
-
import { useTheme } from '../ThemeContext.js';
|
|
4
|
-
import { colourProp } from '../theme.js';
|
|
5
|
-
/**
|
|
6
|
-
* Each key is paired with a word, so the line reads in monochrome — colour
|
|
7
|
-
* is an accent here too, never the only thing telling `↵` from `send`.
|
|
8
|
-
*
|
|
9
|
-
* The key is bold and in the app's one accent colour, the same one that
|
|
10
|
-
* marks "Open file" / "Show in Finder" as clickable elsewhere: a keyboard
|
|
11
|
-
* shortcut and a clickable label are both "something you can act on," so
|
|
12
|
-
* they share the one colour that means that rather than splitting it into a
|
|
13
|
-
* second one. A rule in the border colour separates each pair rather than a
|
|
14
|
-
* middle dot, wide enough to read as a row of distinct controls instead of
|
|
15
|
-
* one run-on sentence with dots in it.
|
|
16
|
-
*/
|
|
17
|
-
export function Hints({ pairs }) {
|
|
18
|
-
const palette = useTheme();
|
|
19
|
-
return (_jsx(Text, { children: pairs.map(([key, what], i) => (_jsxs(Text, { children: [i > 0 ? _jsx(Text, { color: colourProp(palette.border), children: ' │ ' }) : null, _jsx(Text, { color: colourProp(palette.accent), bold: true, children: key }), _jsx(Text, { color: colourProp(palette.dim), children: ` ${what}` })] }, key))) }));
|
|
20
|
-
}
|
|
21
|
-
//# sourceMappingURL=Hints.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Hints.js","sourceRoot":"","sources":["../../../src/shell/components/Hints.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,KAAK,CAAA;AAC1B,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAA;AAC7C,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AAExC;;;;;;;;;;;GAWG;AACH,MAAM,UAAU,KAAK,CAAC,EAAE,KAAK,EAAsC;IACjE,MAAM,OAAO,GAAG,QAAQ,EAAE,CAAA;IAC1B,OAAO,CACL,KAAC,IAAI,cACF,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,EAAE,IAAI,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAC7B,MAAC,IAAI,eACF,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,KAAC,IAAI,IAAC,KAAK,EAAE,UAAU,CAAC,OAAO,CAAC,MAAM,CAAC,YAAG,OAAO,GAAQ,CAAC,CAAC,CAAC,IAAI,EACzE,KAAC,IAAI,IAAC,KAAK,EAAE,UAAU,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,IAAI,kBAC1C,GAAG,GACC,EACP,KAAC,IAAI,IAAC,KAAK,EAAE,UAAU,CAAC,OAAO,CAAC,GAAG,CAAC,YAAG,IAAI,IAAI,EAAE,GAAQ,KALhD,GAAG,CAMP,CACR,CAAC,GACG,CACR,CAAA;AACH,CAAC"}
|
|
@@ -1,268 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { statSync } from 'node:fs';
|
|
3
|
-
import { basename, dirname, extname, join } from 'node:path';
|
|
4
|
-
import { Box, Text } from 'ink';
|
|
5
|
-
import { useMemo, useRef, useState } from 'react';
|
|
6
|
-
import stringWidth from 'string-width';
|
|
7
|
-
import { moveItem, nextSortMode, sortSources } from '../../core/order.js';
|
|
8
|
-
import { mergeOutputPath } from '../../core/output-path.js';
|
|
9
|
-
import { formatBytes } from '../../core/units.js';
|
|
10
|
-
import { useTheme } from '../ThemeContext.js';
|
|
11
|
-
import { colourProp, SYMBOLS } from '../theme.js';
|
|
12
|
-
import { useKeys } from '../useKeys.js';
|
|
13
|
-
import { middleEllipsis } from '../width.js';
|
|
14
|
-
import { HintBar } from './HintBar.js';
|
|
15
|
-
import { Prompt } from './Prompt.js';
|
|
16
|
-
/**
|
|
17
|
-
* Real modification times for `sortSources`'s `newest`/`oldest` modes. A
|
|
18
|
-
* missing or unreadable file (never expected here — everything staged was
|
|
19
|
-
* already probed — but cheap to guard) is simply left out of the map;
|
|
20
|
-
* `sortSources` already treats an absent entry as 0, "oldest", rather than
|
|
21
|
-
* this throwing and taking the picker down with it.
|
|
22
|
-
*/
|
|
23
|
-
function mtimesFor(sources) {
|
|
24
|
-
const map = new Map();
|
|
25
|
-
for (const s of sources) {
|
|
26
|
-
try {
|
|
27
|
-
map.set(s.path, statSync(s.path).mtimeMs);
|
|
28
|
-
}
|
|
29
|
-
catch {
|
|
30
|
-
// left out of the map — see the doc comment above
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
return map;
|
|
34
|
-
}
|
|
35
|
-
const pagesOf = (s) => (s.kind === 'document' ? s.pages : 0);
|
|
36
|
-
/**
|
|
37
|
-
* The reorderable list `/pdf` → Merge plans from.
|
|
38
|
-
*
|
|
39
|
-
* Pick-up-and-move, not a modifier chord: `space` grabs the row under the
|
|
40
|
-
* cursor, arrows then move the *row* rather than the cursor, `space` drops
|
|
41
|
-
* it, `esc` puts it back. Deliberately not `shift+↑↓` — modifier-plus-arrow
|
|
42
|
-
* is the least reliably detected input across terminals, and a held row
|
|
43
|
-
* that visibly travels explains itself where a chord does not.
|
|
44
|
-
*
|
|
45
|
-
* Uncontrolled after mount, the same way `PageGrid` is: `sources` seeds the
|
|
46
|
-
* starting order and this component owns all further edits itself, only
|
|
47
|
-
* ever reporting out through `onSubmit`, `onCancel` and `onTooFew`.
|
|
48
|
-
*/
|
|
49
|
-
export function MergeList({ sources, width, onSubmit, onCancel, onTooFew, heldIndex, }) {
|
|
50
|
-
const palette = useTheme();
|
|
51
|
-
const mtimes = useMemo(() => mtimesFor(sources), [sources]);
|
|
52
|
-
const [order, setOrder] = useState(sources);
|
|
53
|
-
const [cursor, setCursor] = useState(heldIndex ?? 0);
|
|
54
|
-
const [held, setHeld] = useState(heldIndex ?? null);
|
|
55
|
-
const [mode, setMode] = useState('dropped');
|
|
56
|
-
const [renaming, setRenaming] = useState(false);
|
|
57
|
-
const [stemText, setStemText] = useState('');
|
|
58
|
-
const [customStem, setCustomStem] = useState(undefined);
|
|
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 (see the same comment in `Select.tsx` and
|
|
63
|
-
* `PageGrid.tsx`). These refs are the source of truth the handlers below
|
|
64
|
-
* read and write; the `useState` pairs above exist only to trigger a
|
|
65
|
-
* render with the latest value.
|
|
66
|
-
*/
|
|
67
|
-
const orderRef = useRef(order);
|
|
68
|
-
const cursorRef = useRef(cursor);
|
|
69
|
-
const heldRef = useRef(held);
|
|
70
|
-
const modeRef = useRef(mode);
|
|
71
|
-
const customStemRef = useRef(customStem);
|
|
72
|
-
customStemRef.current = customStem;
|
|
73
|
-
/**
|
|
74
|
-
* What `s` sorts from, and what cycling back around to `dropped` restores
|
|
75
|
-
* — `sortSources`'s `dropped` case is identity, so it has to be handed a
|
|
76
|
-
* list rather than reading the screen.
|
|
77
|
-
*
|
|
78
|
-
* Starts as the as-staged order and is replaced whenever a row is dropped
|
|
79
|
-
* somewhere new by hand. Sorting never touches it, so `s` remains
|
|
80
|
-
* reversible; a hand-dragged order is the more expensive thing to lose,
|
|
81
|
-
* and without this someone who dragged a row and then pressed `s` once
|
|
82
|
-
* could never get their arrangement back. `dropped` is also the only mode
|
|
83
|
-
* that renders no `sorted: … ▾` line, so it can honestly mean "the order
|
|
84
|
-
* you have" rather than "the order they arrived in". Also shrinks when `x`
|
|
85
|
-
* removes a file.
|
|
86
|
-
*/
|
|
87
|
-
const baseRef = useRef(sources);
|
|
88
|
-
/** The order to restore to if a held row is put back with `esc`. */
|
|
89
|
-
const heldSnapshotRef = useRef(null);
|
|
90
|
-
const clampIndex = (i, len) => Math.min(Math.max(i, 0), Math.max(0, len - 1));
|
|
91
|
-
const defaultOutputPath = mergeOutputPath(order.map((s) => s.path));
|
|
92
|
-
const outputExt = extname(defaultOutputPath) || '.pdf';
|
|
93
|
-
const outputPath = customStem
|
|
94
|
-
? join(dirname(defaultOutputPath), `${customStem}${outputExt}`)
|
|
95
|
-
: defaultOutputPath;
|
|
96
|
-
const currentOutputPath = () => {
|
|
97
|
-
const def = mergeOutputPath(orderRef.current.map((s) => s.path));
|
|
98
|
-
const stem = customStemRef.current;
|
|
99
|
-
return stem ? join(dirname(def), `${stem}${extname(def) || '.pdf'}`) : def;
|
|
100
|
-
};
|
|
101
|
-
const moveCursor = (delta) => {
|
|
102
|
-
if (heldRef.current !== null) {
|
|
103
|
-
const from = heldRef.current;
|
|
104
|
-
const to = clampIndex(from + delta, orderRef.current.length);
|
|
105
|
-
if (to === from)
|
|
106
|
-
return;
|
|
107
|
-
const next = moveItem(orderRef.current, from, to);
|
|
108
|
-
orderRef.current = next;
|
|
109
|
-
setOrder(next);
|
|
110
|
-
heldRef.current = to;
|
|
111
|
-
setHeld(to);
|
|
112
|
-
cursorRef.current = to;
|
|
113
|
-
setCursor(to);
|
|
114
|
-
return;
|
|
115
|
-
}
|
|
116
|
-
const next = clampIndex(cursorRef.current + delta, orderRef.current.length);
|
|
117
|
-
if (next === cursorRef.current)
|
|
118
|
-
return;
|
|
119
|
-
cursorRef.current = next;
|
|
120
|
-
setCursor(next);
|
|
121
|
-
};
|
|
122
|
-
const toggleHold = () => {
|
|
123
|
-
if (heldRef.current === null) {
|
|
124
|
-
heldSnapshotRef.current = orderRef.current;
|
|
125
|
-
heldRef.current = cursorRef.current;
|
|
126
|
-
setHeld(cursorRef.current);
|
|
127
|
-
}
|
|
128
|
-
else {
|
|
129
|
-
// Dropping a row commits the arrangement: it becomes what `s` sorts
|
|
130
|
-
// from and what cycling back to `dropped` restores (see `baseRef`).
|
|
131
|
-
// Only reached by `space` — `esc` goes through `putBackOrCancel`,
|
|
132
|
-
// which restores the snapshot instead and leaves the baseline alone.
|
|
133
|
-
baseRef.current = orderRef.current;
|
|
134
|
-
heldRef.current = null;
|
|
135
|
-
setHeld(null);
|
|
136
|
-
heldSnapshotRef.current = null;
|
|
137
|
-
}
|
|
138
|
-
};
|
|
139
|
-
const putBackOrCancel = () => {
|
|
140
|
-
if (heldRef.current !== null) {
|
|
141
|
-
const snapshot = heldSnapshotRef.current;
|
|
142
|
-
if (snapshot) {
|
|
143
|
-
orderRef.current = snapshot;
|
|
144
|
-
setOrder(snapshot);
|
|
145
|
-
}
|
|
146
|
-
heldRef.current = null;
|
|
147
|
-
setHeld(null);
|
|
148
|
-
heldSnapshotRef.current = null;
|
|
149
|
-
return;
|
|
150
|
-
}
|
|
151
|
-
onCancel();
|
|
152
|
-
};
|
|
153
|
-
const removeCurrent = () => {
|
|
154
|
-
if (heldRef.current !== null)
|
|
155
|
-
return;
|
|
156
|
-
const i = cursorRef.current;
|
|
157
|
-
const removed = orderRef.current[i];
|
|
158
|
-
if (!removed)
|
|
159
|
-
return;
|
|
160
|
-
const next = orderRef.current.filter((_, idx) => idx !== i);
|
|
161
|
-
orderRef.current = next;
|
|
162
|
-
setOrder(next);
|
|
163
|
-
baseRef.current = baseRef.current.filter((s) => s.path !== removed.path);
|
|
164
|
-
if (next.length < 2) {
|
|
165
|
-
onTooFew(next.length);
|
|
166
|
-
return;
|
|
167
|
-
}
|
|
168
|
-
const clamped = clampIndex(i, next.length);
|
|
169
|
-
cursorRef.current = clamped;
|
|
170
|
-
setCursor(clamped);
|
|
171
|
-
};
|
|
172
|
-
const cycleSort = () => {
|
|
173
|
-
if (heldRef.current !== null)
|
|
174
|
-
return;
|
|
175
|
-
// `modeRef`, not `mode`: two `s` presses delivered in one tick share this
|
|
176
|
-
// render's closure, so reading the state would advance the cycle once for
|
|
177
|
-
// both of them (see the ref note above).
|
|
178
|
-
const next = nextSortMode(modeRef.current);
|
|
179
|
-
const sorted = sortSources(baseRef.current, next, mtimes);
|
|
180
|
-
modeRef.current = next;
|
|
181
|
-
setMode(next);
|
|
182
|
-
orderRef.current = sorted;
|
|
183
|
-
setOrder(sorted);
|
|
184
|
-
const clamped = clampIndex(cursorRef.current, sorted.length);
|
|
185
|
-
cursorRef.current = clamped;
|
|
186
|
-
setCursor(clamped);
|
|
187
|
-
};
|
|
188
|
-
const openRename = () => {
|
|
189
|
-
if (heldRef.current !== null)
|
|
190
|
-
return;
|
|
191
|
-
setStemText(customStemRef.current ?? basename(defaultOutputPath, outputExt));
|
|
192
|
-
setRenaming(true);
|
|
193
|
-
};
|
|
194
|
-
const submitRename = (raw) => {
|
|
195
|
-
const cleaned = raw.trim().replace(/\//g, '-');
|
|
196
|
-
setCustomStem(cleaned === '' ? undefined : cleaned);
|
|
197
|
-
setRenaming(false);
|
|
198
|
-
};
|
|
199
|
-
useKeys((_input, key) => {
|
|
200
|
-
if (key.escape)
|
|
201
|
-
setRenaming(false);
|
|
202
|
-
}, { isActive: renaming });
|
|
203
|
-
useKeys((input, key) => {
|
|
204
|
-
if (key.upArrow)
|
|
205
|
-
moveCursor(-1);
|
|
206
|
-
if (key.downArrow)
|
|
207
|
-
moveCursor(1);
|
|
208
|
-
if (input === ' ')
|
|
209
|
-
toggleHold();
|
|
210
|
-
if (key.escape)
|
|
211
|
-
putBackOrCancel();
|
|
212
|
-
if (input === 'x')
|
|
213
|
-
removeCurrent();
|
|
214
|
-
if (input === 's')
|
|
215
|
-
cycleSort();
|
|
216
|
-
if (input === 'n')
|
|
217
|
-
openRename();
|
|
218
|
-
if (key.return && heldRef.current === null)
|
|
219
|
-
onSubmit(orderRef.current, currentOutputPath());
|
|
220
|
-
}, { isActive: !renaming });
|
|
221
|
-
const totalPages = order.reduce((n, s) => n + pagesOf(s), 0);
|
|
222
|
-
/**
|
|
223
|
-
* Everything on a row that is not the name: two leading spaces, the
|
|
224
|
-
* pick-up mark, a space, the two-digit number, two spaces, then the
|
|
225
|
-
* right-aligned page count (9) and size (10).
|
|
226
|
-
*/
|
|
227
|
-
const ROW_CHROME = 27;
|
|
228
|
-
/**
|
|
229
|
-
* The name column is as wide as the longest name, but never wider than the
|
|
230
|
-
* room left on the row — spec §13: content is truncated, not wrapped. One
|
|
231
|
-
* long filename used to push every row past the terminal width, and Ink
|
|
232
|
-
* wrapped the lot. Measured in columns rather than code units, because
|
|
233
|
-
* `middleEllipsis` budgets in columns and a name can contain a wide glyph.
|
|
234
|
-
*/
|
|
235
|
-
const nameWidth = Math.min(Math.max(0, ...order.map((s) => stringWidth(basename(s.path)))) + 4, Math.max(4, width - ROW_CHROME));
|
|
236
|
-
const rows = order.map((s, i) => {
|
|
237
|
-
const isCursor = i === cursor;
|
|
238
|
-
const isHeld = i === held;
|
|
239
|
-
const mark = isHeld ? '⇅' : isCursor ? SYMBOLS.cursor : ' ';
|
|
240
|
-
const name = middleEllipsis(basename(s.path), nameWidth);
|
|
241
|
-
const numStr = String(i + 1).padStart(2);
|
|
242
|
-
// Padded by column count, not by `padEnd`'s code units, for the same
|
|
243
|
-
// reason the width above is measured in columns.
|
|
244
|
-
const nameStr = `${name}${' '.repeat(Math.max(0, nameWidth - stringWidth(name)))}`;
|
|
245
|
-
const pages = pagesOf(s);
|
|
246
|
-
const pagesStr = `${pages} ${pages === 1 ? 'page' : 'pages'}`.padStart(9);
|
|
247
|
-
const sizeStr = formatBytes(s.bytes).padStart(10);
|
|
248
|
-
const bg = isCursor && palette.selectionBg !== '' ? palette.selectionBg : undefined;
|
|
249
|
-
return (_jsxs(Text, { ...(bg ? { backgroundColor: bg } : {}), children: [_jsx(Text, { children: ' ' }), _jsx(Text, { ...(isCursor || isHeld ? { color: colourProp(palette.accent) } : {}), children: mark }), _jsx(Text, { children: " " }), _jsx(Text, { bold: isCursor, color: colourProp(isCursor ? palette.fg : palette.dim), children: `${numStr} ${nameStr}` }), _jsx(Text, { color: colourProp(palette.dim), children: pagesStr }), _jsx(Text, { color: colourProp(palette.dim), children: sizeStr })] }, s.path));
|
|
250
|
-
});
|
|
251
|
-
const hintPairs = held !== null
|
|
252
|
-
? [
|
|
253
|
-
['↑↓', 'move'],
|
|
254
|
-
['space', 'drop'],
|
|
255
|
-
['esc', 'put back'],
|
|
256
|
-
]
|
|
257
|
-
: [
|
|
258
|
-
['↑↓', 'select'],
|
|
259
|
-
['space', 'pick up'],
|
|
260
|
-
['s', 'sort'],
|
|
261
|
-
['x', 'remove'],
|
|
262
|
-
['n', 'rename'],
|
|
263
|
-
['↵', 'confirm'],
|
|
264
|
-
['esc', 'cancel'],
|
|
265
|
-
];
|
|
266
|
-
return (_jsxs(Box, { flexDirection: "column", children: [_jsx(Text, { color: colourProp(palette.dim), children: `${order.length} ${order.length === 1 ? 'file' : 'files'} to merge` }), _jsx(Box, { flexDirection: "column", marginTop: 1, children: rows }), renaming ? (_jsxs(Box, { flexDirection: "column", marginTop: 1, children: [_jsx(Text, { color: colourProp(palette.label), children: "Name the output" }), _jsx(Prompt, { value: stemText, onChange: setStemText, onSubmit: submitRename, placeholder: basename(defaultOutputPath, outputExt), isActive: true, variant: "field", width: width })] })) : (_jsxs(Box, { flexDirection: "column", marginTop: 1, children: [_jsx(Text, { color: colourProp(palette.dim), children: `${SYMBOLS.longArrow} ${middleEllipsis(outputPath, Math.max(12, width - 4))} · ${totalPages} ${totalPages === 1 ? 'page' : 'pages'}` }), mode !== 'dropped' ? (_jsx(Text, { color: colourProp(palette.dim), children: `sorted: ${mode} ▾` })) : null] })), _jsx(HintBar, { width: width, pairs: hintPairs })] }));
|
|
267
|
-
}
|
|
268
|
-
//# sourceMappingURL=MergeList.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"MergeList.js","sourceRoot":"","sources":["../../../src/shell/components/MergeList.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAA;AAClC,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AAC5D,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAA;AAC/B,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AACjD,OAAO,WAAW,MAAM,cAAc,CAAA;AACtC,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAiB,WAAW,EAAE,MAAM,qBAAqB,CAAA;AACxF,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAA;AAE3D,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAA;AACjD,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;AACvC,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAA;AAC5C,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AACtC,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AAEpC;;;;;;GAMG;AACH,SAAS,SAAS,CAAC,OAAqB;IACtC,MAAM,GAAG,GAAG,IAAI,GAAG,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AK,CAAC,gCAAwB,EAC9D,KAAC,MAAM,IACL,KAAK,EAAE,QAAQ,EACf,QAAQ,EAAE,WAAW,EACrB,QAAQ,EAAE,YAAY,EACtB,WAAW,EAAE,QAAQ,CAAC,iBAAiB,EAAE,SAAS,CAAC,EACnD,QAAQ,QACR,OAAO,EAAC,OAAO,EACf,KAAK,EAAE,KAAK,GACZ,IACE,CACP,CAAC,CAAC,CAAC,CACF,MAAC,GAAG,IAAC,aAAa,EAAC,QAAQ,EAAC,SAAS,EAAE,CAAC,aACtC,KAAC,IAAI,IAAC,KAAK,EAAE,UAAU,CAAC,OAAO,CAAC,GAAG,CAAC,YACjC,GAAG,OAAO,CAAC,SAAS,IAAI,cAAc,CAAC,UAAU,EAAE,IAAI,CAAC,GAAG,CAAC,EAAE,EAAE,KAAK,GAAG,CAAC,CAAC,CAAC,QAAQ,UAAU,IAAI,UAAU,KAAK,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,EAAE,GAClI,EACN,IAAI,KAAK,SAAS,CAAC,CAAC,CAAC,CACpB,KAAC,IAAI,IAAC,KAAK,EAAE,UAAU,CAAC,OAAO,CAAC,GAAG,CAAC,YAAG,WAAW,IAAI,IAAI,GAAQ,CACnE,CAAC,CAAC,CAAC,IAAI,IACJ,CACP,EACD,KAAC,OAAO,IAAC,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,SAAS,GAAI,IACvC,CACP,CAAA;AACH,CAAC"}
|
|
@@ -1,21 +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 { colourProp } from '../theme.js';
|
|
5
|
-
function styleFor(mode, palette) {
|
|
6
|
-
if (mode === 'convert') {
|
|
7
|
-
return { borderStyle: 'single', marker: '↔', colour: palette.modeConvert };
|
|
8
|
-
}
|
|
9
|
-
if (mode === 'compress') {
|
|
10
|
-
return { borderStyle: 'round', marker: '↓', colour: palette.modeCompress };
|
|
11
|
-
}
|
|
12
|
-
return { borderStyle: 'double', marker: '▣', colour: palette.modePdf };
|
|
13
|
-
}
|
|
14
|
-
export function ModeHeader({ mode, title, width, children, }) {
|
|
15
|
-
const palette = useTheme();
|
|
16
|
-
const style = styleFor(mode, palette);
|
|
17
|
-
const compact = width < 40;
|
|
18
|
-
const displayTitle = compact ? (mode === 'pdf' ? 'PDF' : mode) : title;
|
|
19
|
-
return (_jsxs(Box, { flexDirection: "column", width: width, borderStyle: style.borderStyle, borderColor: colourProp(style.colour), paddingX: 1, marginBottom: 1, children: [_jsxs(Text, { children: [_jsx(Text, { color: colourProp(style.colour), bold: true, children: `${style.marker} ${displayTitle}` }), !compact ? _jsx(Text, { color: colourProp(palette.dim), children: ` ${mode.toUpperCase()}` }) : null] }), children] }));
|
|
20
|
-
}
|
|
21
|
-
//# sourceMappingURL=ModeHeader.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ModeHeader.js","sourceRoot":"","sources":["../../../src/shell/components/ModeHeader.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAA;AAE/B,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAA;AAC7C,OAAO,EAAE,UAAU,EAAgB,MAAM,aAAa,CAAA;AAUtD,SAAS,QAAQ,CAAC,IAAe,EAAE,OAAgB;IACjD,IAAI,IAAI,KAAK,SAAS,EAAE,CAAC;QACvB,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,OAAO,CAAC,WAAW,EAAE,CAAA;IAC5E,CAAC;IACD,IAAI,IAAI,KAAK,UAAU,EAAE,CAAC;QACxB,OAAO,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,OAAO,CAAC,YAAY,EAAE,C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