gutterpress 0.11.6-alpha.1 → 0.11.6-alpha.3

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 (30) hide show
  1. package/dist/api/index.js +3 -3
  2. package/dist/{audit-bhxh0bbf.js → audit-t4r954ff.js} +5 -5
  3. package/dist/{build-sqdahz2j.js → build-8gx90w22.js} +5 -5
  4. package/dist/{cli-cghcd60p.js → cli-5c2xfsmz.js} +1 -1
  5. package/dist/{cli-sekhwex4.js → cli-5vdgncmm.js} +2 -2
  6. package/dist/{cli-c9h2bk2k.js → cli-c5360prx.js} +7 -7
  7. package/dist/{cli-q696mp75.js → cli-g6vshy3f.js} +27 -27
  8. package/dist/{cli-jp97snns.js → cli-rra50cp6.js} +1 -1
  9. package/dist/cli.js +14 -14
  10. package/dist/{doctor-gj8gtgec.js → doctor-b1awtn7m.js} +2 -2
  11. package/dist/{engine-w5ed5hmb.js → engine-15dfcy85.js} +2 -2
  12. package/dist/{engine-cbc17ne4.js → engine-amxqsfka.js} +1 -1
  13. package/dist/{ext-xhtta4bh.js → ext-mxxz3p8t.js} +7 -7
  14. package/dist/{gutterpress-viewer-k0xrt5hw.js → gutterpress-viewer-swz6bwfa.js} +25 -3
  15. package/dist/{index-cwhgq7tq.js → index-0h00ve4y.js} +38 -38
  16. package/dist/{index-c5ev4r1y.js → index-8xkw284t.js} +7 -7
  17. package/dist/{index-6n15e1ze.js → index-gf1shk3y.js} +1 -1
  18. package/dist/{index-12pvhbyz.js → index-yeej2vhs.js} +2 -2
  19. package/dist/index.js +4 -4
  20. package/dist/lib/extension-manager.d.ts +3 -1
  21. package/dist/lib/remote-auth/sync-messages.d.ts +7 -7
  22. package/dist/{lint-t0tj3psc.js → lint-vyxf5zmw.js} +5 -5
  23. package/dist/{new-s256mmkt.js → new-r3s74yfv.js} +7 -7
  24. package/dist/{preflight-5y10233n.js → preflight-j9e9m4ea.js} +5 -5
  25. package/dist/{preview-j2rvdhg1.js → preview-aprv0c49.js} +6 -6
  26. package/dist/{publish-6px5snad.js → publish-4y1kztbd.js} +6 -6
  27. package/dist/{source-provider-54a52bpd.js → source-provider-exy1wakv.js} +1 -1
  28. package/dist/{source-provider-a458mmec.js → source-provider-y9ktprbx.js} +1 -1
  29. package/dist/{validate-f0m0d2zs.js → validate-sf6hga9e.js} +5 -5
  30. package/package.json +1 -1
package/dist/api/index.js CHANGED
@@ -124,12 +124,12 @@ import {
124
124
  syncProject,
125
125
  testRemoteAccess,
126
126
  validateProjectExtensions
127
- } from "../index-cwhgq7tq.js";
127
+ } from "../index-0h00ve4y.js";
128
128
  import {
129
129
  BuildError,
130
130
  DEFAULT_PRINT_OPTS,
131
131
  readyProbeExpr
132
- } from "../index-6n15e1ze.js";
132
+ } from "../index-gf1shk3y.js";
133
133
  import {
134
134
  AUTO_SNAPSHOT_MESSAGE,
135
135
  HISTORY_PAGE_LIMIT,
@@ -141,7 +141,7 @@ import {
141
141
  resolveLogger,
142
142
  restoreVersionWithBackup,
143
143
  switchBranch
144
- } from "../index-c5ev4r1y.js";
144
+ } from "../index-8xkw284t.js";
145
145
  import {
146
146
  capabilitiesFor,
147
147
  detectProjectSource,
@@ -1,20 +1,20 @@
1
1
  import {
2
2
  executeAndReport
3
- } from "./cli-q696mp75.js";
3
+ } from "./cli-g6vshy3f.js";
4
4
  import {
5
5
  log
6
- } from "./cli-jp97snns.js";
6
+ } from "./cli-rra50cp6.js";
7
7
  import {
8
8
  UsageError,
9
9
  rejectExtraPositionals,
10
10
  rejectUnknownFlags
11
- } from "./cli-cghcd60p.js";
12
- import"./cli-sekhwex4.js";
11
+ } from "./cli-5c2xfsmz.js";
12
+ import"./cli-5vdgncmm.js";
13
13
  import"./cli-c41yr7he.js";
14
14
  import {
15
15
  EXIT_CODES
16
16
  } from "./cli-46ycxe6r.js";
17
- import"./cli-c9h2bk2k.js";
17
+ import"./cli-c5360prx.js";
18
18
  import"./cli-v5mp7a6q.js";
19
19
  import"./cli-37x76zdn.js";
20
20
 
@@ -1,23 +1,23 @@
1
1
  import {
2
2
  runBuild,
3
3
  splitOutPath
4
- } from "./cli-q696mp75.js";
4
+ } from "./cli-g6vshy3f.js";
5
5
  import {
6
6
  log
7
- } from "./cli-jp97snns.js";
7
+ } from "./cli-rra50cp6.js";
8
8
  import {
9
9
  UsageError,
10
10
  parseFormat,
11
11
  parsePdfxFlavor,
12
12
  rejectExtraPositionals,
13
13
  rejectUnknownFlags
14
- } from "./cli-cghcd60p.js";
15
- import"./cli-sekhwex4.js";
14
+ } from "./cli-5c2xfsmz.js";
15
+ import"./cli-5vdgncmm.js";
16
16
  import"./cli-c41yr7he.js";
17
17
  import {
18
18
  BuildError
19
19
  } from "./cli-46ycxe6r.js";
20
- import"./cli-c9h2bk2k.js";
20
+ import"./cli-c5360prx.js";
21
21
  import"./cli-v5mp7a6q.js";
22
22
  import"./cli-37x76zdn.js";
23
23
 
@@ -4,7 +4,7 @@ import {
4
4
  // package.json
5
5
  var package_default = {
6
6
  name: "gutterpress",
7
- version: "0.11.6-alpha.1",
7
+ version: "0.11.6-alpha.3",
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",
@@ -1445,7 +1445,7 @@ var preview_shell_default = "./preview-shell-gqnc5xxe.js";
1445
1445
  var CGATS21_CRPC1_default = "./CGATS21_CRPC1-g0e3k7kr.icc";
1446
1446
 
1447
1447
  // src/assets/engine/gutterpress-viewer.js
1448
- var gutterpress_viewer_default = "./gutterpress-viewer-k0xrt5hw.js";
1448
+ var gutterpress_viewer_default = "./gutterpress-viewer-swz6bwfa.js";
1449
1449
 
1450
1450
  // src/assets/engine/gutterpress-agent.js
1451
1451
  var gutterpress_agent_default = "./gutterpress-agent-cazqstr1.js";
@@ -2542,7 +2542,7 @@ ${mapCss}`;
2542
2542
  if (layerTraps.length)
2543
2543
  log(`audit: ${layerTraps.length} trapped layer warning(s)`);
2544
2544
  for (const hit of pageBackgrounds)
2545
- diagnose("engine.page-background.unreferenced", `"${hit.url}" is only referenced from "${hit.where}", and Chromium will not print an image referenced nowhere else — the page prints with its background colour alone, with no error. Gutterpress stages and preloads every image your project stylesheets reference, so this one is outside that: it is remote (a url(https://...), which is never staged), or it comes from CSS that does not pass through your stylesheets, or an element in the document uses the same URL as its src, which drops it on its own. Use a local image, referenced from one of your project stylesheets, and not also used as an <img>.`);
2545
+ diagnose("engine.page-background.unreferenced", `"${hit.url}" is only referenced from "${hit.where}", and Chromium will not print an image referenced nowhere else — the page prints with its background color alone, with no error. Gutterpress stages and preloads every image your book's stylesheets reference, so this one is outside that: it is remote (a url(https://...), which is never staged), or it comes from CSS that does not pass through your stylesheets, or an element in the document uses the same URL as its src, which drops it on its own. Use a local image, referenced from one of your book's stylesheets, and not also used as an <img>.`);
2546
2546
  if (pageBackgrounds.length)
2547
2547
  log(`audit: ${pageBackgrounds.length} unreferenced @page background image(s)`);
2548
2548
  for (const d of multicol)
@@ -298,7 +298,7 @@ class LocalFolderSourceProvider {
298
298
  async initVersionHistory(options) {
299
299
  const dir = options.projectDir;
300
300
  if (await findEnclosingRepoDir(dir) !== undefined) {
301
- throw new Error("This folder is already inside a versioned project, so gutterpress " + "won't create a separate history here.");
301
+ throw new Error("This folder is already inside a versioned book, so gutterpress " + "won't create a separate history here.");
302
302
  }
303
303
  return withRepoLock(dir, async () => {
304
304
  const cache = {};
@@ -322,7 +322,7 @@ class LocalFolderSourceProvider {
322
322
  });
323
323
  }
324
324
  snapshot() {
325
- return Promise.reject(new Error("This project has no version history yet. Enable version history first."));
325
+ return Promise.reject(new Error("This book has no version history yet. Enable version history first."));
326
326
  }
327
327
  listHistory() {
328
328
  return Promise.resolve([]);
@@ -331,7 +331,7 @@ class LocalFolderSourceProvider {
331
331
  return Promise.resolve({ entries: [], hasMore: false });
332
332
  }
333
333
  restore() {
334
- return Promise.reject(new Error("This project has no version history yet. Enable version history first."));
334
+ return Promise.reject(new Error("This book has no version history yet. Enable version history first."));
335
335
  }
336
336
  }
337
337
 
@@ -477,7 +477,7 @@ function providerFor(source) {
477
477
  case "local-git-folder":
478
478
  return new LocalGitSourceProvider(source);
479
479
  case "managed-github":
480
- throw new Error("Managed GitHub projects are not supported yet (#15/#16).");
480
+ throw new Error("Managed GitHub books are not supported yet (#15/#16).");
481
481
  }
482
482
  }
483
483
  function gitDirFor(projectDir) {
@@ -492,7 +492,7 @@ async function restoreVersionWithBackup(options) {
492
492
  const { projectDir, id, authorName, authorEmail } = options;
493
493
  const source = await detectProjectSource(projectDir);
494
494
  if (source.type !== "local-git-folder") {
495
- throw new Error("This project has no version history yet. Enable version history first.");
495
+ throw new Error("This book has no version history yet. Enable version history first.");
496
496
  }
497
497
  const provider = new LocalGitSourceProvider(source);
498
498
  const repoDir = gitScopeFor(source);
@@ -510,7 +510,7 @@ async function restoreVersionWithBackup(options) {
510
510
  try {
511
511
  await provider.restoreUnlocked({ projectDir, id });
512
512
  } catch (cause) {
513
- throw new Error(backupId ? "The restore could not be completed, but your work is safe — it was " + `automatically saved as a backup snapshot (${backupId.slice(0, 7)}) ` + "and appears in your version history." : "The restore could not be completed. Your project files were not changed.", { cause });
513
+ throw new Error(backupId ? "The restore could not be completed, but your work is safe — it was " + `automatically saved as a backup snapshot (${backupId.slice(0, 7)}) ` + "and appears in your version history." : "The restore could not be completed. Your book files were not changed.", { cause });
514
514
  }
515
515
  return { restoredId: id, backupId };
516
516
  });
@@ -597,7 +597,7 @@ async function switchBranch(options) {
597
597
  const { projectDir, branch, authorName, authorEmail } = options;
598
598
  const source = await detectProjectSource(projectDir);
599
599
  if (source.type !== "local-git-folder") {
600
- throw new Error("This project has no version history yet. Enable version history first.");
600
+ throw new Error("This book has no version history yet. Enable version history first.");
601
601
  }
602
602
  const repoDir = gitScopeFor(source);
603
603
  return withRepoLock(repoDir, async () => {
@@ -13,12 +13,12 @@ import {
13
13
  stampCreator,
14
14
  stripAnnotations,
15
15
  warn
16
- } from "./cli-jp97snns.js";
16
+ } from "./cli-rra50cp6.js";
17
17
  import {
18
18
  DEBOUNCE,
19
19
  UsageError,
20
20
  resolvePort
21
- } from "./cli-cghcd60p.js";
21
+ } from "./cli-5c2xfsmz.js";
22
22
  import {
23
23
  MARGIN_BOX_IGNORED_PROPERTIES,
24
24
  RENDER_TIMEOUT_MS,
@@ -28,7 +28,7 @@ import {
28
28
  getAssetsDir,
29
29
  getBrowser,
30
30
  prewarmBrowser
31
- } from "./cli-sekhwex4.js";
31
+ } from "./cli-5vdgncmm.js";
32
32
  import {
33
33
  INSTALL_HINTS,
34
34
  execCapture,
@@ -43,7 +43,7 @@ import {
43
43
  import {
44
44
  hasUncommittedChanges,
45
45
  listWorkdirChanges
46
- } from "./cli-c9h2bk2k.js";
46
+ } from "./cli-c5360prx.js";
47
47
  import {
48
48
  detectProjectSource,
49
49
  repoSubPath
@@ -432,7 +432,7 @@ async function resolveVendoredPluginInstallRoot(projectDir, expectedName, expect
432
432
  realpath(requestedInstallRoot)
433
433
  ]);
434
434
  if (!isContained(realProjectRoot, installRoot)) {
435
- throw new Error("Vendor install root resolves outside the project.");
435
+ throw new Error("Vendor install root resolves outside the book folder.");
436
436
  }
437
437
  return installRoot;
438
438
  }
@@ -3120,12 +3120,12 @@ function escapesProjectRoot(projectDir, absPath) {
3120
3120
  function proseImageRefError(ref, projectDir) {
3121
3121
  const cleaned = stripUrlSuffix(decodeRef(ref));
3122
3122
  if (/^file:/i.test(cleaned) || path3.isAbsolute(cleaned)) {
3123
- return `Image reference must be relative to the project: ${ref}
3124
- ` + ` Copy the file into your project folder and reference it from there.`;
3123
+ return `Image reference must be relative to the book folder: ${ref}
3124
+ ` + ` Copy the file into your book folder and reference it from there.`;
3125
3125
  }
3126
3126
  if (escapesProjectRoot(projectDir, path3.resolve(projectDir, cleaned))) {
3127
- return `Image reference points outside the project: ${ref}
3128
- ` + ` Copy the file into your project folder and reference it from there.`;
3127
+ return `Image reference points outside the book folder: ${ref}
3128
+ ` + ` Copy the file into your book folder and reference it from there.`;
3129
3129
  }
3130
3130
  return null;
3131
3131
  }
@@ -3197,7 +3197,7 @@ async function inlineOne(cssPath, copies, warnings, seen) {
3197
3197
  if (seen.has(abs))
3198
3198
  return "";
3199
3199
  seen.add(abs);
3200
- const source = await readOrThrow(abs, "stylesheet", "the project manifest");
3200
+ const source = await readOrThrow(abs, "stylesheet", "the book manifest");
3201
3201
  const cssDir = path3.dirname(abs);
3202
3202
  let root;
3203
3203
  try {
@@ -5836,7 +5836,7 @@ async function loadNpmPackage(packageName, baseDir, version) {
5836
5836
  } catch {}
5837
5837
  const looksLikeJsFilename = /\.(m?js|cjs)$/i.test(packageName);
5838
5838
  const suggestedPath = looksLikeJsFilename ? `./${packageName}` : `./plugins/${packageName}.js`;
5839
- throw new Error(`Extension "${packageName}" not found. Install it with \`gutterpress ext add ${packageName}\` (or Project settings > Extensions),
5839
+ throw new Error(`Extension "${packageName}" not found. Install it with \`gutterpress ext add ${packageName}\` (or Book settings > Features > Advanced in the desktop app),
5840
5840
  or reference a local file under \`extensions:\`:
5841
5841
  extensions:
5842
5842
  - ${suggestedPath}`);
@@ -6768,7 +6768,7 @@ var check25 = {
6768
6768
  results.push(finding(check25.id, {
6769
6769
  severity: "warning",
6770
6770
  code: "kept-both-versions",
6771
- message: `Two versions of ${withoutOnlineTag(rel)} are in your project — keep the one you want, then delete the other.`,
6771
+ message: `Two versions of ${withoutOnlineTag(rel)} are in your book — keep the one you want, then delete the other.`,
6772
6772
  file: sibling
6773
6773
  }));
6774
6774
  }
@@ -7770,7 +7770,7 @@ async function uncommittedAmong(inputDir, files) {
7770
7770
  async function applyMarkdownlintFixes(ctx) {
7771
7771
  const sourceConfig = ctx.config.validate.source;
7772
7772
  if (sourceConfig.markdownlint === false) {
7773
- log.warn("--fix: source.markdownlint is disabled for this project — no files were fixed.");
7773
+ log.warn("--fix: source.markdownlint is disabled for this book — no files were fixed.");
7774
7774
  return [];
7775
7775
  }
7776
7776
  const files = ctx.markdownFiles;
@@ -8541,7 +8541,7 @@ async function resolveBuildContext(opts) {
8541
8541
  const inputDir = path9.resolve(opts.inputDir);
8542
8542
  const { manifest, manifestDir, manifestPath } = await loadManifestWithPath(opts.manifestPath ?? inputDir, { explicit: opts.manifestPath !== undefined });
8543
8543
  if (manifestPath === null) {
8544
- throw new UsageError(`No project manifest found in ${inputDir}. Looked for ${MANIFEST_FILENAMES.join(" or ")}. ` + "Run from your project folder or pass that folder with `gutterpress build <project-dir>`. " + "For a custom manifest filename, pass `--manifest <path>`.");
8544
+ throw new UsageError(`No book manifest found in ${inputDir}. Looked for ${MANIFEST_FILENAMES.join(" or ")}. ` + "Run from your book folder or pass that folder with `gutterpress build <book-dir>`. " + "For a custom manifest filename, pass `--manifest <path>`.");
8545
8545
  }
8546
8546
  const pdfxConfigOverride = format === "pdfx" ? {
8547
8547
  flavor: opts.pdfxFlavor,
@@ -8768,7 +8768,7 @@ class PdfOutput {
8768
8768
  const rawPdf = pdfxMode ? path9.join(stage, "raw.pdf") : path9.resolve(pdfFile);
8769
8769
  await fsp2.mkdir(path9.dirname(path9.resolve(pdfFile)), { recursive: true });
8770
8770
  log.info("Rendering HTML to PDF via the Gutterpress engine (native Chromium pagination)");
8771
- const { buildNativePdf } = await import("./engine-cbc17ne4.js");
8771
+ const { buildNativePdf } = await import("./engine-amxqsfka.js");
8772
8772
  const engineDiagnostics = await buildNativePdf(htmlFile, rawPdf, {
8773
8773
  title: config.title,
8774
8774
  author: config.authors.length > 0 ? config.authors.join(", ") : undefined,
@@ -10324,7 +10324,7 @@ function resolveScaffoldTargets(requested, preset) {
10324
10324
  async function scaffoldProject(options) {
10325
10325
  const name = (options.name ?? "").trim();
10326
10326
  if (!name) {
10327
- throw new CreateProjectErrorImpl("invalid-name", "A project name is required.");
10327
+ throw new CreateProjectErrorImpl("invalid-name", "A book name is required.");
10328
10328
  }
10329
10329
  const slug = slugifyProjectName(name);
10330
10330
  const folderName = (options.folderName ?? slug).trim();
@@ -10374,7 +10374,7 @@ async function scaffoldProject(options) {
10374
10374
  await writeFile6(path15.join(projectDir, "styles", "book.css"), starterOverridesCss(), "utf8");
10375
10375
  }
10376
10376
  } catch (e) {
10377
- throw new CreateProjectErrorImpl("scaffold-io", `Could not create the project files: ${e instanceof Error ? e.message : String(e)}`);
10377
+ throw new CreateProjectErrorImpl("scaffold-io", `Could not create the book files: ${e instanceof Error ? e.message : String(e)}`);
10378
10378
  }
10379
10379
  try {
10380
10380
  await ensureGitignoreHasDist(projectDir);
@@ -10411,14 +10411,14 @@ async function scaffoldProject(options) {
10411
10411
  openFile = path15.join(projectDir, firstSource);
10412
10412
  await fillTemplateFile(openFile, { "{{TITLE}}": name }).catch(() => {});
10413
10413
  } catch (e) {
10414
- throw new CreateProjectErrorImpl("scaffold-io", `Could not finalise the project files: ${e instanceof Error ? e.message : String(e)}`);
10414
+ throw new CreateProjectErrorImpl("scaffold-io", `Could not finalize the book files: ${e instanceof Error ? e.message : String(e)}`);
10415
10415
  }
10416
10416
  const requested = options.versionHistory ?? "local-git";
10417
10417
  let versionHistory = "none";
10418
10418
  let versionHistoryError;
10419
10419
  if (requested === "local-git") {
10420
10420
  try {
10421
- const { providerFor } = await import("./source-provider-54a52bpd.js");
10421
+ const { providerFor } = await import("./source-provider-exy1wakv.js");
10422
10422
  const provider = providerFor({ type: "local-folder", path: projectDir });
10423
10423
  await provider.initVersionHistory({
10424
10424
  projectDir,
@@ -11244,7 +11244,7 @@ async function prepareVendorParent(projectDir, name) {
11244
11244
  realpath2(packageParent)
11245
11245
  ]);
11246
11246
  if (!isContained2(projectDir, realNpm) || !isContained2(projectDir, realPackageParent)) {
11247
- throw new Error("Plugin install path resolves outside the project.");
11247
+ throw new Error("Plugin install path resolves outside the book folder.");
11248
11248
  }
11249
11249
  return realNpm;
11250
11250
  }
@@ -11326,7 +11326,7 @@ async function installNpmPlugin(projectDirInput, packageSpec, options = {}) {
11326
11326
  finalRoot = vendoredNpmPluginRoot(projectDir, rootRecord.name, rootRecord.version);
11327
11327
  const realFinalParent = await realpath2(path17.dirname(finalRoot));
11328
11328
  if (!isContained2(projectDir, realFinalParent)) {
11329
- throw new Error("Plugin install destination resolves outside the project.");
11329
+ throw new Error("Plugin install destination resolves outside the book folder.");
11330
11330
  }
11331
11331
  try {
11332
11332
  await lstat2(finalRoot);
@@ -11376,27 +11376,27 @@ var RECOMMENDED_EXTENSIONS = [
11376
11376
  {
11377
11377
  use: "markdown-it-mark",
11378
11378
  label: "Highlight",
11379
- description: "Highlighted text with `==marked==` -> `<mark>`."
11379
+ description: "Highlight text by wrapping it in `==double equals==`."
11380
11380
  },
11381
11381
  {
11382
11382
  use: "markdown-it-sub",
11383
11383
  label: "Subscript",
11384
- description: "Subscript text with `H~2~O`."
11384
+ description: "Lower text below the line, like the 2 in `H~2~O`."
11385
11385
  },
11386
11386
  {
11387
11387
  use: "markdown-it-sup",
11388
11388
  label: "Superscript",
11389
- description: "Superscript text with `29^th^`."
11389
+ description: "Raise text above the line, like the th in `29^th^`."
11390
11390
  },
11391
11391
  {
11392
11392
  use: "markdown-it-abbr",
11393
11393
  label: "Abbreviations",
11394
- description: "Define `*[HTML]: Hyper Text...` and get `<abbr>` tooltips."
11394
+ description: "Explain an abbreviation when readers hover over it. Define it once, like `*[GPS]: Global Positioning System`."
11395
11395
  },
11396
11396
  {
11397
11397
  use: "gutterpress-gfm-alerts",
11398
11398
  label: "Callouts",
11399
- description: "GitHub-style `> [!NOTE]` alert boxes (Note/Tip/Important/Warning/Caution)."
11399
+ description: "Turn a quote into a boxed note: start it with `> [!NOTE]` (or `TIP`, `IMPORTANT`, `WARNING`, `CAUTION`)."
11400
11400
  }
11401
11401
  ];
11402
11402
  var BUILT_IN_STYLE_SET_IDS = ["clean-book", "zine", "technical-doc"];
@@ -11466,7 +11466,7 @@ function indexOfUse(seq, use) {
11466
11466
  function manifestPathFor(projectDir, abs) {
11467
11467
  const rel = path18.relative(path18.resolve(projectDir), abs).split(path18.sep).join("/");
11468
11468
  if (rel === "") {
11469
- throw new Error("An extension cannot be the project folder itself.");
11469
+ throw new Error("An extension cannot be the book folder itself.");
11470
11470
  }
11471
11471
  if (isPathSpecifier(rel))
11472
11472
  return rel;
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  package_default
3
- } from "./cli-cghcd60p.js";
3
+ } from "./cli-5c2xfsmz.js";
4
4
  import {
5
5
  execCapture,
6
6
  findTool,
package/dist/cli.js CHANGED
@@ -6,7 +6,7 @@ import {
6
6
  UsageError,
7
7
  package_default,
8
8
  rejectUnknownFlags
9
- } from "./cli-cghcd60p.js";
9
+ } from "./cli-5c2xfsmz.js";
10
10
  import {
11
11
  EXIT_CODES
12
12
  } from "./cli-46ycxe6r.js";
@@ -18,16 +18,16 @@ import {
18
18
  import { defineCommand, parseArgs, runMain } from "citty";
19
19
  import { statSync } from "node:fs";
20
20
  var SUBCOMMANDS = {
21
- new: () => import("./new-s256mmkt.js").then((m) => m.default),
22
- preview: () => import("./preview-j2rvdhg1.js").then((m) => m.default),
23
- build: () => import("./build-sqdahz2j.js").then((m) => m.default),
24
- publish: () => import("./publish-6px5snad.js").then((m) => m.default),
25
- lint: () => import("./lint-t0tj3psc.js").then((m) => m.default),
26
- validate: () => import("./validate-f0m0d2zs.js").then((m) => m.default),
27
- audit: () => import("./audit-bhxh0bbf.js").then((m) => m.default),
28
- preflight: () => import("./preflight-5y10233n.js").then((m) => m.default),
29
- doctor: () => import("./doctor-gj8gtgec.js").then((m) => m.default),
30
- ext: () => import("./ext-xhtta4bh.js").then((m) => m.default)
21
+ new: () => import("./new-r3s74yfv.js").then((m) => m.default),
22
+ preview: () => import("./preview-aprv0c49.js").then((m) => m.default),
23
+ build: () => import("./build-8gx90w22.js").then((m) => m.default),
24
+ publish: () => import("./publish-4y1kztbd.js").then((m) => m.default),
25
+ lint: () => import("./lint-vyxf5zmw.js").then((m) => m.default),
26
+ validate: () => import("./validate-sf6hga9e.js").then((m) => m.default),
27
+ audit: () => import("./audit-t4r954ff.js").then((m) => m.default),
28
+ preflight: () => import("./preflight-j9e9m4ea.js").then((m) => m.default),
29
+ doctor: () => import("./doctor-b1awtn7m.js").then((m) => m.default),
30
+ ext: () => import("./ext-mxxz3p8t.js").then((m) => m.default)
31
31
  };
32
32
  var VERSION = package_default.version;
33
33
  var main = defineCommand({
@@ -52,7 +52,7 @@ async function preflightRequiredInvocations(rawArgs) {
52
52
  const [command, ...commandArgs] = rawArgs;
53
53
  try {
54
54
  if (command === "new") {
55
- const { newArgs } = await import("./new-s256mmkt.js");
55
+ const { newArgs } = await import("./new-r3s74yfv.js");
56
56
  rejectUnknownFlags(commandArgs, newArgs, "new");
57
57
  const parsed = parseArgs(commandArgs, {
58
58
  ...newArgs,
@@ -64,7 +64,7 @@ async function preflightRequiredInvocations(rawArgs) {
64
64
  return;
65
65
  }
66
66
  if (command === "preflight") {
67
- const { preflightArgs } = await import("./preflight-5y10233n.js");
67
+ const { preflightArgs } = await import("./preflight-j9e9m4ea.js");
68
68
  rejectUnknownFlags(commandArgs, preflightArgs, "preflight");
69
69
  const parsed = parseArgs(commandArgs, {
70
70
  ...preflightArgs,
@@ -84,7 +84,7 @@ async function preflightRequiredInvocations(rawArgs) {
84
84
  }
85
85
  if (subcommand.startsWith("-"))
86
86
  return;
87
- const { EXT_SUBCOMMANDS, extAddArgs, extRemoveArgs, extEnableArgs, extDisableArgs } = await import("./ext-xhtta4bh.js");
87
+ const { EXT_SUBCOMMANDS, extAddArgs, extRemoveArgs, extEnableArgs, extDisableArgs } = await import("./ext-mxxz3p8t.js");
88
88
  if (!EXT_SUBCOMMANDS.includes(subcommand)) {
89
89
  throw new UsageError(`gutterpress ext: unknown command "${subcommand}"`);
90
90
  }
@@ -1,12 +1,12 @@
1
1
  import {
2
2
  getSystemDiagnostics,
3
3
  log
4
- } from "./cli-jp97snns.js";
4
+ } from "./cli-rra50cp6.js";
5
5
  import {
6
6
  UsageError,
7
7
  rejectExtraPositionals,
8
8
  rejectUnknownFlags
9
- } from "./cli-cghcd60p.js";
9
+ } from "./cli-5c2xfsmz.js";
10
10
  import"./cli-c41yr7he.js";
11
11
  import"./cli-46ycxe6r.js";
12
12
  import"./cli-37x76zdn.js";
@@ -1,13 +1,13 @@
1
1
  import {
2
2
  build
3
- } from "./index-12pvhbyz.js";
3
+ } from "./index-yeej2vhs.js";
4
4
  import {
5
5
  BuildError,
6
6
  RENDER_TIMEOUT_MS,
7
7
  assertMilestone,
8
8
  connectChromium,
9
9
  getBrowser
10
- } from "./index-6n15e1ze.js";
10
+ } from "./index-gf1shk3y.js";
11
11
  import"./index-37x76zdn.js";
12
12
 
13
13
  // src/lib/engine.ts
@@ -4,7 +4,7 @@ import {
4
4
  build,
5
5
  connectChromium,
6
6
  getBrowser
7
- } from "./cli-sekhwex4.js";
7
+ } from "./cli-5vdgncmm.js";
8
8
  import"./cli-c41yr7he.js";
9
9
  import {
10
10
  BuildError
@@ -10,21 +10,21 @@ import {
10
10
  removeExtension,
11
11
  searchNpmExtensions,
12
12
  setExtensionEnabled
13
- } from "./cli-q696mp75.js";
14
- import"./cli-jp97snns.js";
13
+ } from "./cli-g6vshy3f.js";
14
+ import"./cli-rra50cp6.js";
15
15
  import {
16
16
  UsageError,
17
17
  exitForUsage,
18
18
  rejectExtraPositionals,
19
19
  rejectUnknownFlags,
20
20
  resolveProjectDir
21
- } from "./cli-cghcd60p.js";
22
- import"./cli-sekhwex4.js";
21
+ } from "./cli-5c2xfsmz.js";
22
+ import"./cli-5vdgncmm.js";
23
23
  import"./cli-c41yr7he.js";
24
24
  import {
25
25
  EXIT_CODES
26
26
  } from "./cli-46ycxe6r.js";
27
- import"./cli-c9h2bk2k.js";
27
+ import"./cli-c5360prx.js";
28
28
  import"./cli-v5mp7a6q.js";
29
29
  import"./cli-37x76zdn.js";
30
30
 
@@ -92,12 +92,12 @@ async function requireProjectDir(dir, verb) {
92
92
  info = await stat(projectDir);
93
93
  } catch (error) {
94
94
  if (error.code === "ENOENT") {
95
- throw new UsageError(`Project directory does not exist: ${projectDir}`);
95
+ throw new UsageError(`Book folder does not exist: ${projectDir}`);
96
96
  }
97
97
  throw error;
98
98
  }
99
99
  if (!info.isDirectory()) {
100
- throw new UsageError(`Project path is not a directory: ${projectDir}`);
100
+ throw new UsageError(`Book path is not a folder: ${projectDir}`);
101
101
  }
102
102
  return projectDir;
103
103
  }
@@ -65,7 +65,26 @@
65
65
  overflow: auto;
66
66
  /* Standalone pages use \`--gutterpress-fit-zoom\`; embedded previews use the
67
67
  host-owned \`--gutterpress-zoom\`. fitZoom() guarantees only one is active. */
68
- zoom: calc(var(--gutterpress-zoom, 1) * var(--gutterpress-fit-zoom, 1));
68
+ --gp-zoom: calc(var(--gutterpress-zoom, 1) * var(--gutterpress-fit-zoom, 1));
69
+ /* Zoom is a pure paint transform, NEVER CSS \`zoom\`. \`zoom\` changes layout
70
+ inputs (font sizes and lengths are scaled before text shaping and
71
+ LayoutUnit snapping), so Chromium's column fragmentation broke lines at
72
+ different points per zoom level: in the user guide a paragraph sat on
73
+ page 6 at 50% and page 7 at 25%, and the same book paginated differently
74
+ at 25/50/75/100/150% (#318). \`transform\` leaves layout untouched, so the
75
+ pages are the ones print produces at every zoom.
76
+ Layout width is the visible width / zoom, which is what \`zoom\` gave.
77
+ A transform does not shrink the parent's layout box, so a scaled-down
78
+ stage would leave dead scroll space below it. Taking the stage out of
79
+ flow makes the viewport's scrollable overflow exactly its transformed
80
+ extent, as \`zoom\` had it. */
81
+ position: absolute;
82
+ top: 0;
83
+ left: 0;
84
+ box-sizing: border-box;
85
+ width: calc(100% / var(--gp-zoom));
86
+ transform: scale(var(--gp-zoom));
87
+ transform-origin: 0 0;
69
88
  }
70
89
 
71
90
  /* One flow strip per named-page run. Chromium fragments its content into
@@ -281,7 +300,9 @@
281
300
  background: none;
282
301
  padding: 0;
283
302
  overflow: visible;
284
- zoom: 1;
303
+ position: static;
304
+ width: auto;
305
+ transform: none;
285
306
  }
286
307
  .gp-layer,
287
308
  .gp-warning,
@@ -1565,7 +1586,8 @@
1565
1586
  return stripMetrics(strip).stride;
1566
1587
  }
1567
1588
  function cssZoomOf(el) {
1568
- return el.currentCSSZoom ?? 1;
1589
+ const stage = el.closest(".gp-stage") ?? document.body;
1590
+ return new DOMMatrixReadOnly(getComputedStyle(stage).transform).a || 1;
1569
1591
  }
1570
1592
  function stripMetrics(strip) {
1571
1593
  const cs = getComputedStyle(strip);