@xiee/utils 1.14.136 → 1.14.137

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 CHANGED
@@ -26,6 +26,12 @@ CHROMIUM_PATH=/usr/bin/chromium-browser npm test # use an installed browser
26
26
  - 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
27
  - 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
28
 
29
+ ## Performance of `pages.js`
30
+
31
+ - 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).
32
+ - 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.
33
+ - 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).
34
+
29
35
  ## Releases
30
36
 
31
37
  1. Commit the version bump in `package.json` as `Bump to X.Y.Z` (patch +1 unless told otherwise), after tests pass.
@@ -94,7 +94,7 @@
94
94
  * {
95
95
  flex: 1 0 min-content;
96
96
  }
97
- pre:has(code[data-file]) {
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:has(code[data-file]) {
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
- &:has(code[data-file$=".Rmd"])::before {
131
+ &.example::before {
132
132
  content: "♧ Example";
133
133
  }
134
- &:has(code[data-source])::before {
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:has(code[data-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:has(code[data-file]){&:before{content:"Output";text-transform:uppercase;border-bottom:none;padding:.5em 1em;font-weight:700;display:inline-block}&:has(code[data-file$=\.Rmd]):before{content:"♧ Example"}&:has(code[data-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}
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,iEAGE,mGAKA,mDAOJ,wJAUA,yBACE,4HAQA,2DAGA,qDAKA,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:has(code[data-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:has(code[data-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 &:has(code[data-file$=\".Rmd\"])::before {\n content: \"♧ Example\";\n }\n &:has(code[data-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":[]}
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:has(.pagesjs-front) {
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:has(.pagesjs-front){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))}}}
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 */
@@ -1 +1 @@
1
- {"version":3,"mappings":"AAAA,wCAGA,mDAGA,8CAKE,mDAKA,+CAKF,yBACE,8CAIF,kGAMA,SACE,8BACE,4BACA,sBAEF,iDAGE,sCAGJ,mFAKA,sCAGA,iEAEE,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:first-child:has(.pagesjs-front) {\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":[]}
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
@@ -195,7 +195,7 @@
195
195
  margin-top: var(--page-footer-top);
196
196
  align-items: start;
197
197
  &::before {
198
- content: " ";
198
+ content: attr(data-page-url);
199
199
  }
200
200
  &::after {
201
201
  content: attr(data-page-number);
@@ -208,9 +208,7 @@
208
208
  }
209
209
  @media only screen {
210
210
  .pagesjs {
211
- &:has(.pagesjs-page) {
212
- background: #f7f7f7;
213
- }
211
+ background: #f7f7f7;
214
212
  .pagesjs-page {
215
213
  background: white;
216
214
  }
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:" "}&:after{content:attr(data-page-number)}}.pagesjs-body{flex-grow:1;min-height:0;position:relative}@media only screen{.pagesjs{&:has(.pagesjs-page){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}}}
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: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 */
@@ -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,gIAOA,8BAGA,iFAMA,wFAEE,sDAIF,2FAGA,wCAMJ,8MAaA,kDAIA,0FAKA,2GAIE,uCAGA,uCAIF,uGAIE,qBAGA,wCAIF,yDAKA,mBACE,SACE,wCAGA,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 .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: \" \";\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 &:has(.pagesjs-page) {\n background: #f7f7f7;\n }\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":[]}
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,gIAOA,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 .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,25 @@
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 children are put on
6
- // pages one by one (fill() -> place()). Only the current page is in the DOM, so
7
- // measuring it is cheap (box.scrollHeight > H means the page overflows).
8
- // 2. When an element makes the page overflow, split() puts as much of it as
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 one by one, with the child that overflows broken recursively; text,
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
- // 3. Each page contains empty copies of the ancestors of the content root, so
21
+ // 4. Each page contains empty copies of the ancestors of the content root, so
17
22
  // CSS selectors that depend on them still work (see ctx()).
18
- // 4. In the end, page numbers and titles are added to the headers/footers.
23
+ // 5. In the end, page numbers and titles are added to the headers/footers.
19
24
  (d => {
20
25
 
21
26
  // --- Utilities -----------------------------------------------------
@@ -62,6 +67,7 @@
62
67
  wrapped = new WeakSet(), // elements whose runs of inline nodes have been wrapped
63
68
  guessed = new WeakSet(), // pages whose number of physical pages is an estimate (see calcPages())
64
69
  notes = new Map(), // the items of each note (footnote or citation), by its marker (see detachNotes())
70
+ probeY = new WeakMap(), // the bottoms of the blocks on the probe page (see fitting())
65
71
  hold = make('div'); // a hidden container for elements that need styles
66
72
  tpl.innerHTML = `<div class="pagesjs-header"></div>
67
73
  <div class="pagesjs-body"></div>
@@ -74,6 +80,7 @@
74
80
  wrap = [], // the ancestors of the content root (outermost first)
75
81
  H, B, // the height of a page and of its body
76
82
  H_min, H_line, // the height of a single-line paragraph (with margins) and of a line
83
+ used, // the height of the content of the page when it was last measured (see overflows())
77
84
  main_title, // the title of the document
78
85
  probed, // the content that is on the probe page (see probe())
79
86
  pending, // the rest of the pagination, which is waiting for the probe
@@ -105,7 +112,7 @@
105
112
  // the height of the page without the margin at the end of its content
106
113
  function pageHeight() { syncNotes(); return rect(box).height - trailingMargin(); }
107
114
  // does the page overflow?
108
- function overflows() { syncNotes(); return box.scrollHeight - trailingMargin() > H; }
115
+ function overflows() { syncNotes(); return (used = box.scrollHeight - trailingMargin()) > H; }
109
116
  // The notes are not measured inline (where they are floats next to their references),
110
117
  // but in a block after the page body, as in the end: put the notes of the references
111
118
  // that are on the page there (and take the others off).
@@ -347,6 +354,29 @@
347
354
 
348
355
  // --- Breaking elements ---------------------------------------------
349
356
 
357
+ // Measuring the page after each child is slow (a forced layout), so put several children
358
+ // on it at once when they surely fit: the nodes (in order) that end a line above the page
359
+ // bottom, going by their distances on the probe page from the last child on the page. If
360
+ // they turn out not to fit, they are taken back, so the estimate affects the speed but not
361
+ // the result. The children of the content root need the room that fill() asks for (H_min,
362
+ // and as much again for the margin after the previous child).
363
+ function fitting(head, nodes, root) {
364
+ const prev = lastEl(head), y0 = prev && !has(prev, fr_cls) ? probeY.get(prev) : undefined, run = [];
365
+ if (y0 === undefined || !used) return run;
366
+ let y = y0, n = 0;
367
+ for (const c of nodes) {
368
+ if (c.nodeType === 1) {
369
+ const y1 = probeY.get(c);
370
+ if (!(y1 >= y) || c.matches(`.${fr_cls}, .pagesjs-page`) || isBigBlock(c) || $('.pagesjs-note', c) ||
371
+ used + y1 - y0 + H_line > H || root && (used + y - y0 + 2 * H_min > H || book && $('h1', c))) break;
372
+ y = y1;
373
+ }
374
+ run.push(c);
375
+ c.nodeType === 1 && (n = run.length);
376
+ }
377
+ return run.slice(0, n);
378
+ }
379
+ function* siblings(n) { for (; n; n = n.nextSibling) yield n; }
350
380
  // move children to a clone of el one by one until the page is full, and split
351
381
  // the child that overflows recursively, so elements can be broken at any depth
352
382
  function splitBlock(el, container, prev, first, more) {
@@ -359,10 +389,15 @@
359
389
  endFrag(item);
360
390
  const big = isBigBlock(item);
361
391
  if (!big) {
362
- head.append(item);
392
+ const run = fitting(head, siblings(item));
393
+ run.length || run.push(item);
394
+ head.append(...run);
363
395
  if (!overflows()) continue;
396
+ // (the estimate was too optimistic) take back all but the first
397
+ if (run.length > 1 && (el.prepend(...run.slice(1)), !overflows())) continue;
364
398
  }
365
399
  const n = nChild(head), rest = split(item, head, big ? 'block' : undefined, more || !!firstEl(el));
400
+ used = null; // (the page has changed)
366
401
  if (rest) { partial = nChild(head) > n; el.prepend(rest); break; }
367
402
  }
368
403
  blank(el) && fitLastPiece(head, el, prev); // (may push children to el)
@@ -597,8 +632,14 @@
597
632
  })();
598
633
  });
599
634
  }
635
+ // record the bottoms of the blocks that may be children of a broken element
636
+ function markY(el) {
637
+ probeY.set(el, rect(el).bottom);
638
+ el.matches(`p, pre, table, ${atomic}`) || kids(el).forEach(markY);
639
+ }
600
640
  function unprobe() {
601
641
  if (!probed) return;
642
+ probed.forEach(ch => ch.forEach(markY)); // (before removing anything, to lay out only once)
602
643
  probed.forEach(ch => ch.forEach(el => el.remove()));
603
644
  box_body.innerHTML = ''; box_ctx = null; wrap = [];
604
645
  rmCls(box, 'pagesjs-settle');
@@ -615,6 +656,8 @@
615
656
  // add page number, title, etc. to data-* attributes of page elements
616
657
  function numberPages() {
617
658
  let page_title, i = 0;
659
+ const u = new URL(location.href); // page URL without ?paged=1, shown on the last page
660
+ u.searchParams.delete('paged');
618
661
  boxes.forEach(box => {
619
662
  if (book) {
620
663
  if ($('.pagesjs-front', box)) return; // skip book frontmatter page
@@ -625,7 +668,8 @@
625
668
  i += N;
626
669
  addCls(box, `page-${i % 2 === 0 ? 'even' : 'odd'}`);
627
670
  const info = {
628
- 'pageNumber': i, 'mainTitle': main_title, 'pageTitle': page_title
671
+ 'pageNumber': i, 'mainTitle': main_title, 'pageTitle': page_title,
672
+ 'pageUrl': box === boxes.at(-1) && u.href
629
673
  };
630
674
  [box.children[0], lastEl(box)].forEach(el => {
631
675
  for (const key in info) info[key] && (el.dataset[key] = info[key]);
@@ -638,9 +682,8 @@
638
682
  // add page numbers to TOC with data-* attributes
639
683
  function numberToc() {
640
684
  $$('#TOC a[href^="#"]').forEach(a => {
641
- const id = CSS.escape(a.getAttribute('href').replace(/^#/, '')),
642
- p = $(`.pagesjs-page:has(#${id}) .pagesjs-header`);
643
- a.dataset.pageNumber = p ? p.dataset.pageNumber : '';
685
+ const p = d.getElementById(a.getAttribute('href').slice(1))?.closest('.pagesjs-page');
686
+ a.dataset.pageNumber = p?.children[0].dataset.pageNumber ?? '';
644
687
  });
645
688
  }
646
689
 
@@ -724,13 +767,21 @@
724
767
  // iteratively add elements to pages
725
768
  function* fillPages(roots, els) {
726
769
  for (const el of $$('.pagesjs-front, .abstract, #TOC:not(.chapter-toc)')) {
770
+ // mark the first page if it has the frontmatter (for styling; :has() would be re-checked on every change)
771
+ has(el, 'pagesjs-front') && box === boxes[0] && addCls(box, 'page-front');
727
772
  yield* fill(el);
728
773
  book && nextPage();
729
774
  }
730
775
  for (const [i, el] of roots.entries()) {
731
776
  wrap = ancestors(el); box_ctx = null;
732
777
  book && (box.innerText === '' ? newPage(box) : nextPage());
733
- for (const [j, child] of els[i].entries()) yield* fill(child, i < roots.length - 1 || j < els[i].length - 1);
778
+ const list = els[i];
779
+ for (let j = 0; j < list.length; j++) {
780
+ yield* fill(list[j], i < roots.length - 1 || j < list.length - 1);
781
+ // put the next children on the page at once if they surely fit
782
+ const run = fitting(ctx(), list.slice(j + 1), true);
783
+ run.length && (ctx().append(...run), overflows() ? run.forEach(e => e.remove()) : j += run.length);
784
+ }
734
785
  // clean up container and self if empty
735
786
  removeBlank(el.parentNode); removeBlank(el);
736
787
  }
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 d(e,...t){e.classList.add(...t)}function p(e,...t){e.classList.remove(...t)}function u(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",E="pagesjs-fragmented",v="fragment-first",N="fragment-last",y=["top","bottom"].map(t=>l(c(e.documentElement).getPropertyValue(`--paper-margin-${t}`))),j=u("div","pagesjs-page"),H=[],C=new WeakSet,L=new WeakSet,x=new Map,M=new WeakMap,w=u("div");j.innerHTML='<div class="pagesjs-header"></div>\n<div class="pagesjs-body"></div>\n<div class="pagesjs-footer"></div>',w.style.display="none";let S,k,O,P,A,R,B,$,W,F,I,q,U,V,z=[],D=0;function X(e){return e&&!t(".pagesjs-body",e)&&e.insertAdjacentHTML("afterbegin",j.innerHTML),S=e||j.cloneNode(!0),k=S.children[1],O=null,H.includes(S)||H.push(S),S}function _(e=k){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 J(){return G(),a(S).height-_()}function Y(){return G(),($=S.scrollHeight-_())>P}function G(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=u("div")),s.className="footnotes",(i.some((e,t)=>s.children[t]!==e)||o(s)!==i.length)&&s.replaceChildren(...i)}function K(e,t){const n=S;n.after(X(e)),t&&t(),Q(n)}function Q(e){G(e);const t=e.scrollHeight;if(t-_(e.children[1])>P&&!e.dataset.pagesOffset){const o=function(e,t){let o=+e.dataset.pagesOffset;if(o)return o;if(o=Math.ceil(t/P),o<=1)return o;const r=y.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)/P)}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(),U&&(U.textContent=`Paginating: ${++D} pages done`)}function Z(t){const n=[];for(;t&&t!==e.body;t=t.parentNode)n.unshift(t);return n}function ee(){return z.length?(O&&k.contains(O)||(O=z.reduce((e,t)=>{const n=t.cloneNode();return d(n,"pagesjs-wrap"),e.appendChild(n)},k)),O):k}function te(e){if(!e||"BODY"===e.tagName)return!1;const t=!("P"===e.tagName?e.innerHTML:e.innerText).trim();return t&&e.remove(),t}function*ne(e,n=!0){f(e,"pagesjs-page")?K(e,()=>o(e)>3&&(k.append(...r(e).slice(3)),K())):(b&&""!==S.innerText&&t("h1",e)&&K(),e.innerText.trim()&&(G(),P-S.scrollHeight<R)&&K(),yield*function*(e,t){for(;;){const n=ee();if(pe(e),re(e))e=oe(e,n,"block",t);else{if(n.append(e),!Y())return;e=oe(e,n,void 0,t)}if(!e)return;K(),yield}}(e,n))}function oe(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)||!ae(t))return;if("PRE"===n){if("CODE"===i(e)?.tagName&&fe(e).length>1)return"code";if(e.offsetHeight<=A)return}return r(e).some(e=>!ce(e))?"block":"inline"}(e),a="block"===s?void 0:se(e),l=!f(e,E),u=s&&ge[s](e,t,a,l,o);if(!u)return a&&(e.remove(),e);const[g,h]=u;return ie(g)?(g.remove(),h):(h?(d(h,E),p(h,v,N)):f(g,v)?p(g,E,v,N):d(g,N),h)}function re(e){return!["TABLE","PRE"].includes(e.tagName)&&e.getElementsByTagName("*").length>300}function ie(e){return!i(e)&&!e.textContent.trim()}function se(e){for(;e&&e!==k;e=e.parentNode)for(let t=e.previousElementSibling;t;t=t.previousElementSibling)if(a(t).height)return!0;return!1}function ae(e){return"none"===e.float&&!["absolute","fixed"].includes(e.position)}function ce(e){if(1!==e.nodeType)return!0;const t=c(e),n=t.display;return n.startsWith("inline")||"none"===n||"contents"===n||!ae(t)}function le(e){const t=c(e);return(t.display.startsWith("inline")||"contents"===t.display)&&ae(t)}function fe(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 de(e,t){d(e,E),p(e,N),t&&d(e,v)}function pe(e){1===e.nodeType&&[e,...n("."+E,e)].forEach(e=>f(e,E)&&d(e,N))}function ue(e,t,n){const o=e.cloneNode();return e.remove(),t.append(o),de(o,n),o}const ge={block:function(e,t,n,r,s){!function(e){if(C.has(e)||f(e,"pagesjs-run"))return;C.add(e),e.isConnected||w.append(e);let t=[];function n(){if(t.some(e=>1===e.nodeType||3===e.nodeType&&e.nodeValue.trim())){const e=u("span","pagesjs-run");t[0].before(e),e.append(...t)}t=[]}for(const o of[...e.childNodes])ce(o)?t.push(o):n();n(),e.parentNode===w&&e.remove()}(e);const a=ue(e,t,r);let c,l;n=se(a);for(;c=e.firstChild;){if(1!==c.nodeType){a.append(c);continue}pe(c);const t=re(c);if(!t){const t=he(a,me(c));if(t.length||t.push(c),a.append(...t),!Y())continue;if(t.length>1&&(e.prepend(...t.slice(1)),!Y()))continue}const n=o(a),r=oe(c,a,t?"block":void 0,s||!!i(e));if($=null,r){l=o(a)>n,e.prepend(r);break}}return ie(e)&&ve(a,e,n),ie(e)||be(a,e,n),n&&!l&&Te(a,e),"OL"===e.tagName&&o(a)&&!ie(e)&&Ne(a,e),[a,ie(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)||!le(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:ye(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 p=d;function u(){const e=c[--p];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()}de(n,i);for(;p>(r?0:1)&&(u(),!(p>0)||Y()););p>1&&d-p===1&&!s&&u();return[n,f]},table:function(e,t,n,o){const r=ue(e,t,o),i=e.tBodies[0],s=i.cloneNode(),l=[...i.rows],f=l.length,d=n?0:1,p=e.caption&&"bottom"!==c(e.caption).captionSide?e.caption:null;function u(){p&&e.prepend(p),r.innerHTML=""}p&&r.append(p),[e.tHead,s,e.tFoot].forEach(e=>e&&r.append(e===s?e:e.cloneNode(!0))),s.append(...l);const g=J()-P-.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&&J()>P+.5;)i.prepend(l[--o])}s.rows.length||u();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&&u());return[r,i.rows.length?e:null]},code:function(e,t,n,o){const s=i(e),l=fe(e),f=r(e),d=f.filter((e,t)=>t>f.indexOf(s)&&ae(c(e))),p=ue(e,t,o),u=s.cloneNode();p.append(u,...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=J()-P-.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&&J()>P+.5;)e.innerHTML=t.slice(0,--d).join("\n");return Math.max(d,r)}(u,l,n);h>1&&l.length-h===1&&h--;1===h&&n&&(h=0);h?u.innerHTML=l.slice(0,h).join("\n"):p.innerHTML="";return s.innerHTML=l.slice(h).join("\n"),s.innerHTML.trim()?[p,e]:(h&&p.append(...d),[p,null])}};function he(e,n,o){const r=s(e),i=r&&!f(r,E)?M.get(r):void 0,a=[];if(void 0===i||!$)return a;let c=i,l=0;for(const e of n){if(1===e.nodeType){const n=M.get(e);if(!(n>=c)||e.matches(`.${E}, .pagesjs-page`)||re(e)||t(".pagesjs-note",e)||$+n-i+B>P||o&&($+c-i+2*R>P||b&&t("h1",e)))break;c=n}a.push(e),1===e.nodeType&&(l=a.length)}return a.slice(0,l)}function*me(e){for(;e;e=e.nextSibling)yield e}function be(e,t,n){for(let r;(r=s(e))?.matches("legend, .caption")&&(o(e)>1||n);)t.prepend(r)}function Te(e,t){!ie(t)&&a(e).height<1.5*B&&(Ee(s(e),i(t)),t.prepend(...e.childNodes))}function Ee(e,t){e&&t&&f(e,E)&&f(t,E)&&e.tagName===t.tagName&&(Ee(s(e),i(t)),t.prepend(...e.childNodes),p(t,...f(e,v)?[E,v,N]:[v]),e.remove())}function ve(e,t,n){for(d(e,N);Y()&&s(e)&&(o(e)>1||n);){const n=s(e),o=oe(n,e,void 0,!0);if(!o)break;if(t.prepend(o),o!==n)break}ie(t)||p(e,N)}function Ne(e,t){t.start+=o(e)-(f(i(t),E)?1:0)}function ye(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 je(e){M.set(e,a(e).bottom),e.matches(`p, pre, table, ${T}`)||r(e).forEach(je)}function He(e){return e&&(e.dataset.shortTitle||e.innerText)}const Ce=(b?"h1":"h2")+":not(.pagesjs-front *)";function Le(e){return[...e.childNodes].some(e=>3===e.nodeType&&e.nodeValue.trim())}function xe(e){return!["PRE","TABLE"].includes(e.tagName)&&!Le(e)}function Me(e){const t=performance.now();for(;!q.next().done;)if(!(e||performance.now()-t<500))return new Promise(e=>{requestAnimationFrame(e),setTimeout(e,50)}).then(()=>Me())}function we(c){const l=c||/Headless/.test(navigator.userAgent)||navigator.webdriver;if("complete"!==e.readyState)return h("load",()=>we(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=>d(e,"pagesjs-front")),W=He(t("h1.title, .pagesjs-front h1, .title, h1")),T.add("pagesjs"),e.body.append(w),l||(U=u("div","pagesjs-progress"),U.textContent="Paginating...",e.body.append(U)),e.body.insertAdjacentElement("afterbegin",X()),P=(S.clientHeight||window.innerHeight)+3,A=k.clientHeight||P,n(":is(#TOC, .footnotes, .chapter-before, .chapter-after):is(.side-left, .side-right).side").forEach(e=>{p(e,"side","side-left","side-right")}),T.add("pagesjs-filling"),function(){const e=u("p"),t=S.scrollHeight;e.innerText="A",k.append(e),R=S.scrollHeight-t,B=a(e).height,e.remove()}(),n('#TOC a[href^="#"]').forEach(e=>{const t=u("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=u("span","pagesjs-note");n.hidden=!0,x.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)&&!Le(a)&&xe(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=>![S,w,U].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")&&S===H[0]&&d(S,"page-front"),yield*ne(e),b&&K();for(const[n,o]of e.entries()){z=Z(o),O=null,b&&(""===S.innerText?X(S):K());const r=t[n];for(let t=0;t<r.length;t++){yield*ne(r[t],n<e.length-1||t<r.length-1);const o=he(ee(),r.slice(t+1),!0);o.length&&(ee().append(...o),Y()?o.forEach(e=>e.remove()):t+=o.length)}te(o.parentNode),te(o)}Q(S),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(Ce,i)&&(e="")}const a=+i.dataset.pagesOffset||1;a>1&&d(i,"page-multiple"),o+=a,d(i,"page-"+(o%2==0?"even":"odd"));const c={pageNumber:o,mainTitle:W,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=He([...n(Ce,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??""}),w.remove(),U?.remove(),V=!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")}I=e=>(I=null,F&&(F.forEach(e=>e.forEach(je)),F.forEach(e=>e.forEach(e=>e.remove())),k.innerHTML="",O=null,z=[],p(S,"pagesjs-settle"),F=null),q=y(),Me(e||l)),c?I(!0):function(e,t){return d(S,"pagesjs-settle"),e.forEach((e,n)=>{z=Z(e),O=null,ee().append(...t[n])}),F=t,new Promise(e=>{const t=setTimeout(e,500);let n=0;!function o(){requestAnimationFrame(()=>++n<3?o():(clearTimeout(t),e()))}()})}(v,N).then(()=>I?.())}h("beforeprint",()=>{if(I)I(!0);else if(q)for(;!q.next().done;);else we(!0)}),h("pagesjs:paginate",()=>{V?m("pagesjs:after"):we()});const Se=new URLSearchParams(location.search);Se.get("paged")&&we(),h("keypress",e=>{"p"===e.key&&(Se.get("paged")?(Se.delete("paged"),location.href=location.pathname+(Se.size?`?${Se}`:"")):(we(),Se.set("paged",1),history.replaceState({},"",`${location.pathname}?${Se}`)))})})(document);
2
2
  //# sourceMappingURL=pages.min.js.map
@@ -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,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AAIC,gBAAgBC,SAASC,QACxCH,GAAGxN,IAAI,UAAYwK,KACnB1O,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","tb","map","i","documentElement","getPropertyValue","tpl","boxes","wrapped","WeakSet","guessed","notes","Map","probeY","WeakMap","hold","innerHTML","display","box","box_body","box_ctx","H","B","H_min","H_line","used","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","fitting","siblings","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","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","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":"AAuBA,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,EAA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O,SAAUH,SAASC,KAAOD,SAASsB,UAAYH,GAAGI,KAAO,IAAIJ,KAAO,MAE9EtD,KACAsD,GAAGtE,IAAI,QAAS,GAAI2E,QAAQC,aAAa,CAAC,EAAG,GAAI,GAAGzB,SAASsB,YAAYH,SAIhF,EAr1BD,CAq1BGO","ignoreList":[]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xiee/utils",
3
- "version": "1.14.136",
3
+ "version": "1.14.137",
4
4
  "description": "Miscellaneous tools and utilities to manipulate HTML pages",
5
5
  "scripts": {
6
6
  "test": "playwright test"