gutterpress 0.11.23-alpha.6 → 0.11.23-beta.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/README.md +2 -0
- package/dist/{README-syg2hn83.md → README-8rct3axy.md} +2 -2
- package/dist/api/index.d.ts +3 -3
- package/dist/api/index.js +7 -5
- package/dist/{build-py643c5a.js → build-dg8a566j.js} +8 -7
- package/dist/{cli-tf9tw6at.js → cli-1fy1pm9d.js} +1 -1
- package/dist/cli-65gy8ask.js +82 -0
- package/dist/{cli-09jj8w5g.js → cli-989eg8jz.js} +186 -83
- package/dist/{cli-55br530w.js → cli-e31jshz6.js} +6 -84
- package/dist/{cli-58fsk6d7.js → cli-k087gj0p.js} +66 -34
- package/dist/{cli-qzkq9em8.js → cli-s1zt779w.js} +1 -1
- package/dist/{cli-x777v272.js → cli-ttj95aex.js} +3 -3
- package/dist/{cli-bnf7eb38.js → cli-vhav8g82.js} +1 -1
- package/dist/cli.js +12 -12
- package/dist/{doctor-tyrzqphh.js → doctor-g4a42tcz.js} +3 -3
- package/dist/engine/shared/page-vars.d.ts +32 -0
- package/dist/{engine-4rabsgwq.js → engine-jvkcahr1.js} +2 -1
- package/dist/{engine-wm4fggac.js → engine-wgkaqjsc.js} +3 -3
- package/dist/{ext-70kt3eft.js → ext-w9d5ftcg.js} +8 -7
- package/dist/{extension-restore-whag4sm0.js → extension-restore-5x4mj79d.js} +3 -3
- package/dist/{extension-restore-fjfn1hrk.js → extension-restore-as0g38p1.js} +5 -4
- package/dist/{gutterpress-viewer-mafsby5k.js → gutterpress-viewer-ze691rrd.js} +52 -13
- package/dist/{index-2vxzxyyj.js → index-798jt0qc.js} +9 -9
- package/dist/{index-1zqkfzcd.js → index-a4j3xcfp.js} +3 -3
- package/dist/{index-ejbfetdn.js → index-c6y0p7jy.js} +272 -151
- package/dist/{index-wm4x7xbf.js → index-fk2kpf2t.js} +58 -26
- package/dist/{index-cmakyf43.js → index-rj5vrhz6.js} +5 -85
- package/dist/index-tayzfr9c.js +99 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +233 -6
- package/dist/lib/book-css.d.ts +56 -0
- package/dist/lib/markdown/assemble.d.ts +58 -0
- package/dist/lib/publish/google-drive.d.ts +12 -4
- package/dist/lib/publish/manifest-publish.d.ts +6 -0
- package/dist/lib/publish/providers/gdrive-folder.d.ts +30 -0
- package/dist/lib/publish/run-publish.d.ts +6 -1
- package/dist/lib/publish/types.d.ts +52 -5
- package/dist/lib/remote-auth/converge-merge.d.ts +3 -3
- package/dist/lib/remote-auth/revisions.d.ts +5 -1
- package/dist/lib/remote-auth/sync-messages.d.ts +2 -2
- package/dist/lib/root-tokens.d.ts +76 -0
- package/dist/lib/version-changes.d.ts +12 -12
- package/dist/{manifest-79zsgkpn.yaml → manifest-0vwaskj2.yaml} +1 -1
- package/dist/{manifest-2kc56wvw.yaml → manifest-aya31jwt.yaml} +1 -1
- package/dist/{manifest-41ddzm13.yaml → manifest-mffah3hr.yaml} +1 -1
- package/dist/{manifest-sqzm4681.yaml → manifest-wbcv8cbp.yaml} +2 -2
- package/dist/{manifest.schema-93sd7zje.json → manifest.schema-0jgj0jt1.json} +1 -1
- package/dist/{new-b27kyr02.js → new-jtk028rf.js} +8 -7
- package/dist/{page-rules-ytj9p04v.css → page-rules-vnja6grt.css} +2 -2
- package/dist/{plugins-racab3cj.js → plugins-bcbe7xs8.js} +1 -1
- package/dist/{plugins-vpx7c53c.js → plugins-zsm6wv79.js} +3 -3
- package/dist/{preflight-akdqz9v8.js → preflight-cs6mj1d6.js} +8 -7
- package/dist/{preview-bck9f88w.js → preview-d1j1g4qf.js} +8 -7
- package/dist/{publish-keyp8rh4.js → publish-7yw4jyrt.js} +24 -8
- package/dist/render.js +65 -24
- package/dist/schema/manifest.types.d.ts +2 -1
- package/dist/{tokens-n82t4k9h.css → tokens-a7grv940.css} +4 -5
- package/dist/{validate-z28cvr5x.js → validate-rkcdnzhw.js} +8 -7
- package/package.json +1 -1
- package/dist/index-46ycxe6r.js +0 -18
package/README.md
CHANGED
|
@@ -253,6 +253,8 @@ gutterpress publish [project] [options]
|
|
|
253
253
|
--account <label> Named-credential label for --connect/--disconnect (keep several accounts per provider); omit for the default
|
|
254
254
|
--token <key> API key for --connect (prefer stdin/env var to keep it out of shell history)
|
|
255
255
|
--file <path> Artifact to publish (PDF path, or HTML export dir). Default: the manifest's output location
|
|
256
|
+
--folder-id <id> Google Drive: publish to this folder for this run only (the manifest is not changed)
|
|
257
|
+
--folder <name> Google Drive: publish to the folder with this name in your own Drive, for this run only
|
|
256
258
|
--manifest <path> Path to manifest.yaml
|
|
257
259
|
--dry-run Preflight only; don't contact the platform
|
|
258
260
|
--json Machine-readable JSON output (CI)
|
|
@@ -159,8 +159,8 @@ one place, and chapters written afterwards get it for free.
|
|
|
159
159
|
### 4. The page size and margins are the book's, not the look's
|
|
160
160
|
|
|
161
161
|
A look never declares `@page { size }` or `@page { margin }`. The book's
|
|
162
|
-
manifest records both (`preset:`, `page: width / height / margin`, which
|
|
163
|
-
|
|
162
|
+
manifest records both (`preset:`, `page: width / height / margin`, which an
|
|
163
|
+
author sets in Book setup), and the build writes them as the `@page`
|
|
164
164
|
rule after every stylesheet, so a `size` in a look is ignored and reported by
|
|
165
165
|
the print-safety check, and a `margin` holds only until the author sets
|
|
166
166
|
margins in the app. `page-rules.css` owns what IS a look's: the margin boxes
|
package/dist/api/index.d.ts
CHANGED
|
@@ -55,8 +55,8 @@ export { readPageSetup, setPageSetup } from "../lib/page-size.ts";
|
|
|
55
55
|
export type { PageMargin, PageSetup, PageSetupChange, PageSizeChoice, PageSizePoints } from "../lib/page-size.ts";
|
|
56
56
|
export { providerFor, restoreVersionWithBackup, isNoChangesError, countUnversionedChanges, whenGitIdle, AUTO_SNAPSHOT_MESSAGE, RESTORE_BACKUP_MESSAGE, HISTORY_PAGE_LIMIT, listRevisions, createRevision, revisionNameFrom, switchBranch, SWITCH_BRANCH_SNAPSHOT_MESSAGE, } from "../lib/source-provider.ts";
|
|
57
57
|
export type { ListHistoryOptions, HistoryPage, UnversionedChanges, Revision, RevisionList, CreateRevisionOptions, SwitchBranchOptions, SwitchBranchResult, } from "../lib/source-provider.ts";
|
|
58
|
-
export { describeVersions, listOnlineVersions, compareVersionFile, exportVersionTree, VERSION_CHANGES_SHOWN, } from "../lib/version-changes.ts";
|
|
59
|
-
export type { VersionEntry, VersionFileChange, CompareRow } from "../lib/version-changes.ts";
|
|
58
|
+
export { describeVersions, listVersionChanges, listOnlineVersions, compareVersionFile, exportVersionTree, VERSION_CHANGES_SHOWN, } from "../lib/version-changes.ts";
|
|
59
|
+
export type { VersionEntry, VersionChanges, VersionFileChange, CompareRow } from "../lib/version-changes.ts";
|
|
60
60
|
export { autoSnapshotDelayMs, autoSyncDelayMs, isGitInternalPath, AUTO_SNAPSHOT_DEFAULT_MINUTES, AUTO_SYNC_MIN_MINUTES, AUTO_SYNC_MAX_MINUTES, AUTO_SYNC_DEFAULT_MINUTES, AUTO_SYNC_PUSH_INTERVAL_MINUTES, } from "../lib/host-policy.ts";
|
|
61
61
|
export type { AutoSnapshotPolicy, AutoSyncPolicy, } from "../lib/host-policy.ts";
|
|
62
62
|
export { FileTokenStore, defaultConfigDir, extractUrlCredential, } from "../lib/remote-auth/token-store.ts";
|
|
@@ -98,6 +98,6 @@ export type { PublishSavedAccount } from "../lib/publish/types.ts";
|
|
|
98
98
|
export { PublishSelectionsStore } from "../lib/publish/selections.ts";
|
|
99
99
|
export type { PublishAccountSelection } from "../lib/publish/selections.ts";
|
|
100
100
|
export { readPublishSettings, savePublishSettings, setPublishProviderConfig, } from "../lib/publish/manifest-publish.ts";
|
|
101
|
-
export type { PublishProvider, PublishProviderId, PublishProviderInfo, PublishProviderKind, PublishConfigField, PublishArtifact, PublishArtifactFormat, PublishAuthStatus, PublishDeps, PublishListingMetadata, PublishOutcome, PublishProduct, PublishProject, PublishRequest, PreflightIssue, CommandRunner, CommandResult, PublishPluginContext, PublishPluginFunction, PublishPluginResult, } from "../lib/publish/types.ts";
|
|
101
|
+
export type { PublishProvider, PublishProviderId, PublishProviderInfo, PublishProviderKind, PublishConfigField, PublishArtifact, PublishArtifactFormat, PublishAuthStatus, PublishDeps, PublishDestinationStatus, PublishListingMetadata, PublishOutcome, PublishProduct, PublishProject, PublishRequest, PreflightIssue, CommandRunner, CommandResult, PublishPluginContext, PublishPluginFunction, PublishPluginResult, } from "../lib/publish/types.ts";
|
|
102
102
|
export { resolveLogger } from "../lib/remote-auth/operation-log.ts";
|
|
103
103
|
export type { OperationLogger, LogData } from "../lib/remote-auth/operation-log.ts";
|
package/dist/api/index.js
CHANGED
|
@@ -62,6 +62,7 @@ import {
|
|
|
62
62
|
listPublishProviders,
|
|
63
63
|
listRepoBooks,
|
|
64
64
|
listSnippets,
|
|
65
|
+
listVersionChanges,
|
|
65
66
|
parseRemoteOrigin,
|
|
66
67
|
pkceChallengeFromVerifier,
|
|
67
68
|
publishConnectionStatus,
|
|
@@ -104,7 +105,7 @@ import {
|
|
|
104
105
|
substituteVariables,
|
|
105
106
|
syncProject,
|
|
106
107
|
testRemoteAccess
|
|
107
|
-
} from "../index-
|
|
108
|
+
} from "../index-c6y0p7jy.js";
|
|
108
109
|
import {
|
|
109
110
|
DEFAULT_NPM_REGISTRY,
|
|
110
111
|
MANIFEST_FILENAMES,
|
|
@@ -133,7 +134,7 @@ import {
|
|
|
133
134
|
setExtensionEnabled,
|
|
134
135
|
updateExtensions,
|
|
135
136
|
validateProjectExtensions
|
|
136
|
-
} from "../index-
|
|
137
|
+
} from "../index-rj5vrhz6.js";
|
|
137
138
|
import {
|
|
138
139
|
BUNDLED_EXTENSIONS,
|
|
139
140
|
EXTENSION_MANIFEST_FILENAME,
|
|
@@ -148,12 +149,12 @@ import {
|
|
|
148
149
|
pathEscapesFolder,
|
|
149
150
|
readExtensionMeta,
|
|
150
151
|
resolveExtension
|
|
151
|
-
} from "../index-
|
|
152
|
+
} from "../index-a4j3xcfp.js";
|
|
152
153
|
import"../index-ht1bcqdd.js";
|
|
153
|
-
import"../index-
|
|
154
|
+
import"../index-798jt0qc.js";
|
|
154
155
|
import {
|
|
155
156
|
BuildError
|
|
156
|
-
} from "../index-
|
|
157
|
+
} from "../index-tayzfr9c.js";
|
|
157
158
|
import"../index-5crpmz42.js";
|
|
158
159
|
import {
|
|
159
160
|
DEFAULT_PRINT_OPTS,
|
|
@@ -256,6 +257,7 @@ export {
|
|
|
256
257
|
parseExtensionSpecifier,
|
|
257
258
|
npmRegistryUrl,
|
|
258
259
|
loadManifestWithPath,
|
|
260
|
+
listVersionChanges,
|
|
259
261
|
listSnippets,
|
|
260
262
|
listRevisions,
|
|
261
263
|
listRepoBooks,
|
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
import {
|
|
2
2
|
runBuild,
|
|
3
3
|
splitOutPath
|
|
4
|
-
} from "./cli-
|
|
5
|
-
import"./cli-
|
|
4
|
+
} from "./cli-989eg8jz.js";
|
|
5
|
+
import"./cli-vhav8g82.js";
|
|
6
6
|
import"./cli-ht1bcqdd.js";
|
|
7
|
-
import"./cli-
|
|
7
|
+
import"./cli-k087gj0p.js";
|
|
8
8
|
import"./cli-5crpmz42.js";
|
|
9
9
|
import"./cli-eyyggect.js";
|
|
10
10
|
import"./cli-asap4t1z.js";
|
|
11
11
|
import"./cli-31anr0r9.js";
|
|
12
12
|
import"./cli-v5mp7a6q.js";
|
|
13
|
-
import"./cli-
|
|
14
|
-
import"./cli-
|
|
13
|
+
import"./cli-e31jshz6.js";
|
|
14
|
+
import"./cli-ttj95aex.js";
|
|
15
15
|
import {
|
|
16
16
|
log
|
|
17
|
-
} from "./cli-
|
|
17
|
+
} from "./cli-1fy1pm9d.js";
|
|
18
18
|
import {
|
|
19
19
|
UsageError,
|
|
20
20
|
parseFormat,
|
|
@@ -22,7 +22,8 @@ import {
|
|
|
22
22
|
rejectExtraPositionals,
|
|
23
23
|
rejectUnknownFlags
|
|
24
24
|
} from "./cli-d8xjns66.js";
|
|
25
|
-
import"./cli-
|
|
25
|
+
import"./cli-s1zt779w.js";
|
|
26
|
+
import"./cli-65gy8ask.js";
|
|
26
27
|
import {
|
|
27
28
|
BuildError
|
|
28
29
|
} from "./cli-46ycxe6r.js";
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
// src/engine/shared/print-area.ts
|
|
2
|
+
function isPositivePoints(value) {
|
|
3
|
+
return typeof value === "number" && Number.isFinite(value) && value > 0;
|
|
4
|
+
}
|
|
5
|
+
function isNonNegativePoints(value) {
|
|
6
|
+
return typeof value === "number" && Number.isFinite(value) && value >= 0;
|
|
7
|
+
}
|
|
8
|
+
var round3 = (n) => Math.round(n * 1000) / 1000;
|
|
9
|
+
function cssLength(pt) {
|
|
10
|
+
const inches = round3(pt / 72);
|
|
11
|
+
return Math.abs(inches * 72 - pt) < 0.000001 ? `${inches}in` : `${round3(pt)}pt`;
|
|
12
|
+
}
|
|
13
|
+
function formatPageSize(page) {
|
|
14
|
+
return `${cssLength(page.width)} ${cssLength(page.height)}`;
|
|
15
|
+
}
|
|
16
|
+
function printAreaMeta(page) {
|
|
17
|
+
const area = JSON.stringify({
|
|
18
|
+
width: page.width,
|
|
19
|
+
height: page.height,
|
|
20
|
+
bleed: page.bleed ?? 0,
|
|
21
|
+
safe: page.safe ?? 0,
|
|
22
|
+
artSafe: page.artSafe,
|
|
23
|
+
gutter: page.gutter,
|
|
24
|
+
preset: page.preset,
|
|
25
|
+
spec: page.spec
|
|
26
|
+
});
|
|
27
|
+
return `<meta name="gp-print-area" content='${area.replace(/&/g, "&").replace(/'/g, "'")}'>`;
|
|
28
|
+
}
|
|
29
|
+
function pageBoxes(area, side, scale = 1) {
|
|
30
|
+
const w = area.width * scale;
|
|
31
|
+
const h = area.height * scale;
|
|
32
|
+
const b = Math.max(0, area.bleed) * scale;
|
|
33
|
+
const s = Math.max(0, area.safe) * scale;
|
|
34
|
+
const a = Math.max(0, area.artSafe) * scale;
|
|
35
|
+
const g = Math.max(0, area.gutter) * scale;
|
|
36
|
+
const [textLeft, textRight] = side === "verso" ? [s, g] : [g, s];
|
|
37
|
+
const [artLeft, artRight] = side === "verso" ? [a, g] : [g, a];
|
|
38
|
+
const trim = { x: side === "verso" ? b : 0, y: b, w: Math.max(0, w - b), h: Math.max(0, h - 2 * b) };
|
|
39
|
+
return {
|
|
40
|
+
sheet: { x: 0, y: 0, w, h },
|
|
41
|
+
trim,
|
|
42
|
+
safe: {
|
|
43
|
+
x: trim.x + textLeft,
|
|
44
|
+
y: trim.y + s,
|
|
45
|
+
w: Math.max(0, trim.w - textLeft - textRight),
|
|
46
|
+
h: Math.max(0, trim.h - 2 * s)
|
|
47
|
+
},
|
|
48
|
+
safeArt: {
|
|
49
|
+
x: trim.x + artLeft,
|
|
50
|
+
y: trim.y + a,
|
|
51
|
+
w: Math.max(0, trim.w - artLeft - artRight),
|
|
52
|
+
h: Math.max(0, trim.h - 2 * a)
|
|
53
|
+
},
|
|
54
|
+
bleed: b
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
var SEVERITY = { inside: 0, unsafe: 1, bleed: 2, "off-page": 3 };
|
|
58
|
+
function judgeRect(r, boxes, rule, tol = 0) {
|
|
59
|
+
const { sheet, trim } = boxes;
|
|
60
|
+
const safe = rule === "art" ? boxes.safeArt : boxes.safe;
|
|
61
|
+
const sides = [
|
|
62
|
+
["left", -r.x, -safe.x, -trim.x, -sheet.x],
|
|
63
|
+
["right", r.x + r.w, safe.x + safe.w, trim.x + trim.w, sheet.x + sheet.w],
|
|
64
|
+
["top", -r.y, -safe.y, -trim.y, -sheet.y],
|
|
65
|
+
["bottom", r.y + r.h, safe.y + safe.h, trim.y + trim.h, sheet.y + sheet.h]
|
|
66
|
+
];
|
|
67
|
+
let worst = { kind: "inside", gap: 0, need: 0, edge: null };
|
|
68
|
+
let beyond = 0;
|
|
69
|
+
for (const [edge, ink, limit, trimEdge, sheetEdge] of sides) {
|
|
70
|
+
const past = ink - limit;
|
|
71
|
+
if (past <= tol || rule === "art" && ink >= sheetEdge - tol)
|
|
72
|
+
continue;
|
|
73
|
+
const kind = ink > sheetEdge + tol ? "off-page" : ink > trimEdge + tol ? "bleed" : "unsafe";
|
|
74
|
+
if (SEVERITY[kind] > SEVERITY[worst.kind] || kind === worst.kind && past > beyond) {
|
|
75
|
+
worst = { kind, gap: trimEdge - ink, need: trimEdge - limit, edge };
|
|
76
|
+
beyond = past;
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
return worst;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
export { isPositivePoints, isNonNegativePoints, round3, cssLength, formatPageSize, printAreaMeta, pageBoxes, judgeRect };
|