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,94 +0,0 @@
|
|
|
1
|
-
import { extractOutputPaths, suffixedOutputPath } from '../output-path.js';
|
|
2
|
-
import { normalisePages, parseRanges } from '../pages.js';
|
|
3
|
-
// Page operations are pdf-only — see merge.ts's identical comment.
|
|
4
|
-
const soleDocument = (sources) => sources.length === 1 && sources[0]?.kind === 'document' && sources[0].format === 'pdf'
|
|
5
|
-
? sources[0]
|
|
6
|
-
: undefined;
|
|
7
|
-
/**
|
|
8
|
-
* The selected pages, in the one order the engine will use them
|
|
9
|
-
* (`normalisePages`). A raw `values.pages` array arrives in whatever order it
|
|
10
|
-
* was built — the shell's page grid appends in press order — and `plan()`
|
|
11
|
-
* below names an output file per page from this list, so normalising here is
|
|
12
|
-
* what keeps `doc-p5.pdf` holding page 5 rather than whichever page happened
|
|
13
|
-
* to be pressed first. Normalised at this one point rather than at each
|
|
14
|
-
* caller: it is the only place a page list becomes a `Job`.
|
|
15
|
-
*/
|
|
16
|
-
function selectedPages(doc, values) {
|
|
17
|
-
if (Array.isArray(values.pages))
|
|
18
|
-
return normalisePages(values.pages);
|
|
19
|
-
if (typeof values.pages === 'string')
|
|
20
|
-
return normalisePages(parseRanges(values.pages, doc.pages));
|
|
21
|
-
return [];
|
|
22
|
-
}
|
|
23
|
-
const pagesOption = (doc) => ({
|
|
24
|
-
kind: 'text',
|
|
25
|
-
id: 'pages',
|
|
26
|
-
label: 'Pages',
|
|
27
|
-
placeholder: `1-${doc.pages}`,
|
|
28
|
-
});
|
|
29
|
-
export const extractAction = {
|
|
30
|
-
id: 'extract',
|
|
31
|
-
label: 'Extract',
|
|
32
|
-
hint: 'keep only some pages',
|
|
33
|
-
appliesTo: (sources) => soleDocument(sources) !== undefined,
|
|
34
|
-
unavailable: () => 'one PDF at a time',
|
|
35
|
-
options: (sources) => {
|
|
36
|
-
const doc = soleDocument(sources);
|
|
37
|
-
if (!doc)
|
|
38
|
-
return [];
|
|
39
|
-
return [
|
|
40
|
-
pagesOption(doc),
|
|
41
|
-
{
|
|
42
|
-
kind: 'select',
|
|
43
|
-
id: 'separate',
|
|
44
|
-
label: 'Output',
|
|
45
|
-
default: 'one',
|
|
46
|
-
choices: [
|
|
47
|
-
{ value: 'one', label: 'One file', hint: 'all selected pages together' },
|
|
48
|
-
{ value: 'many', label: 'Separate files', hint: 'one per page' },
|
|
49
|
-
],
|
|
50
|
-
},
|
|
51
|
-
];
|
|
52
|
-
},
|
|
53
|
-
plan(sources, values) {
|
|
54
|
-
const doc = soleDocument(sources);
|
|
55
|
-
if (!doc)
|
|
56
|
-
return [];
|
|
57
|
-
const pages = selectedPages(doc, values);
|
|
58
|
-
const separate = values.separate === 'many';
|
|
59
|
-
return [
|
|
60
|
-
{
|
|
61
|
-
op: 'extract',
|
|
62
|
-
sources: [doc],
|
|
63
|
-
outputs: extractOutputPaths(doc.path, pages, separate),
|
|
64
|
-
pages,
|
|
65
|
-
separate,
|
|
66
|
-
},
|
|
67
|
-
];
|
|
68
|
-
},
|
|
69
|
-
};
|
|
70
|
-
export const deleteAction = {
|
|
71
|
-
id: 'delete',
|
|
72
|
-
label: 'Delete',
|
|
73
|
-
hint: 'drop some pages',
|
|
74
|
-
appliesTo: (sources) => soleDocument(sources) !== undefined,
|
|
75
|
-
unavailable: () => 'one PDF at a time',
|
|
76
|
-
options: (sources) => {
|
|
77
|
-
const doc = soleDocument(sources);
|
|
78
|
-
return doc ? [pagesOption(doc)] : [];
|
|
79
|
-
},
|
|
80
|
-
plan(sources, values) {
|
|
81
|
-
const doc = soleDocument(sources);
|
|
82
|
-
if (!doc)
|
|
83
|
-
return [];
|
|
84
|
-
return [
|
|
85
|
-
{
|
|
86
|
-
op: 'delete',
|
|
87
|
-
sources: [doc],
|
|
88
|
-
outputs: [suffixedOutputPath(doc.path, 'trimmed')],
|
|
89
|
-
pages: selectedPages(doc, values),
|
|
90
|
-
},
|
|
91
|
-
];
|
|
92
|
-
},
|
|
93
|
-
};
|
|
94
|
-
//# sourceMappingURL=extract.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"extract.js","sourceRoot":"","sources":["../../../src/core/actions/extract.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,MAAM,mBA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,YAAY,CAAC,OAAO,CAAC,CAAA;QACjC,OAAO,GAAG,CAAC,CAAC,CAAC,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAA;IACtC,CAAC;IACD,IAAI,CAAC,OAAO,EAAE,MAAM;QAClB,MAAM,GAAG,GAAG,YAAY,CAAC,OAAO,CAAC,CAAA;QACjC,IAAI,CAAC,GAAG;YAAE,OAAO,EAAE,CAAA;QACnB,OAAO;YACL;gBACE,EAAE,EAAE,QAAQ;gBACZ,OAAO,EAAE,CAAC,GAAG,CAAC;gBACd,OAAO,EAAE,CAAC,kBAAkB,CAAC,GAAG,CAAC,IAAI,EAAE,SAAS,CAAC,CAAC;gBAClD,KAAK,EAAE,aAAa,CAAC,GAAG,EAAE,MAAM,CAAC;aAClC;SACF,CAAA;IACH,CAAC;CACF,CAAA"}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { compressAction } from './compress.js';
|
|
2
|
-
import { convertAction } from './convert.js';
|
|
3
|
-
import { deleteAction, extractAction } from './extract.js';
|
|
4
|
-
import { mergeAction } from './merge.js';
|
|
5
|
-
import { rotateAction } from './rotate.js';
|
|
6
|
-
import { splitAction } from './split.js';
|
|
7
|
-
export { compressAction, convertAction, deleteAction, extractAction, mergeAction, rotateAction, splitAction, };
|
|
8
|
-
export const ACTIONS = [
|
|
9
|
-
convertAction,
|
|
10
|
-
compressAction,
|
|
11
|
-
mergeAction,
|
|
12
|
-
splitAction,
|
|
13
|
-
extractAction,
|
|
14
|
-
deleteAction,
|
|
15
|
-
rotateAction,
|
|
16
|
-
];
|
|
17
|
-
export function actionsFor(sources) {
|
|
18
|
-
return ACTIONS.filter((a) => a.appliesTo(sources));
|
|
19
|
-
}
|
|
20
|
-
export function unavailableReason(action, sources) {
|
|
21
|
-
return action.appliesTo(sources) ? undefined : action.unavailable?.(sources);
|
|
22
|
-
}
|
|
23
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/core/actions/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAA;AAC9C,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAA;AAC5C,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,cAAc,CAAA;AAC1D,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAA;AACxC,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAC1C,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAA;AAiExC,OAAO,EACL,cAAc,EACd,aAAa,EACb,YAAY,EACZ,aAAa,EACb,WAAW,EACX,YAAY,EACZ,WAAW,GACZ,CAAA;AAED,MAAM,CAAC,MAAM,OAAO,GAAa;IAC/B,aAAa;IACb,cAAc;IACd,WAAW;IACX,WAAW;IACX,aAAa;IACb,YAAY;IACZ,YAAY;CACb,CAAA;AAED,MAAM,UAAU,UAAU,CAAC,OAAqB;IAC9C,OAAO,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC,CAAA;AACpD,CAAC;AAED,MAAM,UAAU,iBAAiB,CAAC,MAAc,EAAE,OAAqB;IACrE,OAAO,MAAM,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,MAAM,CAAC,WAAW,EAAE,CAAC,OAAO,CAAC,CAAA;AAC9E,CAAC"}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { mergeOutputPath } from '../output-path.js';
|
|
2
|
-
// Page operations are pdf-only — a docx/doc has no fixed page tree to
|
|
3
|
-
// merge, split, extract from, delete from, or rotate.
|
|
4
|
-
const documents = (sources) => sources.filter((s) => s.kind === 'document' && s.format === 'pdf');
|
|
5
|
-
export const mergeAction = {
|
|
6
|
-
id: 'merge',
|
|
7
|
-
label: 'Merge',
|
|
8
|
-
hint: 'several files into one',
|
|
9
|
-
appliesTo: (sources) => documents(sources).length >= 2 && documents(sources).length === sources.length,
|
|
10
|
-
unavailable: (sources) => documents(sources).length !== sources.length ? 'PDFs only' : 'needs 2+ files',
|
|
11
|
-
options: () => [],
|
|
12
|
-
plan(sources) {
|
|
13
|
-
return [{ op: 'merge', sources, outputs: [mergeOutputPath(sources.map((s) => s.path))] }];
|
|
14
|
-
},
|
|
15
|
-
};
|
|
16
|
-
//# sourceMappingURL=merge.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"merge.js","sourceRoot":"","sources":["../../../src/core/actions/merge.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAA;AAInD,sEAAsE;AACtE,sDAAsD;AACtD,MAAM,SAAS,GAAG,CAAC,OAAqB,EAAE,EAAE,CAC1C,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,UAAU,IAAI,CAAC,CAAC,MAAM,KAAK,KAAK,CAAC,CAAA;AAEpE,MAAM,CAAC,MAAM,WAAW,GAAW;IACjC,EAAE,EAAE,OAAO;IACX,KAAK,EAAE,OAAO;IACd,IAAI,EAAE,wBAAwB;IAC9B,SAAS,EAAE,CAAC,OAAO,EAAE,EAAE,CACrB,SAAS,CAAC,OAAO,CAAC,CAAC,MAAM,IAAI,CAAC,IAAI,SAAS,CAAC,OAAO,CAAC,CAAC,MAAM,KAAK,OAAO,CAAC,MAAM;IAChF,WAAW,EAAE,CAAC,OAAO,EAAE,EAAE,CACvB,SAAS,CAAC,OAAO,CAAC,CAAC,MAAM,KAAK,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,gBAAgB;IAC/E,OAAO,EAAE,GAAG,EAAE,CAAC,EAAE;IACjB,IAAI,CAAC,OAAO;QACV,OAAO,CAAC,EAAE,EAAE,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,CAAC,eAAe,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAA;IAC3F,CAAC;CACF,CAAA"}
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import { suffixedOutputPath } from '../output-path.js';
|
|
2
|
-
// Page operations are pdf-only — see merge.ts's identical comment.
|
|
3
|
-
const soleDocument = (sources) => sources.length === 1 && sources[0]?.kind === 'document' && sources[0].format === 'pdf'
|
|
4
|
-
? sources[0]
|
|
5
|
-
: undefined;
|
|
6
|
-
export const rotateAction = {
|
|
7
|
-
id: 'rotate',
|
|
8
|
-
label: 'Rotate',
|
|
9
|
-
hint: 'turn pages',
|
|
10
|
-
appliesTo: (sources) => soleDocument(sources) !== undefined,
|
|
11
|
-
unavailable: () => 'one PDF at a time',
|
|
12
|
-
options: () => [
|
|
13
|
-
{
|
|
14
|
-
kind: 'select',
|
|
15
|
-
id: 'degrees',
|
|
16
|
-
label: 'Turn',
|
|
17
|
-
default: '90',
|
|
18
|
-
choices: [
|
|
19
|
-
{ value: '90', label: '90° right', hint: 'a quarter turn' },
|
|
20
|
-
{ value: '180', label: '180°', hint: 'upside down' },
|
|
21
|
-
{ value: '270', label: '90° left', hint: 'a quarter turn back' },
|
|
22
|
-
],
|
|
23
|
-
},
|
|
24
|
-
],
|
|
25
|
-
plan(sources, values) {
|
|
26
|
-
const doc = soleDocument(sources);
|
|
27
|
-
if (!doc)
|
|
28
|
-
return [];
|
|
29
|
-
const deg = Number(values.degrees ?? 90);
|
|
30
|
-
const turns = ((deg / 90) % 4 || 1);
|
|
31
|
-
return [
|
|
32
|
-
{ op: 'rotate', sources: [doc], outputs: [suffixedOutputPath(doc.path, 'rotated')], turns },
|
|
33
|
-
];
|
|
34
|
-
},
|
|
35
|
-
};
|
|
36
|
-
//# sourceMappingURL=rotate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AE,OAAO,EAAE,CAAA;QACnB,MAAM,GAAG,GAAG,MAAM,CAAC,MAAM,CAAC,OAAO,IAAI,EAAE,CAAC,CAAA;QACxC,MAAM,KAAK,GAAG,CAAC,CAAC,GAAG,GAAG,EAAE,CAAC,GAAG,CAAC,IAAI,CAAC,CAAc,CAAA;QAChD,OAAO;YACL,EAAE,EAAE,EAAE,QAAQ,EAAE,OAAO,EAAE,CAAC,GAAG,CAAC,EAAE,OAAO,EAAE,CAAC,kBAAkB,CAAC,GAAG,CAAC,IAAI,EAAE,SAAS,CAAC,CAAC,EAAE,KAAK,EAAE;SAC5F,CAAA;IACH,CAAC;CACF,CAAA"}
|
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
import { invalidArguments } from '../errors.js';
|
|
2
|
-
import { splitOutputPaths } from '../output-path.js';
|
|
3
|
-
import { cutsToRanges } from '../pages.js';
|
|
4
|
-
// Page operations are pdf-only — see merge.ts's identical comment.
|
|
5
|
-
const soleDocument = (sources) => sources.length === 1 && sources[0]?.kind === 'document' && sources[0].format === 'pdf'
|
|
6
|
-
? sources[0]
|
|
7
|
-
: undefined;
|
|
8
|
-
export const splitAction = {
|
|
9
|
-
id: 'split',
|
|
10
|
-
label: 'Split',
|
|
11
|
-
hint: 'into several files',
|
|
12
|
-
appliesTo: (sources) => (soleDocument(sources)?.pages ?? 0) > 1,
|
|
13
|
-
unavailable: (sources) => soleDocument(sources) === undefined ? 'one PDF at a time' : 'only one page',
|
|
14
|
-
options(sources) {
|
|
15
|
-
const doc = soleDocument(sources);
|
|
16
|
-
if (!doc)
|
|
17
|
-
return [];
|
|
18
|
-
return [
|
|
19
|
-
{
|
|
20
|
-
kind: 'select',
|
|
21
|
-
id: 'mode',
|
|
22
|
-
label: 'How',
|
|
23
|
-
default: 'every-page',
|
|
24
|
-
choices: [
|
|
25
|
-
{ value: 'every-page', label: 'Every page', hint: `${doc.pages} files` },
|
|
26
|
-
{ value: 'every-n', label: 'Every N pages', hint: 'ask how many' },
|
|
27
|
-
{ value: 'points', label: 'At points I choose', hint: 'grid' },
|
|
28
|
-
],
|
|
29
|
-
},
|
|
30
|
-
];
|
|
31
|
-
},
|
|
32
|
-
plan(sources, values) {
|
|
33
|
-
const doc = soleDocument(sources);
|
|
34
|
-
if (!doc)
|
|
35
|
-
return [];
|
|
36
|
-
const cuts = Array.isArray(values.cuts) ? values.cuts : [];
|
|
37
|
-
const parts = cutsToRanges(cuts, doc.pages).length;
|
|
38
|
-
return [{ op: 'split', sources: [doc], outputs: splitOutputPaths(doc.path, parts), cuts }];
|
|
39
|
-
},
|
|
40
|
-
};
|
|
41
|
-
/** Cuts after every page — what "every page" means. */
|
|
42
|
-
export function everyPageCuts(pages) {
|
|
43
|
-
return Array.from({ length: Math.max(0, pages - 1) }, (_, i) => i);
|
|
44
|
-
}
|
|
45
|
-
/**
|
|
46
|
-
* Cuts every `n` pages, so a 25-page document at n=10 gives 10, 10, 5.
|
|
47
|
-
*
|
|
48
|
-
* A step below 1 never advances the loop: it used to run until the array hit
|
|
49
|
-
* its maximum length and then throw a bare `RangeError`, which `src/index.ts`
|
|
50
|
-
* rethrows as a stack trace. Both front ends validate before calling — the
|
|
51
|
-
* shell in `flows/pdf.tsx`, the CLI in `cli/args.ts` — so this is a backstop,
|
|
52
|
-
* and it refuses rather than returning "no cuts": a single-part split is a
|
|
53
|
-
* plausible-looking answer to a question nobody asked, which is worse than a
|
|
54
|
-
* refusal a caller can render.
|
|
55
|
-
*/
|
|
56
|
-
export function everyNCuts(pages, n) {
|
|
57
|
-
if (!Number.isInteger(n) || n < 1) {
|
|
58
|
-
throw invalidArguments('Splitting every N pages needs N to be a whole number, at least 1.');
|
|
59
|
-
}
|
|
60
|
-
const cuts = [];
|
|
61
|
-
for (let p = n; p < pages; p += n)
|
|
62
|
-
cuts.push(p - 1);
|
|
63
|
-
return cuts;
|
|
64
|
-
}
|
|
65
|
-
//# sourceMappingURL=split.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3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C7F,CAAC;IACD,MAAM,IAAI,GAAa,EAAE,CAAA;IACzB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,KAAK,EAAE,CAAC,IAAI,CAAC;QAAE,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,CAAA;IACnD,OAAO,IAAI,CAAA;AACb,CAAC"}
|
package/dist/core/atomic.js
DELETED
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
import { randomBytes } from 'node:crypto';
|
|
2
|
-
import { constants } from 'node:fs';
|
|
3
|
-
import { access, mkdir, rename, rm, writeFile } from 'node:fs/promises';
|
|
4
|
-
import { dirname } from 'node:path';
|
|
5
|
-
import { classifyWriteError, outputInvalid, outputPermissionDenied } from './errors.js';
|
|
6
|
-
/**
|
|
7
|
-
* Makes sure the folder `output` will be written into exists and is writable,
|
|
8
|
-
* and says which it is when it is not.
|
|
9
|
-
*
|
|
10
|
-
* The writability check is what catches a read-only destination. `mkdir -p`
|
|
11
|
-
* succeeds on a folder that already exists, and Sharp's own write error
|
|
12
|
-
* carries no errno — only "system error: Permission denied" in its message —
|
|
13
|
-
* so without this a locked folder surfaced as a generic "Conversion failed".
|
|
14
|
-
* Inputs have always been checked the same way (`engines/image.ts`, spec
|
|
15
|
-
* §11); this is the output side. Shared by both atomic writers below and in
|
|
16
|
-
* `engines/image.ts`, so every engine reports it the same way.
|
|
17
|
-
*/
|
|
18
|
-
export async function prepareOutputDir(output) {
|
|
19
|
-
const dir = dirname(output);
|
|
20
|
-
try {
|
|
21
|
-
await mkdir(dir, { recursive: true });
|
|
22
|
-
}
|
|
23
|
-
catch (cause) {
|
|
24
|
-
const classified = classifyWriteError(output, cause);
|
|
25
|
-
throw classified === cause ? outputInvalid(output, cause) : classified;
|
|
26
|
-
}
|
|
27
|
-
try {
|
|
28
|
-
await access(dir, constants.W_OK);
|
|
29
|
-
}
|
|
30
|
-
catch (cause) {
|
|
31
|
-
throw outputPermissionDenied(output, cause);
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
/**
|
|
35
|
-
* Invariant 6: temp file, then rename. Never a partial file at the real path.
|
|
36
|
-
*
|
|
37
|
-
* Shared by every engine that writes bytes it already holds in memory (as
|
|
38
|
-
* opposed to `image.ts`'s Sharp-pipeline variant, which streams an encode
|
|
39
|
-
* straight to the temp file and is a genuinely different function — see that
|
|
40
|
-
* file's own `writeAtomic`).
|
|
41
|
-
*
|
|
42
|
-
* Cleanup must never mask the original error: if the write or rename fails
|
|
43
|
-
* and the best-effort `rm` of the temp file then *also* fails (EACCES, EBUSY,
|
|
44
|
-
* ...), the caller must still see the real cause, not the cleanup failure.
|
|
45
|
-
*/
|
|
46
|
-
export async function writeAtomic(path, bytes) {
|
|
47
|
-
await prepareOutputDir(path);
|
|
48
|
-
const temp = `${path}.${randomBytes(6).toString('hex')}.tmp`;
|
|
49
|
-
try {
|
|
50
|
-
await writeFile(temp, bytes);
|
|
51
|
-
await rename(temp, path);
|
|
52
|
-
return bytes.byteLength;
|
|
53
|
-
}
|
|
54
|
-
catch (e) {
|
|
55
|
-
// `force` only swallows ENOENT. A cleanup failure (EACCES, EBUSY, ...)
|
|
56
|
-
// must never replace the real error that is about to be thrown.
|
|
57
|
-
await rm(temp, { force: true }).catch(() => { });
|
|
58
|
-
throw classifyWriteError(path, e);
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
//# sourceMappingURL=atomic.js.map
|
package/dist/core/atomic.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"atomic.js","sourceRoot":"","sources":["../../src/core/atomic.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAA;AACzC,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAA;AACnC,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAA;AACvE,OAAO,EAAE,OAAO,EAAE,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QAChE,MAAM,EAAE,CAAC,IAAI,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC,KAAK,CAAC,GAAG,EAAE,GAAE,CAAC,CAAC,CAAA;QAC/C,MAAM,kBAAkB,CAAC,IAAI,EAAE,CAAC,CAAC,CAAA;IACnC,CAAC;AACH,CAAC"}
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
import { pdfiumEngine } from '../engines/pdfium.js';
|
|
2
|
-
import { ENGINES } from '../engines/registry.js';
|
|
3
|
-
import { FORMATS } from './formats.js';
|
|
4
|
-
function sortByRegistryOrder(ids) {
|
|
5
|
-
const order = Object.keys(FORMATS);
|
|
6
|
-
return [...ids].sort((a, b) => order.indexOf(a) - order.indexOf(b));
|
|
7
|
-
}
|
|
8
|
-
/**
|
|
9
|
-
* The single source of truth for "what can this file become". Nothing else in
|
|
10
|
-
* the codebase may hardcode a format list — a new engine has to change the
|
|
11
|
-
* menu everywhere at once, and this is how that happens.
|
|
12
|
-
*/
|
|
13
|
-
export function targetIdsFor(source) {
|
|
14
|
-
const ids = new Set();
|
|
15
|
-
for (const engine of ENGINES) {
|
|
16
|
-
if (!engine.reads.has(source.format))
|
|
17
|
-
continue;
|
|
18
|
-
for (const id of engine.writes)
|
|
19
|
-
ids.add(id);
|
|
20
|
-
}
|
|
21
|
-
return sortByRegistryOrder([...ids]);
|
|
22
|
-
}
|
|
23
|
-
export function targetsFor(source) {
|
|
24
|
-
return targetIdsFor(source).map((id) => ({
|
|
25
|
-
id,
|
|
26
|
-
label: FORMATS[id].label,
|
|
27
|
-
hint: FORMATS[id].hint,
|
|
28
|
-
lossy: FORMATS[id].lossy,
|
|
29
|
-
}));
|
|
30
|
-
}
|
|
31
|
-
export function canConvert(source, target) {
|
|
32
|
-
return targetIdsFor(source).includes(target);
|
|
33
|
-
}
|
|
34
|
-
export function readableFormats() {
|
|
35
|
-
const ids = new Set();
|
|
36
|
-
for (const engine of ENGINES)
|
|
37
|
-
for (const id of engine.reads)
|
|
38
|
-
ids.add(id);
|
|
39
|
-
return sortByRegistryOrder([...ids]);
|
|
40
|
-
}
|
|
41
|
-
export function writableFormats() {
|
|
42
|
-
const ids = new Set();
|
|
43
|
-
for (const engine of ENGINES)
|
|
44
|
-
for (const id of engine.writes)
|
|
45
|
-
ids.add(id);
|
|
46
|
-
return sortByRegistryOrder([...ids]);
|
|
47
|
-
}
|
|
48
|
-
/**
|
|
49
|
-
* Whether a `convert` job targeting this format is a rasterisation — a
|
|
50
|
-
* document source becoming pixels — versus a document-to-document
|
|
51
|
-
* conversion (pdf/docx/doc). Read from pdfium's own declared `writes`
|
|
52
|
-
* rather than a hardcoded `['jpeg', 'png']` (invariant 2): the only engine
|
|
53
|
-
* that turns a page into an image is `pdfiumEngine`, so whatever it writes
|
|
54
|
-
* *is* the definition of "rasterises."
|
|
55
|
-
*/
|
|
56
|
-
export function rasterises(target) {
|
|
57
|
-
return pdfiumEngine.writes.has(target);
|
|
58
|
-
}
|
|
59
|
-
//# sourceMappingURL=capabilities.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"capabilities.js","sourceRoot":"","sources":["../../src/core/capabilities.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAA;AACnD,OAAO,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAA;AAChD,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AAUtC,SAAS,mBAAmB,CAAC,GAAe;IAC1C,MAAM,KAAK,GAAG,MAAM,CAAC,IAAI,CAAC,OAAO,CAAe,CAAA;IAChD,OAAO,CAAC,GAAG,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAA;AACrE,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,YAAY,CAA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AM,IAAI,OAAO;QAAE,KAAK,MAAM,EAAE,IAAI,MAAM,CAAC,MAAM;YAAE,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC,CAAA;IACzE,OAAO,mBAAmB,CAAC,CAAC,GAAG,GAAG,CAAC,CAAC,CAAA;AACtC,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,UAAU,CAAC,MAAgB;IACzC,OAAO,YAAY,CAAC,MAAM,CAAC,GAAG,CAAC,MAAM,CAAC,CAAA;AACxC,CAAC"}
|
package/dist/core/compress.js
DELETED
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
const DEFAULT_MIN = 1;
|
|
2
|
-
const DEFAULT_MAX = 100;
|
|
3
|
-
/**
|
|
4
|
-
* How many encodes the search can possibly need.
|
|
5
|
-
*
|
|
6
|
-
* Known before the search starts, which is what lets progress be reported
|
|
7
|
-
* honestly: `attempt 3 of 8` is a real position in a bounded sequence, not a
|
|
8
|
-
* percentage invented to look like movement. Spec §12 forbids the latter, and
|
|
9
|
-
* a made-up denominator is the same offence.
|
|
10
|
-
*
|
|
11
|
-
* The `+ 1` is the probe at `max` that always runs before the search proper.
|
|
12
|
-
* The design doc put this bound at `ceil(log2(100))` = 7, which counted the
|
|
13
|
-
* bisection steps and forgot the probe; the search really can take 8, and
|
|
14
|
-
* reporting "attempt 8 of 7" would be exactly the dishonesty this number
|
|
15
|
-
* exists to prevent.
|
|
16
|
-
*/
|
|
17
|
-
export function maxAttempts(min = DEFAULT_MIN, max = DEFAULT_MAX) {
|
|
18
|
-
const range = Math.max(1, max - min + 1);
|
|
19
|
-
return 1 + Math.max(0, Math.ceil(Math.log2(range)));
|
|
20
|
-
}
|
|
21
|
-
/**
|
|
22
|
-
* The highest quality whose encoded size fits within `targetBytes`.
|
|
23
|
-
*
|
|
24
|
-
* Assumes only that size rises with quality, which holds for every encoder
|
|
25
|
-
* Forge uses. `encode` is a parameter rather than an import so this module
|
|
26
|
-
* stays free of Sharp and can be tested against arithmetic — and so the same
|
|
27
|
-
* search will serve a PDF encoder later without knowing anything about it.
|
|
28
|
-
*/
|
|
29
|
-
export async function findQuality(req) {
|
|
30
|
-
const min = req.min ?? DEFAULT_MIN;
|
|
31
|
-
const max = req.max ?? DEFAULT_MAX;
|
|
32
|
-
const of = maxAttempts(min, max);
|
|
33
|
-
let attempt = 0;
|
|
34
|
-
const measure = async (quality) => {
|
|
35
|
-
attempt += 1;
|
|
36
|
-
req.onAttempt?.(attempt, of);
|
|
37
|
-
return req.encode(quality);
|
|
38
|
-
};
|
|
39
|
-
/**
|
|
40
|
-
* Checked before each encode rather than after: the point of cancelling is
|
|
41
|
-
* to not spend the next several seconds encoding, so the test that matters
|
|
42
|
-
* is "may I start this one", not "was that one wasted".
|
|
43
|
-
*/
|
|
44
|
-
const cancelled = () => req.signal?.aborted === true;
|
|
45
|
-
// The best case first: if the largest size already fits, there is nothing
|
|
46
|
-
// to search for and the user keeps every bit of quality.
|
|
47
|
-
const atMax = await measure(max);
|
|
48
|
-
if (cancelled())
|
|
49
|
-
return { quality: max, bytes: atMax, missed: false, cancelled: true };
|
|
50
|
-
if (atMax <= req.targetBytes)
|
|
51
|
-
return { quality: max, bytes: atMax, missed: false };
|
|
52
|
-
let low = min;
|
|
53
|
-
let high = max;
|
|
54
|
-
let best;
|
|
55
|
-
while (low <= high) {
|
|
56
|
-
const mid = Math.floor((low + high) / 2);
|
|
57
|
-
const bytes = await measure(mid);
|
|
58
|
-
if (cancelled())
|
|
59
|
-
return { quality: mid, bytes, missed: false, cancelled: true };
|
|
60
|
-
if (bytes <= req.targetBytes) {
|
|
61
|
-
best = { quality: mid, bytes, missed: false };
|
|
62
|
-
low = mid + 1;
|
|
63
|
-
}
|
|
64
|
-
else {
|
|
65
|
-
high = mid - 1;
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
if (best)
|
|
69
|
-
return best;
|
|
70
|
-
// Nothing fits. Report the smallest achievable rather than writing a file
|
|
71
|
-
// that quietly misses the number the user asked for — the caller shows this
|
|
72
|
-
// so they learn what is actually possible.
|
|
73
|
-
const floor = await req.encode(min);
|
|
74
|
-
return { quality: min, bytes: floor, missed: true };
|
|
75
|
-
}
|
|
76
|
-
//# sourceMappingURL=compress.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"compress.js","sourceRoot":"","sources":["../../src/core/compress.ts"],"names":[],"mappings":"AA6BA,MAAM,WAAW,GAAG,CAAC,CAAA;AACrB,MAAM,WAAW,GAAG,GAAG,CAAA;AAEvB;;;;;;;;;;;;;GAaG;AACH,MAAM,UAAU,WAAW,CAAC,GAAG,GAAW,WAAW,EAAE,GAAG,GAAW,WAAW;IAC9E,MAAM,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,GAAG,GAAG,GAAG,GAAG,CAAC,CAAC,CAAA;IACxC,OAAO,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAA;AACrD,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,CAAC,KAAK,UAAU,WAAW,CAAC,GAAkB;IAClD,MAAM,GAAG,GAAG,GAAG,CAAC,GAAG,IAAI,WAAW,CAAA;IAClC,MAAM,GAAG,GAAG,GAAG,CAAC,GAAG,IAAI,WAAW,CAAA;IAClC,MAAM,EAAE,GAAG,WAAW,CAAC,GAAG,EAAE,GAAG,CAAC,CAAA;IAChC,IAAI,OAAO,GAAG,CAAC,CAAA;IAEf,MAAM,OAAO,GAAG,KAAK,EAAE,OAAe,EAAmB,EAAE;QACzD,OAAO,IAAI,CAAC,CAAA;QACZ,GAAG,CAAC,SAAS,EAAE,CAAC,OAAO,EAAE,EAAE,CAAC,CAAA;QAC5B,OAAO,GAAG,CAAC,MAAM,CAAC,OAAO,CAAC,CAAA;IAC5B,CAAC,CAAA;IAED;;;;OAIG;IACH,MAAM,SAAS,GAAG,GAAG,EAAE,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AAM,KAAK,GAAG,MAAM,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAA;IACnC,OAAO,EAAE,OAAO,EAAE,GAAG,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,CAAA;AACrD,CAAC"}
|
package/dist/core/describe.js
DELETED
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* `compressAction.plan()` emits `op: 'convert'` jobs — `cli/execute.ts` asserts
|
|
3
|
-
* exactly that before using one — so compress and convert are the same
|
|
4
|
-
* operation and cannot be told apart by `op`. What separates them is whether
|
|
5
|
-
* the target format is the source's own: a compress re-encodes in place, a
|
|
6
|
-
* convert does not. `/convert jpeg → jpeg` at a lower quality therefore reads
|
|
7
|
-
* as "compressed", which is accurate rather than a mislabelling.
|
|
8
|
-
*/
|
|
9
|
-
function verbFor(job) {
|
|
10
|
-
switch (job.op) {
|
|
11
|
-
case 'convert':
|
|
12
|
-
return job.target === job.sources[0].format ? 'compressed' : 'converted';
|
|
13
|
-
case 'merge':
|
|
14
|
-
return 'merged';
|
|
15
|
-
case 'split':
|
|
16
|
-
return 'split';
|
|
17
|
-
case 'extract':
|
|
18
|
-
return 'extracted';
|
|
19
|
-
case 'delete':
|
|
20
|
-
return 'deleted from';
|
|
21
|
-
case 'rotate':
|
|
22
|
-
return 'rotated';
|
|
23
|
-
default: {
|
|
24
|
-
/**
|
|
25
|
-
* A new `op` fails to compile here, in one place, rather than silently
|
|
26
|
-
* mislabelling in whichever front end forgot it. This is what lets
|
|
27
|
-
* `shell/blocks.tsx` drop its "cannot render a result yet" throw.
|
|
28
|
-
*/
|
|
29
|
-
const unhandled = job;
|
|
30
|
-
throw new Error(`describeResult has no verb for ${JSON.stringify(unhandled)}`);
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
export function describeResult(result) {
|
|
35
|
-
const { job } = result;
|
|
36
|
-
const sources = job.sources.map((s) => ({ path: s.path, bytes: s.bytes }));
|
|
37
|
-
// A ratio only means something when one file became one file. A twenty-page
|
|
38
|
-
// render has no "before" to compare each output against.
|
|
39
|
-
const only = sources.length === 1 && job.outputs.length === 1 ? sources[0] : undefined;
|
|
40
|
-
return {
|
|
41
|
-
verb: verbFor(job),
|
|
42
|
-
sources,
|
|
43
|
-
outputs: [...job.outputs],
|
|
44
|
-
outputBytes: result.outputBytes,
|
|
45
|
-
...(only ? { size: { from: only.bytes, to: result.outputBytes } } : {}),
|
|
46
|
-
warnings: result.warnings,
|
|
47
|
-
};
|
|
48
|
-
}
|
|
49
|
-
//# sourceMappingURL=describe.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"describe.js","sourceRoot":"","sources":["../../src/core/describe.ts"],"names":[],"mappings":"AA0CA;;;;;;;GAOG;AACH,SAAS,OAAO,CAAC,GAAQ;IACvB,QAAQ,GAAG,CAAC,EAAE,EAAE,CAAC;QACf,KAAK,SAAS;YACZ,OAAO,GAAG,CAAC,MAAM,KAAK,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,WAAW,CAAA;QAC1E,KAAK,OAAO;YACV,OAAO,QAAQ,CAAA;QACjB,KAAK,OAAO;YACV,OAAO,OAAO,CAAA;QAChB,KAAK,SAAS;YACZ,OAAO,WAAW,CAAA;QACpB,KAAK,QAAQ;YACX,OAAO,cAAc,CAAA;QACvB,KAAK,QAAQ;YACX,OAAO,SAAS,CAAA;QAClB,SAAS,CAAC;YACR;;;;eAIG;YACH,MAAM,SAAS,GAAU,GAAG,CAAA;YAC5B,MAAM,IAAI,KAAK,CAAC,kCAAkC,IAAI,CAAC,SAAS,CAAC,SAAS,CAAC,EAAE,CAAC,CAAA;QAChF,CAAC;IACH,CAAC;AACH,CAAC;AAED,MAAM,UAAU,cAAc,CAAC,MAAc;IAC3C,MAAM,EAAE,GAAG,EAAE,GAAG,MAAM,CAAA;IACtB,MAA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