gutterpress 0.11.18-alpha.1 → 0.11.18-alpha.2
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-fpd3qp17.js → build-se062swz.js} +4 -4
- package/dist/{cli-1msxnhzy.js → cli-0w3961p5.js} +15 -10
- package/dist/{cli-th1ve2cx.js → cli-161z4n0s.js} +5 -5
- package/dist/{cli-gv97c2a6.js → cli-qp6dtsh3.js} +1 -1
- package/dist/{cli-bzz33hjz.js → cli-yqpnksaa.js} +1 -1
- package/dist/cli.js +12 -12
- package/dist/{doctor-cg0kb8h6.js → doctor-tkbdx8c1.js} +2 -2
- package/dist/{engine-s2caze6b.js → engine-7gfr16t8.js} +2 -2
- package/dist/{engine-0g9t43gx.js → engine-jkf4pxz9.js} +1 -1
- package/dist/{ext-keedd40p.js → ext-kg8m8vda.js} +4 -4
- package/dist/{gutterpress-viewer-p50c4f08.js → gutterpress-viewer-spq1ge52.js} +122 -31
- package/dist/{index-3pnmf25p.js → index-3x23by5j.js} +1 -1
- package/dist/{index-pdanxwn1.js → index-bb2d1ev8.js} +14 -9
- package/dist/{index-jg1r9t4w.js → index-t3zxy69d.js} +5 -5
- package/dist/index.js +3 -3
- package/dist/lib/presets.d.ts +11 -0
- package/dist/{manifest.schema-gh0jjve9.json → manifest.schema-8m82f37q.json} +6 -0
- package/dist/{new-d010czw1.js → new-w7q0n21v.js} +4 -4
- package/dist/{preflight-jgcp1xsr.js → preflight-m54qsjs7.js} +4 -4
- package/dist/preview/file-watcher.d.ts +4 -1
- package/dist/{preview-m3afbq53.js → preview-bg3wxqxc.js} +4 -4
- package/dist/{preview-bridge-ga409pgz.js → preview-bridge-evecsh4w.js} +1 -1
- package/dist/{preview-interface-dm6wbdq6.js → preview-interface-2n1d9pbf.js} +10 -4
- package/dist/{preview-shell-c909krk2.js → preview-shell-hyp7g158.js} +7 -1
- package/dist/{publish-69x46m3f.js → publish-waps63wf.js} +4 -4
- package/dist/schema/manifest.types.d.ts +11 -0
- package/dist/{validate-vc6cp1cs.js → validate-c9d8d656.js} +4 -4
- package/package.json +1 -1
package/dist/api/index.js
CHANGED
|
@@ -136,11 +136,11 @@ import {
|
|
|
136
136
|
testRemoteAccess,
|
|
137
137
|
updateExtensions,
|
|
138
138
|
validateProjectExtensions
|
|
139
|
-
} from "../index-
|
|
139
|
+
} from "../index-bb2d1ev8.js";
|
|
140
140
|
import"../index-ht1bcqdd.js";
|
|
141
141
|
import {
|
|
142
142
|
BuildError
|
|
143
|
-
} from "../index-
|
|
143
|
+
} from "../index-t3zxy69d.js";
|
|
144
144
|
import {
|
|
145
145
|
DEFAULT_PRINT_OPTS,
|
|
146
146
|
assertMilestone,
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import {
|
|
2
2
|
runBuild,
|
|
3
3
|
splitOutPath
|
|
4
|
-
} from "./cli-
|
|
4
|
+
} from "./cli-0w3961p5.js";
|
|
5
5
|
import {
|
|
6
6
|
log
|
|
7
|
-
} from "./cli-
|
|
7
|
+
} from "./cli-qp6dtsh3.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-yqpnksaa.js";
|
|
15
15
|
import"./cli-ht1bcqdd.js";
|
|
16
|
-
import"./cli-
|
|
16
|
+
import"./cli-161z4n0s.js";
|
|
17
17
|
import {
|
|
18
18
|
BuildError
|
|
19
19
|
} from "./cli-46ycxe6r.js";
|
|
@@ -13,12 +13,12 @@ import {
|
|
|
13
13
|
stampCreator,
|
|
14
14
|
stripAnnotations,
|
|
15
15
|
warn
|
|
16
|
-
} from "./cli-
|
|
16
|
+
} from "./cli-qp6dtsh3.js";
|
|
17
17
|
import {
|
|
18
18
|
DEBOUNCE,
|
|
19
19
|
UsageError,
|
|
20
20
|
resolvePort
|
|
21
|
-
} from "./cli-
|
|
21
|
+
} from "./cli-yqpnksaa.js";
|
|
22
22
|
import {
|
|
23
23
|
blackTextToGray
|
|
24
24
|
} from "./cli-ht1bcqdd.js";
|
|
@@ -27,7 +27,7 @@ import {
|
|
|
27
27
|
getAssetPath,
|
|
28
28
|
getAssetsDir,
|
|
29
29
|
lastPageMode
|
|
30
|
-
} from "./cli-
|
|
30
|
+
} from "./cli-161z4n0s.js";
|
|
31
31
|
import {
|
|
32
32
|
BuildError,
|
|
33
33
|
EXIT_CODES
|
|
@@ -120,7 +120,8 @@ var DTRPG_PRESET = {
|
|
|
120
120
|
page: {
|
|
121
121
|
width: 621,
|
|
122
122
|
height: 810,
|
|
123
|
-
tolerance: 0.5
|
|
123
|
+
tolerance: 0.5,
|
|
124
|
+
bleed: 9
|
|
124
125
|
},
|
|
125
126
|
ink: {
|
|
126
127
|
maxTac: 240,
|
|
@@ -196,7 +197,8 @@ var BOOK_PRESET = {
|
|
|
196
197
|
page: {
|
|
197
198
|
width: 432,
|
|
198
199
|
height: 648,
|
|
199
|
-
tolerance: 0.5
|
|
200
|
+
tolerance: 0.5,
|
|
201
|
+
bleed: undefined
|
|
200
202
|
},
|
|
201
203
|
ink: {
|
|
202
204
|
maxTac: 400,
|
|
@@ -543,7 +545,8 @@ function resolveCustomPage(c, m) {
|
|
|
543
545
|
return {
|
|
544
546
|
width,
|
|
545
547
|
height,
|
|
546
|
-
tolerance: c.page?.tolerance ?? m.page?.tolerance ?? 0.5
|
|
548
|
+
tolerance: c.page?.tolerance ?? m.page?.tolerance ?? 0.5,
|
|
549
|
+
bleed: c.page?.bleed ?? m.page?.bleed
|
|
547
550
|
};
|
|
548
551
|
}
|
|
549
552
|
function resolveWithPreset(cliOverrides, manifest, preset) {
|
|
@@ -9723,7 +9726,7 @@ class PdfOutput {
|
|
|
9723
9726
|
const rawPdf = pdfxMode ? path13.join(stage, "raw.pdf") : path13.resolve(pdfFile);
|
|
9724
9727
|
await fsp2.mkdir(path13.dirname(path13.resolve(pdfFile)), { recursive: true });
|
|
9725
9728
|
log.info("Rendering HTML to PDF via the Gutterpress engine (native Chromium pagination)");
|
|
9726
|
-
const { buildNativePdf } = await import("./engine-
|
|
9729
|
+
const { buildNativePdf } = await import("./engine-jkf4pxz9.js");
|
|
9727
9730
|
const engineDiagnostics = await buildNativePdf(htmlFile, rawPdf, {
|
|
9728
9731
|
title: config.title,
|
|
9729
9732
|
author: config.authors.length > 0 ? config.authors.join(", ") : undefined,
|
|
@@ -9974,8 +9977,10 @@ async function renderPreviewBook(inputPath, config, opts) {
|
|
|
9974
9977
|
}
|
|
9975
9978
|
});
|
|
9976
9979
|
}
|
|
9977
|
-
function injectPreviewScripts(html) {
|
|
9978
|
-
const
|
|
9980
|
+
function injectPreviewScripts(html, insetBleedPt = 0) {
|
|
9981
|
+
const meta = insetBleedPt > 0 ? ` <meta name="gp-inset-bleed" content="${insetBleedPt}">
|
|
9982
|
+
` : "";
|
|
9983
|
+
const scripts = meta + ` <script src="/engine/gutterpress-viewer.js"></script>
|
|
9979
9984
|
` + `<script src="/preview/scripts/preview-interface.js"></script>
|
|
9980
9985
|
` + `<script src="/preview/scripts/preview-bridge.js"></script>
|
|
9981
9986
|
`;
|
|
@@ -10009,7 +10014,7 @@ async function generateAndWriteHtml(inputPath, tempDir, config, cssAssets, image
|
|
|
10009
10014
|
for (const ref of nextImageRefs)
|
|
10010
10015
|
imageRefs.add(ref);
|
|
10011
10016
|
}
|
|
10012
|
-
await fsp3.writeFile(path15.join(tempDir, BOOK_HTML_FILENAME), injectPreviewScripts(html), "utf-8");
|
|
10017
|
+
await fsp3.writeFile(path15.join(tempDir, BOOK_HTML_FILENAME), injectPreviewScripts(html, config.page?.bleed), "utf-8");
|
|
10013
10018
|
}
|
|
10014
10019
|
function isDotPathUnderRoot(candidatePath, root) {
|
|
10015
10020
|
const normalizedRoot = root.replace(/\\/g, "/").replace(/\/+$/, "");
|
|
@@ -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-8m82f37q.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-2n1d9pbf.js";
|
|
1123
1123
|
|
|
1124
1124
|
// src/assets/preview/scripts/preview-bridge.js
|
|
1125
|
-
var preview_bridge_default = "./preview-bridge-
|
|
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-hyp7g158.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-spq1ge52.js";
|
|
1135
1135
|
|
|
1136
1136
|
// src/assets/engine/gutterpress-agent.js
|
|
1137
1137
|
var gutterpress_agent_default = "./gutterpress-agent-cazqstr1.js";
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
// package.json
|
|
5
5
|
var package_default = {
|
|
6
6
|
name: "gutterpress",
|
|
7
|
-
version: "0.11.18-alpha.
|
|
7
|
+
version: "0.11.18-alpha.2",
|
|
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",
|
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-yqpnksaa.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-w7q0n21v.js").then((m) => m.default),
|
|
22
|
+
preview: () => import("./preview-bg3wxqxc.js").then((m) => m.default),
|
|
23
|
+
build: () => import("./build-se062swz.js").then((m) => m.default),
|
|
24
|
+
publish: () => import("./publish-waps63wf.js").then((m) => m.default),
|
|
25
|
+
validate: () => import("./validate-c9d8d656.js").then((m) => m.default),
|
|
26
|
+
preflight: () => import("./preflight-m54qsjs7.js").then((m) => m.default),
|
|
27
|
+
doctor: () => import("./doctor-tkbdx8c1.js").then((m) => m.default),
|
|
28
|
+
ext: () => import("./ext-kg8m8vda.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-w7q0n21v.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-m54qsjs7.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-kg8m8vda.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-qp6dtsh3.js";
|
|
5
5
|
import {
|
|
6
6
|
UsageError,
|
|
7
7
|
rejectExtraPositionals,
|
|
8
8
|
rejectUnknownFlags
|
|
9
|
-
} from "./cli-
|
|
9
|
+
} from "./cli-yqpnksaa.js";
|
|
10
10
|
import"./cli-46ycxe6r.js";
|
|
11
11
|
import"./cli-7fkhgtfn.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-0w3961p5.js";
|
|
16
|
+
import"./cli-qp6dtsh3.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-yqpnksaa.js";
|
|
24
24
|
import"./cli-ht1bcqdd.js";
|
|
25
|
-
import"./cli-
|
|
25
|
+
import"./cli-161z4n0s.js";
|
|
26
26
|
import {
|
|
27
27
|
EXIT_CODES
|
|
28
28
|
} from "./cli-46ycxe6r.js";
|
|
@@ -270,6 +270,35 @@
|
|
|
270
270
|
.gp-marginbox[data-align="end"] > .gp-marginbox-content { justify-content: flex-end; }
|
|
271
271
|
|
|
272
272
|
/* margin & bleed overlay (overlay.ts) -------------------------------- */
|
|
273
|
+
/* THE LOOK LIVES HERE, in these tokens, and nowhere else: colours, line
|
|
274
|
+
width, line style, tint strength. The desktop app's settings change the
|
|
275
|
+
colour (an inline \`--gp-ov-color\` on <body>) and pick a strength preset
|
|
276
|
+
(\`data-overlay-strength\`); nothing in a book's CSS is involved or needed. */
|
|
277
|
+
.gp-stage {
|
|
278
|
+
--gp-ov-color: #2f80ed; /* margin box line + the tint over the margins */
|
|
279
|
+
--gp-ov-width: 2px; /* line width as seen on screen, at any zoom */
|
|
280
|
+
--gp-ov-style: dashed; /* margin box line style */
|
|
281
|
+
--gp-ov-tint: 0.1; /* opacity of the tint over the margin area */
|
|
282
|
+
--gp-ov-bleed-color: #e5484d; /* bleed band + trim line */
|
|
283
|
+
--gp-ov-bleed-alpha: 0.45; /* opacity of the bleed band */
|
|
284
|
+
--gp-ov-trim-color: #8a0b18; /* the trim line: darker than the band so it reads as an edge */
|
|
285
|
+
--gp-ov-flag-width: 2px; /* overflow flag outline */
|
|
286
|
+
--gp-ov-warn: #f59e0b; /* reaches into the margin */
|
|
287
|
+
--gp-ov-error: #e5484d; /* crosses the trim / leaves the page */
|
|
288
|
+
--gp-ov-intent: #8b5cf6; /* placed on purpose */
|
|
289
|
+
}
|
|
290
|
+
.gp-stage[data-overlay-strength="subtle"] {
|
|
291
|
+
--gp-ov-width: 1px;
|
|
292
|
+
--gp-ov-tint: 0.05;
|
|
293
|
+
--gp-ov-bleed-alpha: 0.3;
|
|
294
|
+
}
|
|
295
|
+
.gp-stage[data-overlay-strength="strong"] {
|
|
296
|
+
--gp-ov-width: 3px;
|
|
297
|
+
--gp-ov-tint: 0.2;
|
|
298
|
+
--gp-ov-bleed-alpha: 0.65;
|
|
299
|
+
--gp-ov-flag-width: 3px;
|
|
300
|
+
}
|
|
301
|
+
|
|
273
302
|
/* One sibling layer per run, ABOVE the strip so the lines stay visible over
|
|
274
303
|
author backgrounds and art. Absolutely positioned and pointer-transparent:
|
|
275
304
|
it takes no flow space and no hits, so it cannot move a page break. Exists
|
|
@@ -279,22 +308,30 @@
|
|
|
279
308
|
inset: 0;
|
|
280
309
|
z-index: 5;
|
|
281
310
|
pointer-events: none;
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
--gp-ov-
|
|
286
|
-
--gp-ov-
|
|
311
|
+
/* The stage is a paint transform, so a 2px line would shrink with the zoom
|
|
312
|
+
and vanish at fit-to-width. Lines are sized in layout px divided by the
|
|
313
|
+
zoom, which makes them the same width on screen at every zoom. */
|
|
314
|
+
--gp-ov-w: calc(var(--gp-ov-width) / var(--gp-zoom, 1));
|
|
315
|
+
--gp-ov-flag-w: calc(var(--gp-ov-flag-width) / var(--gp-zoom, 1));
|
|
287
316
|
}
|
|
288
317
|
|
|
289
318
|
.gp-ov-page {
|
|
290
319
|
position: absolute;
|
|
291
320
|
}
|
|
292
321
|
|
|
293
|
-
/*
|
|
322
|
+
/* the margins as a region: the trim minus the content box (clip-path, set in
|
|
323
|
+
overlay.ts), so a margin reads as an area, not a hairline */
|
|
324
|
+
.gp-ov-tint {
|
|
325
|
+
position: absolute;
|
|
326
|
+
inset: 0;
|
|
327
|
+
background: color-mix(in srgb, var(--gp-ov-color) calc(var(--gp-ov-tint) * 100%), transparent);
|
|
328
|
+
}
|
|
329
|
+
|
|
330
|
+
/* margin box: the content area's outline */
|
|
294
331
|
.gp-ov-margin {
|
|
295
332
|
position: absolute;
|
|
296
333
|
box-sizing: border-box;
|
|
297
|
-
border:
|
|
334
|
+
border: var(--gp-ov-w) var(--gp-ov-style) var(--gp-ov-color);
|
|
298
335
|
}
|
|
299
336
|
|
|
300
337
|
/* the PDF's own margins for this page, where they differ from where the
|
|
@@ -302,8 +339,8 @@
|
|
|
302
339
|
.gp-ov-print {
|
|
303
340
|
position: absolute;
|
|
304
341
|
box-sizing: border-box;
|
|
305
|
-
border:
|
|
306
|
-
opacity: 0.
|
|
342
|
+
border: var(--gp-ov-w) dotted var(--gp-ov-color);
|
|
343
|
+
opacity: 0.6;
|
|
307
344
|
}
|
|
308
345
|
|
|
309
346
|
/* bleed: a translucent band OUTSIDE the trim (its width is the border) */
|
|
@@ -311,14 +348,16 @@
|
|
|
311
348
|
position: absolute;
|
|
312
349
|
box-sizing: border-box;
|
|
313
350
|
border-style: solid;
|
|
314
|
-
border-color:
|
|
351
|
+
border-color: color-mix(in srgb, var(--gp-ov-bleed-color) calc(var(--gp-ov-bleed-alpha) * 100%), transparent);
|
|
315
352
|
}
|
|
316
353
|
|
|
317
|
-
/* trim: where the sheet will be cut, drawn only when there is bleed
|
|
354
|
+
/* trim: where the sheet will be cut, drawn only when there is bleed — solid,
|
|
355
|
+
just inside the edge so it never paints over the band (overlay.ts sizes and
|
|
356
|
+
places it: the whole sheet, or the sheet less an in-sheet bleed) */
|
|
318
357
|
.gp-ov-trim {
|
|
319
358
|
position: absolute;
|
|
320
|
-
|
|
321
|
-
outline:
|
|
359
|
+
outline: var(--gp-ov-w) solid var(--gp-ov-trim-color);
|
|
360
|
+
outline-offset: calc(-1 * var(--gp-ov-w));
|
|
322
361
|
}
|
|
323
362
|
|
|
324
363
|
/* overflow flags — outline + faint tint, never a box change */
|
|
@@ -327,17 +366,17 @@
|
|
|
327
366
|
box-sizing: border-box;
|
|
328
367
|
}
|
|
329
368
|
.gp-ov-flag[data-kind="margin"] {
|
|
330
|
-
outline:
|
|
331
|
-
background:
|
|
369
|
+
outline: var(--gp-ov-flag-w) solid var(--gp-ov-warn);
|
|
370
|
+
background: color-mix(in srgb, var(--gp-ov-warn) 16%, transparent);
|
|
332
371
|
}
|
|
333
372
|
.gp-ov-flag[data-kind="bleed"],
|
|
334
373
|
.gp-ov-flag[data-kind="off-page"] {
|
|
335
|
-
outline:
|
|
336
|
-
background:
|
|
374
|
+
outline: var(--gp-ov-flag-w) solid var(--gp-ov-error);
|
|
375
|
+
background: color-mix(in srgb, var(--gp-ov-error) 18%, transparent);
|
|
337
376
|
}
|
|
338
377
|
/* placed on purpose (.gp-bleed, .gp-pin, …): present, not a problem */
|
|
339
378
|
.gp-ov-flag[data-kind="intended"] {
|
|
340
|
-
outline:
|
|
379
|
+
outline: var(--gp-ov-flag-w) dotted var(--gp-ov-intent);
|
|
341
380
|
}
|
|
342
381
|
|
|
343
382
|
/* designer mode ------------------------------------------------------- */
|
|
@@ -2170,6 +2209,7 @@
|
|
|
2170
2209
|
const h = g.height * scale;
|
|
2171
2210
|
const b = Math.max(0, bleed) * scale;
|
|
2172
2211
|
return {
|
|
2212
|
+
host: { x: 0, y: 0, w, h },
|
|
2173
2213
|
trim: { x: 0, y: 0, w, h },
|
|
2174
2214
|
content: {
|
|
2175
2215
|
x: margin.left * scale,
|
|
@@ -2181,6 +2221,17 @@
|
|
|
2181
2221
|
bleed: b
|
|
2182
2222
|
};
|
|
2183
2223
|
}
|
|
2224
|
+
function insetPageBoxes(g, margin, bleed, side, scale = 1) {
|
|
2225
|
+
const sheet = pageBoxes(g, margin, 0, scale);
|
|
2226
|
+
const b = Math.max(0, bleed) * scale;
|
|
2227
|
+
return {
|
|
2228
|
+
host: sheet.host,
|
|
2229
|
+
trim: { x: side === "verso" ? b : 0, y: b, w: sheet.host.w - b, h: sheet.host.h - 2 * b },
|
|
2230
|
+
content: sheet.content,
|
|
2231
|
+
bleedBox: sheet.host,
|
|
2232
|
+
bleed: b
|
|
2233
|
+
};
|
|
2234
|
+
}
|
|
2184
2235
|
var SEVERITY = { inside: 0, margin: 1, bleed: 2, "off-page": 3 };
|
|
2185
2236
|
var within = (r, outer, tol) => r.x >= outer.x - tol && r.y >= outer.y - tol && r.x + r.w <= outer.x + outer.w + tol && r.y + r.h <= outer.y + outer.h + tol;
|
|
2186
2237
|
function classifyRect(r, boxes, tol = 0) {
|
|
@@ -2196,10 +2247,25 @@
|
|
|
2196
2247
|
return kinds.reduce((worst, k) => SEVERITY[k] > SEVERITY[worst] ? k : worst, "inside");
|
|
2197
2248
|
}
|
|
2198
2249
|
var INTENT_SELECTOR = ".gp-bleed, .gp-pin, .gp-flush, .gp-behind, .gp-page-full-bleed";
|
|
2250
|
+
var OVERLAY_STRENGTHS = ["subtle", "normal", "strong"];
|
|
2251
|
+
var HEX_COLOR = /^#(?:[0-9a-f]{3}|[0-9a-f]{6})$/i;
|
|
2252
|
+
function sanitizeOverlayStyle(style) {
|
|
2253
|
+
const s = style && typeof style === "object" ? style : {};
|
|
2254
|
+
const out = {};
|
|
2255
|
+
if (typeof s.color === "string" && HEX_COLOR.test(s.color.trim()))
|
|
2256
|
+
out.color = s.color.trim();
|
|
2257
|
+
if (OVERLAY_STRENGTHS.includes(s.strength))
|
|
2258
|
+
out.strength = s.strength;
|
|
2259
|
+
return out;
|
|
2260
|
+
}
|
|
2199
2261
|
var OVERLAY_OFF = { on: false, issues: 0, intended: 0, bleedPt: 0 };
|
|
2200
2262
|
function marginsDiffer(a, b) {
|
|
2201
2263
|
return ["top", "right", "bottom", "left"].some((k) => Math.abs(a[k] - b[k]) > 0.5);
|
|
2202
2264
|
}
|
|
2265
|
+
function configInsetBleedPt() {
|
|
2266
|
+
const v = parseFloat(document.querySelector('meta[name="gp-inset-bleed"]')?.getAttribute("content") ?? "");
|
|
2267
|
+
return Number.isFinite(v) && v > 0 ? v : 0;
|
|
2268
|
+
}
|
|
2203
2269
|
var SKIP = new Set(["SCRIPT", "STYLE", "LINK", "TEMPLATE", "BR", "WBR", "SOURCE", "TRACK", "META"]);
|
|
2204
2270
|
var TOL_PX = 1;
|
|
2205
2271
|
function div(cls, box) {
|
|
@@ -2215,11 +2281,25 @@
|
|
|
2215
2281
|
el.style.width = `${r.w}px`;
|
|
2216
2282
|
el.style.height = `${r.h}px`;
|
|
2217
2283
|
}
|
|
2284
|
+
function marginTint(b) {
|
|
2285
|
+
const el = div("gp-ov-tint");
|
|
2286
|
+
const t = b.trim;
|
|
2287
|
+
const clamp = (v, lo, hi) => Math.min(hi, Math.max(lo, v));
|
|
2288
|
+
const l = clamp(b.content.x, t.x, t.x + t.w);
|
|
2289
|
+
const r = clamp(b.content.x + b.content.w, t.x, t.x + t.w);
|
|
2290
|
+
const top = clamp(b.content.y, t.y, t.y + t.h);
|
|
2291
|
+
const bot = clamp(b.content.y + b.content.h, t.y, t.y + t.h);
|
|
2292
|
+
const x2 = t.x + t.w;
|
|
2293
|
+
const y2 = t.y + t.h;
|
|
2294
|
+
el.style.clipPath = `polygon(evenodd, ${t.x}px ${t.y}px, ${x2}px ${t.y}px, ${x2}px ${y2}px, ${t.x}px ${y2}px, ${t.x}px ${t.y}px, ` + `${l}px ${top}px, ${l}px ${bot}px, ${r}px ${bot}px, ${r}px ${top}px, ${l}px ${top}px)`;
|
|
2295
|
+
return el;
|
|
2296
|
+
}
|
|
2218
2297
|
function clearOverlay() {
|
|
2219
2298
|
for (const layer of Array.from(document.querySelectorAll(".gp-ov")))
|
|
2220
2299
|
layer.remove();
|
|
2221
2300
|
}
|
|
2222
|
-
function paintOverlay(pages, strips, bleedPt) {
|
|
2301
|
+
function paintOverlay(pages, strips, bleedPt, insetBleedPt = 0) {
|
|
2302
|
+
const inSheet = bleedPt <= 0 && insetBleedPt > 0;
|
|
2223
2303
|
clearOverlay();
|
|
2224
2304
|
const layers = new Map;
|
|
2225
2305
|
const painted = new Map;
|
|
@@ -2233,18 +2313,20 @@
|
|
|
2233
2313
|
run.appendChild(layer);
|
|
2234
2314
|
layers.set(run, layer);
|
|
2235
2315
|
}
|
|
2236
|
-
const boxes = pageBoxes(p.geometry, p.margin, bleedPt, PX_PER_PT);
|
|
2237
|
-
const host = div("gp-ov-page", boxes.
|
|
2316
|
+
const boxes = inSheet ? insetPageBoxes(p.geometry, p.margin, insetBleedPt, p.sheet.dataset.side === "verso" ? "verso" : "recto", PX_PER_PT) : pageBoxes(p.geometry, p.margin, bleedPt, PX_PER_PT);
|
|
2317
|
+
const host = div("gp-ov-page", boxes.host);
|
|
2238
2318
|
host.style.left = p.sheet.style.left;
|
|
2239
2319
|
host.style.top = p.sheet.style.top;
|
|
2240
2320
|
host.dataset.page = String(p.index + 1);
|
|
2241
2321
|
if (boxes.bleed > 0) {
|
|
2242
|
-
const
|
|
2243
|
-
|
|
2244
|
-
band
|
|
2322
|
+
const bb = boxes.bleedBox;
|
|
2323
|
+
const t = boxes.trim;
|
|
2324
|
+
const band = div("gp-ov-bleed", bb);
|
|
2325
|
+
band.style.borderWidth = `${t.y - bb.y}px ${bb.x + bb.w - (t.x + t.w)}px ${bb.y + bb.h - (t.y + t.h)}px ${t.x - bb.x}px`;
|
|
2245
2326
|
host.appendChild(band);
|
|
2246
|
-
host.appendChild(div("gp-ov-trim"));
|
|
2327
|
+
host.appendChild(div("gp-ov-trim", t));
|
|
2247
2328
|
}
|
|
2329
|
+
host.appendChild(marginTint(boxes));
|
|
2248
2330
|
host.appendChild(div("gp-ov-margin", boxes.content));
|
|
2249
2331
|
if (marginsDiffer(p.printMargin, p.margin)) {
|
|
2250
2332
|
host.appendChild(div("gp-ov-print", pageBoxes(p.geometry, p.printMargin, 0, PX_PER_PT).content));
|
|
@@ -2306,7 +2388,7 @@
|
|
|
2306
2388
|
el.dataset.kind = f.kind;
|
|
2307
2389
|
f.host.appendChild(el);
|
|
2308
2390
|
}
|
|
2309
|
-
return { on: true, issues, intended, bleedPt };
|
|
2391
|
+
return inSheet ? { on: true, issues, intended, bleedPt: insetBleedPt, bleedInSheet: true } : { on: true, issues, intended, bleedPt };
|
|
2310
2392
|
}
|
|
2311
2393
|
|
|
2312
2394
|
// src/engine/viewer/decorate.ts
|
|
@@ -2341,7 +2423,7 @@
|
|
|
2341
2423
|
let overlayPages = [];
|
|
2342
2424
|
let overlaySummary = OVERLAY_OFF;
|
|
2343
2425
|
const paintOverlayNow = () => {
|
|
2344
|
-
overlaySummary = paintOverlay(overlayPages, layout.strips, documentBleedPt(model));
|
|
2426
|
+
overlaySummary = paintOverlay(overlayPages, layout.strips, documentBleedPt(model), configInsetBleedPt());
|
|
2345
2427
|
window.dispatchEvent(new CustomEvent("gp:overlay", { detail: overlaySummary }));
|
|
2346
2428
|
};
|
|
2347
2429
|
const api = {
|
|
@@ -2354,12 +2436,21 @@
|
|
|
2354
2436
|
setDesigner(on) {
|
|
2355
2437
|
document.body.dataset.designer = on ? "on" : "off";
|
|
2356
2438
|
},
|
|
2357
|
-
setOverlay(on) {
|
|
2439
|
+
setOverlay(on, style) {
|
|
2440
|
+
if (style) {
|
|
2441
|
+
const { color, strength } = sanitizeOverlayStyle(style);
|
|
2442
|
+
if (strength)
|
|
2443
|
+
document.body.dataset.overlayStrength = strength;
|
|
2444
|
+
if (color)
|
|
2445
|
+
document.body.style.setProperty("--gp-ov-color", color);
|
|
2446
|
+
}
|
|
2447
|
+
const wasOn = overlayOn;
|
|
2358
2448
|
overlayOn = on;
|
|
2359
2449
|
document.body.dataset.overlay = on ? "on" : "off";
|
|
2360
|
-
if (on)
|
|
2361
|
-
|
|
2362
|
-
|
|
2450
|
+
if (on) {
|
|
2451
|
+
if (!(wasOn && style))
|
|
2452
|
+
paintOverlayNow();
|
|
2453
|
+
} else {
|
|
2363
2454
|
clearOverlay();
|
|
2364
2455
|
overlaySummary = OVERLAY_OFF;
|
|
2365
2456
|
window.dispatchEvent(new CustomEvent("gp:overlay", { detail: overlaySummary }));
|
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
getAssetsDir,
|
|
10
10
|
lastPageMode,
|
|
11
11
|
parseSize
|
|
12
|
-
} from "./index-
|
|
12
|
+
} from "./index-t3zxy69d.js";
|
|
13
13
|
import {
|
|
14
14
|
INSTALL_HINTS,
|
|
15
15
|
execCapture,
|
|
@@ -155,7 +155,8 @@ var DTRPG_PRESET = {
|
|
|
155
155
|
page: {
|
|
156
156
|
width: 621,
|
|
157
157
|
height: 810,
|
|
158
|
-
tolerance: 0.5
|
|
158
|
+
tolerance: 0.5,
|
|
159
|
+
bleed: 9
|
|
159
160
|
},
|
|
160
161
|
ink: {
|
|
161
162
|
maxTac: 240,
|
|
@@ -231,7 +232,8 @@ var BOOK_PRESET = {
|
|
|
231
232
|
page: {
|
|
232
233
|
width: 432,
|
|
233
234
|
height: 648,
|
|
234
|
-
tolerance: 0.5
|
|
235
|
+
tolerance: 0.5,
|
|
236
|
+
bleed: undefined
|
|
235
237
|
},
|
|
236
238
|
ink: {
|
|
237
239
|
maxTac: 400,
|
|
@@ -584,7 +586,8 @@ function resolveCustomPage(c, m) {
|
|
|
584
586
|
return {
|
|
585
587
|
width,
|
|
586
588
|
height,
|
|
587
|
-
tolerance: c.page?.tolerance ?? m.page?.tolerance ?? 0.5
|
|
589
|
+
tolerance: c.page?.tolerance ?? m.page?.tolerance ?? 0.5,
|
|
590
|
+
bleed: c.page?.bleed ?? m.page?.bleed
|
|
588
591
|
};
|
|
589
592
|
}
|
|
590
593
|
function resolveWithPreset(cliOverrides, manifest, preset) {
|
|
@@ -5747,7 +5750,7 @@ import git from "isomorphic-git";
|
|
|
5747
5750
|
// package.json
|
|
5748
5751
|
var package_default = {
|
|
5749
5752
|
name: "gutterpress",
|
|
5750
|
-
version: "0.11.18-alpha.
|
|
5753
|
+
version: "0.11.18-alpha.2",
|
|
5751
5754
|
description: "Markdown-to-PDF converter for professional print layout using a native Chromium print engine and Ghostscript.",
|
|
5752
5755
|
author: "itlackey",
|
|
5753
5756
|
license: "MPL-2.0",
|
|
@@ -10303,7 +10306,7 @@ class PdfOutput {
|
|
|
10303
10306
|
const rawPdf = pdfxMode ? path13.join(stage, "raw.pdf") : path13.resolve(pdfFile);
|
|
10304
10307
|
await fsp2.mkdir(path13.dirname(path13.resolve(pdfFile)), { recursive: true });
|
|
10305
10308
|
log.info("Rendering HTML to PDF via the Gutterpress engine (native Chromium pagination)");
|
|
10306
|
-
const { buildNativePdf } = await import("./engine-
|
|
10309
|
+
const { buildNativePdf } = await import("./engine-7gfr16t8.js");
|
|
10307
10310
|
const engineDiagnostics = await buildNativePdf(htmlFile, rawPdf, {
|
|
10308
10311
|
title: config.title,
|
|
10309
10312
|
author: config.authors.length > 0 ? config.authors.join(", ") : undefined,
|
|
@@ -10525,8 +10528,10 @@ async function renderPreviewBook(inputPath, config, opts) {
|
|
|
10525
10528
|
}
|
|
10526
10529
|
});
|
|
10527
10530
|
}
|
|
10528
|
-
function injectPreviewScripts(html) {
|
|
10529
|
-
const
|
|
10531
|
+
function injectPreviewScripts(html, insetBleedPt = 0) {
|
|
10532
|
+
const meta = insetBleedPt > 0 ? ` <meta name="gp-inset-bleed" content="${insetBleedPt}">
|
|
10533
|
+
` : "";
|
|
10534
|
+
const scripts = meta + ` <script src="/engine/gutterpress-viewer.js"></script>
|
|
10530
10535
|
` + `<script src="/preview/scripts/preview-interface.js"></script>
|
|
10531
10536
|
` + `<script src="/preview/scripts/preview-bridge.js"></script>
|
|
10532
10537
|
`;
|
|
@@ -10560,7 +10565,7 @@ async function generateAndWriteHtml(inputPath, tempDir, config, cssAssets, image
|
|
|
10560
10565
|
for (const ref of nextImageRefs)
|
|
10561
10566
|
imageRefs.add(ref);
|
|
10562
10567
|
}
|
|
10563
|
-
await fsp3.writeFile(path15.join(tempDir, BOOK_HTML_FILENAME), injectPreviewScripts(html), "utf-8");
|
|
10568
|
+
await fsp3.writeFile(path15.join(tempDir, BOOK_HTML_FILENAME), injectPreviewScripts(html, config.page?.bleed), "utf-8");
|
|
10564
10569
|
}
|
|
10565
10570
|
function isDotPathUnderRoot(candidatePath, root) {
|
|
10566
10571
|
const normalizedRoot = root.replace(/\\/g, "/").replace(/\/+$/, "");
|
|
@@ -148,22 +148,22 @@ import { fileURLToPath } from "node:url";
|
|
|
148
148
|
var favicon_default = "./favicon-272ga6y0.ico";
|
|
149
149
|
|
|
150
150
|
// src/assets/manifest.schema.json
|
|
151
|
-
var manifest_schema_default = "./manifest.schema-
|
|
151
|
+
var manifest_schema_default = "./manifest.schema-8m82f37q.json";
|
|
152
152
|
|
|
153
153
|
// src/assets/preview/scripts/preview-interface.js
|
|
154
|
-
var preview_interface_default = "./preview-interface-
|
|
154
|
+
var preview_interface_default = "./preview-interface-2n1d9pbf.js";
|
|
155
155
|
|
|
156
156
|
// src/assets/preview/scripts/preview-bridge.js
|
|
157
|
-
var preview_bridge_default = "./preview-bridge-
|
|
157
|
+
var preview_bridge_default = "./preview-bridge-evecsh4w.js";
|
|
158
158
|
|
|
159
159
|
// src/assets/preview/scripts/preview-shell.js
|
|
160
|
-
var preview_shell_default = "./preview-shell-
|
|
160
|
+
var preview_shell_default = "./preview-shell-hyp7g158.js";
|
|
161
161
|
|
|
162
162
|
// profiles/CGATS21_CRPC1.icc
|
|
163
163
|
var CGATS21_CRPC1_default = "./CGATS21_CRPC1-g0e3k7kr.icc";
|
|
164
164
|
|
|
165
165
|
// src/assets/engine/gutterpress-viewer.js
|
|
166
|
-
var gutterpress_viewer_default = "./gutterpress-viewer-
|
|
166
|
+
var gutterpress_viewer_default = "./gutterpress-viewer-spq1ge52.js";
|
|
167
167
|
|
|
168
168
|
// src/assets/engine/gutterpress-agent.js
|
|
169
169
|
var gutterpress_agent_default = "./gutterpress-agent-cazqstr1.js";
|
package/dist/index.js
CHANGED
|
@@ -153,14 +153,14 @@ import {
|
|
|
153
153
|
testRemoteAccess,
|
|
154
154
|
updateExtensions,
|
|
155
155
|
validateProjectExtensions
|
|
156
|
-
} from "./index-
|
|
156
|
+
} from "./index-bb2d1ev8.js";
|
|
157
157
|
import"./index-ht1bcqdd.js";
|
|
158
158
|
import {
|
|
159
159
|
BUILD_DIAGNOSTIC_CODES
|
|
160
|
-
} from "./index-
|
|
160
|
+
} from "./index-3x23by5j.js";
|
|
161
161
|
import {
|
|
162
162
|
BuildError
|
|
163
|
-
} from "./index-
|
|
163
|
+
} from "./index-t3zxy69d.js";
|
|
164
164
|
import {
|
|
165
165
|
DEFAULT_PRINT_OPTS,
|
|
166
166
|
assertMilestone,
|
package/dist/lib/presets.d.ts
CHANGED
|
@@ -21,6 +21,17 @@ export interface VendorPreset extends Omit<ResolvedConfig, "title" | "authors" |
|
|
|
21
21
|
/** The built-in preset ids, in the order pickers should offer them. */
|
|
22
22
|
export declare const PRESET_IDS: readonly ["dtrpg", "book", "custom"];
|
|
23
23
|
export type PresetId = (typeof PRESET_IDS)[number];
|
|
24
|
+
/**
|
|
25
|
+
* DriveThruRPG print-on-demand interior. Where each value comes from:
|
|
26
|
+
*
|
|
27
|
+
* SPEC = DriveThru Partners, "Quick Specifications for Print Books"
|
|
28
|
+
* (help.drivethrupartners.com/hc/en-us/articles/12780800178583)
|
|
29
|
+
* GUIDE = third-party DriveThruRPG layout guides (consistent with SPEC's
|
|
30
|
+
* bleed rule; not stated by DriveThru itself)
|
|
31
|
+
* CONVENTION = Gutterpress's own choice or a value DERIVED from a spec
|
|
32
|
+
* requirement (e.g. PDF/X-1a forbids transparency) — NOT a DriveThru
|
|
33
|
+
* requirement in its own right.
|
|
34
|
+
*/
|
|
24
35
|
export declare const DTRPG_PRESET: VendorPreset;
|
|
25
36
|
/**
|
|
26
37
|
* A neutral, vendor-agnostic default for authors who aren't targeting a
|
|
@@ -200,6 +200,12 @@
|
|
|
200
200
|
"description": "Allowed deviation, in points, between the expected and the actual page size.",
|
|
201
201
|
"default": 0.5,
|
|
202
202
|
"minimum": 0
|
|
203
|
+
},
|
|
204
|
+
"bleed": {
|
|
205
|
+
"type": "number",
|
|
206
|
+
"description": "A bleed, in points, that the page width x height ALREADY CONTAINS on the top, bottom and OUTER edges (none on the binding edge) — how DriveThruRPG's interior file is cut (8.625 x 11.25in for an 8.5 x 11in book). Preview overlay only: it tells the margin & bleed overlay where the trim is and changes nothing in the PDF. CSS `@page { bleed }` wins when the stylesheet declares one. Preset default: dtrpg 9 (0.125in); book and custom none.",
|
|
207
|
+
"minimum": 0,
|
|
208
|
+
"examples": [9]
|
|
203
209
|
}
|
|
204
210
|
}
|
|
205
211
|
},
|
|
@@ -7,17 +7,17 @@ import {
|
|
|
7
7
|
TARGET_IDS,
|
|
8
8
|
scaffoldExtension,
|
|
9
9
|
scaffoldProject
|
|
10
|
-
} from "./cli-
|
|
10
|
+
} from "./cli-0w3961p5.js";
|
|
11
11
|
import {
|
|
12
12
|
resolveGhostscript
|
|
13
|
-
} from "./cli-
|
|
13
|
+
} from "./cli-qp6dtsh3.js";
|
|
14
14
|
import {
|
|
15
15
|
UsageError,
|
|
16
16
|
rejectExtraPositionals,
|
|
17
17
|
rejectUnknownFlags
|
|
18
|
-
} from "./cli-
|
|
18
|
+
} from "./cli-yqpnksaa.js";
|
|
19
19
|
import"./cli-ht1bcqdd.js";
|
|
20
|
-
import"./cli-
|
|
20
|
+
import"./cli-161z4n0s.js";
|
|
21
21
|
import {
|
|
22
22
|
EXIT_CODES
|
|
23
23
|
} from "./cli-46ycxe6r.js";
|
|
@@ -2,17 +2,17 @@ import {
|
|
|
2
2
|
executeValidation,
|
|
3
3
|
publishTargetFor,
|
|
4
4
|
reportMissingTools
|
|
5
|
-
} from "./cli-
|
|
5
|
+
} from "./cli-0w3961p5.js";
|
|
6
6
|
import {
|
|
7
7
|
log
|
|
8
|
-
} from "./cli-
|
|
8
|
+
} from "./cli-qp6dtsh3.js";
|
|
9
9
|
import {
|
|
10
10
|
UsageError,
|
|
11
11
|
rejectExtraPositionals,
|
|
12
12
|
rejectUnknownFlags
|
|
13
|
-
} from "./cli-
|
|
13
|
+
} from "./cli-yqpnksaa.js";
|
|
14
14
|
import"./cli-ht1bcqdd.js";
|
|
15
|
-
import"./cli-
|
|
15
|
+
import"./cli-161z4n0s.js";
|
|
16
16
|
import {
|
|
17
17
|
BuildError,
|
|
18
18
|
EXIT_CODES
|
|
@@ -22,7 +22,7 @@ import type { PrintPadding } from '../engine/shared/synthesis.ts';
|
|
|
22
22
|
* no per-source wrappers or forced breaks are added, so preview pagination
|
|
23
23
|
* never diverges from the PDF where a source file begins mid-page.
|
|
24
24
|
*/
|
|
25
|
-
export declare function injectPreviewScripts(html: string): string;
|
|
25
|
+
export declare function injectPreviewScripts(html: string, insetBleedPt?: number): string;
|
|
26
26
|
/**
|
|
27
27
|
* Generate HTML from markdown and write book.html to the temp directory.
|
|
28
28
|
* The desktop's iframe loads `book.html` via a relative URL — same name in
|
|
@@ -45,6 +45,9 @@ export declare function generateAndWriteHtml(inputPath: string, tempDir: string,
|
|
|
45
45
|
};
|
|
46
46
|
extensions?: ResolvedExtensionConfig[];
|
|
47
47
|
print?: PrintPadding;
|
|
48
|
+
page?: {
|
|
49
|
+
bleed?: number;
|
|
50
|
+
};
|
|
48
51
|
}, cssAssets: Map<string, string>, imageRefs?: Set<string>): Promise<void>;
|
|
49
52
|
/**
|
|
50
53
|
* Chokidar 5's `ignored` matcher (regex or function) is tested against the
|
|
@@ -7,10 +7,10 @@ import {
|
|
|
7
7
|
runBuild,
|
|
8
8
|
splitOutPath,
|
|
9
9
|
startPreviewServer
|
|
10
|
-
} from "./cli-
|
|
10
|
+
} from "./cli-0w3961p5.js";
|
|
11
11
|
import {
|
|
12
12
|
log
|
|
13
|
-
} from "./cli-
|
|
13
|
+
} from "./cli-qp6dtsh3.js";
|
|
14
14
|
import {
|
|
15
15
|
UsageError,
|
|
16
16
|
parseFormat,
|
|
@@ -18,9 +18,9 @@ import {
|
|
|
18
18
|
rejectExtraPositionals,
|
|
19
19
|
rejectUnknownFlags,
|
|
20
20
|
resolvePort
|
|
21
|
-
} from "./cli-
|
|
21
|
+
} from "./cli-yqpnksaa.js";
|
|
22
22
|
import"./cli-ht1bcqdd.js";
|
|
23
|
-
import"./cli-
|
|
23
|
+
import"./cli-161z4n0s.js";
|
|
24
24
|
import {
|
|
25
25
|
BuildError
|
|
26
26
|
} from "./cli-46ycxe6r.js";
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
//
|
|
15
15
|
// Commands map 1:1 to previewAPI methods: getTotalPages, getCurrentPage,
|
|
16
16
|
// goToPage, firstPage, prevPage, nextPage, lastPage, setViewMode, setZoom,
|
|
17
|
-
// toggleDebugMode, setMarginOverlay. Plus a synthetic 'print' command that calls window.print().
|
|
17
|
+
// toggleDebugMode, setMarginOverlay(on, {color, strength}). Plus a synthetic 'print' command that calls window.print().
|
|
18
18
|
//
|
|
19
19
|
// Additional messages:
|
|
20
20
|
// parent -> iframe: { type: 'gutterpress:inject-styles', id: <attr-name>, css: <string> }
|
|
@@ -1101,15 +1101,20 @@
|
|
|
1101
1101
|
// the overlayChanged event (margin & bleed overlay, engine/viewer/
|
|
1102
1102
|
// overlay.ts). A v9 lib with a pre-v9 SPA simply never turns it on; a v9
|
|
1103
1103
|
// SPA feature-detects on the version before offering the toggle.
|
|
1104
|
+
// (v9 is unreleased as of this writing, so setMarginOverlay's optional
|
|
1105
|
+
// second argument — the look, below — is part of v9, not a bump.)
|
|
1104
1106
|
getProtocolVersion: function () { return 9; },
|
|
1105
1107
|
|
|
1106
1108
|
// Margin & bleed overlay. Viewer chrome only — it adds no box to the book
|
|
1107
1109
|
// and no attribute to its elements, so pagination is identical on or off.
|
|
1108
1110
|
// Returns the summary {on, issues, intended, bleedPt}, or null when the
|
|
1109
|
-
// viewer predates it.
|
|
1110
|
-
|
|
1111
|
+
// viewer predates it. `style` ({color: '#rrggbb', strength: 'subtle' |
|
|
1112
|
+
// 'normal' | 'strong'}) is optional: it only sets the viewer's own
|
|
1113
|
+
// `--gp-ov-*` tokens, and a call that carries it while the overlay is
|
|
1114
|
+
// already on restyles without repainting.
|
|
1115
|
+
setMarginOverlay: function (on, style) {
|
|
1111
1116
|
var d = window.Gutterpress && window.Gutterpress.decoration;
|
|
1112
|
-
return d && typeof d.setOverlay === 'function' ? d.setOverlay(!!on) : null;
|
|
1117
|
+
return d && typeof d.setOverlay === 'function' ? d.setOverlay(!!on, style) : null;
|
|
1113
1118
|
},
|
|
1114
1119
|
toggleMarginOverlay: function () {
|
|
1115
1120
|
var d = window.Gutterpress && window.Gutterpress.decoration;
|
|
@@ -1650,7 +1655,8 @@
|
|
|
1650
1655
|
var parts = ['Margins & bleed'];
|
|
1651
1656
|
parts.push(summary.issues ? summary.issues + ' overflowing' : 'nothing overflows');
|
|
1652
1657
|
if (summary.intended) parts.push(summary.intended + ' placed on purpose');
|
|
1653
|
-
if (
|
|
1658
|
+
if (summary.bleedInSheet) parts.push('bleed inside the page (print preset)');
|
|
1659
|
+
if (!summary.bleedPt) parts.push('no bleed set \u2014 add @page { bleed: 0.125in } to see the bleed edge');
|
|
1654
1660
|
badge.textContent = parts.join(' \u00b7 ') + ' (Alt+M hides)';
|
|
1655
1661
|
}
|
|
1656
1662
|
|
|
@@ -108,7 +108,13 @@
|
|
|
108
108
|
if (sourceBody.classList.contains('debug')) api.toggleDebugMode();
|
|
109
109
|
// The margin & bleed overlay is a review aid the author switched on: a
|
|
110
110
|
// hot reload must not drop it.
|
|
111
|
-
|
|
111
|
+
// Its look (colour, strength) travels with it.
|
|
112
|
+
if (sourceBody.dataset.overlay === 'on' && api.setMarginOverlay) {
|
|
113
|
+
api.setMarginOverlay(true, {
|
|
114
|
+
color: sourceBody.style.getPropertyValue('--gp-ov-color').trim(),
|
|
115
|
+
strength: sourceBody.dataset.overlayStrength
|
|
116
|
+
});
|
|
117
|
+
}
|
|
112
118
|
}
|
|
113
119
|
var zoom = source.documentElement.style.getPropertyValue('--gutterpress-zoom');
|
|
114
120
|
// Carry the fit flag too (setZoom's third argument clips sideways overflow).
|
|
@@ -11,18 +11,18 @@ import {
|
|
|
11
11
|
publishProviderFor,
|
|
12
12
|
resolvePublishFormat,
|
|
13
13
|
runPublish
|
|
14
|
-
} from "./cli-
|
|
14
|
+
} from "./cli-0w3961p5.js";
|
|
15
15
|
import {
|
|
16
16
|
FileTokenStore,
|
|
17
17
|
log
|
|
18
|
-
} from "./cli-
|
|
18
|
+
} from "./cli-qp6dtsh3.js";
|
|
19
19
|
import {
|
|
20
20
|
UsageError,
|
|
21
21
|
rejectExtraPositionals,
|
|
22
22
|
rejectUnknownFlags
|
|
23
|
-
} from "./cli-
|
|
23
|
+
} from "./cli-yqpnksaa.js";
|
|
24
24
|
import"./cli-ht1bcqdd.js";
|
|
25
|
-
import"./cli-
|
|
25
|
+
import"./cli-161z4n0s.js";
|
|
26
26
|
import {
|
|
27
27
|
EXIT_CODES
|
|
28
28
|
} from "./cli-46ycxe6r.js";
|
|
@@ -146,6 +146,15 @@ export interface GutterpressManifest {
|
|
|
146
146
|
width?: number;
|
|
147
147
|
height?: number;
|
|
148
148
|
tolerance?: number;
|
|
149
|
+
/**
|
|
150
|
+
* A bleed (pt) the page `width` x `height` ALREADY CONTAINS, on the top,
|
|
151
|
+
* bottom and OUTER edges only (the binding edge has none) — how
|
|
152
|
+
* DriveThruRPG's interior file is cut (8.625 x 11.25in for an 8.5 x 11in
|
|
153
|
+
* book). It changes nothing in the PDF: it only tells the preview's margin
|
|
154
|
+
* & bleed overlay where the trim is. CSS `@page { bleed }` (symmetric,
|
|
155
|
+
* grows the page) wins when the stylesheet declares one.
|
|
156
|
+
*/
|
|
157
|
+
bleed?: number;
|
|
149
158
|
};
|
|
150
159
|
ink?: {
|
|
151
160
|
maxTac?: number;
|
|
@@ -261,6 +270,8 @@ export interface ResolvedConfig {
|
|
|
261
270
|
width: number;
|
|
262
271
|
height: number;
|
|
263
272
|
tolerance: number;
|
|
273
|
+
/** In-sheet bleed in pt (top, bottom, outer edge; see the manifest field); absent = none. */
|
|
274
|
+
bleed?: number;
|
|
264
275
|
};
|
|
265
276
|
ink: {
|
|
266
277
|
maxTac: number;
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import {
|
|
2
2
|
executeAndReport
|
|
3
|
-
} from "./cli-
|
|
3
|
+
} from "./cli-0w3961p5.js";
|
|
4
4
|
import {
|
|
5
5
|
log
|
|
6
|
-
} from "./cli-
|
|
6
|
+
} from "./cli-qp6dtsh3.js";
|
|
7
7
|
import {
|
|
8
8
|
UsageError,
|
|
9
9
|
rejectExtraPositionals,
|
|
10
10
|
rejectUnknownFlags
|
|
11
|
-
} from "./cli-
|
|
11
|
+
} from "./cli-yqpnksaa.js";
|
|
12
12
|
import"./cli-ht1bcqdd.js";
|
|
13
|
-
import"./cli-
|
|
13
|
+
import"./cli-161z4n0s.js";
|
|
14
14
|
import {
|
|
15
15
|
BuildError,
|
|
16
16
|
EXIT_CODES
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "gutterpress",
|
|
3
|
-
"version": "0.11.18-alpha.
|
|
3
|
+
"version": "0.11.18-alpha.2",
|
|
4
4
|
"description": "Markdown-to-PDF converter for professional print layout using a native Chromium print engine and Ghostscript.",
|
|
5
5
|
"author": "itlackey",
|
|
6
6
|
"license": "MPL-2.0",
|