gutterpress 0.11.10 → 0.11.11-alpha.1
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-83dnh2qe.js → build-ycaavzsb.js} +4 -4
- package/dist/{cli-mv1mhpkk.js → cli-g3xd0x9z.js} +4 -4
- package/dist/{cli-79tsqp3p.js → cli-kgd355eh.js} +1 -1
- package/dist/{cli-30j93gzt.js → cli-p40641zw.js} +1 -1
- package/dist/{cli-b36za51e.js → cli-wtw5nfsx.js} +3 -3
- package/dist/cli.js +12 -12
- package/dist/{doctor-sy4gc8r9.js → doctor-71dxjkpz.js} +2 -2
- package/dist/{engine-mwshptgf.js → engine-fv61tyn7.js} +1 -1
- package/dist/{engine-3gwctsty.js → engine-sq1kpg5s.js} +2 -2
- package/dist/{ext-a7ffvyc0.js → ext-rkfntmtv.js} +4 -4
- package/dist/{index-r4wvy5v3.js → index-b7q4wev1.js} +1 -1
- package/dist/{index-dzp0hc2c.js → index-dxt4t7et.js} +1 -1
- package/dist/{index-0cvkvpkg.js → index-wdqymw2k.js} +5 -5
- package/dist/index.js +3 -3
- package/dist/{new-994trd8k.js → new-c6pmpvhw.js} +4 -4
- package/dist/{preflight-2rtrakyf.js → preflight-9vq1ygh4.js} +4 -4
- package/dist/{preview-n9s46142.js → preview-6n5ava6c.js} +4 -4
- package/dist/{preview-interface-9rwz21yw.js → preview-interface-x22vcqyw.js} +66 -3
- package/dist/{publish-wte9548r.js → publish-9an2a1ma.js} +4 -4
- package/dist/{validate-jfsh3m1c.js → validate-0rrjva48.js} +4 -4
- package/package.json +3 -3
package/dist/api/index.js
CHANGED
|
@@ -127,10 +127,10 @@ import {
|
|
|
127
127
|
syncProject,
|
|
128
128
|
testRemoteAccess,
|
|
129
129
|
validateProjectExtensions
|
|
130
|
-
} from "../index-
|
|
130
|
+
} from "../index-wdqymw2k.js";
|
|
131
131
|
import {
|
|
132
132
|
BuildError
|
|
133
|
-
} from "../index-
|
|
133
|
+
} from "../index-b7q4wev1.js";
|
|
134
134
|
import {
|
|
135
135
|
DEFAULT_PRINT_OPTS,
|
|
136
136
|
assertMilestone,
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import {
|
|
2
2
|
runBuild,
|
|
3
3
|
splitOutPath
|
|
4
|
-
} from "./cli-
|
|
4
|
+
} from "./cli-g3xd0x9z.js";
|
|
5
5
|
import {
|
|
6
6
|
log
|
|
7
|
-
} from "./cli-
|
|
7
|
+
} from "./cli-kgd355eh.js";
|
|
8
8
|
import {
|
|
9
9
|
UsageError,
|
|
10
10
|
parseFormat,
|
|
11
11
|
parsePdfxFlavor,
|
|
12
12
|
rejectExtraPositionals,
|
|
13
13
|
rejectUnknownFlags
|
|
14
|
-
} from "./cli-
|
|
15
|
-
import"./cli-
|
|
14
|
+
} from "./cli-wtw5nfsx.js";
|
|
15
|
+
import"./cli-p40641zw.js";
|
|
16
16
|
import {
|
|
17
17
|
BuildError
|
|
18
18
|
} from "./cli-46ycxe6r.js";
|
|
@@ -13,17 +13,17 @@ import {
|
|
|
13
13
|
stampCreator,
|
|
14
14
|
stripAnnotations,
|
|
15
15
|
warn
|
|
16
|
-
} from "./cli-
|
|
16
|
+
} from "./cli-kgd355eh.js";
|
|
17
17
|
import {
|
|
18
18
|
DEBOUNCE,
|
|
19
19
|
UsageError,
|
|
20
20
|
resolvePort
|
|
21
|
-
} from "./cli-
|
|
21
|
+
} from "./cli-wtw5nfsx.js";
|
|
22
22
|
import {
|
|
23
23
|
MARGIN_BOX_IGNORED_PROPERTIES,
|
|
24
24
|
getAssetPath,
|
|
25
25
|
getAssetsDir
|
|
26
|
-
} from "./cli-
|
|
26
|
+
} from "./cli-p40641zw.js";
|
|
27
27
|
import {
|
|
28
28
|
BuildError
|
|
29
29
|
} from "./cli-46ycxe6r.js";
|
|
@@ -7728,7 +7728,7 @@ class PdfOutput {
|
|
|
7728
7728
|
const rawPdf = pdfxMode ? path8.join(stage, "raw.pdf") : path8.resolve(pdfFile);
|
|
7729
7729
|
await fsp2.mkdir(path8.dirname(path8.resolve(pdfFile)), { recursive: true });
|
|
7730
7730
|
log.info("Rendering HTML to PDF via the Gutterpress engine (native Chromium pagination)");
|
|
7731
|
-
const { buildNativePdf } = await import("./engine-
|
|
7731
|
+
const { buildNativePdf } = await import("./engine-fv61tyn7.js");
|
|
7732
7732
|
const engineDiagnostics = await buildNativePdf(htmlFile, rawPdf, {
|
|
7733
7733
|
title: config.title,
|
|
7734
7734
|
author: config.authors.length > 0 ? config.authors.join(", ") : undefined,
|
|
@@ -1109,7 +1109,7 @@ var favicon_default = "./favicon-wkbm9cjn.ico";
|
|
|
1109
1109
|
var manifest_schema_default = "./manifest.schema-61bsspsb.json";
|
|
1110
1110
|
|
|
1111
1111
|
// src/assets/preview/scripts/preview-interface.js
|
|
1112
|
-
var preview_interface_default = "./preview-interface-
|
|
1112
|
+
var preview_interface_default = "./preview-interface-x22vcqyw.js";
|
|
1113
1113
|
|
|
1114
1114
|
// src/assets/preview/scripts/preview-bridge.js
|
|
1115
1115
|
var preview_bridge_default = "./preview-bridge-b4jbtb79.js";
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
// package.json
|
|
5
5
|
var package_default = {
|
|
6
6
|
name: "gutterpress",
|
|
7
|
-
version: "0.11.
|
|
7
|
+
version: "0.11.11-alpha.1",
|
|
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",
|
|
@@ -71,7 +71,7 @@ var package_default = {
|
|
|
71
71
|
glob: "^13.0.0",
|
|
72
72
|
htmlhint: "^1.9.2",
|
|
73
73
|
"isomorphic-git": "^1.38.4",
|
|
74
|
-
"markdown-it": "^14.
|
|
74
|
+
"markdown-it": "^14.3.2",
|
|
75
75
|
"markdown-it-abbr": "^2.0.0",
|
|
76
76
|
"markdown-it-attrs": "^4.3.0",
|
|
77
77
|
"markdown-it-deflist": "^3.0.1",
|
|
@@ -85,7 +85,7 @@ var package_default = {
|
|
|
85
85
|
postcss: "^8.5.18",
|
|
86
86
|
"resolve.exports": "2.0.3",
|
|
87
87
|
semver: "7.8.0",
|
|
88
|
-
tar: "7.5.
|
|
88
|
+
tar: "7.5.22",
|
|
89
89
|
unpdf: "^1.6.2",
|
|
90
90
|
ws: "^8.21.0",
|
|
91
91
|
yaml: "^2.8.2"
|
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-wtw5nfsx.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-c6pmpvhw.js").then((m) => m.default),
|
|
22
|
+
preview: () => import("./preview-6n5ava6c.js").then((m) => m.default),
|
|
23
|
+
build: () => import("./build-ycaavzsb.js").then((m) => m.default),
|
|
24
|
+
publish: () => import("./publish-9an2a1ma.js").then((m) => m.default),
|
|
25
|
+
validate: () => import("./validate-0rrjva48.js").then((m) => m.default),
|
|
26
|
+
preflight: () => import("./preflight-9vq1ygh4.js").then((m) => m.default),
|
|
27
|
+
doctor: () => import("./doctor-71dxjkpz.js").then((m) => m.default),
|
|
28
|
+
ext: () => import("./ext-rkfntmtv.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-c6pmpvhw.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-9vq1ygh4.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-rkfntmtv.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-kgd355eh.js";
|
|
5
5
|
import {
|
|
6
6
|
UsageError,
|
|
7
7
|
rejectExtraPositionals,
|
|
8
8
|
rejectUnknownFlags
|
|
9
|
-
} from "./cli-
|
|
9
|
+
} from "./cli-wtw5nfsx.js";
|
|
10
10
|
import"./cli-46ycxe6r.js";
|
|
11
11
|
import"./cli-7fkhgtfn.js";
|
|
12
12
|
import"./cli-37x76zdn.js";
|
|
@@ -10,16 +10,16 @@ import {
|
|
|
10
10
|
removeExtension,
|
|
11
11
|
searchNpmExtensions,
|
|
12
12
|
setExtensionEnabled
|
|
13
|
-
} from "./cli-
|
|
14
|
-
import"./cli-
|
|
13
|
+
} from "./cli-g3xd0x9z.js";
|
|
14
|
+
import"./cli-kgd355eh.js";
|
|
15
15
|
import {
|
|
16
16
|
UsageError,
|
|
17
17
|
exitForUsage,
|
|
18
18
|
rejectExtraPositionals,
|
|
19
19
|
rejectUnknownFlags,
|
|
20
20
|
resolveProjectDir
|
|
21
|
-
} from "./cli-
|
|
22
|
-
import"./cli-
|
|
21
|
+
} from "./cli-wtw5nfsx.js";
|
|
22
|
+
import"./cli-p40641zw.js";
|
|
23
23
|
import {
|
|
24
24
|
EXIT_CODES
|
|
25
25
|
} from "./cli-46ycxe6r.js";
|
|
@@ -29,7 +29,7 @@ var favicon_default = "./favicon-wkbm9cjn.ico";
|
|
|
29
29
|
var manifest_schema_default = "./manifest.schema-61bsspsb.json";
|
|
30
30
|
|
|
31
31
|
// src/assets/preview/scripts/preview-interface.js
|
|
32
|
-
var preview_interface_default = "./preview-interface-
|
|
32
|
+
var preview_interface_default = "./preview-interface-x22vcqyw.js";
|
|
33
33
|
|
|
34
34
|
// src/assets/preview/scripts/preview-bridge.js
|
|
35
35
|
var preview_bridge_default = "./preview-bridge-b4jbtb79.js";
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
MARGIN_BOX_IGNORED_PROPERTIES,
|
|
5
5
|
getAssetPath,
|
|
6
6
|
getAssetsDir
|
|
7
|
-
} from "./index-
|
|
7
|
+
} from "./index-b7q4wev1.js";
|
|
8
8
|
import {
|
|
9
9
|
INSTALL_HINTS,
|
|
10
10
|
execCapture,
|
|
@@ -3858,7 +3858,7 @@ import git from "isomorphic-git";
|
|
|
3858
3858
|
// package.json
|
|
3859
3859
|
var package_default = {
|
|
3860
3860
|
name: "gutterpress",
|
|
3861
|
-
version: "0.11.
|
|
3861
|
+
version: "0.11.11-alpha.1",
|
|
3862
3862
|
description: "Markdown-to-PDF converter for professional print layout using a native Chromium print engine and Ghostscript.",
|
|
3863
3863
|
author: "itlackey",
|
|
3864
3864
|
license: "MPL-2.0",
|
|
@@ -3925,7 +3925,7 @@ var package_default = {
|
|
|
3925
3925
|
glob: "^13.0.0",
|
|
3926
3926
|
htmlhint: "^1.9.2",
|
|
3927
3927
|
"isomorphic-git": "^1.38.4",
|
|
3928
|
-
"markdown-it": "^14.
|
|
3928
|
+
"markdown-it": "^14.3.2",
|
|
3929
3929
|
"markdown-it-abbr": "^2.0.0",
|
|
3930
3930
|
"markdown-it-attrs": "^4.3.0",
|
|
3931
3931
|
"markdown-it-deflist": "^3.0.1",
|
|
@@ -3939,7 +3939,7 @@ var package_default = {
|
|
|
3939
3939
|
postcss: "^8.5.18",
|
|
3940
3940
|
"resolve.exports": "2.0.3",
|
|
3941
3941
|
semver: "7.8.0",
|
|
3942
|
-
tar: "7.5.
|
|
3942
|
+
tar: "7.5.22",
|
|
3943
3943
|
unpdf: "^1.6.2",
|
|
3944
3944
|
ws: "^8.21.0",
|
|
3945
3945
|
yaml: "^2.8.2"
|
|
@@ -8218,7 +8218,7 @@ class PdfOutput {
|
|
|
8218
8218
|
const rawPdf = pdfxMode ? path8.join(stage, "raw.pdf") : path8.resolve(pdfFile);
|
|
8219
8219
|
await fsp2.mkdir(path8.dirname(path8.resolve(pdfFile)), { recursive: true });
|
|
8220
8220
|
log.info("Rendering HTML to PDF via the Gutterpress engine (native Chromium pagination)");
|
|
8221
|
-
const { buildNativePdf } = await import("./engine-
|
|
8221
|
+
const { buildNativePdf } = await import("./engine-sq1kpg5s.js");
|
|
8222
8222
|
const engineDiagnostics = await buildNativePdf(htmlFile, rawPdf, {
|
|
8223
8223
|
title: config.title,
|
|
8224
8224
|
author: config.authors.length > 0 ? config.authors.join(", ") : undefined,
|
package/dist/index.js
CHANGED
|
@@ -144,13 +144,13 @@ import {
|
|
|
144
144
|
syncProject,
|
|
145
145
|
testRemoteAccess,
|
|
146
146
|
validateProjectExtensions
|
|
147
|
-
} from "./index-
|
|
147
|
+
} from "./index-wdqymw2k.js";
|
|
148
148
|
import {
|
|
149
149
|
BUILD_DIAGNOSTIC_CODES
|
|
150
|
-
} from "./index-
|
|
150
|
+
} from "./index-dxt4t7et.js";
|
|
151
151
|
import {
|
|
152
152
|
BuildError
|
|
153
|
-
} from "./index-
|
|
153
|
+
} from "./index-b7q4wev1.js";
|
|
154
154
|
import {
|
|
155
155
|
DEFAULT_PRINT_OPTS,
|
|
156
156
|
assertMilestone,
|
|
@@ -7,16 +7,16 @@ import {
|
|
|
7
7
|
TARGET_IDS,
|
|
8
8
|
scaffoldExtension,
|
|
9
9
|
scaffoldProject
|
|
10
|
-
} from "./cli-
|
|
10
|
+
} from "./cli-g3xd0x9z.js";
|
|
11
11
|
import {
|
|
12
12
|
resolveGhostscript
|
|
13
|
-
} from "./cli-
|
|
13
|
+
} from "./cli-kgd355eh.js";
|
|
14
14
|
import {
|
|
15
15
|
UsageError,
|
|
16
16
|
rejectExtraPositionals,
|
|
17
17
|
rejectUnknownFlags
|
|
18
|
-
} from "./cli-
|
|
19
|
-
import"./cli-
|
|
18
|
+
} from "./cli-wtw5nfsx.js";
|
|
19
|
+
import"./cli-p40641zw.js";
|
|
20
20
|
import {
|
|
21
21
|
EXIT_CODES
|
|
22
22
|
} from "./cli-46ycxe6r.js";
|
|
@@ -2,16 +2,16 @@ import {
|
|
|
2
2
|
executeValidation,
|
|
3
3
|
publishTargetFor,
|
|
4
4
|
reportMissingTools
|
|
5
|
-
} from "./cli-
|
|
5
|
+
} from "./cli-g3xd0x9z.js";
|
|
6
6
|
import {
|
|
7
7
|
log
|
|
8
|
-
} from "./cli-
|
|
8
|
+
} from "./cli-kgd355eh.js";
|
|
9
9
|
import {
|
|
10
10
|
UsageError,
|
|
11
11
|
rejectExtraPositionals,
|
|
12
12
|
rejectUnknownFlags
|
|
13
|
-
} from "./cli-
|
|
14
|
-
import"./cli-
|
|
13
|
+
} from "./cli-wtw5nfsx.js";
|
|
14
|
+
import"./cli-p40641zw.js";
|
|
15
15
|
import {
|
|
16
16
|
EXIT_CODES
|
|
17
17
|
} from "./cli-46ycxe6r.js";
|
|
@@ -6,10 +6,10 @@ import {
|
|
|
6
6
|
runBuild,
|
|
7
7
|
splitOutPath,
|
|
8
8
|
startPreviewServer
|
|
9
|
-
} from "./cli-
|
|
9
|
+
} from "./cli-g3xd0x9z.js";
|
|
10
10
|
import {
|
|
11
11
|
log
|
|
12
|
-
} from "./cli-
|
|
12
|
+
} from "./cli-kgd355eh.js";
|
|
13
13
|
import {
|
|
14
14
|
UsageError,
|
|
15
15
|
parseFormat,
|
|
@@ -17,8 +17,8 @@ import {
|
|
|
17
17
|
rejectExtraPositionals,
|
|
18
18
|
rejectUnknownFlags,
|
|
19
19
|
resolvePort
|
|
20
|
-
} from "./cli-
|
|
21
|
-
import"./cli-
|
|
20
|
+
} from "./cli-wtw5nfsx.js";
|
|
21
|
+
import"./cli-p40641zw.js";
|
|
22
22
|
import {
|
|
23
23
|
BuildError
|
|
24
24
|
} from "./cli-46ycxe6r.js";
|
|
@@ -82,16 +82,18 @@
|
|
|
82
82
|
return (bestArea > 0 ? best : nearest) + 1;
|
|
83
83
|
}
|
|
84
84
|
|
|
85
|
-
function scrollToCurrentPage() {
|
|
85
|
+
function scrollToCurrentPage(smooth) {
|
|
86
86
|
if (pages.length === 0) return;
|
|
87
87
|
var page = clampPage(currentPage);
|
|
88
88
|
currentPage = page;
|
|
89
|
-
|
|
89
|
+
// A smooth scroll is still moving when the plain 300ms guard expires, and
|
|
90
|
+
// detectVisiblePage would then report the page it is passing through.
|
|
91
|
+
ignoreScrollUntil = Date.now() + (smooth ? 700 : 300);
|
|
90
92
|
// Native's rows can be wider than the viewport (a long chapter scrolls
|
|
91
93
|
// horizontally within its own row) — align the target sheet's left edge
|
|
92
94
|
// to the viewport's left edge (matching detectVisiblePage's `refX`).
|
|
93
95
|
pages[page - 1].scrollIntoView({
|
|
94
|
-
behavior: 'instant',
|
|
96
|
+
behavior: smooth ? 'smooth' : 'instant',
|
|
95
97
|
block: 'start',
|
|
96
98
|
inline: 'start'
|
|
97
99
|
});
|
|
@@ -1505,6 +1507,67 @@
|
|
|
1505
1507
|
});
|
|
1506
1508
|
window.addEventListener('resize', scheduleViewportChanged);
|
|
1507
1509
|
|
|
1510
|
+
// Wheel / trackpad page flip (#301). Viewer tooling, not pagination: it
|
|
1511
|
+
// only chooses which already-laid-out page to show. It lives here, in the
|
|
1512
|
+
// book document, because wheel events over a cross-origin iframe never
|
|
1513
|
+
// reach the host page.
|
|
1514
|
+
//
|
|
1515
|
+
// One flick turns one step — the same 1 page (single view) or 2 pages
|
|
1516
|
+
// (spread) the arrow keys move. A gesture is every wheel event until the
|
|
1517
|
+
// wheel has been quiet for WHEEL_GESTURE_IDLE_MS, so a fast mouse spin or a
|
|
1518
|
+
// trackpad's inertia tail turns exactly one step.
|
|
1519
|
+
//
|
|
1520
|
+
// A page taller than the viewport (fit-width on a short window, high zoom)
|
|
1521
|
+
// is READ first: while there is more of it in the wheel's direction, the
|
|
1522
|
+
// wheel scrolls normally, and only a gesture that starts at its edge turns
|
|
1523
|
+
// the page. The choice is made once per gesture, so the momentum of reading
|
|
1524
|
+
// down to a page's end never turns the page by itself. Pinch / Ctrl+wheel
|
|
1525
|
+
// (zoom), sideways swipes and in-place editing are left alone.
|
|
1526
|
+
var WHEEL_FLIP_PX = 50;
|
|
1527
|
+
var WHEEL_GESTURE_IDLE_MS = 220;
|
|
1528
|
+
var wheelGesture = null; // null | 'scroll' | 'flip'
|
|
1529
|
+
var wheelAccum = 0;
|
|
1530
|
+
var wheelTurned = false;
|
|
1531
|
+
var wheelIdleTimer = null;
|
|
1532
|
+
function wheelDeltaPx(e) {
|
|
1533
|
+
if (e.deltaMode === 1) return e.deltaY * 16; // lines
|
|
1534
|
+
if (e.deltaMode === 2) return e.deltaY * window.innerHeight; // pages
|
|
1535
|
+
return e.deltaY;
|
|
1536
|
+
}
|
|
1537
|
+
// More of the current page lies beyond the viewport edge in direction `dir`.
|
|
1538
|
+
function pageContinuesPastViewport(dir) {
|
|
1539
|
+
if (pages.length === 0) refreshPages();
|
|
1540
|
+
var sheet = pages[clampPage(currentPage) - 1];
|
|
1541
|
+
if (!sheet) return false;
|
|
1542
|
+
var r = sheet.getBoundingClientRect();
|
|
1543
|
+
return dir > 0 ? r.bottom > window.innerHeight + 1 : r.top < -1;
|
|
1544
|
+
}
|
|
1545
|
+
window.addEventListener('wheel', function (e) {
|
|
1546
|
+
if (e.ctrlKey || edit || e.deltaY === 0 || Math.abs(e.deltaX) > Math.abs(e.deltaY)) return;
|
|
1547
|
+
if (wheelIdleTimer) clearTimeout(wheelIdleTimer);
|
|
1548
|
+
wheelIdleTimer = setTimeout(function () {
|
|
1549
|
+
wheelIdleTimer = null;
|
|
1550
|
+
wheelGesture = null;
|
|
1551
|
+
wheelAccum = 0;
|
|
1552
|
+
wheelTurned = false;
|
|
1553
|
+
}, WHEEL_GESTURE_IDLE_MS);
|
|
1554
|
+
if (wheelGesture === null) {
|
|
1555
|
+
wheelGesture = pageContinuesPastViewport(e.deltaY > 0 ? 1 : -1) ? 'scroll' : 'flip';
|
|
1556
|
+
}
|
|
1557
|
+
if (wheelGesture === 'scroll') return;
|
|
1558
|
+
e.preventDefault();
|
|
1559
|
+
if (wheelTurned) return;
|
|
1560
|
+
wheelAccum += wheelDeltaPx(e);
|
|
1561
|
+
if (Math.abs(wheelAccum) < WHEEL_FLIP_PX) return;
|
|
1562
|
+
wheelTurned = true;
|
|
1563
|
+
refreshPages();
|
|
1564
|
+
var target = clampPage(currentPage + (wheelAccum > 0 ? 1 : -1) * pageStep());
|
|
1565
|
+
if (target === currentPage) return;
|
|
1566
|
+
currentPage = target;
|
|
1567
|
+
scrollToCurrentPage(true);
|
|
1568
|
+
api.notifyPageChange();
|
|
1569
|
+
}, { passive: false });
|
|
1570
|
+
|
|
1508
1571
|
// Reset to page 1, scroll to top, and announce completion once the native
|
|
1509
1572
|
// viewer's pagination finishes.
|
|
1510
1573
|
function onRenderingComplete() {
|
|
@@ -11,17 +11,17 @@ import {
|
|
|
11
11
|
publishProviderFor,
|
|
12
12
|
resolvePublishFormat,
|
|
13
13
|
runPublish
|
|
14
|
-
} from "./cli-
|
|
14
|
+
} from "./cli-g3xd0x9z.js";
|
|
15
15
|
import {
|
|
16
16
|
FileTokenStore,
|
|
17
17
|
log
|
|
18
|
-
} from "./cli-
|
|
18
|
+
} from "./cli-kgd355eh.js";
|
|
19
19
|
import {
|
|
20
20
|
UsageError,
|
|
21
21
|
rejectExtraPositionals,
|
|
22
22
|
rejectUnknownFlags
|
|
23
|
-
} from "./cli-
|
|
24
|
-
import"./cli-
|
|
23
|
+
} from "./cli-wtw5nfsx.js";
|
|
24
|
+
import"./cli-p40641zw.js";
|
|
25
25
|
import {
|
|
26
26
|
EXIT_CODES
|
|
27
27
|
} from "./cli-46ycxe6r.js";
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import {
|
|
2
2
|
executeAndReport
|
|
3
|
-
} from "./cli-
|
|
3
|
+
} from "./cli-g3xd0x9z.js";
|
|
4
4
|
import {
|
|
5
5
|
log
|
|
6
|
-
} from "./cli-
|
|
6
|
+
} from "./cli-kgd355eh.js";
|
|
7
7
|
import {
|
|
8
8
|
UsageError,
|
|
9
9
|
rejectExtraPositionals,
|
|
10
10
|
rejectUnknownFlags
|
|
11
|
-
} from "./cli-
|
|
12
|
-
import"./cli-
|
|
11
|
+
} from "./cli-wtw5nfsx.js";
|
|
12
|
+
import"./cli-p40641zw.js";
|
|
13
13
|
import {
|
|
14
14
|
EXIT_CODES
|
|
15
15
|
} from "./cli-46ycxe6r.js";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "gutterpress",
|
|
3
|
-
"version": "0.11.
|
|
3
|
+
"version": "0.11.11-alpha.1",
|
|
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",
|
|
@@ -67,7 +67,7 @@
|
|
|
67
67
|
"glob": "^13.0.0",
|
|
68
68
|
"htmlhint": "^1.9.2",
|
|
69
69
|
"isomorphic-git": "^1.38.4",
|
|
70
|
-
"markdown-it": "^14.
|
|
70
|
+
"markdown-it": "^14.3.2",
|
|
71
71
|
"markdown-it-abbr": "^2.0.0",
|
|
72
72
|
"markdown-it-attrs": "^4.3.0",
|
|
73
73
|
"markdown-it-deflist": "^3.0.1",
|
|
@@ -81,7 +81,7 @@
|
|
|
81
81
|
"postcss": "^8.5.18",
|
|
82
82
|
"resolve.exports": "2.0.3",
|
|
83
83
|
"semver": "7.8.0",
|
|
84
|
-
"tar": "7.5.
|
|
84
|
+
"tar": "7.5.22",
|
|
85
85
|
"unpdf": "^1.6.2",
|
|
86
86
|
"ws": "^8.21.0",
|
|
87
87
|
"yaml": "^2.8.2"
|