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.
Files changed (53) hide show
  1. package/dist/api/index.d.ts +4 -0
  2. package/dist/api/index.js +11 -2
  3. package/dist/black-text-gray-7dz61456.js +15 -0
  4. package/dist/{build-1p999cmg.js → build-fam0tqg6.js} +5 -4
  5. package/dist/checks/pdf/black-text.d.ts +3 -0
  6. package/dist/checks/pdf/index.d.ts +2 -0
  7. package/dist/checks/pdf/signature.d.ts +3 -0
  8. package/dist/{cli-6z5zthzt.js → cli-2kc34kme.js} +470 -489
  9. package/dist/{cli-70xgehq2.js → cli-8apk8571.js} +1 -1
  10. package/dist/cli-ht1bcqdd.js +493 -0
  11. package/dist/{cli-gymfg04q.js → cli-jyy9pqf3.js} +15 -10
  12. package/dist/{cli-ppc0vz4b.js → cli-pqcb2nnb.js} +1 -1
  13. package/dist/cli.js +12 -12
  14. package/dist/{doctor-reqpnn3h.js → doctor-zre5k5fg.js} +2 -2
  15. package/dist/engine/compiler/build.d.ts +3 -2
  16. package/dist/engine/compiler/postprocess.d.ts +6 -4
  17. package/dist/engine/shared/synthesis.d.ts +29 -5
  18. package/dist/{engine-5jzhjjvv.js → engine-3xqgm82d.js} +2 -2
  19. package/dist/{engine-078ggczp.js → engine-zdb41ay1.js} +1 -1
  20. package/dist/{ext-dsbfejt3.js → ext-hfqcg6ax.js} +5 -4
  21. package/dist/{gutterpress-viewer-zkv2stfy.js → gutterpress-viewer-1n793gwd.js} +5 -3
  22. package/dist/{index-c275p061.js → index-gp503ze9.js} +1622 -1332
  23. package/dist/{index-5dcj1vts.js → index-hrx0gfkj.js} +23 -684
  24. package/dist/index-ht1bcqdd.js +493 -0
  25. package/dist/index-q1xqxrh9.js +949 -0
  26. package/dist/index.js +12 -3
  27. package/dist/lib/black-text-gray.d.ts +55 -8
  28. package/dist/lib/build-fingerprint.d.ts +2 -0
  29. package/dist/lib/engine.d.ts +2 -1
  30. package/dist/lib/lint-rules.d.ts +9 -0
  31. package/dist/lib/markdown/assemble.d.ts +3 -5
  32. package/dist/lib/markdown/index.d.ts +3 -8
  33. package/dist/lib/markdown/renderer.d.ts +9 -1
  34. package/dist/lib/page-size.d.ts +66 -0
  35. package/dist/lib/pdf-inspect.d.ts +6 -0
  36. package/dist/lib/printsafe.d.ts +8 -1
  37. package/dist/lib/project-scaffold.d.ts +3 -9
  38. package/dist/lib/remote-auth/github-repos.d.ts +7 -0
  39. package/dist/lib/remote-auth/online-backup.d.ts +51 -0
  40. package/dist/lib/snippets.d.ts +3 -0
  41. package/dist/{manifest.schema-40sfq49z.json → manifest.schema-gh0jjve9.json} +14 -2
  42. package/dist/{new-m5y2wepr.js → new-bjdf7bhg.js} +5 -4
  43. package/dist/{plugin.js-m4a7m3t4.tpl → plugin.js-cswq7wvd.tpl} +4 -1
  44. package/dist/{plugin.test.js-6n8ct5e3.tpl → plugin.test.js-xgxrd8hf.tpl} +4 -1
  45. package/dist/{preflight-bwpqwwny.js → preflight-gvw01661.js} +5 -4
  46. package/dist/preview/file-watcher.d.ts +2 -4
  47. package/dist/{preview-62y7qhkp.js → preview-1cschq8s.js} +5 -4
  48. package/dist/{publish-k2zyt3x6.js → publish-ddqrb8s9.js} +5 -4
  49. package/dist/render.js +30 -5
  50. package/dist/schema/manifest.types.d.ts +17 -0
  51. package/dist/{validate-fgwwxtbn.js → validate-3hjkgxrz.js} +5 -4
  52. package/package.json +1 -1
  53. 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
- * Guarantee the last page is a blank page added here. If signature padding
8
- * would add nothing, append one full signature of blank pages (one page when
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
- reserveLastPage?: boolean;
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`, and — with `reserveLastPage` — a
40
- * full extra signature when that would add none, so the last page is always a
41
- * blank one (one page when `signature` <= 1). `postprocess.ts` pads the PDF by
42
- * this and the viewer shows the same sheets, so their page counts agree.
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, reserveLastPage?: boolean): 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 */
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  build
3
- } from "./index-5dcj1vts.js";
3
+ } from "./index-hrx0gfkj.js";
4
4
  import {
5
5
  BuildError
6
- } from "./index-eyaj6nkc.js";
6
+ } from "./index-q1xqxrh9.js";
7
7
  import"./index-rzm1phg0.js";
8
8
  import"./index-37x76zdn.js";
9
9
 
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  build
3
- } from "./cli-gymfg04q.js";
3
+ } from "./cli-jyy9pqf3.js";
4
4
  import {
5
5
  BuildError
6
6
  } from "./cli-46ycxe6r.js";
@@ -12,16 +12,17 @@ import {
12
12
  searchNpmExtensions,
13
13
  setExtensionEnabled,
14
14
  updateExtensions
15
- } from "./cli-6z5zthzt.js";
16
- import"./cli-70xgehq2.js";
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-ppc0vz4b.js";
24
- import"./cli-gymfg04q.js";
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, reserveLastPage = false) {
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 && reserveLastPage ? size : padded;
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.gpReserveLastPage !== undefined);
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;