@xiee/utils 1.14.136 → 1.14.138
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/AGENTS.md +7 -0
- package/css/book-litedown.css +4 -4
- package/css/book-litedown.min.css +1 -1
- package/css/book-litedown.min.css.map +1 -1
- package/css/book.css +1 -1
- package/css/book.min.css +1 -1
- package/css/book.min.css.map +1 -1
- package/css/pages.css +8 -4
- package/css/pages.min.css +1 -1
- package/css/pages.min.css.map +1 -1
- package/js/pages.js +152 -30
- package/js/pages.min.js +1 -1
- package/js/pages.min.js.map +1 -1
- package/package.json +1 -1
package/AGENTS.md
CHANGED
|
@@ -23,9 +23,16 @@ CHROMIUM_PATH=/usr/bin/chromium-browser npm test # use an installed browser
|
|
|
23
23
|
- Tests for white space at page bottoms: a filler `div` of `B - free` px (`B`: body height of a probe page) before the block, sweep `free` over a range (the page capacity is not exactly the body height), assert on page 1 (see `firstPages()`), and check that the test fails without the change.
|
|
24
24
|
- Fill mode (`pagesjs-filling`: `height: auto`, `scrollHeight` is the natural height) differs from the final layout (fixed height; the body may hang over into the space above the footer). What the reader sees must be measured in the final layout (`checkOffsets()` for `page-multiple`).
|
|
25
25
|
- Footnotes and citations are measured as a `.footnotes` block after the page body, like in the end (`syncNotes()`); in the text they are hidden markers (`span.pagesjs-note`) that go with their references. Don't measure them inline or add CSS to approximate their space.
|
|
26
|
+
- Floats (captioned `figure`/`.figure`, or `.float`): one that does not fit waits for the next page and the content after it fills the gap, so a `fragment-last` piece may follow a float (`.pagesjs-float`) at the top of a page, and the order of the text changes (tests compare sorted characters). A float taller than `data-pages-float-page` percent of the body (70) gets a page of its own.
|
|
26
27
|
- By design, not bugs: a 2-line paragraph is not split (orphan/widow), a heading may end a page, `.figure`/diagrams/flex containers are never broken (they overflow small pages), `moveShortHead()` compares with one line.
|
|
27
28
|
- To compare a change: dump the `.pagesjs-page` HTML before and after (normalize file paths in link titles, random `md-<n>-<n>` ids and `data-page-number`), and check that the concatenated body text is identical.
|
|
28
29
|
|
|
30
|
+
## Performance of `pages.js`
|
|
31
|
+
|
|
32
|
+
- The time is the browser's style and layout, not the JS: every `scrollHeight`/`getBoundingClientRect()` read after a DOM change is a forced layout with a large fixed cost (0.3-0.6 ms). Count and batch the reads (see `fitting()`) instead of tuning the JS. `:has()` rules are re-evaluated on every DOM change in the page being filled, so don't use one that can match an ancestor of the content (e.g., `.pagesjs-page:has(.pagesjs-front)` cost 8% on the litedown book; `pages.js` adds the class `page-front` instead). Rules on content cost less (`pre:has(code[data-file])` was about 3% on the litedown book); a child combinator `:has(> ...)` does not make them cheaper, a class on the subject does (`pre.file`, which the book sets in a script).
|
|
33
|
+
- Measure on the litedown book (and on a flat variant of it, without the chapter wrappers, since the children of the root take another path than those of a broken element). On a shared machine wall time is useless; compare the thread CPU time (CDP `Performance.getMetrics`, `ThreadTime`), the minimum of several runs, with the variants interleaved.
|
|
34
|
+
- A speedup must not change the pages: compare the `.pagesjs-page` HTML before and after (see above) on those documents and on random ones (paragraphs, lists, tables, code, figures, big margins).
|
|
35
|
+
|
|
29
36
|
## Releases
|
|
30
37
|
|
|
31
38
|
1. Commit the version bump in `package.json` as `Bump to X.Y.Z` (patch +1 unless told otherwise), after tests pass.
|
package/css/book-litedown.css
CHANGED
|
@@ -94,7 +94,7 @@
|
|
|
94
94
|
* {
|
|
95
95
|
flex: 1 0 min-content;
|
|
96
96
|
}
|
|
97
|
-
pre
|
|
97
|
+
pre.file {
|
|
98
98
|
border: groove mintcream;
|
|
99
99
|
border-top: none;
|
|
100
100
|
&::before {
|
|
@@ -119,7 +119,7 @@ code[data-file]::before {
|
|
|
119
119
|
margin: -1em -1em 1em 1em;
|
|
120
120
|
}
|
|
121
121
|
|
|
122
|
-
pre
|
|
122
|
+
pre.file {
|
|
123
123
|
&::before {
|
|
124
124
|
content: "Output";
|
|
125
125
|
text-transform: uppercase;
|
|
@@ -128,10 +128,10 @@ pre:has(code[data-file]) {
|
|
|
128
128
|
padding: .5em 1em;
|
|
129
129
|
border-bottom: none;
|
|
130
130
|
}
|
|
131
|
-
|
|
131
|
+
&.example::before {
|
|
132
132
|
content: "♧ Example";
|
|
133
133
|
}
|
|
134
|
-
|
|
134
|
+
&.source::before {
|
|
135
135
|
content: "♧ Source";
|
|
136
136
|
}
|
|
137
137
|
/* pieces of a code block split across pages: label only on the first piece,
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
.pagesjs #TOC>ul>li>ul>li>ul>li>ul,.chapter-toc>ul>li>ul>li>ul{display:none}.pagesjs{& #tab\:assets tr>:nth-child(2){display:none}}.epigraph{margin-bottom:4em;padding:5px;position:relative;&,& blockquote{border:1px solid}&:before,&:after,& blockquote:before,& blockquote:after{content:"•";text-align:center;border:1px solid;width:1em;height:1em;line-height:1;display:inline-block;position:absolute}&:before{left:5px}&:after{content:"❀";color:#639;text-align:right;opacity:.2;border:none;font-size:3em;inset:5px 5px auto auto}& blockquote{padding:1em;&:before{inset:auto auto 5px 5px}&:after{inset:auto 5px 5px auto}}&.pagesjs-fragmented{&:not(.fragment-first),&:not(.fragment-last) blockquote{&:before,&:after{display:none}}&:not(.fragment-first){&,& blockquote{padding-top:1px}}&:not(.fragment-last){&,& blockquote{padding-bottom:1px}}}}.new-road{& p{justify-content:center;gap:.5em;display:flex}& button:before{font-size:200%}& .old-knit,& .new-fuse{&:hover:before{content:"❓ "}}& .old-knit{&:before{content:"🧶 "}&:focus:before{content:"😡 "}}& .new-fuse:before{content:"↯ "}& .new-preview:before{content:"⏵ "}& .new-fuse:focus:before{content:"😇 "}}.flex-col{gap:.5em;& *{flex:1 0 min-content}& pre
|
|
1
|
+
.pagesjs #TOC>ul>li>ul>li>ul>li>ul,.chapter-toc>ul>li>ul>li>ul{display:none}.pagesjs{& #tab\:assets tr>:nth-child(2){display:none}}.epigraph{margin-bottom:4em;padding:5px;position:relative;&,& blockquote{border:1px solid}&:before,&:after,& blockquote:before,& blockquote:after{content:"•";text-align:center;border:1px solid;width:1em;height:1em;line-height:1;display:inline-block;position:absolute}&:before{left:5px}&:after{content:"❀";color:#639;text-align:right;opacity:.2;border:none;font-size:3em;inset:5px 5px auto auto}& blockquote{padding:1em;&:before{inset:auto auto 5px 5px}&:after{inset:auto 5px 5px auto}}&.pagesjs-fragmented{&:not(.fragment-first),&:not(.fragment-last) blockquote{&:before,&:after{display:none}}&:not(.fragment-first){&,& blockquote{padding-top:1px}}&:not(.fragment-last){&,& blockquote{padding-bottom:1px}}}}.new-road{& p{justify-content:center;gap:.5em;display:flex}& button:before{font-size:200%}& .old-knit,& .new-fuse{&:hover:before{content:"❓ "}}& .old-knit{&:before{content:"🧶 "}&:focus:before{content:"😡 "}}& .new-fuse:before{content:"↯ "}& .new-preview:before{content:"⏵ "}& .new-fuse:focus:before{content:"😇 "}}.flex-col{gap:.5em;& *{flex:1 0 min-content}& pre.file{border:groove #f5fffa;border-top:none;&:before{border-top:groove #f5fffa;border-bottom:none;border-left:none;border-right:groove #f5fffa}& code{border:none;border-top:1px dashed #d3d3d3}}}code[data-file]:before{content:attr(data-file);float:right;background:#ffffe0;margin:-1em -1em 1em 1em;padding:.5em;font-size:.9em;display:inline-block}pre.file{&:before{content:"Output";text-transform:uppercase;border-bottom:none;padding:.5em 1em;font-weight:700;display:inline-block}&.example:before{content:"♧ Example"}&.source:before{content:"♧ Source"}&.pagesjs-fragmented{&:not(.fragment-first){&:before,& code:before{content:unset}& code{border-top:none}}&:not(.fragment-last) code{border-bottom:none}}& code,&:before{border:groove #f5fffa}&:before{border-bottom:none}}pre .ex-out:after{content:"⏵";font-size:1.5em;text-decoration:none;position:absolute;inset:auto 5px 0 auto}.no-ref-label{& .cross-ref-sec:before{content:""}}.larger{font-size:1.5em}
|
|
2
2
|
/*# sourceMappingURL=book-litedown.min.css.map */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"mappings":"AAGA,4EAIA,SACE,8CAKF,0DAIE,gCAGA,mLAUA,kBAGA,+GASA,yBAEE,iCAGA,iCAIF,qBACE,wDACE,+BAIF,uBACE,gCAIF,sBACE,qCAQN,UACE,iDAKA,+BACA,wBACE,+BAEF,YACE,yBACA,gCAEF,kCACA,qCACA,0CAIF,mBAEE,yBAGA,
|
|
1
|
+
{"version":3,"mappings":"AAGA,4EAIA,SACE,8CAKF,0DAIE,gCAGA,mLAUA,kBAGA,+GASA,yBAEE,iCAGA,iCAIF,qBACE,wDACE,+BAIF,uBACE,gCAIF,sBACE,qCAQN,UACE,iDAKA,+BACA,wBACE,+BAEF,YACE,yBACA,gCAEF,kCACA,qCACA,0CAIF,mBAEE,yBAGA,iDAGE,mGAKA,mDAOJ,wJAUA,SACE,4HAQA,uCAGA,qCAKA,qBACE,uBACE,qCAGA,wBAIF,+CAIF,sCAGA,6BAKF,6GAQA,cACE,oCAKF","sources":["book-litedown.css"],"sourcesContent":["/* CSS for https://yihui.org/litedown/ */\n\n/* hide 4th-level TOC items when printing to PDF and 3rd-level in chapter TOC */\n.pagesjs #TOC > ul > li > ul > li > ul > li > ul, .chapter-toc > ul > li > ul > li > ul {\n display: none;\n}\n\n.pagesjs {\n #tab\\:assets tr > :nth-child(2) {\n display: none;\n }\n}\n\n.epigraph {\n position: relative;\n padding: 5px;\n margin-bottom: 4em;\n &, blockquote {\n border: 1px solid;\n }\n &::before, &::after, blockquote::before, blockquote::after {\n content: \"•\";\n position: absolute;\n border: 1px solid;\n display: inline-block;\n width: 1em;\n height: 1em;\n text-align: center;\n line-height: 1;\n }\n &::before {\n left: 5px;\n }\n &::after {\n content: \"❀\";\n color: rebeccapurple;\n font-size: 3em;\n text-align: right;\n border: none;\n opacity: .2;\n inset: 5px 5px auto auto;\n }\n blockquote {\n padding: 1em;\n &::before {\n inset: auto auto 5px 5px;\n }\n &::after {\n inset: auto 5px 5px auto;\n }\n }\n &.pagesjs-fragmented {\n &:not(.fragment-first), &:not(.fragment-last) blockquote {\n &::before, &::after {\n display: none;\n }\n }\n &:not(.fragment-first) {\n &, blockquote {\n padding-top: 1px;\n }\n }\n &:not(.fragment-last) {\n &, blockquote {\n padding-bottom: 1px;\n }\n }\n }\n}\n\n/* a tale of two buttons */\n.new-road {\n p {\n display: flex;\n justify-content: center;\n gap: .5em;\n }\n button::before { font-size: 200%; }\n .old-knit, .new-fuse {\n &:hover::before { content: \"❓ \"; }\n }\n .old-knit {\n &::before { content: \"🧶 \"; }\n &:focus::before { content: \"😡 \"; }\n }\n .new-fuse::before { content: \"↯ \"; }\n .new-preview::before { content: \"⏵ \"; }\n .new-fuse:focus::before { content: \"😇 \"; }\n}\n\n/* arrange elements in columns */\n.flex-col {\n gap: .5em;\n * {\n flex: 1 0 min-content;\n }\n pre.file {\n border: groove mintcream;\n border-top: none;\n &::before {\n border: groove mintcream;\n border-left: none;\n border-bottom: none;\n }\n code {\n border: none;\n border-top: 1px dashed lightgray;\n }\n }\n}\n\ncode[data-file]::before {\n content: attr(data-file);\n font-size: .9em;\n float: right;\n background: lightyellow;\n display: inline-block;\n padding: .5em;\n margin: -1em -1em 1em 1em;\n}\n\npre.file {\n &::before {\n content: \"Output\";\n text-transform: uppercase;\n font-weight: bold;\n display: inline-block;\n padding: .5em 1em;\n border-bottom: none;\n }\n &.example::before {\n content: \"♧ Example\";\n }\n &.source::before {\n content: \"♧ Source\";\n }\n /* pieces of a code block split across pages: label only on the first piece,\n and no border on the sides where it is cut */\n &.pagesjs-fragmented {\n &:not(.fragment-first) {\n &::before, code::before {\n content: unset;\n }\n code {\n border-top: none;\n }\n }\n &:not(.fragment-last) code {\n border-bottom: none;\n }\n }\n code, &::before {\n border: groove mintcream;\n }\n &::before {\n border-bottom: none;\n }\n}\n\npre .ex-out::after {\n content: \"⏵\";\n position: absolute;\n inset: auto 5px 0 auto;\n text-decoration: none;\n font-size: 1.5em;\n}\n\n.no-ref-label {\n .cross-ref-sec:before {\n content: \"\";\n }\n}\n\n.larger { font-size: 1.5em; }\n"],"names":[]}
|
package/css/book.css
CHANGED
|
@@ -49,7 +49,7 @@ h1 .section-number {
|
|
|
49
49
|
article h2 { border-bottom-style: dashed; }
|
|
50
50
|
/* TODO: style for h1.part and printing */
|
|
51
51
|
|
|
52
|
-
.pagesjs .pagesjs-page:first-child
|
|
52
|
+
.pagesjs .pagesjs-page.page-front:first-child {
|
|
53
53
|
padding: 0;
|
|
54
54
|
.pagesjs-header, .pagesjs-footer {
|
|
55
55
|
display: none;
|
package/css/book.min.css
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
body{font-family:Palatino,Georgia,serif}.frontmatter,.chapter{min-height:calc(100vh - 1em)}.frontmatter{background:#fff;padding-bottom:0;&>div{background:#ebf6f9;margin:0 -1em;padding:1em}& .title{margin-top:-1em;padding:20vh 1em 1em}}@media (width>=79.002em){body:not(.pagesjs) .chapter-toc{display:none}}.chapter-toc{border:1px solid var(--border-color);border-radius:5px;margin-bottom:2em;padding:1em}.chapter{&:not(.appendix) .main-number{&:before{content:"Chapter "}&:after{content:none}}& h1{border-bottom:1px solid;margin:1em auto 3em;&:has(+.epigraph){margin-bottom:2em}}}h1 .section-number{border-bottom:4px solid;margin-bottom:-4px;display:inline-block}article h2{border-bottom-style:dashed}.pagesjs .pagesjs-page:first-child
|
|
1
|
+
body{font-family:Palatino,Georgia,serif}.frontmatter,.chapter{min-height:calc(100vh - 1em)}.frontmatter{background:#fff;padding-bottom:0;&>div{background:#ebf6f9;margin:0 -1em;padding:1em}& .title{margin-top:-1em;padding:20vh 1em 1em}}@media (width>=79.002em){body:not(.pagesjs) .chapter-toc{display:none}}.chapter-toc{border:1px solid var(--border-color);border-radius:5px;margin-bottom:2em;padding:1em}.chapter{&:not(.appendix) .main-number{&:before{content:"Chapter "}&:after{content:none}}& h1{border-bottom:1px solid;margin:1em auto 3em;&:has(+.epigraph){margin-bottom:2em}}}h1 .section-number{border-bottom:4px solid;margin-bottom:-4px;display:inline-block}article h2{border-bottom-style:dashed}.pagesjs .pagesjs-page.page-front:first-child{padding:0;& .pagesjs-header,& .pagesjs-footer{display:none}& .pagesjs-front{padding:var(--paper-margin-top) var(--paper-margin-right) var(--paper-margin-bottom) var(--paper-margin-left);height:100%;margin:0;& .title{margin-top:calc(0px - var(--paper-margin-top))}&>div{margin:0 calc(0px - var(--paper-margin-right)) 0 calc(0px - var(--paper-margin-left))}}}
|
|
2
2
|
/*# sourceMappingURL=book.min.css.map */
|
package/css/book.min.css.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"mappings":"AAAA,wCAGA,mDAGA,8CAKE,mDAKA,+CAKF,yBACE,8CAIF,kGAMA,SACE,8BACE,4BACA,sBAEF,iDAGE,sCAGJ,mFAKA,sCAGA,
|
|
1
|
+
{"version":3,"mappings":"AAAA,wCAGA,mDAGA,8CAKE,mDAKA,+CAKF,yBACE,8CAIF,kGAMA,SACE,8BACE,4BACA,sBAEF,iDAGE,sCAGJ,mFAKA,sCAGA,wDAEE,iDAGA,oJAIE,wDAGA","sources":["book.css"],"sourcesContent":["body {\n font-family: Palatino, Georgia, serif;\n}\n.frontmatter, .chapter {\n min-height: calc(100vh - 1em);\n}\n.frontmatter {\n background-image: radial-gradient(#b6cee2 1px, #fff 1px);\n background-size: 2em 2em;\n background: #fff;\n padding-bottom: 0;\n & > div {\n margin: 0 -1em;\n background: #ebf6f9;\n padding: 1em;\n }\n & .title {\n padding: 20vh 1em 1em;\n margin-top: -1em;\n }\n}\n@media (min-width: 79.002em) {\n body:not(.pagesjs) .chapter-toc {\n display: none;\n }\n}\n.chapter-toc {\n border: 1px solid var(--border-color);\n border-radius: 5px;\n padding: 1em;\n margin-bottom: 2em;\n}\n.chapter {\n &:not(.appendix) .main-number {\n &::before { content: \"Chapter \"; }\n &::after { content: none; }\n }\n h1 {\n margin: 1em auto 3em;\n border-bottom: 1px solid;\n &:has(+ .epigraph) { margin-bottom: 2em; }\n }\n}\nh1 .section-number {\n display: inline-block;\n border-bottom: 4px solid;\n margin-bottom: -4px;\n}\narticle h2 { border-bottom-style: dashed; }\n/* TODO: style for h1.part and printing */\n\n.pagesjs .pagesjs-page.page-front:first-child {\n padding: 0;\n .pagesjs-header, .pagesjs-footer {\n display: none;\n }\n .pagesjs-front {\n margin: 0;\n padding: var(--paper-margin-top) var(--paper-margin-right) var(--paper-margin-bottom) var(--paper-margin-left);\n height: 100%;\n .title {\n margin-top: calc(0px - var(--paper-margin-top));\n }\n & > div {\n margin: 0 calc(0px - var(--paper-margin-right)) 0 calc(0px - var(--paper-margin-left));\n }\n }\n}\n"],"names":[]}
|
package/css/pages.css
CHANGED
|
@@ -133,6 +133,12 @@
|
|
|
133
133
|
margin-left: calc(0px - var(--paper-margin-left));
|
|
134
134
|
transform: none;
|
|
135
135
|
}
|
|
136
|
+
/* the page of a float that takes the whole page (the class is set by pages.js): center it */
|
|
137
|
+
&.page-float .pagesjs-body {
|
|
138
|
+
display: flex;
|
|
139
|
+
flex-direction: column;
|
|
140
|
+
justify-content: safe center; /* (a float taller than the page starts at the top) */
|
|
141
|
+
}
|
|
136
142
|
.footnotes {
|
|
137
143
|
margin-top: 1.5em;
|
|
138
144
|
}
|
|
@@ -195,7 +201,7 @@
|
|
|
195
201
|
margin-top: var(--page-footer-top);
|
|
196
202
|
align-items: start;
|
|
197
203
|
&::before {
|
|
198
|
-
content:
|
|
204
|
+
content: attr(data-page-url);
|
|
199
205
|
}
|
|
200
206
|
&::after {
|
|
201
207
|
content: attr(data-page-number);
|
|
@@ -208,9 +214,7 @@
|
|
|
208
214
|
}
|
|
209
215
|
@media only screen {
|
|
210
216
|
.pagesjs {
|
|
211
|
-
|
|
212
|
-
background: #f7f7f7;
|
|
213
|
-
}
|
|
217
|
+
background: #f7f7f7;
|
|
214
218
|
.pagesjs-page {
|
|
215
219
|
background: white;
|
|
216
220
|
}
|
package/css/pages.min.css
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
:root{--paper-width:210mm;--paper-height:297mm;--paper-margin-top:40px;--paper-margin-right:80px;--paper-margin-bottom:40px;--paper-margin-left:80px;--page-header-height:40px;--page-header-bottom:40px;--page-footer-height:40px;--page-footer-top:40px}@page{size:var(--paper-width) var(--paper-height);margin:0}@page multiple{margin-top:var(--paper-margin-top);margin-bottom:var(--paper-margin-bottom)}.page-multiple{page:multiple}.pagesjs{flex-wrap:wrap;justify-content:center;gap:5mm;max-width:100%;margin:5mm;padding:0;display:flex;& .pagesjs-front,& .chapter{min-height:unset;box-shadow:none}&>*,&:not(:has(.pagesjs-front)):has(.chapter-toc) #TOC:not(.chapter-toc){display:none}& .pagesjs-page{width:var(--paper-width);height:var(--paper-height);padding:var(--paper-margin-top) var(--paper-margin-right) var(--paper-margin-bottom) var(--paper-margin-left);break-after:page;flex-direction:column;justify-content:space-between;display:flex;overflow:hidden;& img{max-width:100%}& .chapter-before,& .chapter-after,& .buttons:has(+.chapter-before){display:none}& #TOC{border:none;margin-left:auto;padding:0;&:not(.chapter-toc):is(.fragment-first,:not(.pagesjs-fragmented)):before{content:"Contents";margin-bottom:1em;font-size:1.5em;font-weight:700;display:block}& a{display:flex;&:after{content:attr(data-page-number);align-self:end;margin-left:1ch}& .section-number{margin-right:.3em}& .toc-text{flex:1 0;position:relative;overflow:hidden;&:after{content:"";border-bottom:1px dashed;width:100%;margin-left:1ch;position:absolute;bottom:1.5ex}}}}& .pagesjs-wrap{box-shadow:none!important;float:none!important;background:0 0!important;border:none!important;width:auto!important;max-width:none!important;height:auto!important;min-height:0!important;margin:0!important;padding:0!important;display:block!important;position:static!important;transform:none!important}& .pagesjs-run{display:block}& .pagesjs-fragmented{&:not(.fragment-first){border-top:none;margin-top:0;padding-top:0;&>thead{opacity:.5}}&:not(.fragment-last){border-bottom:none;margin-bottom:0;padding-bottom:0;&>tfoot{opacity:.5}}}& li.pagesjs-fragmented:not(.fragment-first)::marker{content:""}& .fullwidth{float:none;max-width:none;width:var(--paper-width);margin-left:calc(0px - var(--paper-margin-left));transform:none}& .footnotes{margin-top:1.5em}& .footnotes:before{content:"";border-top:1px solid;max-width:20em;display:block}&:has(.side-left,.embed-left) .pagesjs-body{padding-left:calc(0px - var(--side-margin));& .fullwidth{transform:translate(var(--side-margin))}}&:has(.side-right,.embed-right) .pagesjs-body{padding-right:calc(0px - var(--side-margin))}& .side{background:0 0;font-size:.9em}}}.pagesjs>.pagesjs-progress{z-index:9999;color:#fff;background:#000000bf;border-radius:1em;padding:.3em .8em;font:14px sans-serif;display:block;position:fixed;top:50%;left:50%;transform:translate(-50%,-50%)}.pagesjs-settle .pagesjs-body{padding:0!important}.pagesjs-header,.pagesjs-footer{justify-content:space-between;font-size:.9em;display:flex}.pagesjs-header{flex:0 0 var(--page-header-height);margin-bottom:var(--page-header-bottom);align-items:end;&:before{content:attr(data-main-title)}&:after{content:attr(data-page-title)}}.pagesjs-footer{flex:0 0 var(--page-footer-height);margin-top:var(--page-footer-top);align-items:start;&:before{content:
|
|
1
|
+
:root{--paper-width:210mm;--paper-height:297mm;--paper-margin-top:40px;--paper-margin-right:80px;--paper-margin-bottom:40px;--paper-margin-left:80px;--page-header-height:40px;--page-header-bottom:40px;--page-footer-height:40px;--page-footer-top:40px}@page{size:var(--paper-width) var(--paper-height);margin:0}@page multiple{margin-top:var(--paper-margin-top);margin-bottom:var(--paper-margin-bottom)}.page-multiple{page:multiple}.pagesjs{flex-wrap:wrap;justify-content:center;gap:5mm;max-width:100%;margin:5mm;padding:0;display:flex;& .pagesjs-front,& .chapter{min-height:unset;box-shadow:none}&>*,&:not(:has(.pagesjs-front)):has(.chapter-toc) #TOC:not(.chapter-toc){display:none}& .pagesjs-page{width:var(--paper-width);height:var(--paper-height);padding:var(--paper-margin-top) var(--paper-margin-right) var(--paper-margin-bottom) var(--paper-margin-left);break-after:page;flex-direction:column;justify-content:space-between;display:flex;overflow:hidden;& img{max-width:100%}& .chapter-before,& .chapter-after,& .buttons:has(+.chapter-before){display:none}& #TOC{border:none;margin-left:auto;padding:0;&:not(.chapter-toc):is(.fragment-first,:not(.pagesjs-fragmented)):before{content:"Contents";margin-bottom:1em;font-size:1.5em;font-weight:700;display:block}& a{display:flex;&:after{content:attr(data-page-number);align-self:end;margin-left:1ch}& .section-number{margin-right:.3em}& .toc-text{flex:1 0;position:relative;overflow:hidden;&:after{content:"";border-bottom:1px dashed;width:100%;margin-left:1ch;position:absolute;bottom:1.5ex}}}}& .pagesjs-wrap{box-shadow:none!important;float:none!important;background:0 0!important;border:none!important;width:auto!important;max-width:none!important;height:auto!important;min-height:0!important;margin:0!important;padding:0!important;display:block!important;position:static!important;transform:none!important}& .pagesjs-run{display:block}& .pagesjs-fragmented{&:not(.fragment-first){border-top:none;margin-top:0;padding-top:0;&>thead{opacity:.5}}&:not(.fragment-last){border-bottom:none;margin-bottom:0;padding-bottom:0;&>tfoot{opacity:.5}}}& li.pagesjs-fragmented:not(.fragment-first)::marker{content:""}& .fullwidth{float:none;max-width:none;width:var(--paper-width);margin-left:calc(0px - var(--paper-margin-left));transform:none}&.page-float .pagesjs-body{flex-direction:column;justify-content:safe center;display:flex}& .footnotes{margin-top:1.5em}& .footnotes:before{content:"";border-top:1px solid;max-width:20em;display:block}&:has(.side-left,.embed-left) .pagesjs-body{padding-left:calc(0px - var(--side-margin));& .fullwidth{transform:translate(var(--side-margin))}}&:has(.side-right,.embed-right) .pagesjs-body{padding-right:calc(0px - var(--side-margin))}& .side{background:0 0;font-size:.9em}}}.pagesjs>.pagesjs-progress{z-index:9999;color:#fff;background:#000000bf;border-radius:1em;padding:.3em .8em;font:14px sans-serif;display:block;position:fixed;top:50%;left:50%;transform:translate(-50%,-50%)}.pagesjs-settle .pagesjs-body{padding:0!important}.pagesjs-header,.pagesjs-footer{justify-content:space-between;font-size:.9em;display:flex}.pagesjs-header{flex:0 0 var(--page-header-height);margin-bottom:var(--page-header-bottom);align-items:end;&:before{content:attr(data-main-title)}&:after{content:attr(data-page-title)}}.pagesjs-footer{flex:0 0 var(--page-footer-height);margin-top:var(--page-footer-top);align-items:start;&:before{content:attr(data-page-url)}&:after{content:attr(data-page-number)}}.pagesjs-body{flex-grow:1;min-height:0;position:relative}@media only screen{.pagesjs{background:#f7f7f7;& .pagesjs-page{background:#fff}& .page-multiple{overflow-y:auto}}.pagesjs-filling{display:block;& .pagesjs-page{opacity:0;height:auto}}}@media print{.pagesjs{gap:0;margin:0;& .page-multiple{height:auto;padding-top:0;padding-bottom:0}}}
|
|
2
2
|
/*# sourceMappingURL=pages.min.css.map */
|
package/css/pages.min.css.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"mappings":"AAAA,0PAYA,2DAIA,2FAIA,6BAGA,wGAQE,6DAIA,sFAGA,oRASE,qBAGA,iFAGA,8CAIE,4JAOA,iBAEE,sEAKA,oCAGA,uDAIE,yGAaN,2TAeA,6BAIA,sBACE,kEAIE,oBAEF,0EAIE,qBAIJ,gEAGA,
|
|
1
|
+
{"version":3,"mappings":"AAAA,0PAYA,2DAIA,2FAIA,6BAGA,wGAQE,6DAIA,sFAGA,oRASE,qBAGA,iFAGA,8CAIE,4JAOA,iBAEE,sEAKA,oCAGA,uDAIE,yGAaN,2TAeA,6BAIA,sBACE,kEAIE,oBAEF,0EAIE,qBAIJ,gEAGA,gIAQA,0FAKA,8BAGA,iFAMA,wFAEE,sDAIF,2FAGA,wCAMJ,8MAaA,kDAIA,0FAKA,2GAIE,uCAGA,uCAIF,uGAIE,qCAGA,wCAIF,yDAKA,mBACE,4BAEE,gCAGA,kCAIF,+BAEE,wCAMJ,aACE,wBAGE","sources":["pages.css"],"sourcesContent":[":root {\n --paper-width: 210mm;\n --paper-height: 297mm;\n --paper-margin-top: 40px;\n --paper-margin-right: 80px;\n --paper-margin-bottom: 40px;\n --paper-margin-left: 80px;\n --page-header-height: 40px;\n --page-header-bottom: 40px;\n --page-footer-height: 40px;\n --page-footer-top: 40px;\n}\n@page {\n size: var(--paper-width) var(--paper-height);\n margin: 0;\n}\n@page multiple {\n margin-top: var(--paper-margin-top);\n margin-bottom: var(--paper-margin-bottom);\n}\n.page-multiple {\n page: multiple;\n}\n.pagesjs {\n padding: 0;\n max-width: 100%;\n margin: 5mm;\n display: flex;\n justify-content: center;\n flex-wrap: wrap;\n gap: 5mm;\n .pagesjs-front, .chapter {\n min-height: unset;\n box-shadow: none;\n }\n & > *, &:not(:has(.pagesjs-front)):has(.chapter-toc) #TOC:not(.chapter-toc) {\n display: none;\n }\n .pagesjs-page {\n width: var(--paper-width);\n height: var(--paper-height);\n padding: var(--paper-margin-top) var(--paper-margin-right) var(--paper-margin-bottom) var(--paper-margin-left);\n break-after: page;\n display: flex;\n flex-direction: column;\n justify-content: space-between;\n overflow: hidden;\n img {\n max-width: 100%;\n }\n .chapter-before, .chapter-after, .buttons:has(+ .chapter-before) {\n display: none;\n }\n #TOC {\n border: none;\n padding: 0;\n margin-left: auto;\n &:not(.chapter-toc):is(.fragment-first, :not(.pagesjs-fragmented))::before {\n content: \"Contents\";\n display: block;\n font-weight: bold;\n font-size: 1.5em;\n margin-bottom: 1em;\n }\n a {\n display: flex;\n &::after {\n content: attr(data-page-number);\n align-self: end;\n margin-left: 1ch;\n }\n .section-number {\n margin-right: .3em;\n }\n .toc-text {\n position: relative;\n flex: 1 0;\n overflow: hidden;\n &::after {\n content: \"\";\n width: 100%;\n position: absolute;\n bottom: 1.5ex;\n margin-left: 1ch;\n border-bottom: dashed 1px;\n }\n }\n }\n }\n /* wrappers cloned from the content root and its ancestors: keep their\n context for CSS selectors, but not their boxes */\n .pagesjs-wrap {\n display: block !important;\n margin: 0 !important;\n padding: 0 !important;\n border: none !important;\n box-shadow: none !important;\n background: none !important;\n width: auto !important;\n max-width: none !important;\n min-height: 0 !important;\n height: auto !important;\n float: none !important;\n position: static !important;\n transform: none !important;\n }\n .pagesjs-run {\n display: block;\n }\n /* pieces of a fragmented element: slice it (instead of decorating each piece) */\n .pagesjs-fragmented {\n &:not(.fragment-first) {\n border-top: none;\n margin-top: 0;\n padding-top: 0;\n & > thead { opacity: .5; }\n }\n &:not(.fragment-last) {\n border-bottom: none;\n margin-bottom: 0;\n padding-bottom: 0;\n & > tfoot { opacity: .5; }\n }\n }\n /* a list item continued from the previous page has no marker */\n li.pagesjs-fragmented:not(.fragment-first)::marker {\n content: \"\";\n }\n .fullwidth {\n float: none;\n max-width: none;\n width: var(--paper-width);\n margin-left: calc(0px - var(--paper-margin-left));\n transform: none;\n }\n /* the page of a float that takes the whole page (the class is set by pages.js): center it */\n &.page-float .pagesjs-body {\n display: flex;\n flex-direction: column;\n justify-content: safe center; /* (a float taller than the page starts at the top) */\n }\n .footnotes {\n margin-top: 1.5em;\n }\n .footnotes::before {\n content: \"\";\n display: block;\n max-width: 20em;\n border-top: solid 1px;\n }\n &:has(.side-left, .embed-left) .pagesjs-body {\n padding-left: calc(0px - var(--side-margin));\n .fullwidth {\n transform: translate(var(--side-margin));\n }\n }\n &:has(.side-right, .embed-right) .pagesjs-body {\n padding-right: calc(0px - var(--side-margin));\n }\n .side {\n font-size: .9em;\n background: none;\n }\n }\n}\n.pagesjs > .pagesjs-progress {\n display: block;\n position: fixed;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n z-index: 9999;\n padding: .3em .8em;\n border-radius: 1em;\n background: rgba(0, 0, 0, .75);\n color: white;\n font: 14px sans-serif;\n}\n.pagesjs-settle .pagesjs-body {\n /* the probe page that holds all content has sides, but normal pages don't */\n padding: 0 !important;\n}\n.pagesjs-header, .pagesjs-footer {\n font-size: .9em;\n display: flex;\n justify-content: space-between;\n}\n.pagesjs-header {\n flex: 0 0 var(--page-header-height);\n margin-bottom: var(--page-header-bottom);\n align-items: end;\n &::before {\n content: attr(data-main-title);\n }\n &::after {\n content: attr(data-page-title);\n }\n}\n.pagesjs-footer {\n flex: 0 0 var(--page-footer-height);\n margin-top: var(--page-footer-top);\n align-items: start;\n &::before {\n content: attr(data-page-url);\n }\n &::after {\n content: attr(data-page-number);\n }\n}\n.pagesjs-body {\n flex-grow: 1;\n min-height: 0; /* don't let the body push the footer down when content overhangs by a few pixels */\n position: relative;\n}\n@media only screen {\n .pagesjs {\n background: #f7f7f7;\n .pagesjs-page {\n background: white;\n }\n .page-multiple {\n overflow-y: auto;\n }\n }\n .pagesjs-filling {\n display: block;\n .pagesjs-page {\n opacity: 0; /* don't show the page that is being filled (only the progress) */\n height: auto;\n }\n }\n}\n@media print {\n .pagesjs {\n margin: 0;\n gap: 0;\n .page-multiple {\n padding-top: 0;\n padding-bottom: 0;\n height: auto;\n }\n }\n}\n"],"names":[]}
|
package/js/pages.js
CHANGED
|
@@ -2,20 +2,28 @@
|
|
|
2
2
|
// each box holds as much content as possible without exceeding the page height.
|
|
3
3
|
//
|
|
4
4
|
// How it works:
|
|
5
|
-
// 1. The content root (e.g., <main>) is emptied, and its
|
|
6
|
-
//
|
|
7
|
-
//
|
|
8
|
-
// 2.
|
|
5
|
+
// 1. The content root (e.g., <main>) is emptied, and all its content is laid out
|
|
6
|
+
// once on a probe page (probe()), so that content that reacts to the page width
|
|
7
|
+
// settles and the positions of the blocks are known.
|
|
8
|
+
// 2. The children are put on pages one by one (fill() -> place()). Only the current
|
|
9
|
+
// page is in the DOM, so measuring it is cheap (box.scrollHeight > H means the
|
|
10
|
+
// page overflows), but each measurement is a forced layout; so children that
|
|
11
|
+
// surely fit, according to their positions on the probe page, are put on a page
|
|
12
|
+
// together and measured once (fitting()).
|
|
13
|
+
// 3. When an element makes the page overflow, split() puts as much of it as
|
|
9
14
|
// possible on the current page and returns the rest, which goes to the next
|
|
10
15
|
// page. An element can be broken in different ways (kindOf()): block elements
|
|
11
16
|
// (e.g., lists and quotes) are cloned and their children are moved into the
|
|
12
|
-
// clone
|
|
17
|
+
// clone as in step 2, with the child that overflows broken recursively; text,
|
|
13
18
|
// table rows, and code lines are broken by lines/rows. Every piece of a broken
|
|
14
19
|
// element has the classes pagesjs-fragmented, fragment-first, fragment-last
|
|
15
20
|
// (the pieces can be styled differently in pages.css).
|
|
16
|
-
//
|
|
21
|
+
// A float (see isFloat()) that does not fit is not broken: it waits for the next
|
|
22
|
+
// page (class pagesjs-float), and the content after it fills the space. A float
|
|
23
|
+
// that is very tall takes a whole page (nothing else fits on it), centered.
|
|
24
|
+
// 4. Each page contains empty copies of the ancestors of the content root, so
|
|
17
25
|
// CSS selectors that depend on them still work (see ctx()).
|
|
18
|
-
//
|
|
26
|
+
// 5. In the end, page numbers and titles are added to the headers/footers.
|
|
19
27
|
(d => {
|
|
20
28
|
|
|
21
29
|
// --- Utilities -----------------------------------------------------
|
|
@@ -46,12 +54,16 @@
|
|
|
46
54
|
const
|
|
47
55
|
book = $$('h1').length > 1, // a document with multiple <h1> is a book (chapters)
|
|
48
56
|
// elements that are never broken across pages (CSS break-inside: avoid also works)
|
|
49
|
-
atomic = 'h1,h2,h3,h4,h5,h6,hr,img,svg,video,canvas,iframe,object,embed,math,mjx-container,figure,.figure,.caption,details',
|
|
57
|
+
atomic = 'h1,h2,h3,h4,h5,h6,hr,img,svg,video,canvas,iframe,object,embed,math,mjx-container,figure,.figure,.float,.caption,details',
|
|
50
58
|
// classes of the pieces of a broken element
|
|
51
59
|
fr_cls = 'pagesjs-fragmented', fr_1 = 'fragment-first', fr_2 = 'fragment-last',
|
|
52
60
|
// pixels that the content may hang over the bottom of a page (the page has a
|
|
53
61
|
// much larger padding there), since sizes are rounded and the browsers differ
|
|
54
62
|
tol = 3,
|
|
63
|
+
// floats taller than this percentage of the page body take a whole page (see stays());
|
|
64
|
+
// set via <body data-pages-float-page="...">, e.g., 100 for never (in LaTeX, a float
|
|
65
|
+
// taller than 70% of the page, \topfraction, can't share a page with text at its top)
|
|
66
|
+
floatPage = parseFloat(d.body.dataset.pagesFloatPage) || 70,
|
|
55
67
|
// top/bottom page margin
|
|
56
68
|
tb = ['top', 'bottom'].map(i =>
|
|
57
69
|
num(style(d.documentElement).getPropertyValue(`--paper-margin-${i}`))
|
|
@@ -61,7 +73,9 @@
|
|
|
61
73
|
boxes = [], // all pages
|
|
62
74
|
wrapped = new WeakSet(), // elements whose runs of inline nodes have been wrapped
|
|
63
75
|
guessed = new WeakSet(), // pages whose number of physical pages is an estimate (see calcPages())
|
|
76
|
+
floats = [], // the floats that wait for a page (see putFloats())
|
|
64
77
|
notes = new Map(), // the items of each note (footnote or citation), by its marker (see detachNotes())
|
|
78
|
+
probeY = new WeakMap(), // the bottoms of the blocks on the probe page (see fitting())
|
|
65
79
|
hold = make('div'); // a hidden container for elements that need styles
|
|
66
80
|
tpl.innerHTML = `<div class="pagesjs-header"></div>
|
|
67
81
|
<div class="pagesjs-body"></div>
|
|
@@ -74,6 +88,8 @@
|
|
|
74
88
|
wrap = [], // the ancestors of the content root (outermost first)
|
|
75
89
|
H, B, // the height of a page and of its body
|
|
76
90
|
H_min, H_line, // the height of a single-line paragraph (with margins) and of a line
|
|
91
|
+
used, // the height of the content of the page when it was last measured (see overflows())
|
|
92
|
+
whole, // the float that takes the page that is being filled (see takePage())
|
|
77
93
|
main_title, // the title of the document
|
|
78
94
|
probed, // the content that is on the probe page (see probe())
|
|
79
95
|
pending, // the rest of the pagination, which is waiting for the probe
|
|
@@ -103,9 +119,13 @@
|
|
|
103
119
|
return m;
|
|
104
120
|
}
|
|
105
121
|
// the height of the page without the margin at the end of its content
|
|
106
|
-
function pageHeight() { syncNotes(); return rect(box).height - trailingMargin(); }
|
|
122
|
+
function pageHeight() { syncNotes(); return crowded() ? Infinity : rect(box).height - trailingMargin(); }
|
|
107
123
|
// does the page overflow?
|
|
108
|
-
function overflows() { syncNotes(); return box.scrollHeight - trailingMargin() > H; }
|
|
124
|
+
function overflows() { syncNotes(); return (used = box.scrollHeight - trailingMargin()) > H || crowded(); }
|
|
125
|
+
// Nothing fits on the page of a float that takes it: is the page taken, and is there
|
|
126
|
+
// anything after the float?
|
|
127
|
+
function taken() { return !!whole && box_body.contains(whole); }
|
|
128
|
+
function crowded() { return taken() && hasAround(whole, 'next'); }
|
|
109
129
|
// The notes are not measured inline (where they are floats next to their references),
|
|
110
130
|
// but in a block after the page body, as in the end: put the notes of the references
|
|
111
131
|
// that are on the page there (and take the others off).
|
|
@@ -119,7 +139,7 @@
|
|
|
119
139
|
}
|
|
120
140
|
// start the next page and finish current page
|
|
121
141
|
function nextPage(el, callback) {
|
|
122
|
-
const cur = box; cur.after(newPage(el)); callback && callback(); finish(cur);
|
|
142
|
+
const cur = box; cur.after(newPage(el)); callback && callback(); putFloats(); finish(cur);
|
|
123
143
|
}
|
|
124
144
|
// compute page numbers and temporarily remove the box
|
|
125
145
|
function finish(box) {
|
|
@@ -175,13 +195,15 @@
|
|
|
175
195
|
// The container for the content on the current page. It is a chain of empty
|
|
176
196
|
// clones of the content root and its ancestors (i.e., the original context), so
|
|
177
197
|
// CSS selectors that depend on them (e.g., `main h2`) still apply on pages.
|
|
198
|
+
// an empty clone of el that keeps its context for CSS selectors but not its box
|
|
199
|
+
function wrapper(el) {
|
|
200
|
+
const c = el.cloneNode(); addCls(c, 'pagesjs-wrap'); rmCls(c, fr_cls, fr_1, fr_2);
|
|
201
|
+
return c;
|
|
202
|
+
}
|
|
178
203
|
function ctx() {
|
|
179
204
|
if (!wrap.length) return box_body;
|
|
180
205
|
if (!box_ctx || !box_body.contains(box_ctx)) {
|
|
181
|
-
box_ctx = wrap.reduce((p, el) =>
|
|
182
|
-
const c = el.cloneNode(); addCls(c, 'pagesjs-wrap');
|
|
183
|
-
return p.appendChild(c);
|
|
184
|
-
}, box_body);
|
|
206
|
+
box_ctx = wrap.reduce((p, el) => p.appendChild(wrapper(el)), box_body);
|
|
185
207
|
}
|
|
186
208
|
return box_ctx;
|
|
187
209
|
}
|
|
@@ -206,8 +228,8 @@
|
|
|
206
228
|
));
|
|
207
229
|
} else {
|
|
208
230
|
// in a book, a chapter (a container of <h1>) starts on a new page
|
|
209
|
-
if (book && box.innerText !== '' && $('h1', el)) nextPage();
|
|
210
|
-
if (el.innerText.trim() && (syncNotes(), H - box.scrollHeight < H_min)) nextPage();
|
|
231
|
+
if (book && box.innerText !== '' && $('h1', el)) flush(), nextPage();
|
|
232
|
+
if (el.innerText.trim() && (taken() || (syncNotes(), H - box.scrollHeight < H_min))) nextPage();
|
|
211
233
|
yield* place(el, more);
|
|
212
234
|
}
|
|
213
235
|
}
|
|
@@ -224,6 +246,7 @@
|
|
|
224
246
|
el = split(el, c, 'block', more);
|
|
225
247
|
} else {
|
|
226
248
|
c.append(el);
|
|
249
|
+
if (isFloat(el) && !stays(el, c)) return;
|
|
227
250
|
if (!overflows()) return;
|
|
228
251
|
el = split(el, c, undefined, more);
|
|
229
252
|
}
|
|
@@ -241,7 +264,7 @@
|
|
|
241
264
|
// (for a block, prev is determined after it is cut, to avoid laying it out)
|
|
242
265
|
const k = kind || kindOf(el), prev = k === 'block' ? undefined : hasPrev(el),
|
|
243
266
|
first = !has(el, fr_cls), r = k && splitters[k](el, container, prev, first, more);
|
|
244
|
-
if (!r) return prev && (el.remove(), el);
|
|
267
|
+
if (!r) return prev && (el.remove(), isFloat(el) ? defer(el, container) : el);
|
|
245
268
|
const [head, rest] = r;
|
|
246
269
|
if (blank(head)) return head.remove(), rest; // nothing fits
|
|
247
270
|
if (rest) {
|
|
@@ -254,18 +277,70 @@
|
|
|
254
277
|
return rest;
|
|
255
278
|
}
|
|
256
279
|
|
|
280
|
+
// Floats are captioned figures and elements with the class "float". They are never
|
|
281
|
+
// broken: one that does not fit where it is waits for the next page, and the content
|
|
282
|
+
// after it fills the page, as in LaTeX. They keep their order (a float waits if an
|
|
283
|
+
// earlier one does), and wait at most until the end of the chapter (book) or the root.
|
|
284
|
+
function isFloat(el) {
|
|
285
|
+
return el.matches('.float') || el.matches('figure, .figure') && !!$('figcaption, .caption', el);
|
|
286
|
+
}
|
|
287
|
+
// does a float take a whole page?
|
|
288
|
+
function isTall(f) { return rect(f).height > B * floatPage / 100; }
|
|
289
|
+
// let a float take the page: overflows() keeps everything else off the page, and
|
|
290
|
+
// the class makes the body center the float vertically (see pages.css)
|
|
291
|
+
function takePage(f) { whole = f; addCls(box, 'page-float'); }
|
|
292
|
+
// Does a float (attached to container) stay where it is? Not if floats wait before it,
|
|
293
|
+
// or if it takes a whole page and there is content before it: it goes to a page of its own.
|
|
294
|
+
function stays(f, container) {
|
|
295
|
+
const tall = isTall(f);
|
|
296
|
+
if (floats.length || tall && hasPrev(f)) return defer(f, container, tall), false;
|
|
297
|
+
tall && takePage(f);
|
|
298
|
+
return true;
|
|
299
|
+
}
|
|
300
|
+
// does the next page belong to a float that takes a page? (then the rest of what is
|
|
301
|
+
// broken on this page is not on the next page, and should not be a lone line)
|
|
302
|
+
function tallWaiting() { return floats[0]?.[2]; }
|
|
303
|
+
// (a float keeps the wrappers of the pieces of the elements that it was in, e.g., a
|
|
304
|
+
// chapter, so the CSS selectors that depend on them still work on the next page)
|
|
305
|
+
function defer(el, container, tall) {
|
|
306
|
+
const chain = [];
|
|
307
|
+
for (let p = container, top = ctx(); p && p !== top; p = p.parentNode) chain.unshift(wrapper(p));
|
|
308
|
+
el.remove(); floats.push([el, chain, tall]);
|
|
309
|
+
}
|
|
310
|
+
// put the waiting floats at the top of the new page, in order, as many as fit (the
|
|
311
|
+
// first one stays even if it is too big, since it can't wait any longer)
|
|
312
|
+
function putFloats() {
|
|
313
|
+
while (floats.length) {
|
|
314
|
+
const [f, chain] = floats[0], out = chain[0] || f;
|
|
315
|
+
chain.reduce((p, c) => p.appendChild(c), ctx()).append(f);
|
|
316
|
+
// the first float on the page stays (centered if it takes the page); the others
|
|
317
|
+
// only if they are short and fit
|
|
318
|
+
if (hasPrev(out)) {
|
|
319
|
+
if (isTall(f) || overflows()) return out.remove();
|
|
320
|
+
} else isTall(f) && takePage(f);
|
|
321
|
+
floats.shift(); addCls(f, 'pagesjs-float');
|
|
322
|
+
}
|
|
323
|
+
}
|
|
324
|
+
function flush() {
|
|
325
|
+
putFloats();
|
|
326
|
+
while (floats.length) nextPage();
|
|
327
|
+
}
|
|
328
|
+
|
|
257
329
|
// is an element a block that is too big to be put on a page as a whole?
|
|
258
330
|
function isBigBlock(el) {
|
|
259
|
-
return !['TABLE', 'PRE'].includes(el.tagName) && el.getElementsByTagName('*').length > 300;
|
|
331
|
+
return !isFloat(el) && !['TABLE', 'PRE'].includes(el.tagName) && el.getElementsByTagName('*').length > 300;
|
|
260
332
|
}
|
|
261
333
|
function blank(el) { return !firstEl(el) && !el.textContent.trim(); }
|
|
262
|
-
// is there anything
|
|
263
|
-
|
|
334
|
+
// is there anything before ('previous') or after ('next') el on the page (if there is
|
|
335
|
+
// something before it, el may go to the next page)?
|
|
336
|
+
function hasAround(el, side) {
|
|
337
|
+
const k = side + 'ElementSibling';
|
|
264
338
|
for (; el && el !== box_body; el = el.parentNode)
|
|
265
|
-
for (let p = el
|
|
339
|
+
for (let p = el[k]; p; p = p[k])
|
|
266
340
|
if (rect(p).height) return true;
|
|
267
341
|
return false;
|
|
268
342
|
}
|
|
343
|
+
function hasPrev(el) { return hasAround(el, 'previous'); }
|
|
269
344
|
function inFlow(cs) {
|
|
270
345
|
return cs.float === 'none' && !['absolute', 'fixed'].includes(cs.position);
|
|
271
346
|
}
|
|
@@ -347,6 +422,29 @@
|
|
|
347
422
|
|
|
348
423
|
// --- Breaking elements ---------------------------------------------
|
|
349
424
|
|
|
425
|
+
// Measuring the page after each child is slow (a forced layout), so put several children
|
|
426
|
+
// on it at once when they surely fit: the nodes (in order) that end a line above the page
|
|
427
|
+
// bottom, going by their distances on the probe page from the last child on the page. If
|
|
428
|
+
// they turn out not to fit, they are taken back, so the estimate affects the speed but not
|
|
429
|
+
// the result. The children of the content root need the room that fill() asks for (H_min,
|
|
430
|
+
// and as much again for the margin after the previous child).
|
|
431
|
+
function fitting(head, nodes, root) {
|
|
432
|
+
const prev = lastEl(head), y0 = prev && !has(prev, fr_cls) ? probeY.get(prev) : undefined, run = [];
|
|
433
|
+
if (y0 === undefined || !used) return run;
|
|
434
|
+
let y = y0, n = 0;
|
|
435
|
+
for (const c of nodes) {
|
|
436
|
+
if (c.nodeType === 1) {
|
|
437
|
+
const y1 = probeY.get(c);
|
|
438
|
+
if (!(y1 >= y) || c.matches(`.${fr_cls}, .pagesjs-page`) || isFloat(c) || isBigBlock(c) || $('.pagesjs-note', c) ||
|
|
439
|
+
used + y1 - y0 + H_line > H || root && (used + y - y0 + 2 * H_min > H || book && $('h1', c))) break;
|
|
440
|
+
y = y1;
|
|
441
|
+
}
|
|
442
|
+
run.push(c);
|
|
443
|
+
c.nodeType === 1 && (n = run.length);
|
|
444
|
+
}
|
|
445
|
+
return run.slice(0, n);
|
|
446
|
+
}
|
|
447
|
+
function* siblings(n) { for (; n; n = n.nextSibling) yield n; }
|
|
350
448
|
// move children to a clone of el one by one until the page is full, and split
|
|
351
449
|
// the child that overflows recursively, so elements can be broken at any depth
|
|
352
450
|
function splitBlock(el, container, prev, first, more) {
|
|
@@ -359,10 +457,16 @@
|
|
|
359
457
|
endFrag(item);
|
|
360
458
|
const big = isBigBlock(item);
|
|
361
459
|
if (!big) {
|
|
362
|
-
head
|
|
460
|
+
const run = fitting(head, siblings(item));
|
|
461
|
+
run.length || run.push(item);
|
|
462
|
+
head.append(...run);
|
|
463
|
+
if (isFloat(item) && !stays(item, head)) continue;
|
|
363
464
|
if (!overflows()) continue;
|
|
465
|
+
// (the estimate was too optimistic) take back all but the first
|
|
466
|
+
if (run.length > 1 && (el.prepend(...run.slice(1)), !overflows())) continue;
|
|
364
467
|
}
|
|
365
468
|
const n = nChild(head), rest = split(item, head, big ? 'block' : undefined, more || !!firstEl(el));
|
|
469
|
+
used = null; // (the page has changed)
|
|
366
470
|
if (rest) { partial = nChild(head) > n; el.prepend(rest); break; }
|
|
367
471
|
}
|
|
368
472
|
blank(el) && fitLastPiece(head, el, prev); // (may push children to el)
|
|
@@ -436,8 +540,9 @@
|
|
|
436
540
|
if (k > 0 && !overflows()) break;
|
|
437
541
|
}
|
|
438
542
|
// avoid a widow only when it is the very last line of the content, i.e.,
|
|
439
|
-
// alone on a page (an orphan, or a widow followed by more content, is fine)
|
|
440
|
-
|
|
543
|
+
// alone on a page (an orphan, or a widow followed by more content, is fine); or when
|
|
544
|
+
// it would come after a page of a float (the paragraph moves entirely if it has 2 lines)
|
|
545
|
+
if (n - k === 1 && (k > 1 && !more || (k > 1 || prev) && tallWaiting())) cutLine();
|
|
441
546
|
return [el, rest];
|
|
442
547
|
}
|
|
443
548
|
|
|
@@ -597,8 +702,14 @@
|
|
|
597
702
|
})();
|
|
598
703
|
});
|
|
599
704
|
}
|
|
705
|
+
// record the bottoms of the blocks that may be children of a broken element
|
|
706
|
+
function markY(el) {
|
|
707
|
+
probeY.set(el, rect(el).bottom);
|
|
708
|
+
el.matches(`p, pre, table, ${atomic}`) || kids(el).forEach(markY);
|
|
709
|
+
}
|
|
600
710
|
function unprobe() {
|
|
601
711
|
if (!probed) return;
|
|
712
|
+
probed.forEach(ch => ch.forEach(markY)); // (before removing anything, to lay out only once)
|
|
602
713
|
probed.forEach(ch => ch.forEach(el => el.remove()));
|
|
603
714
|
box_body.innerHTML = ''; box_ctx = null; wrap = [];
|
|
604
715
|
rmCls(box, 'pagesjs-settle');
|
|
@@ -615,6 +726,8 @@
|
|
|
615
726
|
// add page number, title, etc. to data-* attributes of page elements
|
|
616
727
|
function numberPages() {
|
|
617
728
|
let page_title, i = 0;
|
|
729
|
+
const u = new URL(location.href); // page URL without ?paged=1, shown on the last page
|
|
730
|
+
u.searchParams.delete('paged');
|
|
618
731
|
boxes.forEach(box => {
|
|
619
732
|
if (book) {
|
|
620
733
|
if ($('.pagesjs-front', box)) return; // skip book frontmatter page
|
|
@@ -625,7 +738,8 @@
|
|
|
625
738
|
i += N;
|
|
626
739
|
addCls(box, `page-${i % 2 === 0 ? 'even' : 'odd'}`);
|
|
627
740
|
const info = {
|
|
628
|
-
'pageNumber': i, 'mainTitle': main_title, 'pageTitle': page_title
|
|
741
|
+
'pageNumber': i, 'mainTitle': main_title, 'pageTitle': page_title,
|
|
742
|
+
'pageUrl': box === boxes.at(-1) && u.href
|
|
629
743
|
};
|
|
630
744
|
[box.children[0], lastEl(box)].forEach(el => {
|
|
631
745
|
for (const key in info) info[key] && (el.dataset[key] = info[key]);
|
|
@@ -638,9 +752,8 @@
|
|
|
638
752
|
// add page numbers to TOC with data-* attributes
|
|
639
753
|
function numberToc() {
|
|
640
754
|
$$('#TOC a[href^="#"]').forEach(a => {
|
|
641
|
-
const
|
|
642
|
-
|
|
643
|
-
a.dataset.pageNumber = p ? p.dataset.pageNumber : '';
|
|
755
|
+
const p = d.getElementById(a.getAttribute('href').slice(1))?.closest('.pagesjs-page');
|
|
756
|
+
a.dataset.pageNumber = p?.children[0].dataset.pageNumber ?? '';
|
|
644
757
|
});
|
|
645
758
|
}
|
|
646
759
|
|
|
@@ -724,13 +837,22 @@
|
|
|
724
837
|
// iteratively add elements to pages
|
|
725
838
|
function* fillPages(roots, els) {
|
|
726
839
|
for (const el of $$('.pagesjs-front, .abstract, #TOC:not(.chapter-toc)')) {
|
|
840
|
+
// mark the first page if it has the frontmatter (for styling; :has() would be re-checked on every change)
|
|
841
|
+
has(el, 'pagesjs-front') && box === boxes[0] && addCls(box, 'page-front');
|
|
727
842
|
yield* fill(el);
|
|
728
843
|
book && nextPage();
|
|
729
844
|
}
|
|
730
845
|
for (const [i, el] of roots.entries()) {
|
|
731
846
|
wrap = ancestors(el); box_ctx = null;
|
|
732
847
|
book && (box.innerText === '' ? newPage(box) : nextPage());
|
|
733
|
-
|
|
848
|
+
const list = els[i];
|
|
849
|
+
for (let j = 0; j < list.length; j++) {
|
|
850
|
+
yield* fill(list[j], i < roots.length - 1 || j < list.length - 1);
|
|
851
|
+
// put the next children on the page at once if they surely fit
|
|
852
|
+
const run = fitting(ctx(), list.slice(j + 1), true);
|
|
853
|
+
run.length && (ctx().append(...run), overflows() ? run.forEach(e => e.remove()) : j += run.length);
|
|
854
|
+
}
|
|
855
|
+
flush();
|
|
734
856
|
// clean up container and self if empty
|
|
735
857
|
removeBlank(el.parentNode); removeBlank(el);
|
|
736
858
|
}
|
package/js/pages.min.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
(e=>{function t(t,n=e){return n?.querySelector(t)}function n(t,n=e){return n?n.querySelectorAll(t):[]}function o(e){return e.childElementCount}function r(e){return[...e.children]}function i(e){return e.firstElementChild}function s(e){return e.lastElementChild}function a(e){return e.getBoundingClientRect()}function c(e){return getComputedStyle(e)}function l(e){return parseFloat(e)||0}function f(e,t){return e.classList.contains(t)}function d(e,...t){e.classList.add(...t)}function u(e,...t){e.classList.remove(...t)}function p(t,n){const o=e.createElement(t);return n&&(o.className=n),o}function g(){return e.createRange()}function h(e,t){addEventListener(e,t)}function m(e){dispatchEvent(new Event(e))}const b=n("h1").length>1,T="h1,h2,h3,h4,h5,h6,hr,img,svg,video,canvas,iframe,object,embed,math,mjx-container,figure,.figure,.caption,details",N="pagesjs-fragmented",E="fragment-first",v="fragment-last",j=["top","bottom"].map(t=>l(c(e.documentElement).getPropertyValue(`--paper-margin-${t}`))),y=p("div","pagesjs-page"),C=[],H=new WeakSet,L=new WeakSet,x=new Map,M=p("div");y.innerHTML='<div class="pagesjs-header"></div>\n<div class="pagesjs-body"></div>\n<div class="pagesjs-footer"></div>',M.style.display="none";let S,w,k,O,A,P,R,B,$,W,F,q,I,V=[],z=0;function D(e){return e&&!t(".pagesjs-body",e)&&e.insertAdjacentHTML("afterbegin",y.innerHTML),S=e||y.cloneNode(!0),w=S.children[1],k=null,C.includes(S)||C.push(S),S}function X(e=w){let t=0;for(let n=s(e);n;n=s(n)){const e=c(n);if(t=Math.max(t,l(e.marginBottom)),l(e.paddingBottom)||l(e.borderBottomWidth))break}return t}function _(){return U(),a(S).height-X()}function J(){return U(),S.scrollHeight-X()>O}function U(e=S){const r=e.children[1],i=[...n(".pagesjs-note",r)].flatMap(e=>x.get(e));let s=t(":scope > .footnotes",e);if(!i.length)return s?.remove();s||r.after(s=p("div")),s.className="footnotes",(i.some((e,t)=>s.children[t]!==e)||o(s)!==i.length)&&s.replaceChildren(...i)}function Y(e,t){const n=S;n.after(D(e)),t&&t(),G(n)}function G(e){U(e);const t=e.scrollHeight;if(t-X(e.children[1])>O&&!e.dataset.pagesOffset){const o=function(e,t){let o=+e.dataset.pagesOffset;if(o)return o;if(o=Math.ceil(t/O),o<=1)return o;const r=j.concat([...n("thead",e)].map(e=>+e.offsetHeight)).reduce((e,t)=>e+t);if(!r)return o;function i(){return Math.ceil((t+(o-1)*r)/O)}let s=i();for(;s>o;)o=s,s=i();return o}(e,t);o>1&&(e.dataset.pagesOffset=o,L.add(e))}e.remove(),q&&(q.textContent=`Paginating: ${++z} pages done`)}function K(t){const n=[];for(;t&&t!==e.body;t=t.parentNode)n.unshift(t);return n}function Q(){return V.length?(k&&w.contains(k)||(k=V.reduce((e,t)=>{const n=t.cloneNode();return d(n,"pagesjs-wrap"),e.appendChild(n)},w)),k):w}function Z(e){if(!e||"BODY"===e.tagName)return!1;const t=!("P"===e.tagName?e.innerHTML:e.innerText).trim();return t&&e.remove(),t}function*ee(e,n=!0){f(e,"pagesjs-page")?Y(e,()=>o(e)>3&&(w.append(...r(e).slice(3)),Y())):(b&&""!==S.innerText&&t("h1",e)&&Y(),e.innerText.trim()&&(U(),O-S.scrollHeight<P)&&Y(),yield*function*(e,t){for(;;){const n=Q();if(fe(e),ne(e))e=te(e,n,"block",t);else{if(n.append(e),!J())return;e=te(e,n,void 0,t)}if(!e)return;Y(),yield}}(e,n))}function te(e,t,n,o){const s=n||function(e){const t=c(e),n=e.tagName;if(/avoid/.test(t.breakInside)||e.matches(T))return;if("TABLE"===n)return e.tBodies[0]&&"table";if(!["block","list-item","flow-root"].includes(t.display)||!ie(t))return;if("PRE"===n){if("CODE"===i(e)?.tagName&&ce(e).length>1)return"code";if(e.offsetHeight<=A)return}return r(e).some(e=>!se(e))?"block":"inline"}(e),a="block"===s?void 0:re(e),l=!f(e,N),p=s&&ue[s](e,t,a,l,o);if(!p)return a&&(e.remove(),e);const[g,h]=p;return oe(g)?(g.remove(),h):(h?(d(h,N),u(h,E,v)):f(g,E)?u(g,N,E,v):d(g,v),h)}function ne(e){return!["TABLE","PRE"].includes(e.tagName)&&e.getElementsByTagName("*").length>300}function oe(e){return!i(e)&&!e.textContent.trim()}function re(e){for(;e&&e!==w;e=e.parentNode)for(let t=e.previousElementSibling;t;t=t.previousElementSibling)if(a(t).height)return!0;return!1}function ie(e){return"none"===e.float&&!["absolute","fixed"].includes(e.position)}function se(e){if(1!==e.nodeType)return!0;const t=c(e),n=t.display;return n.startsWith("inline")||"none"===n||"contents"===n||!ie(t)}function ae(e){const t=c(e);return(t.display.startsWith("inline")||"contents"===t.display)&&ie(t)}function ce(e){const t=[];return i(e).innerHTML.replace(/\n$/,"").split("\n").map(e=>{const n=t.map(e=>e[0]).join("");return e.replace(/<(\/?)([a-z][\w-]*)[^>]*>/gi,(e,n,o)=>{n?t.pop():t.push([e,o])}),n+e+t.map(e=>`</${e[1]}>`).reverse().join("")})}function le(e,t){d(e,N),u(e,v),t&&d(e,E)}function fe(e){1===e.nodeType&&[e,...n("."+N,e)].forEach(e=>f(e,N)&&d(e,v))}function de(e,t,n){const o=e.cloneNode();return e.remove(),t.append(o),le(o,n),o}const ue={block:function(e,t,n,r,s){!function(e){if(H.has(e)||f(e,"pagesjs-run"))return;H.add(e),e.isConnected||M.append(e);let t=[];function n(){if(t.some(e=>1===e.nodeType||3===e.nodeType&&e.nodeValue.trim())){const e=p("span","pagesjs-run");t[0].before(e),e.append(...t)}t=[]}for(const o of[...e.childNodes])se(o)?t.push(o):n();n(),e.parentNode===M&&e.remove()}(e);const a=de(e,t,r);let c,l;n=re(a);for(;c=e.firstChild;){if(1!==c.nodeType){a.append(c);continue}fe(c);const t=ne(c);if(!t&&(a.append(c),!J()))continue;const n=o(a),r=te(c,a,t?"block":void 0,s||!!i(e));if(r){l=o(a)>n,e.prepend(r);break}}return oe(e)&&me(a,e,n),oe(e)||pe(a,e,n),n&&!l&&ge(a,e),"OL"===e.tagName&&o(a)&&!oe(e)&&be(a,e),[a,oe(e)?null:e]},inline:function(n,o,r,i,s){const c=function(n){const o=g(),r=[{node:n,i:0}],i=e.createTreeWalker(n,NodeFilter.SHOW_TEXT|NodeFilter.SHOW_ELEMENT);let s,c;function l(e){return c&&c.bottom<=e.top&&c.right>e.left}for(;s=i.nextNode();){const e=s.tagName;if(e){if(("MJX-CONTAINER"===e||"SPAN"===e&&t(".katex",s)||!ae(s))&&(s=i.nextSibling(),!s))break;if(s.firstChild)continue}if(s.tagName){const e=a(s);l(e)&&r.push({node:s,i:-1}),c=e}else if(s.textContent.trim()){o.selectNodeContents(s);const e=o.getClientRects();if(!e.length)continue;l(e[0])&&r.push({node:s,i:0});for(let t=1;t<e.length;t++)r.push({node:s,i:Te(s,t,o)});c=e[e.length-1]}}return r}(n);if(c.length<2)return;const l=g(),f=n.cloneNode(),d=c.length;let u=d;function p(){const e=c[--u];e.i<0?l.setStartBefore(e.node):l.setStart(e.node,e.i),l.setEnd(n,n.childNodes.length),f.prepend(l.extractContents());const t=n.lastChild;""===t?.innerHTML&&t.remove()}le(n,i);for(;u>(r?0:1)&&(p(),!(u>0)||J()););u>1&&d-u===1&&!s&&p();return[n,f]},table:function(e,t,n,o){const r=de(e,t,o),i=e.tBodies[0],s=i.cloneNode(),l=[...i.rows],f=l.length,d=n?0:1,u=e.caption&&"bottom"!==c(e.caption).captionSide?e.caption:null;function p(){u&&e.prepend(u),r.innerHTML=""}u&&r.append(u),[e.tHead,s,e.tFoot].forEach(e=>e&&r.append(e===s?e:e.cloneNode(!0))),s.append(...l);const g=_()-O-.5;if(g>=0){const e=a(l[f-1]).bottom-g;let t=0,n=f;for(;t<n;){const o=t+n>>1;a(l[o]).bottom<=e?t=o+1:n=o}let o=Math.max(t,d);for(i.prepend(...l.slice(o));o>d&&_()>O+.5;)i.prepend(l[--o])}s.rows.length||p();const h=s.rows.length;(1===i.rows.length&&h>1||1===h&&n&&i.rows.length)&&(i.prepend(s.rows[h-1]),1===h&&p());return[r,i.rows.length?e:null]},code:function(e,t,n,o){const s=i(e),l=ce(e),f=r(e),d=f.filter((e,t)=>t>f.indexOf(s)&&ie(c(e))),u=de(e,t,o),p=s.cloneNode();u.append(p,...f.filter(e=>e!==s&&!d.includes(e)));let h=function(e,t,n){const o=t.length,r=n?0:1;e.innerHTML=t.join("\n");const i=_()-O-.5;if(i<0)return o;const s=g(),c=[];e.childNodes.forEach(e=>{if(3===e.nodeType)for(let t=e.data.indexOf("\n");t>=0;t=e.data.indexOf("\n",t+1))s.setStart(e,t),s.setEnd(e,t+1),c.push(a(s).bottom)}),s.selectNodeContents(e);const l=s.getClientRects(),f=l[l.length-1].bottom;c.push(f);let d=0;for(;d<o&&c[d]<=f-i;)d++;for(;d&&d<o&&!t[d].trim();)d++;e.innerHTML=t.slice(0,Math.max(d,r)).join("\n");for(;d>r&&_()>O+.5;)e.innerHTML=t.slice(0,--d).join("\n");return Math.max(d,r)}(p,l,n);h>1&&l.length-h===1&&h--;1===h&&n&&(h=0);h?p.innerHTML=l.slice(0,h).join("\n"):u.innerHTML="";return s.innerHTML=l.slice(h).join("\n"),s.innerHTML.trim()?[u,e]:(h&&u.append(...d),[u,null])}};function pe(e,t,n){for(let r;(r=s(e))?.matches("legend, .caption")&&(o(e)>1||n);)t.prepend(r)}function ge(e,t){!oe(t)&&a(e).height<1.5*R&&(he(s(e),i(t)),t.prepend(...e.childNodes))}function he(e,t){e&&t&&f(e,N)&&f(t,N)&&e.tagName===t.tagName&&(he(s(e),i(t)),t.prepend(...e.childNodes),u(t,...f(e,E)?[N,E,v]:[E]),e.remove())}function me(e,t,n){for(d(e,v);J()&&s(e)&&(o(e)>1||n);){const n=s(e),o=te(n,e,void 0,!0);if(!o)break;if(t.prepend(o),o!==n)break}oe(t)||u(e,v)}function be(e,t){t.start+=o(e)-(f(i(t),N)?1:0)}function Te(e,t,n){let o=0,r=e.length;for(;o<r;){const i=o+r>>1;n.setStart(e,0),n.setEnd(e,i),n.getClientRects().length>t?r=i:o=i+1}return o-1}function Ne(e){return e&&(e.dataset.shortTitle||e.innerText)}const Ee=(b?"h1":"h2")+":not(.pagesjs-front *)";function ve(e){return[...e.childNodes].some(e=>3===e.nodeType&&e.nodeValue.trim())}function je(e){return!["PRE","TABLE"].includes(e.tagName)&&!ve(e)}function ye(e){const t=performance.now();for(;!F.next().done;)if(!(e||performance.now()-t<500))return new Promise(e=>{requestAnimationFrame(e),setTimeout(e,50)}).then(()=>ye())}function Ce(c){const l=c||/Headless/.test(navigator.userAgent)||navigator.webdriver;if("complete"!==e.readyState)return h("load",()=>Ce(c));const T=e.body.classList;if(T.contains("pagesjs"))return;m("pagesjs:before");const N=performance.now();n(e.body.dataset.pagesFront||"body > header").forEach(e=>d(e,"pagesjs-front")),B=Ne(t("h1.title, .pagesjs-front h1, .title, h1")),T.add("pagesjs"),e.body.append(M),l||(q=p("div","pagesjs-progress"),q.textContent="Paginating...",e.body.append(q)),e.body.insertAdjacentElement("afterbegin",D()),O=(S.clientHeight||window.innerHeight)+3,A=w.clientHeight||O,n(":is(#TOC, .footnotes, .chapter-before, .chapter-after):is(.side-left, .side-right).side").forEach(e=>{u(e,"side","side-left","side-right")}),T.add("pagesjs-filling"),function(){const e=p("p"),t=S.scrollHeight;e.innerText="A",w.append(e),P=S.scrollHeight-t,R=a(e).height,e.remove()}(),n('#TOC a[href^="#"]').forEach(e=>{const t=p("span","toc-text");let n;for(e.append(t);(n=t.previousSibling)&&(1!==n.nodeType||!f(n,"section-number"));)t.prepend(n);e.dataset.pageNumber="000"}),n(".footnotes").forEach(e=>{const t=e.previousElementSibling;if(!t||!f(t,"note-ref"))return;const n=p("span","pagesjs-note");n.hidden=!0,x.set(n,r(e)),e.replaceWith(n)});const E=function(){const r=e.body.dataset.pagesRoot,s=r?[...n(r)]:[];if(s.length)return s;let a=t('main, [role="main"]');for(;a&&1===o(a)&&!ve(a)&&je(i(a));)a=i(a);if(a)return[a];const c=[...n("article")].filter(e=>!e.parentNode.closest("article"));return c.length?c:[e.body]}(),v=function(t){return t.map(t=>{n('style, link[rel="stylesheet"]',t).forEach(t=>e.head.append(t));const o=r(t).filter(e=>![S,M,q].includes(e)&&!["SCRIPT","NOSCRIPT","TEMPLATE"].includes(e.tagName));return o.forEach(e=>e.remove()),o})}(E);function*j(){yield*function*(e,t){for(const e of n(".pagesjs-front, .abstract, #TOC:not(.chapter-toc)"))yield*ee(e),b&&Y();for(const[n,o]of e.entries()){V=K(o),k=null,b&&(""===S.innerText?D(S):Y());for(const[o,r]of t[n].entries())yield*ee(r,n<e.length-1||o<t[n].length-1);Z(o.parentNode),Z(o)}G(S),n(".pagesjs-run").forEach(e=>e.replaceWith(...e.childNodes))}(E,v),T.remove("pagesjs-filling"),e.body.prepend(...C),C.forEach(e=>{if(!L.has(e))return;const t=e.children[1],n=g();n.selectNodeContents(t),a(n).bottom<=a(t.nextElementSibling).top&&e.scrollHeight<=e.clientHeight+1&&delete e.dataset.pagesOffset}),function(){let e,o=0;C.forEach(r=>{if(b){if(t(".pagesjs-front",r))return;t(Ee,r)&&(e="")}const i=+r.dataset.pagesOffset||1;i>1&&d(r,"page-multiple"),o+=i,d(r,"page-"+(o%2==0?"even":"odd"));const a={pageNumber:o,mainTitle:B,pageTitle:e};[r.children[0],s(r)].forEach(e=>{for(const t in a)a[t]&&(e.dataset[t]=a[t])}),e=Ne([...n(Ee,r)].pop())||e})}(),n('#TOC a[href^="#"]').forEach(e=>{const n=t(`.pagesjs-page:has(#${CSS.escape(e.getAttribute("href").replace(/^#/,""))}) .pagesjs-header`);e.dataset.pageNumber=n?n.dataset.pageNumber:""}),M.remove(),q?.remove(),I=!0;const o=C.filter(e=>e.classList.contains("page-multiple")).length;console.info(`pages.js: ${C.length} pages in ${Math.round(performance.now()-N)} ms`+(o?`; ${o} overflow their page`:"")),m("pagesjs:after")}W=e=>(W=null,$&&($.forEach(e=>e.forEach(e=>e.remove())),w.innerHTML="",k=null,V=[],u(S,"pagesjs-settle"),$=null),F=j(),ye(e||l)),c?W(!0):function(e,t){return d(S,"pagesjs-settle"),e.forEach((e,n)=>{V=K(e),k=null,Q().append(...t[n])}),$=t,new Promise(e=>{const t=setTimeout(e,500);let n=0;!function o(){requestAnimationFrame(()=>++n<3?o():(clearTimeout(t),e()))}()})}(E,v).then(()=>W?.())}h("beforeprint",()=>{if(W)W(!0);else if(F)for(;!F.next().done;);else Ce(!0)}),h("pagesjs:paginate",()=>{I?m("pagesjs:after"):Ce()});const He=new URLSearchParams(location.search);He.get("paged")&&Ce(),h("keypress",e=>{"p"===e.key&&(He.get("paged")?(He.delete("paged"),location.href=location.pathname+(He.size?`?${He}`:"")):(Ce(),He.set("paged",1),history.replaceState({},"",`${location.pathname}?${He}`)))})})(document);
|
|
1
|
+
(e=>{function t(t,n=e){return n?.querySelector(t)}function n(t,n=e){return n?n.querySelectorAll(t):[]}function o(e){return e.childElementCount}function r(e){return[...e.children]}function i(e){return e.firstElementChild}function s(e){return e.lastElementChild}function a(e){return e.getBoundingClientRect()}function c(e){return getComputedStyle(e)}function l(e){return parseFloat(e)||0}function f(e,t){return e.classList.contains(t)}function u(e,...t){e.classList.add(...t)}function d(e,...t){e.classList.remove(...t)}function p(t,n){const o=e.createElement(t);return n&&(o.className=n),o}function g(){return e.createRange()}function h(e,t){addEventListener(e,t)}function m(e){dispatchEvent(new Event(e))}const b=n("h1").length>1,T="h1,h2,h3,h4,h5,h6,hr,img,svg,video,canvas,iframe,object,embed,math,mjx-container,figure,.figure,.float,.caption,details",E="pagesjs-fragmented",v="fragment-first",N="fragment-last",y=parseFloat(e.body.dataset.pagesFloatPage)||70,j=["top","bottom"].map(t=>l(c(e.documentElement).getPropertyValue(`--paper-margin-${t}`))),C=p("div","pagesjs-page"),H=[],x=new WeakSet,L=new WeakSet,M=[],w=new Map,S=new WeakMap,k=p("div");C.innerHTML='<div class="pagesjs-header"></div>\n<div class="pagesjs-body"></div>\n<div class="pagesjs-footer"></div>',k.style.display="none";let O,P,A,R,B,$,W,F,I,q,U,V,z,D,X,_=[],J=0;function Y(e){return e&&!t(".pagesjs-body",e)&&e.insertAdjacentHTML("afterbegin",C.innerHTML),O=e||C.cloneNode(!0),P=O.children[1],A=null,H.includes(O)||H.push(O),O}function G(e=P){let t=0;for(let n=s(e);n;n=s(n)){const e=c(n);if(t=Math.max(t,l(e.marginBottom)),l(e.paddingBottom)||l(e.borderBottomWidth))break}return t}function K(){return te(),ee()?1/0:a(O).height-G()}function Q(){return te(),(F=O.scrollHeight-G())>R||ee()}function Z(){return!!I&&P.contains(I)}function ee(){return Z()&&Ee(I,"next")}function te(e=O){const r=e.children[1],i=[...n(".pagesjs-note",r)].flatMap(e=>w.get(e));let s=t(":scope > .footnotes",e);if(!i.length)return s?.remove();s||r.after(s=p("div")),s.className="footnotes",(i.some((e,t)=>s.children[t]!==e)||o(s)!==i.length)&&s.replaceChildren(...i)}function ne(e,t){const n=O;n.after(Y(e)),t&&t(),he(),oe(n)}function oe(e){te(e);const t=e.scrollHeight;if(t-G(e.children[1])>R&&!e.dataset.pagesOffset){const o=function(e,t){let o=+e.dataset.pagesOffset;if(o)return o;if(o=Math.ceil(t/R),o<=1)return o;const r=j.concat([...n("thead",e)].map(e=>+e.offsetHeight)).reduce((e,t)=>e+t);if(!r)return o;function i(){return Math.ceil((t+(o-1)*r)/R)}let s=i();for(;s>o;)o=s,s=i();return o}(e,t);o>1&&(e.dataset.pagesOffset=o,L.add(e))}e.remove(),D&&(D.textContent=`Paginating: ${++J} pages done`)}function re(t){const n=[];for(;t&&t!==e.body;t=t.parentNode)n.unshift(t);return n}function ie(e){const t=e.cloneNode();return u(t,"pagesjs-wrap"),d(t,E,v,N),t}function se(){return _.length?(A&&P.contains(A)||(A=_.reduce((e,t)=>e.appendChild(ie(t)),P)),A):P}function ae(e){if(!e||"BODY"===e.tagName)return!1;const t=!("P"===e.tagName?e.innerHTML:e.innerText).trim();return t&&e.remove(),t}function*ce(e,n=!0){f(e,"pagesjs-page")?ne(e,()=>o(e)>3&&(P.append(...r(e).slice(3)),ne())):(b&&""!==O.innerText&&t("h1",e)&&(me(),ne()),e.innerText.trim()&&(Z()||(te(),R-O.scrollHeight<$))&&ne(),yield*function*(e,t){for(;;){const n=se();if(xe(e),be(e))e=le(e,n,"block",t);else{if(n.append(e),fe(e)&&!pe(e,n))return;if(!Q())return;e=le(e,n,void 0,t)}if(!e)return;ne(),yield}}(e,n))}function le(e,t,n,o){const s=n||function(e){const t=c(e),n=e.tagName;if(/avoid/.test(t.breakInside)||e.matches(T))return;if("TABLE"===n)return e.tBodies[0]&&"table";if(!["block","list-item","flow-root"].includes(t.display)||!Ne(t))return;if("PRE"===n){if("CODE"===i(e)?.tagName&&Ce(e).length>1)return"code";if(e.offsetHeight<=B)return}return r(e).some(e=>!ye(e))?"block":"inline"}(e),a="block"===s?void 0:ve(e),l=!f(e,E),p=s&&Me[s](e,t,a,l,o);if(!p)return a&&(e.remove(),fe(e)?ge(e,t):e);const[g,h]=p;return Te(g)?(g.remove(),h):(h?(u(h,E),d(h,v,N)):f(g,v)?d(g,E,v,N):u(g,N),h)}function fe(e){return e.matches(".float")||e.matches("figure, .figure")&&!!t("figcaption, .caption",e)}function ue(e){return a(e).height>B*y/100}function de(e){I=e,u(O,"page-float")}function pe(e,t){const n=ue(e);return M.length||n&&ve(e)?(ge(e,t,n),!1):(n&&de(e),!0)}function ge(e,t,n){const o=[];for(let e=t,n=se();e&&e!==n;e=e.parentNode)o.unshift(ie(e));e.remove(),M.push([e,o,n])}function he(){for(;M.length;){const[e,t]=M[0],n=t[0]||e;if(t.reduce((e,t)=>e.appendChild(t),se()).append(e),ve(n)){if(ue(e)||Q())return n.remove()}else ue(e)&&de(e);M.shift(),u(e,"pagesjs-float")}}function me(){for(he();M.length;)ne()}function be(e){return!fe(e)&&!["TABLE","PRE"].includes(e.tagName)&&e.getElementsByTagName("*").length>300}function Te(e){return!i(e)&&!e.textContent.trim()}function Ee(e,t){const n=t+"ElementSibling";for(;e&&e!==P;e=e.parentNode)for(let t=e[n];t;t=t[n])if(a(t).height)return!0;return!1}function ve(e){return Ee(e,"previous")}function Ne(e){return"none"===e.float&&!["absolute","fixed"].includes(e.position)}function ye(e){if(1!==e.nodeType)return!0;const t=c(e),n=t.display;return n.startsWith("inline")||"none"===n||"contents"===n||!Ne(t)}function je(e){const t=c(e);return(t.display.startsWith("inline")||"contents"===t.display)&&Ne(t)}function Ce(e){const t=[];return i(e).innerHTML.replace(/\n$/,"").split("\n").map(e=>{const n=t.map(e=>e[0]).join("");return e.replace(/<(\/?)([a-z][\w-]*)[^>]*>/gi,(e,n,o)=>{n?t.pop():t.push([e,o])}),n+e+t.map(e=>`</${e[1]}>`).reverse().join("")})}function He(e,t){u(e,E),d(e,N),t&&u(e,v)}function xe(e){1===e.nodeType&&[e,...n("."+E,e)].forEach(e=>f(e,E)&&u(e,N))}function Le(e,t,n){const o=e.cloneNode();return e.remove(),t.append(o),He(o,n),o}const Me={block:function(e,t,n,r,s){!function(e){if(x.has(e)||f(e,"pagesjs-run"))return;x.add(e),e.isConnected||k.append(e);let t=[];function n(){if(t.some(e=>1===e.nodeType||3===e.nodeType&&e.nodeValue.trim())){const e=p("span","pagesjs-run");t[0].before(e),e.append(...t)}t=[]}for(const o of[...e.childNodes])ye(o)?t.push(o):n();n(),e.parentNode===k&&e.remove()}(e);const a=Le(e,t,r);let c,l;n=ve(a);for(;c=e.firstChild;){if(1!==c.nodeType){a.append(c);continue}xe(c);const t=be(c);if(!t){const t=we(a,Se(c));if(t.length||t.push(c),a.append(...t),fe(c)&&!pe(c,a))continue;if(!Q())continue;if(t.length>1&&(e.prepend(...t.slice(1)),!Q()))continue}const n=o(a),r=le(c,a,t?"block":void 0,s||!!i(e));if(F=null,r){l=o(a)>n,e.prepend(r);break}}return Te(e)&&Ae(a,e,n),Te(e)||ke(a,e,n),n&&!l&&Oe(a,e),"OL"===e.tagName&&o(a)&&!Te(e)&&Re(a,e),[a,Te(e)?null:e]},inline:function(n,o,r,i,s){const c=function(n){const o=g(),r=[{node:n,i:0}],i=e.createTreeWalker(n,NodeFilter.SHOW_TEXT|NodeFilter.SHOW_ELEMENT);let s,c;function l(e){return c&&c.bottom<=e.top&&c.right>e.left}for(;s=i.nextNode();){const e=s.tagName;if(e){if(("MJX-CONTAINER"===e||"SPAN"===e&&t(".katex",s)||!je(s))&&(s=i.nextSibling(),!s))break;if(s.firstChild)continue}if(s.tagName){const e=a(s);l(e)&&r.push({node:s,i:-1}),c=e}else if(s.textContent.trim()){o.selectNodeContents(s);const e=o.getClientRects();if(!e.length)continue;l(e[0])&&r.push({node:s,i:0});for(let t=1;t<e.length;t++)r.push({node:s,i:Be(s,t,o)});c=e[e.length-1]}}return r}(n);if(c.length<2)return;const l=g(),f=n.cloneNode(),u=c.length;let d=u;function p(){const e=c[--d];e.i<0?l.setStartBefore(e.node):l.setStart(e.node,e.i),l.setEnd(n,n.childNodes.length),f.prepend(l.extractContents());const t=n.lastChild;""===t?.innerHTML&&t.remove()}He(n,i);for(;d>(r?0:1)&&(p(),!(d>0)||Q()););u-d===1&&(d>1&&!s||(d>1||r)&&M[0]?.[2])&&p();return[n,f]},table:function(e,t,n,o){const r=Le(e,t,o),i=e.tBodies[0],s=i.cloneNode(),l=[...i.rows],f=l.length,u=n?0:1,d=e.caption&&"bottom"!==c(e.caption).captionSide?e.caption:null;function p(){d&&e.prepend(d),r.innerHTML=""}d&&r.append(d),[e.tHead,s,e.tFoot].forEach(e=>e&&r.append(e===s?e:e.cloneNode(!0))),s.append(...l);const g=K()-R-.5;if(g>=0){const e=a(l[f-1]).bottom-g;let t=0,n=f;for(;t<n;){const o=t+n>>1;a(l[o]).bottom<=e?t=o+1:n=o}let o=Math.max(t,u);for(i.prepend(...l.slice(o));o>u&&K()>R+.5;)i.prepend(l[--o])}s.rows.length||p();const h=s.rows.length;(1===i.rows.length&&h>1||1===h&&n&&i.rows.length)&&(i.prepend(s.rows[h-1]),1===h&&p());return[r,i.rows.length?e:null]},code:function(e,t,n,o){const s=i(e),l=Ce(e),f=r(e),u=f.filter((e,t)=>t>f.indexOf(s)&&Ne(c(e))),d=Le(e,t,o),p=s.cloneNode();d.append(p,...f.filter(e=>e!==s&&!u.includes(e)));let h=function(e,t,n){const o=t.length,r=n?0:1;e.innerHTML=t.join("\n");const i=K()-R-.5;if(i<0)return o;const s=g(),c=[];e.childNodes.forEach(e=>{if(3===e.nodeType)for(let t=e.data.indexOf("\n");t>=0;t=e.data.indexOf("\n",t+1))s.setStart(e,t),s.setEnd(e,t+1),c.push(a(s).bottom)}),s.selectNodeContents(e);const l=s.getClientRects(),f=l[l.length-1].bottom;c.push(f);let u=0;for(;u<o&&c[u]<=f-i;)u++;for(;u&&u<o&&!t[u].trim();)u++;e.innerHTML=t.slice(0,Math.max(u,r)).join("\n");for(;u>r&&K()>R+.5;)e.innerHTML=t.slice(0,--u).join("\n");return Math.max(u,r)}(p,l,n);h>1&&l.length-h===1&&h--;1===h&&n&&(h=0);h?p.innerHTML=l.slice(0,h).join("\n"):d.innerHTML="";return s.innerHTML=l.slice(h).join("\n"),s.innerHTML.trim()?[d,e]:(h&&d.append(...u),[d,null])}};function we(e,n,o){const r=s(e),i=r&&!f(r,E)?S.get(r):void 0,a=[];if(void 0===i||!F)return a;let c=i,l=0;for(const e of n){if(1===e.nodeType){const n=S.get(e);if(!(n>=c)||e.matches(`.${E}, .pagesjs-page`)||fe(e)||be(e)||t(".pagesjs-note",e)||F+n-i+W>R||o&&(F+c-i+2*$>R||b&&t("h1",e)))break;c=n}a.push(e),1===e.nodeType&&(l=a.length)}return a.slice(0,l)}function*Se(e){for(;e;e=e.nextSibling)yield e}function ke(e,t,n){for(let r;(r=s(e))?.matches("legend, .caption")&&(o(e)>1||n);)t.prepend(r)}function Oe(e,t){!Te(t)&&a(e).height<1.5*W&&(Pe(s(e),i(t)),t.prepend(...e.childNodes))}function Pe(e,t){e&&t&&f(e,E)&&f(t,E)&&e.tagName===t.tagName&&(Pe(s(e),i(t)),t.prepend(...e.childNodes),d(t,...f(e,v)?[E,v,N]:[v]),e.remove())}function Ae(e,t,n){for(u(e,N);Q()&&s(e)&&(o(e)>1||n);){const n=s(e),o=le(n,e,void 0,!0);if(!o)break;if(t.prepend(o),o!==n)break}Te(t)||d(e,N)}function Re(e,t){t.start+=o(e)-(f(i(t),E)?1:0)}function Be(e,t,n){let o=0,r=e.length;for(;o<r;){const i=o+r>>1;n.setStart(e,0),n.setEnd(e,i),n.getClientRects().length>t?r=i:o=i+1}return o-1}function $e(e){S.set(e,a(e).bottom),e.matches(`p, pre, table, ${T}`)||r(e).forEach($e)}function We(e){return e&&(e.dataset.shortTitle||e.innerText)}const Fe=(b?"h1":"h2")+":not(.pagesjs-front *)";function Ie(e){return[...e.childNodes].some(e=>3===e.nodeType&&e.nodeValue.trim())}function qe(e){return!["PRE","TABLE"].includes(e.tagName)&&!Ie(e)}function Ue(e){const t=performance.now();for(;!z.next().done;)if(!(e||performance.now()-t<500))return new Promise(e=>{requestAnimationFrame(e),setTimeout(e,50)}).then(()=>Ue())}function Ve(c){const l=c||/Headless/.test(navigator.userAgent)||navigator.webdriver;if("complete"!==e.readyState)return h("load",()=>Ve(c));const T=e.body.classList;if(T.contains("pagesjs"))return;m("pagesjs:before");const E=performance.now();n(e.body.dataset.pagesFront||"body > header").forEach(e=>u(e,"pagesjs-front")),q=We(t("h1.title, .pagesjs-front h1, .title, h1")),T.add("pagesjs"),e.body.append(k),l||(D=p("div","pagesjs-progress"),D.textContent="Paginating...",e.body.append(D)),e.body.insertAdjacentElement("afterbegin",Y()),R=(O.clientHeight||window.innerHeight)+3,B=P.clientHeight||R,n(":is(#TOC, .footnotes, .chapter-before, .chapter-after):is(.side-left, .side-right).side").forEach(e=>{d(e,"side","side-left","side-right")}),T.add("pagesjs-filling"),function(){const e=p("p"),t=O.scrollHeight;e.innerText="A",P.append(e),$=O.scrollHeight-t,W=a(e).height,e.remove()}(),n('#TOC a[href^="#"]').forEach(e=>{const t=p("span","toc-text");let n;for(e.append(t);(n=t.previousSibling)&&(1!==n.nodeType||!f(n,"section-number"));)t.prepend(n);e.dataset.pageNumber="000"}),n(".footnotes").forEach(e=>{const t=e.previousElementSibling;if(!t||!f(t,"note-ref"))return;const n=p("span","pagesjs-note");n.hidden=!0,w.set(n,r(e)),e.replaceWith(n)});const v=function(){const r=e.body.dataset.pagesRoot,s=r?[...n(r)]:[];if(s.length)return s;let a=t('main, [role="main"]');for(;a&&1===o(a)&&!Ie(a)&&qe(i(a));)a=i(a);if(a)return[a];const c=[...n("article")].filter(e=>!e.parentNode.closest("article"));return c.length?c:[e.body]}(),N=function(t){return t.map(t=>{n('style, link[rel="stylesheet"]',t).forEach(t=>e.head.append(t));const o=r(t).filter(e=>![O,k,D].includes(e)&&!["SCRIPT","NOSCRIPT","TEMPLATE"].includes(e.tagName));return o.forEach(e=>e.remove()),o})}(v);function*y(){yield*function*(e,t){for(const e of n(".pagesjs-front, .abstract, #TOC:not(.chapter-toc)"))f(e,"pagesjs-front")&&O===H[0]&&u(O,"page-front"),yield*ce(e),b&&ne();for(const[n,o]of e.entries()){_=re(o),A=null,b&&(""===O.innerText?Y(O):ne());const r=t[n];for(let t=0;t<r.length;t++){yield*ce(r[t],n<e.length-1||t<r.length-1);const o=we(se(),r.slice(t+1),!0);o.length&&(se().append(...o),Q()?o.forEach(e=>e.remove()):t+=o.length)}me(),ae(o.parentNode),ae(o)}oe(O),n(".pagesjs-run").forEach(e=>e.replaceWith(...e.childNodes))}(v,N),T.remove("pagesjs-filling"),e.body.prepend(...H),H.forEach(e=>{if(!L.has(e))return;const t=e.children[1],n=g();n.selectNodeContents(t),a(n).bottom<=a(t.nextElementSibling).top&&e.scrollHeight<=e.clientHeight+1&&delete e.dataset.pagesOffset}),function(){let e,o=0;const r=new URL(location.href);r.searchParams.delete("paged"),H.forEach(i=>{if(b){if(t(".pagesjs-front",i))return;t(Fe,i)&&(e="")}const a=+i.dataset.pagesOffset||1;a>1&&u(i,"page-multiple"),o+=a,u(i,"page-"+(o%2==0?"even":"odd"));const c={pageNumber:o,mainTitle:q,pageTitle:e,pageUrl:i===H.at(-1)&&r.href};[i.children[0],s(i)].forEach(e=>{for(const t in c)c[t]&&(e.dataset[t]=c[t])}),e=We([...n(Fe,i)].pop())||e})}(),n('#TOC a[href^="#"]').forEach(t=>{const n=e.getElementById(t.getAttribute("href").slice(1))?.closest(".pagesjs-page");t.dataset.pageNumber=n?.children[0].dataset.pageNumber??""}),k.remove(),D?.remove(),X=!0;const o=H.filter(e=>e.classList.contains("page-multiple")).length;console.info(`pages.js: ${H.length} pages in ${Math.round(performance.now()-E)} ms`+(o?`; ${o} overflow their page`:"")),m("pagesjs:after")}V=e=>(V=null,U&&(U.forEach(e=>e.forEach($e)),U.forEach(e=>e.forEach(e=>e.remove())),P.innerHTML="",A=null,_=[],d(O,"pagesjs-settle"),U=null),z=y(),Ue(e||l)),c?V(!0):function(e,t){return u(O,"pagesjs-settle"),e.forEach((e,n)=>{_=re(e),A=null,se().append(...t[n])}),U=t,new Promise(e=>{const t=setTimeout(e,500);let n=0;!function o(){requestAnimationFrame(()=>++n<3?o():(clearTimeout(t),e()))}()})}(v,N).then(()=>V?.())}h("beforeprint",()=>{if(V)V(!0);else if(z)for(;!z.next().done;);else Ve(!0)}),h("pagesjs:paginate",()=>{X?m("pagesjs:after"):Ve()});const ze=new URLSearchParams(location.search);ze.get("paged")&&Ve(),h("keypress",e=>{"p"===e.key&&(ze.get("paged")?(ze.delete("paged"),location.href=location.pathname+(ze.size?`?${ze}`:"")):(Ve(),ze.set("paged",1),history.replaceState({},"",`${location.pathname}?${ze}`)))})})(document);
|
|
2
2
|
//# sourceMappingURL=pages.min.js.map
|
package/js/pages.min.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["d","$","s","el","querySelector","$$","querySelectorAll","nChild","childElementCount","kids","children","firstEl","firstElementChild","lastEl","lastElementChild","rect","getBoundingClientRect","style","getComputedStyle","num","v","parseFloat","has","c","classList","contains","addCls","add","rmCls","remove","make","tag","cls","createElement","className","range","createRange","on","type","fn","addEventListener","fire","dispatchEvent","Event","book","length","atomic","fr_cls","fr_1","fr_2","tb","map","i","documentElement","getPropertyValue","tpl","boxes","wrapped","WeakSet","guessed","notes","Map","hold","innerHTML","display","box","box_body","box_ctx","H","B","H_min","H_line","main_title","probed","pending","running","progress","finished","wrap","n_done","newPage","insertAdjacentHTML","cloneNode","includes","push","trailingMargin","body","m","e","cs","Math","max","marginBottom","paddingBottom","borderBottomWidth","pageHeight","syncNotes","height","overflows","scrollHeight","b","items","flatMap","get","after","some","replaceChildren","nextPage","callback","cur","finish","h","dataset","pagesOffset","n","ceil","concat","offsetHeight","reduce","m1","m2","nPages","n2","calcPages","textContent","ancestors","a","parentNode","unshift","ctx","p","appendChild","removeBlank","tagName","innerText","trim","fill","more","append","slice","endFrag","isBigBlock","split","undefined","place","container","kind","k","t","test","breakInside","matches","tBodies","inFlow","codeLines","isInline","kindOf","prev","hasPrev","first","r","splitters","head","rest","blank","getElementsByTagName","previousElementSibling","float","position","nodeType","startsWith","inTextFlow","pre","open","replace","line","start","join","pop","reverse","mark","forEach","cut","block","isConnected","run","flush","nodeValue","before","childNodes","wrapRuns","item","partial","firstChild","big","prepend","fitLastPiece","moveTrailingHeadings","moveShortHead","fixOlStart","inline","ends","node","walker","createTreeWalker","NodeFilter","SHOW_TEXT","SHOW_ELEMENT","newLine","bottom","top","right","left","nextNode","nextSibling","rc","selectNodeContents","rects","getClientRects","lineOffset","lineStarts","cutLine","loc","setStartBefore","setStart","setEnd","extractContents","last","lastChild","table","tb2","rows","min","cap","caption","captionSide","clear","tHead","tFoot","over","limit","lo","hi","mid","code","lines","ch","tail","filter","j","indexOf","code2","bottoms","data","fitLines","rejoin","shortTitle","ps","ownText","canBeRoot","advance","sync","performance","now","next","done","Promise","go","requestAnimationFrame","setTimeout","then","paginate","quiet","navigator","userAgent","webdriver","readyState","t0","pagesFront","insertAdjacentElement","clientHeight","window","innerHeight","H0","measureMinHeight","previousSibling","pageNumber","hidden","set","replaceWith","roots","sel","pagesRoot","x","main","articles","closest","findRoots","els","detachContent","entries","child","fillPages","nextElementSibling","page_title","N","info","mainTitle","pageTitle","key","numberPages","CSS","escape","getAttribute","console","round","tick","clearTimeout","probe","SP","URLSearchParams","location","search","delete","href","pathname","size","history","replaceState","document"],"sources":["pages.js"],"mappings":"AAkBA,CAACA,IAIC,SAAUC,EAAEC,EAAGC,EAAKH,GAAK,OAAOG,GAAIC,cAAcF,EAAI,CACtD,SAASG,EAAGH,EAAGC,EAAKH,GAAK,OAAOG,EAAKA,EAAGG,iBAAiBJ,GAAK,EAAI,CAClE,SAASK,EAAOJ,GAAM,OAAOA,EAAGK,iBAAmB,CACnD,SAASC,EAAKN,GAAM,MAAO,IAAIA,EAAGO,SAAW,CAC7C,SAASC,EAAQR,GAAM,OAAOA,EAAGS,iBAAmB,CACpD,SAASC,EAAOV,GAAM,OAAOA,EAAGW,gBAAkB,CAClD,SAASC,EAAKZ,GAAM,OAAOA,EAAGa,uBAAyB,CACvD,SAASC,EAAMd,GAAM,OAAOe,iBAAiBf,EAAK,CAClD,SAASgB,EAAIC,GAAK,OAAOC,WAAWD,IAAM,CAAG,CAC7C,SAASE,EAAInB,EAAIoB,GAAK,OAAOpB,EAAGqB,UAAUC,SAASF,EAAI,CACvD,SAASG,EAAOvB,KAAOoB,GAAKpB,EAAGqB,UAAUG,OAAOJ,EAAI,CACpD,SAASK,EAAMzB,KAAOoB,GAAKpB,EAAGqB,UAAUK,UAAUN,EAAI,CACtD,SAASO,EAAKC,EAAKC,GACjB,MAAM7B,EAAKH,EAAEiC,cAAcF,GAE3B,OADIC,IAAK7B,EAAG+B,UAAYF,GACjB7B,CACT,CACA,SAASgC,IAAU,OAAOnC,EAAEoC,aAAe,CAC3C,SAASC,EAAGC,EAAMC,GAAMC,iBAAiBF,EAAMC,EAAK,CACpD,SAASE,EAAKH,GAAQI,cAAc,IAAIC,MAAML,GAAQ,CAItD,MACEM,EAAOvC,EAAG,MAAMwC,OAAS,EAEzBC,EAAS,mHAETC,EAAS,qBAAsBC,EAAO,iBAAkBC,EAAO,gBAK/DC,EAAK,CAAC,MAAO,UAAUC,IAAIC,GACzBjC,EAAIF,EAAMjB,EAAEqD,iBAAiBC,iBAAiB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1O,EAAG,WAAYmD,IACC,MAAVA,EAAE6N,MACAU,GAAGxN,IAAI,UACTwN,GAAGI,OAAO,SAAUF,SAASG,KAAOH,SAASI,UAAYN,GAAGO,KAAO,IAAIP,KAAO,MAE9EhD,KACAgD,GAAG/B,IAAI,QAAS,GAAIuC,QAAQC,aAAa,CAAC,EAAG,GAAI,GAAGP,SAASI,YAAYN,SAIhF,EAvyBD,CAuyBGU","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["d","$","s","el","querySelector","$$","querySelectorAll","nChild","childElementCount","kids","children","firstEl","firstElementChild","lastEl","lastElementChild","rect","getBoundingClientRect","style","getComputedStyle","num","v","parseFloat","has","c","classList","contains","addCls","add","rmCls","remove","make","tag","cls","createElement","className","range","createRange","on","type","fn","addEventListener","fire","dispatchEvent","Event","book","length","atomic","fr_cls","fr_1","fr_2","floatPage","body","dataset","pagesFloatPage","tb","map","i","documentElement","getPropertyValue","tpl","boxes","wrapped","WeakSet","guessed","floats","notes","Map","probeY","WeakMap","hold","innerHTML","display","box","box_body","box_ctx","H","B","H_min","H_line","used","whole","main_title","probed","pending","running","progress","finished","wrap","n_done","newPage","insertAdjacentHTML","cloneNode","includes","push","trailingMargin","m","e","cs","Math","max","marginBottom","paddingBottom","borderBottomWidth","pageHeight","syncNotes","crowded","Infinity","height","overflows","scrollHeight","taken","hasAround","b","items","flatMap","get","after","some","replaceChildren","nextPage","callback","cur","putFloats","finish","h","pagesOffset","n","ceil","concat","offsetHeight","reduce","m1","m2","nPages","n2","calcPages","textContent","ancestors","a","parentNode","unshift","wrapper","ctx","p","appendChild","removeBlank","tagName","innerText","trim","fill","more","append","slice","flush","endFrag","isBigBlock","split","isFloat","stays","undefined","place","container","kind","k","t","test","breakInside","matches","tBodies","inFlow","codeLines","isInline","kindOf","prev","hasPrev","first","r","splitters","defer","head","rest","blank","isTall","f","takePage","tall","chain","top","out","shift","getElementsByTagName","side","float","position","nodeType","startsWith","inTextFlow","pre","open","replace","line","start","join","pop","reverse","mark","forEach","cut","block","isConnected","run","nodeValue","before","childNodes","wrapRuns","item","partial","firstChild","big","fitting","siblings","prepend","fitLastPiece","moveTrailingHeadings","moveShortHead","fixOlStart","inline","ends","node","walker","createTreeWalker","NodeFilter","SHOW_TEXT","SHOW_ELEMENT","newLine","bottom","right","left","nextNode","nextSibling","rc","selectNodeContents","rects","getClientRects","lineOffset","lineStarts","cutLine","loc","setStartBefore","setStart","setEnd","extractContents","last","lastChild","table","tb2","rows","min","cap","caption","captionSide","clear","tHead","tFoot","over","limit","lo","hi","mid","code","lines","ch","tail","filter","j","indexOf","code2","bottoms","data","fitLines","nodes","root","y0","y","y1","rejoin","markY","set","shortTitle","ps","ownText","canBeRoot","advance","sync","performance","now","next","done","Promise","go","requestAnimationFrame","setTimeout","then","paginate","quiet","navigator","userAgent","webdriver","readyState","t0","pagesFront","insertAdjacentElement","clientHeight","window","innerHeight","H0","measureMinHeight","previousSibling","pageNumber","previousElementSibling","hidden","replaceWith","roots","sel","pagesRoot","x","main","articles","closest","findRoots","els","detachContent","entries","list","fillPages","nextElementSibling","page_title","u","URL","location","href","searchParams","delete","N","info","mainTitle","pageTitle","pageUrl","at","key","numberPages","getElementById","getAttribute","console","round","tick","clearTimeout","probe","SP","URLSearchParams","search","pathname","size","history","replaceState","document"],"sources":["pages.js"],"mappings":"AA0BA,CAACA,IAIC,SAAUC,EAAEC,EAAGC,EAAKH,GAAK,OAAOG,GAAIC,cAAcF,EAAI,CACtD,SAASG,EAAGH,EAAGC,EAAKH,GAAK,OAAOG,EAAKA,EAAGG,iBAAiBJ,GAAK,EAAI,CAClE,SAASK,EAAOJ,GAAM,OAAOA,EAAGK,iBAAmB,CACnD,SAASC,EAAKN,GAAM,MAAO,IAAIA,EAAGO,SAAW,CAC7C,SAASC,EAAQR,GAAM,OAAOA,EAAGS,iBAAmB,CACpD,SAASC,EAAOV,GAAM,OAAOA,EAAGW,gBAAkB,CAClD,SAASC,EAAKZ,GAAM,OAAOA,EAAGa,uBAAy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