gutterpress 0.11.23-alpha.3 → 0.11.23-alpha.5
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/README.md +4 -6
- package/dist/{README-8db7btxb.md → README-syg2hn83.md} +1 -1
- package/dist/api/index.d.ts +1 -1
- package/dist/api/index.js +7 -5
- package/dist/{build-m78jcpf7.js → build-4qv9wvrx.js} +8 -8
- package/dist/checks/asset/extensions.d.ts +1 -1
- package/dist/checks/asset/index.d.ts +0 -1
- package/dist/checks/policy.d.ts +5 -4
- package/dist/checks/source/config-file.d.ts +9 -6
- package/dist/checks/source/dangling-links.d.ts +1 -1
- package/dist/checks/types.d.ts +2 -2
- package/dist/{cli-s6djx4ma.js → cli-2t3krcfy.js} +1 -1
- package/dist/{cli-xsrffqzt.js → cli-58fsk6d7.js} +9 -9
- package/dist/{cli-2ppw6q9v.js → cli-5crpmz42.js} +80 -1
- package/dist/{cli-t8be9yeb.js → cli-de8ydmm7.js} +12 -7
- package/dist/{cli-n2tsxqpn.js → cli-nk0efg2x.js} +7 -2
- package/dist/{cli-1h17ktsg.js → cli-pth362d8.js} +139 -222
- package/dist/{cli-h4x81x97.js → cli-w97xcpag.js} +207 -142
- package/dist/{cli-5jzyw06s.js → cli-yxfznmsq.js} +1 -1
- package/dist/cli.js +12 -12
- package/dist/{doctor-j71jqce3.js → doctor-5nh3t346.js} +4 -3
- package/dist/{engine-m4y10shc.js → engine-4rabsgwq.js} +1 -1
- package/dist/{engine-1r6q80tq.js → engine-wm4fggac.js} +2 -2
- package/dist/{ext-fq2hg9va.js → ext-nhcep6h6.js} +8 -8
- package/dist/{extension-restore-9dh7c4tp.js → extension-restore-55kp0ksq.js} +2 -2
- package/dist/{extension-restore-tmxtzkm0.js → extension-restore-x3mtn844.js} +4 -4
- package/dist/{index-nedd07bk.js → index-2vxzxyyj.js} +9 -9
- package/dist/{index-2ppw6q9v.js → index-5crpmz42.js} +80 -1
- package/dist/{index-0wee4408.js → index-9ye22m7r.js} +12 -7
- package/dist/{index-prqvz3xm.js → index-agrkfbkv.js} +217 -244
- package/dist/{index-7pck1q9c.js → index-t3jkavdz.js} +206 -141
- package/dist/{index-nvmf22rt.js → index-wm4x7xbf.js} +1 -1
- package/dist/index.js +8 -6
- package/dist/lib/build-preflight.d.ts +4 -10
- package/dist/lib/build-runner.d.ts +1 -1
- package/dist/lib/ghostscript.d.ts +5 -2
- package/dist/lib/lint-rules.d.ts +5 -1
- package/dist/lib/manifest-config.d.ts +3 -2
- package/dist/lib/manifest-old-spellings.d.ts +64 -0
- package/dist/lib/markdown/chapter-id.d.ts +1 -1
- package/dist/lib/markdown/index.d.ts +1 -1
- package/dist/lib/markdown/table.d.ts +5 -3
- package/dist/lib/page-size.d.ts +14 -9
- package/dist/lib/pdf-inspect.d.ts +27 -0
- package/dist/lib/presets.d.ts +10 -8
- package/dist/lib/printsafe.d.ts +1 -1
- package/dist/lib/project-scaffold.d.ts +1 -1
- package/dist/lib/publish/connect.d.ts +8 -1
- package/dist/lib/publish/manifest-publish.d.ts +26 -2
- package/dist/lib/publish/selections.d.ts +12 -1
- package/dist/lib/publish/types.d.ts +15 -5
- package/dist/lib/remote-auth/sync-messages.d.ts +2 -2
- package/dist/lib/targets.d.ts +4 -4
- package/dist/lib/validation-exec.d.ts +4 -4
- package/dist/{manifest-my7mdv8j.yaml → manifest-2kc56wvw.yaml} +3 -4
- package/dist/{manifest-8afhrk30.yaml → manifest-41ddzm13.yaml} +3 -4
- package/dist/{manifest-gf13sjp8.yaml → manifest-79zsgkpn.yaml} +3 -4
- package/dist/{manifest-d4f9q79e.yaml → manifest-sqzm4681.yaml} +3 -4
- package/dist/{manifest.schema-650pe0d1.json → manifest.schema-93sd7zje.json} +32 -315
- package/dist/{new-s4zcaepg.js → new-5a4w2vkh.js} +9 -15
- package/dist/{page-rules-fj09xct5.css → page-rules-ytj9p04v.css} +1 -1
- package/dist/{pdf-inspect-wnw4za71.js → pdf-inspect-b3mf81ex.js} +3 -1
- package/dist/{plugins-4vaf27n9.js → plugins-cfzf26b8.js} +3 -3
- package/dist/{plugins-80emnf31.js → plugins-mm8270tn.js} +1 -1
- package/dist/{preflight-c7w1xdn3.js → preflight-jma71n0j.js} +8 -8
- package/dist/preview/file-watcher.d.ts +1 -3
- package/dist/{preview-interface-nnmrxyqm.js → preview-interface-0xdh0r5b.js} +3 -66
- package/dist/{preview-mzytcwyk.js → preview-kmx4h7gv.js} +8 -8
- package/dist/{publish-fez14ad4.js → publish-62843020.js} +8 -8
- package/dist/render.js +6 -1
- package/dist/schema/manifest.types.d.ts +58 -110
- package/dist/{tokens-ye64p899.css → tokens-n82t4k9h.css} +11 -4
- package/dist/{validate-p2chr6hr.js → validate-vvmrd85g.js} +8 -8
- package/package.json +1 -1
- package/dist/checks/asset/approved-fonts.d.ts +0 -3
|
@@ -697,10 +697,10 @@ import { fileURLToPath } from "node:url";
|
|
|
697
697
|
var favicon_default = "./favicon-272ga6y0.ico";
|
|
698
698
|
|
|
699
699
|
// src/assets/manifest.schema.json
|
|
700
|
-
var manifest_schema_default = "./manifest.schema-
|
|
700
|
+
var manifest_schema_default = "./manifest.schema-93sd7zje.json";
|
|
701
701
|
|
|
702
702
|
// src/assets/preview/scripts/preview-interface.js
|
|
703
|
-
var preview_interface_default = "./preview-interface-
|
|
703
|
+
var preview_interface_default = "./preview-interface-0xdh0r5b.js";
|
|
704
704
|
|
|
705
705
|
// src/assets/preview/scripts/preview-bridge.js
|
|
706
706
|
var preview_bridge_default = "./preview-bridge-8wjcjec3.js";
|
|
@@ -718,25 +718,25 @@ var gutterpress_viewer_default = "./gutterpress-viewer-mafsby5k.js";
|
|
|
718
718
|
var gutterpress_agent_default = "./gutterpress-agent-d29ry3ak.js";
|
|
719
719
|
|
|
720
720
|
// src/assets/templates/book/manifest.yaml
|
|
721
|
-
var manifest_default = "./manifest-
|
|
721
|
+
var manifest_default = "./manifest-41ddzm13.yaml";
|
|
722
722
|
|
|
723
723
|
// src/assets/templates/book/chapter-01.md
|
|
724
724
|
var chapter_01_default = "./chapter-01-gsbjt584.md";
|
|
725
725
|
|
|
726
726
|
// src/assets/templates/zine/manifest.yaml
|
|
727
|
-
var manifest_default2 = "./manifest-
|
|
727
|
+
var manifest_default2 = "./manifest-sqzm4681.yaml";
|
|
728
728
|
|
|
729
729
|
// src/assets/templates/zine/chapter-01.md
|
|
730
730
|
var chapter_01_default2 = "./chapter-01-wgjfz4w6.md";
|
|
731
731
|
|
|
732
732
|
// src/assets/templates/technical/manifest.yaml
|
|
733
|
-
var manifest_default3 = "./manifest-
|
|
733
|
+
var manifest_default3 = "./manifest-2kc56wvw.yaml";
|
|
734
734
|
|
|
735
735
|
// src/assets/templates/technical/chapter-01.md
|
|
736
736
|
var chapter_01_default3 = "./chapter-01-6fn9pvd0.md";
|
|
737
737
|
|
|
738
738
|
// src/assets/templates/paper/manifest.yaml
|
|
739
|
-
var manifest_default4 = "./manifest-
|
|
739
|
+
var manifest_default4 = "./manifest-79zsgkpn.yaml";
|
|
740
740
|
|
|
741
741
|
// src/assets/templates/paper/chapter-01.md
|
|
742
742
|
var chapter_01_default4 = "./chapter-01-s71xrf5q.md";
|
|
@@ -769,7 +769,7 @@ var plugin_test_js_default = "./plugin.test.js-gxzqqfdh.tpl";
|
|
|
769
769
|
var package_default2 = "./package-awwkt7sa.json";
|
|
770
770
|
|
|
771
771
|
// src/assets/extension-templates/look/README.md
|
|
772
|
-
var README_default2 = "./README-
|
|
772
|
+
var README_default2 = "./README-syg2hn83.md";
|
|
773
773
|
|
|
774
774
|
// src/assets/extension-templates/look/components.yaml
|
|
775
775
|
var components_default = "./components-zzqdpt3m.yaml";
|
|
@@ -778,7 +778,7 @@ var components_default = "./components-zzqdpt3m.yaml";
|
|
|
778
778
|
var callout_default = "./callout-hv56m16h.md";
|
|
779
779
|
|
|
780
780
|
// src/assets/extension-templates/look/styles/tokens.css
|
|
781
|
-
var tokens_default = "./tokens-
|
|
781
|
+
var tokens_default = "./tokens-n82t4k9h.css";
|
|
782
782
|
|
|
783
783
|
// src/assets/extension-templates/look/styles/base.css
|
|
784
784
|
var base_default = "./base-ypqh9n7f.css";
|
|
@@ -790,7 +790,7 @@ var components_default2 = "./components-aam0fe2z.css";
|
|
|
790
790
|
var page_templates_default = "./page-templates-tx9ryt19.css";
|
|
791
791
|
|
|
792
792
|
// src/assets/extension-templates/look/styles/page-rules.css
|
|
793
|
-
var page_rules_default = "./page-rules-
|
|
793
|
+
var page_rules_default = "./page-rules-ytj9p04v.css";
|
|
794
794
|
|
|
795
795
|
// src/assets/extension-templates/look/styles/book.css
|
|
796
796
|
var book_default = "./book-ted3tzrp.css";
|
|
@@ -348,6 +348,85 @@ async function unsplittableTextReasons(pdfBytes, pages) {
|
|
|
348
348
|
}
|
|
349
349
|
return reasons;
|
|
350
350
|
}
|
|
351
|
+
var FILL_PAINT_OPS = opSet(["fill", "eoFill", "fillStroke", "eoFillStroke", "closeFillStroke", "closeEOFillStroke"]);
|
|
352
|
+
var STROKE_PAINT_OPS = opSet(["stroke", "closeStroke", "fillStroke", "eoFillStroke", "closeFillStroke", "closeEOFillStroke"]);
|
|
353
|
+
var SLIVER_PT = 0.25;
|
|
354
|
+
async function pagesWithVisibleShadingPaints(pdfBytes, pages) {
|
|
355
|
+
const box = (b, m) => {
|
|
356
|
+
const xs = [];
|
|
357
|
+
const ys = [];
|
|
358
|
+
const corners = [[b[0], b[1]], [b[2], b[1]], [b[2], b[3]], [b[0], b[3]]];
|
|
359
|
+
for (const [x, y] of corners) {
|
|
360
|
+
xs.push(m[0] * x + m[2] * y + m[4]);
|
|
361
|
+
ys.push(m[1] * x + m[3] * y + m[5]);
|
|
362
|
+
}
|
|
363
|
+
return [Math.min(...xs), Math.min(...ys), Math.max(...xs), Math.max(...ys)];
|
|
364
|
+
};
|
|
365
|
+
const intersect = (a, b) => a ? [Math.max(a[0], b[0]), Math.max(a[1], b[1]), Math.min(a[2], b[2]), Math.min(a[3], b[3])] : b;
|
|
366
|
+
const visible = (b) => !b || b[2] - b[0] >= SLIVER_PT && b[3] - b[1] >= SLIVER_PT;
|
|
367
|
+
const doc = await getDocumentProxy(new Uint8Array(pdfBytes));
|
|
368
|
+
const out = [];
|
|
369
|
+
try {
|
|
370
|
+
for (const i of pages) {
|
|
371
|
+
const ops = await (await doc.getPage(i)).getOperatorList();
|
|
372
|
+
let ctm = [1, 0, 0, 1, 0, 0];
|
|
373
|
+
let clip = null;
|
|
374
|
+
let fillShading = false;
|
|
375
|
+
let strokeShading = false;
|
|
376
|
+
let pendingClip = false;
|
|
377
|
+
const stack = [];
|
|
378
|
+
let found = false;
|
|
379
|
+
for (let j = 0;j < ops.fnArray.length && !found; j++) {
|
|
380
|
+
const fn = ops.fnArray[j];
|
|
381
|
+
const args = ops.argsArray[j];
|
|
382
|
+
if (fn === OPS.save)
|
|
383
|
+
stack.push([ctm, clip, fillShading, strokeShading]);
|
|
384
|
+
else if (fn === OPS.restore || fn === OPS.paintFormXObjectEnd) {
|
|
385
|
+
const saved = stack.pop();
|
|
386
|
+
if (saved)
|
|
387
|
+
[ctm, clip, fillShading, strokeShading] = saved;
|
|
388
|
+
} else if (fn === OPS.transform)
|
|
389
|
+
ctm = multiply(ctm, args);
|
|
390
|
+
else if (fn === OPS.paintFormXObjectBegin) {
|
|
391
|
+
stack.push([ctm, clip, fillShading, strokeShading]);
|
|
392
|
+
if (Array.isArray(args[0]))
|
|
393
|
+
ctm = multiply(ctm, args[0]);
|
|
394
|
+
if (Array.isArray(args[1]))
|
|
395
|
+
clip = intersect(clip, box(args[1], ctm));
|
|
396
|
+
} else if (fn === OPS.setFillColorN)
|
|
397
|
+
fillShading = args[0] === "Shading";
|
|
398
|
+
else if (fn === OPS.setStrokeColorN)
|
|
399
|
+
strokeShading = args[0] === "Shading";
|
|
400
|
+
else if (FILL_COLOR_OPS.has(fn))
|
|
401
|
+
fillShading = false;
|
|
402
|
+
else if (STROKE_COLOR_OPS.has(fn))
|
|
403
|
+
strokeShading = false;
|
|
404
|
+
else if (fn === OPS.clip || fn === OPS.eoClip)
|
|
405
|
+
pendingClip = true;
|
|
406
|
+
else if (fn === OPS.constructPath) {
|
|
407
|
+
const paintOp = args[0];
|
|
408
|
+
const bounds = args[2] ? box(args[2], ctm) : null;
|
|
409
|
+
if (fillShading && FILL_PAINT_OPS.has(paintOp) && bounds)
|
|
410
|
+
found = visible(intersect(clip, bounds));
|
|
411
|
+
if (strokeShading && STROKE_PAINT_OPS.has(paintOp))
|
|
412
|
+
found = true;
|
|
413
|
+
if (pendingClip) {
|
|
414
|
+
clip = bounds ? intersect(clip, bounds) : [0, 0, 0, 0];
|
|
415
|
+
pendingClip = false;
|
|
416
|
+
}
|
|
417
|
+
} else if (fn === OPS.shadingFill)
|
|
418
|
+
found = visible(clip);
|
|
419
|
+
else if (SHOW_TEXT_OPS.has(fn) && fillShading)
|
|
420
|
+
found = true;
|
|
421
|
+
}
|
|
422
|
+
if (found)
|
|
423
|
+
out.push(i);
|
|
424
|
+
}
|
|
425
|
+
} finally {
|
|
426
|
+
await doc.destroy();
|
|
427
|
+
}
|
|
428
|
+
return out;
|
|
429
|
+
}
|
|
351
430
|
function getImagePixelSize(page, name, timeoutMs = 2000) {
|
|
352
431
|
return new Promise((resolve) => {
|
|
353
432
|
let done = false;
|
|
@@ -435,4 +514,4 @@ async function isLoadable(doc) {
|
|
|
435
514
|
}
|
|
436
515
|
}
|
|
437
516
|
|
|
438
|
-
export { DOC_CACHE_MAX, loadPdf, retainPdfCache, clearPdfCache, pendingGraceDestroyCount, getPageSize, getOutlineCount, getPageLabels, countLinkAnnotations, getTextPass, getOpPass, unsplittableTextReasons, pageHasMarks, getImageResolutions, isLoadable };
|
|
517
|
+
export { DOC_CACHE_MAX, loadPdf, retainPdfCache, clearPdfCache, pendingGraceDestroyCount, getPageSize, getOutlineCount, getPageLabels, countLinkAnnotations, getTextPass, getOpPass, unsplittableTextReasons, pagesWithVisibleShadingPaints, pageHasMarks, getImageResolutions, isLoadable };
|
|
@@ -20,7 +20,7 @@ import { pathToFileURL } from "node:url";
|
|
|
20
20
|
var theme_default = `/* =============================================================================
|
|
21
21
|
Clean Book — gutterpress built-in theme (theme.css)
|
|
22
22
|
A calm, classic long-form book look. Change the :root tokens from the book's own stylesheet.
|
|
23
|
-
The page SIZE comes from the manifest (Setup >
|
|
23
|
+
The page SIZE comes from the manifest (Setup > Book), so it is deliberately not set here.
|
|
24
24
|
============================================================================= */
|
|
25
25
|
|
|
26
26
|
:root {
|
|
@@ -79,7 +79,7 @@ hr { border: 0; border-top: 1px solid var(--color-rule); margin: 1.5em 0; }
|
|
|
79
79
|
var theme_default2 = `/* =============================================================================
|
|
80
80
|
Zine — gutterpress built-in theme (theme.css)
|
|
81
81
|
High-contrast, punchy, photocopier-friendly. Change the :root tokens from the book's own stylesheet.
|
|
82
|
-
The page SIZE comes from the manifest (Setup >
|
|
82
|
+
The page SIZE comes from the manifest (Setup > Book), so it is deliberately not set here.
|
|
83
83
|
============================================================================= */
|
|
84
84
|
|
|
85
85
|
:root {
|
|
@@ -140,7 +140,7 @@ code, pre { font-family: var(--font-mono); font-size: 0.95em; }
|
|
|
140
140
|
var theme_default3 = `/* =============================================================================
|
|
141
141
|
Technical Document — gutterpress built-in theme (theme.css)
|
|
142
142
|
Clean sans-serif manual look with clear hierarchy. Change the :root tokens from the book's own stylesheet.
|
|
143
|
-
The page SIZE comes from the manifest (Setup >
|
|
143
|
+
The page SIZE comes from the manifest (Setup > Book), so it is deliberately not set here.
|
|
144
144
|
============================================================================= */
|
|
145
145
|
|
|
146
146
|
:root {
|
|
@@ -398,7 +398,7 @@ import { satisfies, validRange } from "semver";
|
|
|
398
398
|
// package.json
|
|
399
399
|
var package_default = {
|
|
400
400
|
name: "gutterpress",
|
|
401
|
-
version: "0.11.23-alpha.
|
|
401
|
+
version: "0.11.23-alpha.5",
|
|
402
402
|
description: "Markdown-to-PDF converter for professional print layout using a native Chromium print engine and Ghostscript.",
|
|
403
403
|
author: "itlackey",
|
|
404
404
|
license: "MPL-2.0",
|
|
@@ -2507,7 +2507,12 @@ function splitCells(str2, spans) {
|
|
|
2507
2507
|
lastPos = pos;
|
|
2508
2508
|
}
|
|
2509
2509
|
} else if (!isEscaped && spans[ch]) {
|
|
2510
|
-
|
|
2510
|
+
const end = spans[ch](str2, pos, max);
|
|
2511
|
+
if (ch === 96) {
|
|
2512
|
+
current += str2.substring(lastPos, pos) + str2.substring(pos, end).replace(/\\\|/g, "|");
|
|
2513
|
+
lastPos = end;
|
|
2514
|
+
}
|
|
2515
|
+
pos = end;
|
|
2511
2516
|
continue;
|
|
2512
2517
|
}
|
|
2513
2518
|
isEscaped = ch === 92;
|
|
@@ -3742,9 +3747,9 @@ async function loadNpmPackage(packageName, baseDir, version) {
|
|
|
3742
3747
|
const looksLikeJsFilename = /\.(m?js|cjs)$/i.test(packageName);
|
|
3743
3748
|
const suggestedPath = looksLikeJsFilename ? `./${packageName}` : `./plugins/${packageName}.js`;
|
|
3744
3749
|
if (!looksLikeJsFilename && (!version || !isExactNpmVersion(version))) {
|
|
3745
|
-
throw new Error(`Extension "${packageName}${version ? `@${version}` : ""}" is not pinned to an exact version, so it can't be downloaded automatically. Run \`gutterpress ext add ${packageName}\` (or use Book setup >
|
|
3750
|
+
throw new Error(`Extension "${packageName}${version ? `@${version}` : ""}" is not pinned to an exact version, so it can't be downloaded automatically. Run \`gutterpress ext add ${packageName}\` (or use Book setup > Advanced in the desktop app) to download it and pin its version in your manifest.`);
|
|
3746
3751
|
}
|
|
3747
|
-
throw new Error(`Extension "${packageName}" not found. Install it with \`gutterpress ext add ${version ? `${packageName}@${version}` : packageName}\` (or Book setup >
|
|
3752
|
+
throw new Error(`Extension "${packageName}" not found. Install it with \`gutterpress ext add ${version ? `${packageName}@${version}` : packageName}\` (or Book setup > Advanced in the desktop app),
|
|
3748
3753
|
or reference a local file under \`extensions:\`:
|
|
3749
3754
|
extensions:
|
|
3750
3755
|
- ${suggestedPath}`);
|