gutterpress 0.11.19 → 0.11.20-alpha.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/dist/api/index.js +2 -2
- package/dist/{build-czbaj4qf.js → build-cmf4nbpm.js} +4 -4
- package/dist/{cli-cgbzdrwz.js → cli-7shp2kmj.js} +1 -1
- package/dist/{cli-dzw28t3s.js → cli-mmm22cza.js} +2 -1
- package/dist/{cli-xx94a1k6.js → cli-rtpm04dv.js} +4 -4
- package/dist/{cli-aw614ztv.js → cli-x1nfhaf1.js} +25 -14
- package/dist/cli.js +12 -12
- package/dist/{doctor-6e9perj7.js → doctor-0d6esj02.js} +2 -2
- package/dist/{engine-fe0n7v9p.js → engine-1v8kmv3a.js} +1 -1
- package/dist/{engine-zehw6tkv.js → engine-adxptzf0.js} +2 -2
- package/dist/{ext-kavfk1zn.js → ext-65nfh7st.js} +4 -4
- package/dist/{gutterpress-viewer-k4mpqjh0.js → gutterpress-viewer-0r4rt4de.js} +222 -233
- package/dist/{index-g7vszjqf.js → index-1y885h1j.js} +25 -13
- package/dist/{index-b866g2ph.js → index-cngw658w.js} +1 -1
- package/dist/{index-jt552wtf.js → index-pnvzgftg.js} +4 -4
- package/dist/index.js +3 -3
- package/dist/lib/ghostscript.d.ts +7 -0
- package/dist/{manifest.schema-5pzhscqh.json → manifest.schema-nrykd2c6.json} +14 -1
- package/dist/{new-ckpas1ya.js → new-y4a2xz3g.js} +4 -4
- package/dist/{preflight-yh57q9nn.js → preflight-kt7wfgbd.js} +4 -4
- package/dist/preview/file-watcher.d.ts +9 -1
- package/dist/{preview-a4x2ezjp.js → preview-5ze728kp.js} +4 -4
- package/dist/{preview-interface-2n1d9pbf.js → preview-interface-k2mj5kvq.js} +12 -12
- package/dist/{preview-shell-hyp7g158.js → preview-shell-7jfe6vsc.js} +3 -3
- package/dist/{publish-sfn5hmnx.js → publish-5tpcyysh.js} +4 -4
- package/dist/schema/manifest.types.d.ts +17 -3
- package/dist/{validate-281rsdsv.js → validate-p0hkqkfe.js} +4 -4
- package/package.json +1 -1
package/dist/api/index.js
CHANGED
|
@@ -137,11 +137,11 @@ import {
|
|
|
137
137
|
testRemoteAccess,
|
|
138
138
|
updateExtensions,
|
|
139
139
|
validateProjectExtensions
|
|
140
|
-
} from "../index-
|
|
140
|
+
} from "../index-1y885h1j.js";
|
|
141
141
|
import"../index-ht1bcqdd.js";
|
|
142
142
|
import {
|
|
143
143
|
BuildError
|
|
144
|
-
} from "../index-
|
|
144
|
+
} from "../index-pnvzgftg.js";
|
|
145
145
|
import {
|
|
146
146
|
DEFAULT_PRINT_OPTS,
|
|
147
147
|
assertMilestone,
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import {
|
|
2
2
|
runBuild,
|
|
3
3
|
splitOutPath
|
|
4
|
-
} from "./cli-
|
|
4
|
+
} from "./cli-x1nfhaf1.js";
|
|
5
5
|
import {
|
|
6
6
|
log
|
|
7
|
-
} from "./cli-
|
|
7
|
+
} from "./cli-mmm22cza.js";
|
|
8
8
|
import {
|
|
9
9
|
UsageError,
|
|
10
10
|
parseFormat,
|
|
11
11
|
parsePdfxFlavor,
|
|
12
12
|
rejectExtraPositionals,
|
|
13
13
|
rejectUnknownFlags
|
|
14
|
-
} from "./cli-
|
|
14
|
+
} from "./cli-7shp2kmj.js";
|
|
15
15
|
import"./cli-ht1bcqdd.js";
|
|
16
|
-
import"./cli-
|
|
16
|
+
import"./cli-rtpm04dv.js";
|
|
17
17
|
import {
|
|
18
18
|
BuildError
|
|
19
19
|
} from "./cli-46ycxe6r.js";
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
// package.json
|
|
5
5
|
var package_default = {
|
|
6
6
|
name: "gutterpress",
|
|
7
|
-
version: "0.11.
|
|
7
|
+
version: "0.11.20-alpha.1",
|
|
8
8
|
description: "Markdown-to-PDF converter for professional print layout using a native Chromium print engine and Ghostscript.",
|
|
9
9
|
author: "itlackey",
|
|
10
10
|
license: "MPL-2.0",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
package_default
|
|
3
|
-
} from "./cli-
|
|
3
|
+
} from "./cli-7shp2kmj.js";
|
|
4
4
|
import {
|
|
5
5
|
enhancedPath,
|
|
6
6
|
execCapture,
|
|
@@ -332,6 +332,7 @@ async function convertToPdfxCmyk(inputPdf, outPdf, config) {
|
|
|
332
332
|
"-dDownsampleColorImages=false",
|
|
333
333
|
"-dDownsampleGrayImages=false",
|
|
334
334
|
"-dDownsampleMonoImages=false",
|
|
335
|
+
...config.rasterDpi ? [`-r${config.rasterDpi}`] : [],
|
|
335
336
|
"-sProcessColorModel=DeviceCMYK",
|
|
336
337
|
"-sColorConversionStrategy=CMYK",
|
|
337
338
|
"-dOverrideICC=true",
|
|
@@ -1116,22 +1116,22 @@ import { fileURLToPath } from "node:url";
|
|
|
1116
1116
|
var favicon_default = "./favicon-272ga6y0.ico";
|
|
1117
1117
|
|
|
1118
1118
|
// src/assets/manifest.schema.json
|
|
1119
|
-
var manifest_schema_default = "./manifest.schema-
|
|
1119
|
+
var manifest_schema_default = "./manifest.schema-nrykd2c6.json";
|
|
1120
1120
|
|
|
1121
1121
|
// src/assets/preview/scripts/preview-interface.js
|
|
1122
|
-
var preview_interface_default = "./preview-interface-
|
|
1122
|
+
var preview_interface_default = "./preview-interface-k2mj5kvq.js";
|
|
1123
1123
|
|
|
1124
1124
|
// src/assets/preview/scripts/preview-bridge.js
|
|
1125
1125
|
var preview_bridge_default = "./preview-bridge-evecsh4w.js";
|
|
1126
1126
|
|
|
1127
1127
|
// src/assets/preview/scripts/preview-shell.js
|
|
1128
|
-
var preview_shell_default = "./preview-shell-
|
|
1128
|
+
var preview_shell_default = "./preview-shell-7jfe6vsc.js";
|
|
1129
1129
|
|
|
1130
1130
|
// profiles/CGATS21_CRPC1.icc
|
|
1131
1131
|
var CGATS21_CRPC1_default = "./CGATS21_CRPC1-g0e3k7kr.icc";
|
|
1132
1132
|
|
|
1133
1133
|
// src/assets/engine/gutterpress-viewer.js
|
|
1134
|
-
var gutterpress_viewer_default = "./gutterpress-viewer-
|
|
1134
|
+
var gutterpress_viewer_default = "./gutterpress-viewer-0r4rt4de.js";
|
|
1135
1135
|
|
|
1136
1136
|
// src/assets/engine/gutterpress-agent.js
|
|
1137
1137
|
var gutterpress_agent_default = "./gutterpress-agent-cazqstr1.js";
|
|
@@ -14,12 +14,12 @@ import {
|
|
|
14
14
|
stampCreator,
|
|
15
15
|
stripAnnotations,
|
|
16
16
|
warn
|
|
17
|
-
} from "./cli-
|
|
17
|
+
} from "./cli-mmm22cza.js";
|
|
18
18
|
import {
|
|
19
19
|
DEBOUNCE,
|
|
20
20
|
UsageError,
|
|
21
21
|
resolvePort
|
|
22
|
-
} from "./cli-
|
|
22
|
+
} from "./cli-7shp2kmj.js";
|
|
23
23
|
import {
|
|
24
24
|
blackTextToGray
|
|
25
25
|
} from "./cli-ht1bcqdd.js";
|
|
@@ -28,7 +28,7 @@ import {
|
|
|
28
28
|
getAssetPath,
|
|
29
29
|
getAssetsDir,
|
|
30
30
|
lastPageMode
|
|
31
|
-
} from "./cli-
|
|
31
|
+
} from "./cli-rtpm04dv.js";
|
|
32
32
|
import {
|
|
33
33
|
BuildError,
|
|
34
34
|
EXIT_CODES
|
|
@@ -116,13 +116,15 @@ var DTRPG_PRESET = {
|
|
|
116
116
|
flavor: "x1a",
|
|
117
117
|
icc: "profiles/CGATS21_CRPC1.icc",
|
|
118
118
|
stripAnnotations: true,
|
|
119
|
-
blackText: "k-only"
|
|
119
|
+
blackText: "k-only",
|
|
120
|
+
rasterDpi: undefined
|
|
120
121
|
},
|
|
121
122
|
page: {
|
|
122
123
|
width: 621,
|
|
123
124
|
height: 810,
|
|
124
125
|
tolerance: 0.5,
|
|
125
|
-
bleed: 9
|
|
126
|
+
bleed: 9,
|
|
127
|
+
safe: 18
|
|
126
128
|
},
|
|
127
129
|
ink: {
|
|
128
130
|
maxTac: 240,
|
|
@@ -193,13 +195,15 @@ var BOOK_PRESET = {
|
|
|
193
195
|
flavor: "x1a",
|
|
194
196
|
icc: "profiles/CGATS21_CRPC1.icc",
|
|
195
197
|
stripAnnotations: true,
|
|
196
|
-
blackText: "icc"
|
|
198
|
+
blackText: "icc",
|
|
199
|
+
rasterDpi: undefined
|
|
197
200
|
},
|
|
198
201
|
page: {
|
|
199
202
|
width: 432,
|
|
200
203
|
height: 648,
|
|
201
204
|
tolerance: 0.5,
|
|
202
|
-
bleed: undefined
|
|
205
|
+
bleed: undefined,
|
|
206
|
+
safe: 18
|
|
203
207
|
},
|
|
204
208
|
ink: {
|
|
205
209
|
maxTac: 400,
|
|
@@ -547,7 +551,8 @@ function resolveCustomPage(c, m) {
|
|
|
547
551
|
width,
|
|
548
552
|
height,
|
|
549
553
|
tolerance: c.page?.tolerance ?? m.page?.tolerance ?? 0.5,
|
|
550
|
-
bleed: c.page?.bleed ?? m.page?.bleed
|
|
554
|
+
bleed: c.page?.bleed ?? m.page?.bleed,
|
|
555
|
+
safe: c.page?.safe ?? m.page?.safe
|
|
551
556
|
};
|
|
552
557
|
}
|
|
553
558
|
function resolveWithPreset(cliOverrides, manifest, preset) {
|
|
@@ -580,6 +585,10 @@ function resolveWithPreset(cliOverrides, manifest, preset) {
|
|
|
580
585
|
if (lastPage !== undefined && lastPage !== "blank" && lastPage !== "short-by-one") {
|
|
581
586
|
throw new UsageError(`Manifest field \`print.lastPage\` must be "blank" or "short-by-one", got ${JSON.stringify(lastPage)}.`);
|
|
582
587
|
}
|
|
588
|
+
const rasterDpi = c.pdfx?.rasterDpi ?? m.pdfx?.rasterDpi;
|
|
589
|
+
if (rasterDpi !== undefined && !(Number.isInteger(rasterDpi) && rasterDpi >= 72 && rasterDpi <= 1200)) {
|
|
590
|
+
throw new UsageError(`Manifest field \`pdfx.rasterDpi\` must be a whole number from 72 to 1200, got ${JSON.stringify(rasterDpi)}.`);
|
|
591
|
+
}
|
|
583
592
|
const rawExtensions = c.extensions ?? m.extensions ?? [];
|
|
584
593
|
if (!Array.isArray(rawExtensions)) {
|
|
585
594
|
throw new UsageError("Manifest field `extensions` must be a list of specifiers.");
|
|
@@ -10256,7 +10265,7 @@ class PdfOutput {
|
|
|
10256
10265
|
const rawPdf = pdfxMode ? path13.join(stage, "raw.pdf") : path13.resolve(pdfFile);
|
|
10257
10266
|
await fsp2.mkdir(path13.dirname(path13.resolve(pdfFile)), { recursive: true });
|
|
10258
10267
|
log.info("Rendering HTML to PDF via the Gutterpress engine (native Chromium pagination)");
|
|
10259
|
-
const { buildNativePdf } = await import("./engine-
|
|
10268
|
+
const { buildNativePdf } = await import("./engine-1v8kmv3a.js");
|
|
10260
10269
|
const engineDiagnostics = await buildNativePdf(htmlFile, rawPdf, {
|
|
10261
10270
|
title: config.title,
|
|
10262
10271
|
author: config.authors.length > 0 ? config.authors.join(", ") : undefined,
|
|
@@ -10279,7 +10288,7 @@ class PdfOutput {
|
|
|
10279
10288
|
const icc = opts.iccPath ?? config.pdfx.icc;
|
|
10280
10289
|
effectiveIccPath = await resolveIccProfile(icc, manifestDir, opts.iccPath);
|
|
10281
10290
|
if (await hasLiveTransparency(await fsp2.readFile(rawPdf))) {
|
|
10282
|
-
log.warn("This book uses transparency — an image with an alpha channel, or a CSS " + `rule like \`opacity\` or \`mix-blend-mode\`. PDF/${pdfxMode === "x1a" ? "X-1a" : "X-3"} has no way to represent that (both are based on PDF 1.3, which predates PDF transparency), so Ghostscript will flatten every page that uses it into a single raster ` + "image — that page loses its embedded fonts and searchable text in the " + "PDF/X output. To keep vector text, remove the `opacity`/blend rule and flatten any alpha-channel image against its intended background before including it (export it with no alpha channel), or build --format pdf instead of pdfx if this book doesn't need print-ready CMYK.");
|
|
10291
|
+
log.warn("This book uses transparency — an image with an alpha channel, or a CSS " + `rule like \`opacity\` or \`mix-blend-mode\`. PDF/${pdfxMode === "x1a" ? "X-1a" : "X-3"} has no way to represent that (both are based on PDF 1.3, which predates PDF transparency), so Ghostscript will flatten every page that uses it into a single raster ` + "image — that page loses its embedded fonts and searchable text in the " + "PDF/X output. To keep vector text, remove the `opacity`/blend rule and flatten any alpha-channel image against its intended background before including it (export it with no alpha channel), or build --format pdf instead of pdfx if this book doesn't need print-ready CMYK. `pdfx.rasterDpi` sets the resolution of those page images (default 720).");
|
|
10283
10292
|
}
|
|
10284
10293
|
const blankGradientPages = await findPostScriptShadingPages(await fsp2.readFile(rawPdf));
|
|
10285
10294
|
if (blankGradientPages.length > 0) {
|
|
@@ -10301,7 +10310,8 @@ class PdfOutput {
|
|
|
10301
10310
|
pdfx: pdfxMode,
|
|
10302
10311
|
title: config.title,
|
|
10303
10312
|
maxTac: config.ink.maxTac,
|
|
10304
|
-
stagingDir: stage
|
|
10313
|
+
stagingDir: stage,
|
|
10314
|
+
rasterDpi: config.pdfx.rasterDpi
|
|
10305
10315
|
});
|
|
10306
10316
|
}
|
|
10307
10317
|
if (gates.postValidate) {
|
|
@@ -10512,8 +10522,9 @@ async function renderPreviewBook(inputPath, config, opts) {
|
|
|
10512
10522
|
}
|
|
10513
10523
|
});
|
|
10514
10524
|
}
|
|
10515
|
-
function injectPreviewScripts(html,
|
|
10516
|
-
const
|
|
10525
|
+
function injectPreviewScripts(html, page) {
|
|
10526
|
+
const area = page ? JSON.stringify({ width: page.width, height: page.height, bleed: page.bleed ?? 0, safe: page.safe ?? 0 }) : "";
|
|
10527
|
+
const meta = area ? ` <meta name="gp-print-area" content='${area}'>
|
|
10517
10528
|
` : "";
|
|
10518
10529
|
const scripts = meta + ` <script src="/engine/gutterpress-viewer.js"></script>
|
|
10519
10530
|
` + `<script src="/preview/scripts/preview-interface.js"></script>
|
|
@@ -10549,7 +10560,7 @@ async function generateAndWriteHtml(inputPath, tempDir, config, cssAssets, image
|
|
|
10549
10560
|
for (const ref of nextImageRefs)
|
|
10550
10561
|
imageRefs.add(ref);
|
|
10551
10562
|
}
|
|
10552
|
-
await fsp3.writeFile(path15.join(tempDir, BOOK_HTML_FILENAME), injectPreviewScripts(html, config.page
|
|
10563
|
+
await fsp3.writeFile(path15.join(tempDir, BOOK_HTML_FILENAME), injectPreviewScripts(html, config.page), "utf-8");
|
|
10553
10564
|
}
|
|
10554
10565
|
function isDotPathUnderRoot(candidatePath, root) {
|
|
10555
10566
|
const normalizedRoot = root.replace(/\\/g, "/").replace(/\/+$/, "");
|
package/dist/cli.js
CHANGED
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
UsageError,
|
|
7
7
|
package_default,
|
|
8
8
|
rejectUnknownFlags
|
|
9
|
-
} from "./cli-
|
|
9
|
+
} from "./cli-7shp2kmj.js";
|
|
10
10
|
import {
|
|
11
11
|
EXIT_CODES
|
|
12
12
|
} from "./cli-46ycxe6r.js";
|
|
@@ -18,14 +18,14 @@ import {
|
|
|
18
18
|
import { defineCommand, parseArgs, runMain } from "citty";
|
|
19
19
|
import { statSync } from "node:fs";
|
|
20
20
|
var SUBCOMMANDS = {
|
|
21
|
-
new: () => import("./new-
|
|
22
|
-
preview: () => import("./preview-
|
|
23
|
-
build: () => import("./build-
|
|
24
|
-
publish: () => import("./publish-
|
|
25
|
-
validate: () => import("./validate-
|
|
26
|
-
preflight: () => import("./preflight-
|
|
27
|
-
doctor: () => import("./doctor-
|
|
28
|
-
ext: () => import("./ext-
|
|
21
|
+
new: () => import("./new-y4a2xz3g.js").then((m) => m.default),
|
|
22
|
+
preview: () => import("./preview-5ze728kp.js").then((m) => m.default),
|
|
23
|
+
build: () => import("./build-cmf4nbpm.js").then((m) => m.default),
|
|
24
|
+
publish: () => import("./publish-5tpcyysh.js").then((m) => m.default),
|
|
25
|
+
validate: () => import("./validate-p0hkqkfe.js").then((m) => m.default),
|
|
26
|
+
preflight: () => import("./preflight-kt7wfgbd.js").then((m) => m.default),
|
|
27
|
+
doctor: () => import("./doctor-0d6esj02.js").then((m) => m.default),
|
|
28
|
+
ext: () => import("./ext-65nfh7st.js").then((m) => m.default)
|
|
29
29
|
};
|
|
30
30
|
var VERSION = package_default.version;
|
|
31
31
|
var main = defineCommand({
|
|
@@ -50,7 +50,7 @@ async function preflightRequiredInvocations(rawArgs) {
|
|
|
50
50
|
const [command, ...commandArgs] = rawArgs;
|
|
51
51
|
try {
|
|
52
52
|
if (command === "new") {
|
|
53
|
-
const { newArgs } = await import("./new-
|
|
53
|
+
const { newArgs } = await import("./new-y4a2xz3g.js");
|
|
54
54
|
rejectUnknownFlags(commandArgs, newArgs, "new");
|
|
55
55
|
const parsed = parseArgs(commandArgs, {
|
|
56
56
|
...newArgs,
|
|
@@ -62,7 +62,7 @@ async function preflightRequiredInvocations(rawArgs) {
|
|
|
62
62
|
return;
|
|
63
63
|
}
|
|
64
64
|
if (command === "preflight") {
|
|
65
|
-
const { preflightArgs } = await import("./preflight-
|
|
65
|
+
const { preflightArgs } = await import("./preflight-kt7wfgbd.js");
|
|
66
66
|
rejectUnknownFlags(commandArgs, preflightArgs, "preflight");
|
|
67
67
|
const parsed = parseArgs(commandArgs, {
|
|
68
68
|
...preflightArgs,
|
|
@@ -82,7 +82,7 @@ async function preflightRequiredInvocations(rawArgs) {
|
|
|
82
82
|
}
|
|
83
83
|
if (subcommand.startsWith("-"))
|
|
84
84
|
return;
|
|
85
|
-
const { EXT_SUBCOMMANDS, extAddArgs, extRemoveArgs, extEnableArgs, extDisableArgs } = await import("./ext-
|
|
85
|
+
const { EXT_SUBCOMMANDS, extAddArgs, extRemoveArgs, extEnableArgs, extDisableArgs } = await import("./ext-65nfh7st.js");
|
|
86
86
|
if (!EXT_SUBCOMMANDS.includes(subcommand)) {
|
|
87
87
|
throw new UsageError(`gutterpress ext: unknown command "${subcommand}"`);
|
|
88
88
|
}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
getSystemDiagnostics,
|
|
3
3
|
log
|
|
4
|
-
} from "./cli-
|
|
4
|
+
} from "./cli-mmm22cza.js";
|
|
5
5
|
import {
|
|
6
6
|
UsageError,
|
|
7
7
|
rejectExtraPositionals,
|
|
8
8
|
rejectUnknownFlags
|
|
9
|
-
} from "./cli-
|
|
9
|
+
} from "./cli-7shp2kmj.js";
|
|
10
10
|
import"./cli-46ycxe6r.js";
|
|
11
11
|
import"./cli-asap4t1z.js";
|
|
12
12
|
import"./cli-37x76zdn.js";
|
|
@@ -12,17 +12,17 @@ import {
|
|
|
12
12
|
searchNpmExtensions,
|
|
13
13
|
setExtensionEnabled,
|
|
14
14
|
updateExtensions
|
|
15
|
-
} from "./cli-
|
|
16
|
-
import"./cli-
|
|
15
|
+
} from "./cli-x1nfhaf1.js";
|
|
16
|
+
import"./cli-mmm22cza.js";
|
|
17
17
|
import {
|
|
18
18
|
UsageError,
|
|
19
19
|
exitForUsage,
|
|
20
20
|
rejectExtraPositionals,
|
|
21
21
|
rejectUnknownFlags,
|
|
22
22
|
resolveProjectDir
|
|
23
|
-
} from "./cli-
|
|
23
|
+
} from "./cli-7shp2kmj.js";
|
|
24
24
|
import"./cli-ht1bcqdd.js";
|
|
25
|
-
import"./cli-
|
|
25
|
+
import"./cli-rtpm04dv.js";
|
|
26
26
|
import {
|
|
27
27
|
EXIT_CODES
|
|
28
28
|
} from "./cli-46ycxe6r.js";
|