plasalid 0.7.7 → 0.7.8
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.
|
@@ -43,7 +43,7 @@ export function ScanDashboard(props) {
|
|
|
43
43
|
}
|
|
44
44
|
function usePhase(controller) {
|
|
45
45
|
const [phase, setPhase] = useState("parse");
|
|
46
|
-
useEffect(() => controller.subscribe(event => {
|
|
46
|
+
useEffect(() => controller.subscribe((event) => {
|
|
47
47
|
if (event.type === "phase-set")
|
|
48
48
|
setPhase(event.phase);
|
|
49
49
|
}), [controller]);
|
|
@@ -57,13 +57,15 @@ function useRuleWidth() {
|
|
|
57
57
|
return;
|
|
58
58
|
const onResize = () => setCols(stdout.columns ?? 100);
|
|
59
59
|
stdout.on("resize", onResize);
|
|
60
|
-
return () => {
|
|
60
|
+
return () => {
|
|
61
|
+
stdout.off("resize", onResize);
|
|
62
|
+
};
|
|
61
63
|
}, [stdout]);
|
|
62
64
|
return Math.min(cols, 120);
|
|
63
65
|
}
|
|
64
66
|
const PHASE_RENDER = {
|
|
65
67
|
pending: (label) => _jsx(Text, { dimColor: true, children: label }),
|
|
66
|
-
running: (label) => _jsxs(Text, { color: "yellow", children: [_jsx(Spinner, { type: "dots" }), " ", label] }),
|
|
68
|
+
running: (label) => (_jsxs(Text, { color: "yellow", children: [_jsx(Spinner, { type: "dots" }), " ", label] })),
|
|
67
69
|
done: (label) => _jsxs(Text, { color: "green", children: ["\u2713 ", label] }),
|
|
68
70
|
};
|
|
69
71
|
const PHASE_ORDER = ["parse", "clarify", "done"];
|
|
@@ -117,10 +119,10 @@ function FileGroupView({ group }) {
|
|
|
117
119
|
const chunks = Array.from(group.chunks.values()).sort((a, b) => a.pageNumber - b.pageNumber);
|
|
118
120
|
const agg = aggregate(chunks, group.totalChunks);
|
|
119
121
|
const fileName = `> ${truncateMiddle(group.fileName, COL.files - 2)}`;
|
|
120
|
-
return (_jsxs(Box, { flexDirection: "column", children: [_jsx(Row, { status: _jsx(StatusText, { status: agg.status }), files: _jsx(Text, { dimColor: true, children: fileName }), transactions: agg.totalTx, questions: agg.totalQuestions }), chunks.map((c
|
|
122
|
+
return (_jsxs(Box, { flexDirection: "column", children: [_jsx(Row, { status: _jsx(StatusText, { status: agg.status }), files: _jsx(Text, { dimColor: true, children: fileName }), transactions: agg.totalTx, questions: agg.totalQuestions }), chunks.map((c) => (_jsx(ChunkRow, { chunk: c }, c.pageNumber)))] }));
|
|
121
123
|
}
|
|
122
|
-
function ChunkRow({ chunk
|
|
123
|
-
const connector =
|
|
124
|
+
function ChunkRow({ chunk }) {
|
|
125
|
+
const connector = "|-";
|
|
124
126
|
return (_jsx(Row, { status: _jsx(StatusText, { status: chunk.status }), files: _jsx(Text, { dimColor: true, children: ` ${connector} part ${chunk.pageNumber}` }), transactions: chunk.txCount, questions: chunk.questionsCount }));
|
|
125
127
|
}
|
|
126
128
|
function StatusText({ status }) {
|
package/dist/scanner/engine.js
CHANGED
|
@@ -8,7 +8,7 @@ import { errorMessage } from "./result.js";
|
|
|
8
8
|
const chunkPhase = async (_db, state, hooks) => {
|
|
9
9
|
await hooks.beforeChunk?.(state);
|
|
10
10
|
for (const file of state.decrypted)
|
|
11
|
-
state.chunks.push(...await chunkPdf(file));
|
|
11
|
+
state.chunks.push(...(await chunkPdf(file)));
|
|
12
12
|
await hooks.afterChunk?.(state);
|
|
13
13
|
};
|
|
14
14
|
const clarifyPhase = async (db, state, hooks) => {
|