gutterpress 0.11.17-alpha.2 → 0.11.17-alpha.4
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.d.ts +4 -0
- package/dist/api/index.js +11 -2
- package/dist/black-text-gray-7dz61456.js +15 -0
- package/dist/{build-1p999cmg.js → build-fam0tqg6.js} +5 -4
- package/dist/checks/pdf/black-text.d.ts +3 -0
- package/dist/checks/pdf/index.d.ts +2 -0
- package/dist/checks/pdf/signature.d.ts +3 -0
- package/dist/{cli-6z5zthzt.js → cli-2kc34kme.js} +470 -489
- package/dist/{cli-70xgehq2.js → cli-8apk8571.js} +1 -1
- package/dist/cli-ht1bcqdd.js +493 -0
- package/dist/{cli-gymfg04q.js → cli-jyy9pqf3.js} +15 -10
- package/dist/{cli-ppc0vz4b.js → cli-pqcb2nnb.js} +1 -1
- package/dist/cli.js +12 -12
- package/dist/{doctor-reqpnn3h.js → doctor-zre5k5fg.js} +2 -2
- package/dist/engine/compiler/build.d.ts +3 -2
- package/dist/engine/compiler/postprocess.d.ts +6 -4
- package/dist/engine/shared/synthesis.d.ts +29 -5
- package/dist/{engine-5jzhjjvv.js → engine-3xqgm82d.js} +2 -2
- package/dist/{engine-078ggczp.js → engine-zdb41ay1.js} +1 -1
- package/dist/{ext-dsbfejt3.js → ext-hfqcg6ax.js} +5 -4
- package/dist/{gutterpress-viewer-zkv2stfy.js → gutterpress-viewer-1n793gwd.js} +5 -3
- package/dist/{index-c275p061.js → index-gp503ze9.js} +1622 -1332
- package/dist/{index-5dcj1vts.js → index-hrx0gfkj.js} +23 -684
- package/dist/index-ht1bcqdd.js +493 -0
- package/dist/index-q1xqxrh9.js +949 -0
- package/dist/index.js +12 -3
- package/dist/lib/black-text-gray.d.ts +55 -8
- package/dist/lib/build-fingerprint.d.ts +2 -0
- package/dist/lib/engine.d.ts +2 -1
- package/dist/lib/lint-rules.d.ts +9 -0
- package/dist/lib/markdown/assemble.d.ts +3 -5
- package/dist/lib/markdown/index.d.ts +3 -8
- package/dist/lib/markdown/renderer.d.ts +9 -1
- package/dist/lib/page-size.d.ts +66 -0
- package/dist/lib/pdf-inspect.d.ts +6 -0
- package/dist/lib/printsafe.d.ts +8 -1
- package/dist/lib/project-scaffold.d.ts +3 -9
- package/dist/lib/remote-auth/github-repos.d.ts +7 -0
- package/dist/lib/remote-auth/online-backup.d.ts +51 -0
- package/dist/lib/snippets.d.ts +3 -0
- package/dist/{manifest.schema-40sfq49z.json → manifest.schema-gh0jjve9.json} +14 -2
- package/dist/{new-m5y2wepr.js → new-bjdf7bhg.js} +5 -4
- package/dist/{plugin.js-m4a7m3t4.tpl → plugin.js-cswq7wvd.tpl} +4 -1
- package/dist/{plugin.test.js-6n8ct5e3.tpl → plugin.test.js-xgxrd8hf.tpl} +4 -1
- package/dist/{preflight-bwpqwwny.js → preflight-gvw01661.js} +5 -4
- package/dist/preview/file-watcher.d.ts +2 -4
- package/dist/{preview-62y7qhkp.js → preview-1cschq8s.js} +5 -4
- package/dist/{publish-k2zyt3x6.js → publish-ddqrb8s9.js} +5 -4
- package/dist/render.js +30 -5
- package/dist/schema/manifest.types.d.ts +17 -0
- package/dist/{validate-fgwwxtbn.js → validate-3hjkgxrz.js} +5 -4
- package/package.json +1 -1
- package/dist/index-eyaj6nkc.js +0 -267
|
@@ -1,14 +1,16 @@
|
|
|
1
|
+
import { type LastPageMode } from "../shared/synthesis.ts";
|
|
1
2
|
import type { PageTrim } from "./tier2.ts";
|
|
2
3
|
export interface PostprocessOptions {
|
|
3
4
|
geometry: PageTrim;
|
|
4
5
|
/** append blank pages until pageCount % signature === 0 */
|
|
5
6
|
signature?: number;
|
|
6
7
|
/**
|
|
7
|
-
*
|
|
8
|
-
* would add nothing, append one full signature of blank pages
|
|
9
|
-
* signature <= 1).
|
|
8
|
+
* `blank`: guarantee the last page is a blank page added here (if signature
|
|
9
|
+
* padding would add nothing, append one full signature of blank pages — one
|
|
10
|
+
* page when signature <= 1). `short-by-one`: stop one page short of a
|
|
11
|
+
* multiple of the signature, for the printer to add the last page.
|
|
10
12
|
*/
|
|
11
|
-
|
|
13
|
+
lastPage?: LastPageMode;
|
|
12
14
|
title?: string;
|
|
13
15
|
author?: string;
|
|
14
16
|
subject?: string;
|
|
@@ -34,14 +34,38 @@ export interface RectoSite {
|
|
|
34
34
|
* Page 1 is a recto; recto pages are odd.
|
|
35
35
|
*/
|
|
36
36
|
export declare function planRectoBlanks(sites: RectoSite[]): boolean[];
|
|
37
|
+
/**
|
|
38
|
+
* How the interior treats its last page for a printer that reserves it
|
|
39
|
+
* (DriveThruRPG puts its own information there):
|
|
40
|
+
* - `blank` — the build's last page is an empty one it added (padded to a
|
|
41
|
+
* multiple of the signature, plus a whole signature if that added nothing);
|
|
42
|
+
* - `short-by-one` — the interior is one page short of a multiple of the
|
|
43
|
+
* signature (`k × signature − 1`) and the printer supplies the last page.
|
|
44
|
+
*/
|
|
45
|
+
export type LastPageMode = "blank" | "short-by-one";
|
|
46
|
+
/** The `print` settings that decide how many blank pages the interior gets. */
|
|
47
|
+
export interface PrintPadding {
|
|
48
|
+
signature?: number;
|
|
49
|
+
/** older spelling of `lastPage: "blank"` */
|
|
50
|
+
reserveLastPage?: boolean;
|
|
51
|
+
lastPage?: LastPageMode;
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* The effective last-page mode of a resolved `print` block: `lastPage` when
|
|
55
|
+
* set, else the older `reserveLastPage: true` (which means `blank`). One
|
|
56
|
+
* place, so the manifest, the viewer's data attribute and the preflight
|
|
57
|
+
* check cannot disagree about what an existing manifest asks for.
|
|
58
|
+
*/
|
|
59
|
+
export declare function lastPageMode(print: PrintPadding): LastPageMode | undefined;
|
|
37
60
|
/**
|
|
38
61
|
* How many blank pages the build appends after `pageCount` content pages:
|
|
39
|
-
* enough to reach a multiple of `signature
|
|
40
|
-
*
|
|
41
|
-
* blank one (one page when `signature` <= 1)
|
|
42
|
-
*
|
|
62
|
+
* enough to reach a multiple of `signature` — with `lastPage: "blank"`, a full
|
|
63
|
+
* extra signature when that would add none, so the last page is always a
|
|
64
|
+
* blank one (one page when `signature` <= 1); with `"short-by-one"`, enough to
|
|
65
|
+
* reach one page short of a multiple. `postprocess.ts` pads the PDF by this
|
|
66
|
+
* and the viewer shows the same sheets, so their page counts agree.
|
|
43
67
|
*/
|
|
44
|
-
export declare function signaturePadding(pageCount: number, signature?: number,
|
|
68
|
+
export declare function signaturePadding(pageCount: number, signature?: number, lastPage?: LastPageMode): number;
|
|
45
69
|
export type StringWhich = "first" | "start" | "last" | "first-except";
|
|
46
70
|
export interface StringEntry {
|
|
47
71
|
/** 1-based page the assignment lands on */
|
|
@@ -12,16 +12,17 @@ import {
|
|
|
12
12
|
searchNpmExtensions,
|
|
13
13
|
setExtensionEnabled,
|
|
14
14
|
updateExtensions
|
|
15
|
-
} from "./cli-
|
|
16
|
-
import"./cli-
|
|
15
|
+
} from "./cli-2kc34kme.js";
|
|
16
|
+
import"./cli-8apk8571.js";
|
|
17
17
|
import {
|
|
18
18
|
UsageError,
|
|
19
19
|
exitForUsage,
|
|
20
20
|
rejectExtraPositionals,
|
|
21
21
|
rejectUnknownFlags,
|
|
22
22
|
resolveProjectDir
|
|
23
|
-
} from "./cli-
|
|
24
|
-
import"./cli-
|
|
23
|
+
} from "./cli-pqcb2nnb.js";
|
|
24
|
+
import"./cli-ht1bcqdd.js";
|
|
25
|
+
import"./cli-jyy9pqf3.js";
|
|
25
26
|
import {
|
|
26
27
|
EXIT_CODES
|
|
27
28
|
} from "./cli-46ycxe6r.js";
|
|
@@ -947,10 +947,12 @@
|
|
|
947
947
|
return wrong;
|
|
948
948
|
});
|
|
949
949
|
}
|
|
950
|
-
function signaturePadding(pageCount, signature = 1,
|
|
950
|
+
function signaturePadding(pageCount, signature = 1, lastPage) {
|
|
951
951
|
const size = signature > 1 ? signature : 1;
|
|
952
|
+
if (lastPage === "short-by-one")
|
|
953
|
+
return (size - (pageCount + 1) % size) % size;
|
|
952
954
|
const padded = (size - pageCount % size) % size;
|
|
953
|
-
return padded === 0 &&
|
|
955
|
+
return padded === 0 && lastPage === "blank" ? size : padded;
|
|
954
956
|
}
|
|
955
957
|
var WHICH_VALUES = new Set(["first", "start", "last", "first-except"]);
|
|
956
958
|
function parseWhich(raw) {
|
|
@@ -1678,7 +1680,7 @@
|
|
|
1678
1680
|
for (const spacer of Array.from(document.querySelectorAll(".gp-pad-spacer")))
|
|
1679
1681
|
spacer.remove();
|
|
1680
1682
|
const data = document.documentElement.dataset;
|
|
1681
|
-
const count = signaturePadding(contentPages, Number(data.gpSignature) || 1, data.
|
|
1683
|
+
const count = signaturePadding(contentPages, Number(data.gpSignature) || 1, data.gpLastPage);
|
|
1682
1684
|
const last = strips[strips.length - 1];
|
|
1683
1685
|
if (!last || count === 0)
|
|
1684
1686
|
return contentPages;
|