@xiee/utils 1.13.70 → 1.14.0

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.
@@ -49,6 +49,23 @@
49
49
  inset: auto 5px 5px auto;
50
50
  }
51
51
  }
52
+ &.pagesjs-fragmented {
53
+ &:not(.fragment-first), &:not(.fragment-last) blockquote {
54
+ &::before, &::after {
55
+ display: none;
56
+ }
57
+ }
58
+ &:not(.fragment-first) {
59
+ &, blockquote {
60
+ padding-top: 1px;
61
+ }
62
+ }
63
+ &:not(.fragment-last) {
64
+ &, blockquote {
65
+ padding-bottom: 1px;
66
+ }
67
+ }
68
+ }
52
69
  }
53
70
 
54
71
  /* a tale of two buttons */
@@ -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}}}.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{justify-content:space-between;gap:.5em;display:flex;& *{flex:1}& pre:has(code[data-file]){&,&:before{border:groove #f5fffa}& code{border:none;border-top:1px dashed #d3d3d3}&{border-top:none}&:before{border-bottom:none;border-left:none}}}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:first-child{&:before,& code:before{content:unset}}& code,&:before{border:groove #f5fffa}&:before{border-bottom:none}}.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{justify-content:space-between;gap:.5em;display:flex;& *{flex:1}& pre:has(code[data-file]){&,&:before{border:groove #f5fffa}& code{border:none;border-top:1px dashed #d3d3d3}&{border-top:none}&:before{border-bottom:none;border-left:none}}}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:first-child{&:before,& code:before{content:unset}}& code,&:before{border:groove #f5fffa}&:before{border-bottom:none}}.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,kCAOJ,UACE,iDAKA,+BACA,wBACE,+BAEF,YACE,yBACA,gCAEF,kCACA,qCACA,0CAIF,8DAIE,WAGA,2BACE,iCAGA,iDAIA,kBAGA,+CAOJ,wJAUA,yBACE,4HAQA,2DAGA,qDAGA,iCACE,sCAIF,sCAGA,6BAKF,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}\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 display: flex;\n justify-content: space-between;\n gap: .5em;\n * {\n flex: 1;\n }\n pre:has(code[data-file]) {\n &, &::before {\n border: groove mintcream;\n }\n code {\n border: none;\n border-top: 1px dashed lightgray;\n }\n & {\n border-top: none;\n }\n &::before {\n border-left: none;\n border-bottom: none;\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 &.pagesjs-fragmented:first-child {\n &::before, code::before {\n content: unset;\n }\n }\n code, &::before {\n border: groove mintcream;\n }\n &::before {\n border-bottom: none;\n }\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,8DAIE,WAGA,2BACE,iCAGA,iDAIA,kBAGA,+CAOJ,wJAUA,yBACE,4HAQA,2DAGA,qDAGA,iCACE,sCAIF,sCAGA,6BAKF,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 display: flex;\n justify-content: space-between;\n gap: .5em;\n * {\n flex: 1;\n }\n pre:has(code[data-file]) {\n &, &::before {\n border: groove mintcream;\n }\n code {\n border: none;\n border-top: 1px dashed lightgray;\n }\n & {\n border-top: none;\n }\n &::before {\n border-left: none;\n border-bottom: none;\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 &.pagesjs-fragmented:first-child {\n &::before, code::before {\n content: unset;\n }\n }\n code, &::before {\n border: groove mintcream;\n }\n &::before {\n border-bottom: none;\n }\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/default.css CHANGED
@@ -28,18 +28,19 @@ pre > code {
28
28
  border-left: 2px solid;
29
29
  &:hover { opacity: inherit; }
30
30
  }
31
- .box, .figure, .table { margin: 1em auto; }
31
+ .box, .figure, .table, table { margin: 1em auto; }
32
32
  div > .caption { padding: 1px 1em; }
33
33
  .figure { p:has(img), pre:has(svg) { text-align: center; } }
34
34
  .flex-col { display: flex; justify-content: space-between; }
35
- table :is(th, td) { padding: 5px; font-variant-numeric: tabular-nums; }
36
- table:not([class]) {
37
- margin: 1em auto;
38
- border-top: 1px solid #666;
39
- thead th { border-bottom: 1px solid #ddd; }
40
- }
41
- table:not([class]), .table-striped {
35
+ table {
36
+ &:only-child:not(.table > *) { margin: auto; }
37
+ th, td { padding: 5px; font-variant-numeric: tabular-nums; }
42
38
  thead, tfoot, tr:nth-child(even) { background: whitesmoke; }
39
+ thead th { border-bottom: 1px solid #ddd; }
40
+ &:not(.datatable-table) {
41
+ border-top: 1px solid #666;
42
+ border-bottom: 1px solid #666;
43
+ }
43
44
  }
44
45
  blockquote {
45
46
  color: #666;
@@ -55,7 +56,7 @@ hr, .footnotes::before { border: 1px dashed #ddd; }
55
56
  & > ul { padding: 0; }
56
57
  ul ul { border-left: 1px solid lightsteelblue; }
57
58
  }
58
- table:not([class]), .body h2 { border-bottom: 1px solid #666; }
59
+ .body h2 { border-bottom: 1px solid #666; }
59
60
  .body .appendix, .appendix ~ h2 { border-bottom-style: dashed; }
60
61
  .main-number::after { content: "."; }
61
62
  span[class^="ref-number-"] { font-weight: bold; }
@@ -1,2 +1,2 @@
1
- body{max-width:800px;margin:auto;padding:1em;font-family:sans-serif;line-height:1.5}body,.abstract,code,.footnotes,footer,#refs,.caption{font-size:.9em}li li{font-size:.95em}ul:has(li>input[type=checkbox]){padding-left:1em;list-style:none}*,:before,:after{box-sizing:border-box}a{color:#4682b4}pre,img{max-width:100%}pre{white-space:pre-wrap;word-break:break-word}pre code{padding:1em;display:block;overflow-x:auto}code{font-family:DejaVu Sans Mono,Droid Sans Mono,Lucida Console,Consolas,Monaco,monospace}:not(pre)>code,code[class],div>.caption{background:#f8f8f8}pre>code:is(:not([class]),.language-plain,.language-none,.plain),.box,.figure,.table{background:inherit;border:1px solid #eee}pre>code{&.message{border-color:#9eeaf9}&.warning{background:#fff3cd;border-color:#fff3cd}&.error{background:#f8d7da;border-color:#f8d7da}}.fenced-chunk{border-left:1px solid #666}.code-fence{opacity:.4;border:1px dashed #666;border-left:2px solid;&:hover{opacity:inherit}}.box,.figure,.table{margin:1em auto}div>.caption{padding:1px 1em}.figure{& p:has(img),& pre:has(svg){text-align:center}}.flex-col{justify-content:space-between;display:flex}table :is(th,td){font-variant-numeric:tabular-nums;padding:5px}table:not([class]){border-top:1px solid #666;margin:1em auto;& thead th{border-bottom:1px solid #ddd}}table:not([class]),.table-striped{& thead,& tfoot,& tr:nth-child(2n){background:#f5f5f5}}blockquote{color:#666;border-left:.5em solid #eee;margin:0;padding:1px 1em}hr,.footnotes:before{border:1px dashed #ddd}.frontmatter{text-align:center}#TOC{& a{text-decoration:none}& ul{padding-left:1em;list-style:none}&>ul{padding:0}& ul ul{border-left:1px solid #b0c4de}}table:not([class]),.body h2{border-bottom:1px solid #666}.body .appendix,.appendix~h2{border-bottom-style:dashed}.main-number:after{content:"."}span[class^=ref-number-]{font-weight:700}.ref-number-fig:after,.ref-number-tab:after{content:":"}.cross-ref-chp:before{content:"Chapter "}.cross-ref-sec:before{content:"Section "}.cross-ref-fig:before,.ref-number-fig:before{content:"Figure "}.cross-ref-tab:before,.ref-number-tab:before{content:"Table "}.cross-ref-eqn:before,.MathJax_ref:has(mjx-mtext>mjx-c+mjx-c):before{content:"Equation "}.abstract,#refs{&:before{margin:1em auto;font-weight:700;display:block}}.abstract:before{content:"Abstract";text-align:center}#refs:before{content:"Bibliography";font-size:1.5em}.ref-paren-open:before{content:"("}.ref-paren-close:after{content:")"}.ref-semicolon:after{content:"; "}.ref-and:after{content:" and "}.ref-et-al:after{content:" et al.";font-style:italic}.footnote-ref a{&:before{content:"["}&:after{content:"]"}}section.footnotes{margin-top:2em;&:before{content:"";max-width:20em;display:block}}.fade{opacity:.6;background:repeating-linear-gradient(135deg,#fff,#fff 30px,#ddd 32px 32px)}@media print{body{max-width:100%}tr,img{break-inside:avoid}}@media only screen and (width>=992px){body:not(.pagesjs) pre:has(.line-numbers):not(:hover){white-space:pre}}
1
+ body{max-width:800px;margin:auto;padding:1em;font-family:sans-serif;line-height:1.5}body,.abstract,code,.footnotes,footer,#refs,.caption{font-size:.9em}li li{font-size:.95em}ul:has(li>input[type=checkbox]){padding-left:1em;list-style:none}*,:before,:after{box-sizing:border-box}a{color:#4682b4}pre,img{max-width:100%}pre{white-space:pre-wrap;word-break:break-word}pre code{padding:1em;display:block;overflow-x:auto}code{font-family:DejaVu Sans Mono,Droid Sans Mono,Lucida Console,Consolas,Monaco,monospace}:not(pre)>code,code[class],div>.caption{background:#f8f8f8}pre>code:is(:not([class]),.language-plain,.language-none,.plain),.box,.figure,.table{background:inherit;border:1px solid #eee}pre>code{&.message{border-color:#9eeaf9}&.warning{background:#fff3cd;border-color:#fff3cd}&.error{background:#f8d7da;border-color:#f8d7da}}.fenced-chunk{border-left:1px solid #666}.code-fence{opacity:.4;border:1px dashed #666;border-left:2px solid;&:hover{opacity:inherit}}.box,.figure,.table,table{margin:1em auto}div>.caption{padding:1px 1em}.figure{& p:has(img),& pre:has(svg){text-align:center}}.flex-col{justify-content:space-between;display:flex}table{&:only-child:not(.table>*){margin:auto}& th,& td{font-variant-numeric:tabular-nums;padding:5px}& thead,& tfoot,& tr:nth-child(2n){background:#f5f5f5}& thead th{border-bottom:1px solid #ddd}&:not(.datatable-table){border-top:1px solid #666;border-bottom:1px solid #666}}blockquote{color:#666;border-left:.5em solid #eee;margin:0;padding:1px 1em}hr,.footnotes:before{border:1px dashed #ddd}.frontmatter{text-align:center}#TOC{& a{text-decoration:none}& ul{padding-left:1em;list-style:none}&>ul{padding:0}& ul ul{border-left:1px solid #b0c4de}}.body h2{border-bottom:1px solid #666}.body .appendix,.appendix~h2{border-bottom-style:dashed}.main-number:after{content:"."}span[class^=ref-number-]{font-weight:700}.ref-number-fig:after,.ref-number-tab:after{content:":"}.cross-ref-chp:before{content:"Chapter "}.cross-ref-sec:before{content:"Section "}.cross-ref-fig:before,.ref-number-fig:before{content:"Figure "}.cross-ref-tab:before,.ref-number-tab:before{content:"Table "}.cross-ref-eqn:before,.MathJax_ref:has(mjx-mtext>mjx-c+mjx-c):before{content:"Equation "}.abstract,#refs{&:before{margin:1em auto;font-weight:700;display:block}}.abstract:before{content:"Abstract";text-align:center}#refs:before{content:"Bibliography";font-size:1.5em}.ref-paren-open:before{content:"("}.ref-paren-close:after{content:")"}.ref-semicolon:after{content:"; "}.ref-and:after{content:" and "}.ref-et-al:after{content:" et al.";font-style:italic}.footnote-ref a{&:before{content:"["}&:after{content:"]"}}section.footnotes{margin-top:2em;&:before{content:"";max-width:20em;display:block}}.fade{opacity:.6;background:repeating-linear-gradient(135deg,#fff,#fff 30px,#ddd 32px 32px)}@media print{body{max-width:100%}tr,img{break-inside:avoid}}@media only screen and (width>=992px){body:not(.pagesjs) pre:has(.line-numbers):not(:hover){white-space:pre}}
2
2
  /*# sourceMappingURL=default.min.css.map */
@@ -1 +1 @@
1
- {"version":3,"mappings":"AAAA,oFAOA,oEACA,sBACA,iEACA,uCACA,gBACA,uBACA,+CACA,mDACA,2FACA,2DACA,8HACA,SACE,+BACA,kDACA,iDAEF,yCACA,oEAIE,yBAEF,oCACA,6BACA,QAAU,+CACV,qDACA,+DACA,6DAGE,yCAEF,kCACE,uDAEF,2EAMA,4CACA,+BACA,KACE,yBACA,sCACA,eACA,uCAEF,yDACA,wDACA,+BACA,yCACA,wDACA,yCACA,yCACA,+DACA,8DACA,yFACA,gBACE,wDAEF,sDACA,oDACA,mCACA,mCACA,kCACA,+BACA,qDACA,gBACE,qBACA,qBAEF,iCAEE,kDAEF,4FAKA,aACE,oBACA,2BAEF,sCACE","sources":["default.css"],"sourcesContent":["body {\n font-family: sans-serif;\n max-width: 800px;\n margin: auto;\n padding: 1em;\n line-height: 1.5;\n}\nbody, .abstract, code, .footnotes, footer, #refs, .caption { font-size: .9em; }\nli li { font-size: .95em; }\nul:has(li > input[type=\"checkbox\"]) { list-style: none; padding-left: 1em; }\n*, :before, :after { box-sizing: border-box; }\na { color: steelblue; }\npre, img { max-width: 100%; }\npre { white-space: pre-wrap; word-break: break-word; }\npre code { display: block; padding: 1em; overflow-x: auto; }\ncode { font-family: 'DejaVu Sans Mono', 'Droid Sans Mono', 'Lucida Console', Consolas, Monaco, monospace; }\n:not(pre) > code, code[class], div > .caption { background: #f8f8f8; }\npre > code:is(:not([class]), .language-plain, .language-none, .plain), .box, .figure, .table { background: inherit; border: 1px solid #eee; }\npre > code {\n &.message { border-color: #9eeaf9; }\n &.warning { background: #fff3cd; border-color: #fff3cd; }\n &.error { background: #f8d7da; border-color: #f8d7da; }\n}\n.fenced-chunk { border-left: 1px solid #666; }\n.code-fence {\n opacity: .4;\n border: 1px dashed #666;\n border-left: 2px solid;\n &:hover { opacity: inherit; }\n}\n.box, .figure, .table { margin: 1em auto; }\ndiv > .caption { padding: 1px 1em; }\n.figure { p:has(img), pre:has(svg) { text-align: center; } }\n.flex-col { display: flex; justify-content: space-between; }\ntable :is(th, td) { padding: 5px; font-variant-numeric: tabular-nums; }\ntable:not([class]) {\n margin: 1em auto;\n border-top: 1px solid #666;\n thead th { border-bottom: 1px solid #ddd; }\n}\ntable:not([class]), .table-striped {\n thead, tfoot, tr:nth-child(even) { background: whitesmoke; }\n}\nblockquote {\n color: #666;\n margin: 0;\n padding: 1px 1em;\n border-left: .5em solid #eee;\n}\nhr, .footnotes::before { border: 1px dashed #ddd; }\n.frontmatter { text-align: center; }\n#TOC {\n a { text-decoration: none; }\n ul { list-style: none; padding-left: 1em; }\n & > ul { padding: 0; }\n ul ul { border-left: 1px solid lightsteelblue; }\n}\ntable:not([class]), .body h2 { border-bottom: 1px solid #666; }\n.body .appendix, .appendix ~ h2 { border-bottom-style: dashed; }\n.main-number::after { content: \".\"; }\nspan[class^=\"ref-number-\"] { font-weight: bold; }\n.ref-number-fig::after, .ref-number-tab::after { content: \":\"; }\n.cross-ref-chp::before { content: \"Chapter \"; }\n.cross-ref-sec::before { content: \"Section \"; }\n.cross-ref-fig::before, .ref-number-fig::before { content: \"Figure \"; }\n.cross-ref-tab::before, .ref-number-tab::before { content: \"Table \"; }\n.cross-ref-eqn::before, .MathJax_ref:has(mjx-mtext > mjx-c + mjx-c)::before { content: \"Equation \"; }\n.abstract, #refs {\n &::before { display: block; margin: 1em auto; font-weight: bold; }\n}\n.abstract::before { content: \"Abstract\"; text-align: center; }\n#refs::before { content: \"Bibliography\"; font-size: 1.5em; }\n.ref-paren-open::before { content: \"(\"; }\n.ref-paren-close::after { content: \")\"; }\n.ref-semicolon::after { content: \"; \"; }\n.ref-and::after { content: \" and \"; }\n.ref-et-al::after { content: \" et al.\"; font-style: italic; }\n.footnote-ref a {\n &::before { content: \"[\"; }\n &::after { content: \"]\"; }\n}\nsection.footnotes {\n margin-top: 2em;\n &::before { content: \"\"; display: block; max-width: 20em; }\n}\n.fade {\n background: repeating-linear-gradient(135deg, white, white 30px, #ddd 32px, #ddd 32px);\n opacity: 0.6;\n}\n\n@media print {\n body { max-width: 100%; }\n tr, img { break-inside: avoid; }\n}\n@media only screen and (min-width: 992px) {\n body:not(.pagesjs) pre:has(.line-numbers):not(:hover) { white-space: pre; }\n}\n"],"names":[]}
1
+ {"version":3,"mappings":"AAAA,oFAOA,oEACA,sBACA,iEACA,uCACA,gBACA,uBACA,+CACA,mDACA,2FACA,2DACA,8HACA,SACE,+BACA,kDACA,iDAEF,yCACA,oEAIE,yBAEF,0CACA,6BACA,QAAU,+CACV,qDACA,MACE,uCACA,wDACA,sDACA,wCACA,gFAKF,2EAMA,4CACA,+BACA,KACE,yBACA,sCACA,eACA,uCAEF,sCACA,wDACA,+BACA,yCACA,wDACA,yCACA,yCACA,+DACA,8DACA,yFACA,gBACE,wDAEF,sDACA,oDACA,mCACA,mCACA,kCACA,+BACA,qDACA,gBACE,qBACA,qBAEF,iCAEE,kDAEF,4FAKA,aACE,oBACA,2BAEF,sCACE","sources":["default.css"],"sourcesContent":["body {\n font-family: sans-serif;\n max-width: 800px;\n margin: auto;\n padding: 1em;\n line-height: 1.5;\n}\nbody, .abstract, code, .footnotes, footer, #refs, .caption { font-size: .9em; }\nli li { font-size: .95em; }\nul:has(li > input[type=\"checkbox\"]) { list-style: none; padding-left: 1em; }\n*, :before, :after { box-sizing: border-box; }\na { color: steelblue; }\npre, img { max-width: 100%; }\npre { white-space: pre-wrap; word-break: break-word; }\npre code { display: block; padding: 1em; overflow-x: auto; }\ncode { font-family: 'DejaVu Sans Mono', 'Droid Sans Mono', 'Lucida Console', Consolas, Monaco, monospace; }\n:not(pre) > code, code[class], div > .caption { background: #f8f8f8; }\npre > code:is(:not([class]), .language-plain, .language-none, .plain), .box, .figure, .table { background: inherit; border: 1px solid #eee; }\npre > code {\n &.message { border-color: #9eeaf9; }\n &.warning { background: #fff3cd; border-color: #fff3cd; }\n &.error { background: #f8d7da; border-color: #f8d7da; }\n}\n.fenced-chunk { border-left: 1px solid #666; }\n.code-fence {\n opacity: .4;\n border: 1px dashed #666;\n border-left: 2px solid;\n &:hover { opacity: inherit; }\n}\n.box, .figure, .table, table { margin: 1em auto; }\ndiv > .caption { padding: 1px 1em; }\n.figure { p:has(img), pre:has(svg) { text-align: center; } }\n.flex-col { display: flex; justify-content: space-between; }\ntable {\n &:only-child:not(.table > *) { margin: auto; }\n th, td { padding: 5px; font-variant-numeric: tabular-nums; }\n thead, tfoot, tr:nth-child(even) { background: whitesmoke; }\n thead th { border-bottom: 1px solid #ddd; }\n &:not(.datatable-table) {\n border-top: 1px solid #666;\n border-bottom: 1px solid #666;\n }\n}\nblockquote {\n color: #666;\n margin: 0;\n padding: 1px 1em;\n border-left: .5em solid #eee;\n}\nhr, .footnotes::before { border: 1px dashed #ddd; }\n.frontmatter { text-align: center; }\n#TOC {\n a { text-decoration: none; }\n ul { list-style: none; padding-left: 1em; }\n & > ul { padding: 0; }\n ul ul { border-left: 1px solid lightsteelblue; }\n}\n.body h2 { border-bottom: 1px solid #666; }\n.body .appendix, .appendix ~ h2 { border-bottom-style: dashed; }\n.main-number::after { content: \".\"; }\nspan[class^=\"ref-number-\"] { font-weight: bold; }\n.ref-number-fig::after, .ref-number-tab::after { content: \":\"; }\n.cross-ref-chp::before { content: \"Chapter \"; }\n.cross-ref-sec::before { content: \"Section \"; }\n.cross-ref-fig::before, .ref-number-fig::before { content: \"Figure \"; }\n.cross-ref-tab::before, .ref-number-tab::before { content: \"Table \"; }\n.cross-ref-eqn::before, .MathJax_ref:has(mjx-mtext > mjx-c + mjx-c)::before { content: \"Equation \"; }\n.abstract, #refs {\n &::before { display: block; margin: 1em auto; font-weight: bold; }\n}\n.abstract::before { content: \"Abstract\"; text-align: center; }\n#refs::before { content: \"Bibliography\"; font-size: 1.5em; }\n.ref-paren-open::before { content: \"(\"; }\n.ref-paren-close::after { content: \")\"; }\n.ref-semicolon::after { content: \"; \"; }\n.ref-and::after { content: \" and \"; }\n.ref-et-al::after { content: \" et al.\"; font-style: italic; }\n.footnote-ref a {\n &::before { content: \"[\"; }\n &::after { content: \"]\"; }\n}\nsection.footnotes {\n margin-top: 2em;\n &::before { content: \"\"; display: block; max-width: 20em; }\n}\n.fade {\n background: repeating-linear-gradient(135deg, white, white 30px, #ddd 32px, #ddd 32px);\n opacity: 0.6;\n}\n\n@media print {\n body { max-width: 100%; }\n tr, img { break-inside: avoid; }\n}\n@media only screen and (min-width: 992px) {\n body:not(.pagesjs) pre:has(.line-numbers):not(:hover) { white-space: pre; }\n}\n"],"names":[]}
package/css/manual.css CHANGED
@@ -1,8 +1,6 @@
1
1
  /* mainly for litedown::pkg_manual() */
2
2
  .table-full {
3
3
  width: 100%;
4
- border-top: 1px solid #666;
5
- border-bottom: 1px solid #666;
6
4
  td {
7
5
  vertical-align: baseline;
8
6
  & > p {
@@ -1,2 +1,2 @@
1
- .table-full{border-top:1px solid #666;border-bottom:1px solid #666;width:100%;& td{vertical-align:baseline;&>p{&:first-child{margin-top:0}&:last-child{margin-bottom:0}}}}code.fade:before{content:"🚫";float:right;font-size:1.5em;line-height:1}@media only screen{body:not(.pagesjs) pre:not([class]){max-height:300px;overflow-y:auto}}.orcid{vertical-align:middle;width:1em;height:1em}
1
+ .table-full{width:100%;& td{vertical-align:baseline;&>p{&:first-child{margin-top:0}&:last-child{margin-bottom:0}}}}code.fade:before{content:"🚫";float:right;font-size:1.5em;line-height:1}@media only screen{body:not(.pagesjs) pre:not([class]){max-height:300px;overflow-y:auto}}.orcid{vertical-align:middle;width:1em;height:1em}
2
2
  /*# sourceMappingURL=manual.min.css.map */
@@ -1 +1 @@
1
- {"version":3,"mappings":"AACA,8EAIE,6BAEE,IACE,2BACA,gCAIN,0EAMA,mBACE,sEAKF","sources":["manual.css"],"sourcesContent":["/* mainly for litedown::pkg_manual() */\n.table-full {\n width: 100%;\n border-top: 1px solid #666;\n border-bottom: 1px solid #666;\n td {\n vertical-align: baseline;\n & > p {\n &:first-child { margin-top: 0; }\n &:last-child { margin-bottom: 0; }\n }\n }\n}\ncode.fade::before {\n content: \"🚫\";\n float: right;\n font-size: 1.5em;\n line-height: 1;\n}\n@media only screen {\n body:not(.pagesjs) pre:not([class]) {\n max-height: 300px;\n overflow-y: auto;\n }\n}\n.orcid {\n width: 1em;\n height: 1em;\n vertical-align: middle;\n}\n"],"names":[]}
1
+ {"version":3,"mappings":"AACA,uBAEE,6BAEE,IACE,2BACA,gCAIN,0EAMA,mBACE,sEAKF","sources":["manual.css"],"sourcesContent":["/* mainly for litedown::pkg_manual() */\n.table-full {\n width: 100%;\n td {\n vertical-align: baseline;\n & > p {\n &:first-child { margin-top: 0; }\n &:last-child { margin-bottom: 0; }\n }\n }\n}\ncode.fade::before {\n content: \"🚫\";\n float: right;\n font-size: 1.5em;\n line-height: 1;\n}\n@media only screen {\n body:not(.pagesjs) pre:not([class]) {\n max-height: 300px;\n overflow-y: auto;\n }\n}\n.orcid {\n width: 1em;\n height: 1em;\n vertical-align: middle;\n}\n"],"names":[]}
package/js/pages.js CHANGED
@@ -6,29 +6,28 @@
6
6
  function nChild(el) { return el.childElementCount; }
7
7
 
8
8
  const tpl = d.createElement('div'), book = $$('h1').length > 1, boxes = [],
9
+ fr_tag = ['TABLE', 'UL', 'OL', 'BLOCKQUOTE'],
9
10
  fr_cls = 'pagesjs-fragmented', fr_1 = 'fragment-first', fr_2 = 'fragment-last',
10
11
  tb = ['top', 'bottom'].map(i => {
11
12
  const v = getComputedStyle(d.documentElement).getPropertyValue(`--paper-margin-${i}`);
12
- return +v.replace('px', '') || 0;
13
+ return parseFloat(v) || 0;
13
14
  }); // top/bottom page margin
14
15
  tpl.className = 'pagesjs-page';
15
16
  tpl.innerHTML = `<div class="pagesjs-header"></div>
16
17
  <div class="pagesjs-body"></div>
17
18
  <div class="pagesjs-footer"></div>`;
18
- let box, box_body, box_cls = [], box_n = 0, H, h_code, l_code = [];
19
+ let box, box_body, box_cls = [], H, H_min, h_code, l_code = [];
19
20
  function newPage(el) {
20
- const n = boxes.length;
21
- // finish previous n - 1 boxes
22
- if (n - box_n > 1) {
23
- boxes.slice(box_n, n - 1).forEach(finish);
24
- box_n = n - 1;
25
- }
26
21
  el && !$('.pagesjs-body', el) && el.insertAdjacentHTML('afterbegin', tpl.innerHTML);
27
22
  box = el || tpl.cloneNode(true); box_body = box.children[1];
28
- box_cls.length && box.classList.add(...box_cls);
23
+ box.classList.add(...box_cls);
29
24
  boxes.includes(box) || boxes.push(box); // store new pages in boxes
30
25
  return box;
31
26
  }
27
+ // start the next page and finish current page
28
+ function nextPage(el, callback) {
29
+ const cur = box; cur.after(newPage(el)); callback && callback(); finish(cur);
30
+ }
32
31
  // compute page numbers and temporarily remove the box
33
32
  function finish(box) {
34
33
  const h = box.scrollHeight;
@@ -38,134 +37,211 @@
38
37
  }
39
38
  box.remove();
40
39
  }
41
- function removeBlank(el, html = false) {
42
- if (!el) return false;
43
- const v = (html ? el.innerHTML : el.innerText).trim() === '';
40
+ function removeBlank(el) {
41
+ if (!el || el.tagName === 'BODY') return false;
42
+ const v = !el.innerText.trim();
44
43
  v && el.remove();
45
44
  return v;
46
45
  }
47
46
  function fill(el) {
48
47
  // if the element is already a page, just use it as the box
49
48
  if (el.classList.contains('pagesjs-page')) {
50
- box.after(newPage(el));
51
- // if current element is not empty, fill its content into the box
52
- if (nChild(el) > 3) {
53
- box_body.append(...[...el.children].slice(3));
49
+ nextPage(el, () => nChild(el) > 3 && (
50
+ // if current element is not empty, fill its content into the box
51
+ box_body.append(...[...el.children].slice(3)),
54
52
  // TODO: should we fragment this page if it's too long?
55
- box.after(newPage()); // create a new empty page
56
- }
53
+ nextPage() // create a new empty page
54
+ ));
57
55
  } else {
56
+ if (el.innerText.trim() && H - box.scrollHeight < H_min) nextPage();
58
57
  box_body.append(el);
59
- if (box.scrollHeight <= H) return;
60
- const cls = el.classList, h0 = el.innerHTML, n0 = boxes.length;
61
- fragment(el);
62
- // remove empty pages
63
- if (el.tagName === 'PRE') for (let i = boxes.length - 1; i >= n0; i--) {
64
- removeBlank(boxes[i]) && boxes.splice(i, 1);
58
+ if (box.scrollHeight > H) {
59
+ // temporarily remove el from DOM if it can be fragmented, otherwise
60
+ // simply move it to the next page
61
+ breakable(el) ? (el.tagName !== 'P' && el.remove(), fragment(el)) :
62
+ nextPage(0, () => box_body.append(el));
65
63
  }
66
- // if el can be fragmented, add class *-last, otherwise remove class (e.g.,
67
- // current box can't even hold el's first child so move whole el to new box)
68
- (cls.contains(fr_cls) && el.innerHTML !== h0) ? cls.add(fr_2) :
69
- [el].concat(...$$(`.${fr_cls}`, el)).forEach(el => el.classList.remove(fr_cls, fr_1));
70
- l_code = []; // clean up code lines
71
64
  }
72
65
  }
73
- function fillCode(el, i1, i2) {
74
- el.innerHTML = l_code.slice(i1, i2).join('\n');
66
+ function fillCode(el, i) {
67
+ el.innerHTML = l_code.slice(0, i).join('\n');
68
+ }
69
+ function breakable(el) {
70
+ l_code = [];
71
+ const t = el.tagName, c = el.firstElementChild;
72
+ if (fr_tag.includes(t)) return true;
73
+ if (t === 'P') return el.innerText.trim();
74
+ if (t === 'DIV') {
75
+ const cs = el.children;
76
+ return (cs.length === 1 && fr_tag.includes(c?.tagName)) ||
77
+ [...cs].filter(c => c.tagName === 'TABLE').length;
78
+ }
79
+ if (t !== 'PRE') return false;
80
+ if (c?.tagName !== 'CODE') return false;
81
+ // store all lines in l_code (TODO: ensure complete tags on each line)
82
+ l_code = c.innerHTML.replace(/\n$/, '').split('\n');
83
+ const n_code = l_code.length;
84
+ if (n_code < 2) return false;
85
+ h_code = c.offsetHeight / n_code; // approx line height
86
+ c.innerHTML = ''; // temporarily empty <code>; will use l_code
87
+ return true;
75
88
  }
76
89
  // break elements that are relatively easy to break (such as <ul>)
77
- function fragment(el, container, parent, page) {
90
+ function fragment(el, container, parent) {
78
91
  const tag = el.tagName, cls = el.classList, frag = cls.contains(fr_cls);
79
- parent || frag && cls.remove(fr_1);
80
- // if <code>, keep fragmenting; otherwise exit when box fits
81
- if (!l_code.length && box.scrollHeight <= H) return;
82
- parent ? cls.add(fr_cls) : (frag || cls.add(fr_cls, fr_1));
83
- const box_cur = page || box, el2 = el.cloneNode(); // shallow clone (wrapper only)
84
- // add the clone to current box, and move original el to next box
85
- container ? container.append(el2) : (
86
- box_body.append(el2), box_cur.after(newPage()), box_body.append(el)
87
- );
88
- // fragment <pre>'s <code> and <div>'s single child (e.g., #TOC > ul)
89
- if (tag === 'PRE') {
90
- const code = el.firstElementChild;
91
- if (code?.tagName == 'CODE') {
92
- const initial = l_code.length;
93
- // store all lines in l_code
94
- if (!initial) l_code = code.innerHTML.split('\n');
95
- let n_code = l_code.length;
96
- if (n_code > 1 && l_code[n_code - 1] === '') n_code -= 1; // ignore trailing \n
97
- if (n_code > 1) {
98
- if (!initial) h_code = code.offsetHeight / n_code; // approx line height
99
- code.innerHTML = ''; // temporarily empty <code>; will use l_code
100
- if (fragment(code, el2, el, box_cur)) {
101
- // exit if the rest of lines are empty
102
- if (l_code.join('').trim() === '') {
103
- el2.before(el); el.innerHTML = el2.innerHTML; el2.remove();
104
- boxes.pop().remove(); newPage(boxes[boxes.length - 1]); l_code = [];
105
- }
106
- if (!l_code.length) return; fragment(el);
107
- } else {
108
- // the current page can't hold the block; fragment it on next page
109
- el2.remove(); [code, el].forEach(el => el.classList.remove(fr_cls, fr_1));
110
- fragment(el);
111
- }
112
- } else fillCode(code, 0);
92
+ parent ? cls.add(fr_cls) : (frag ? cls.remove(fr_1) : cls.add(fr_cls, fr_1));
93
+ const el2 = el.cloneNode(); // shallow clone (wrapper only)
94
+ (container || box_body).append(el2);
95
+ if (tag === 'P') splitP(el, el2);
96
+ const prev = el2.previousElementSibling;
97
+ function fragChildren(action) {
98
+ for (let item of [...el.children]) {
99
+ el2.append(item);
100
+ if (box.scrollHeight > H) {
101
+ action(item); break;
102
+ }
113
103
  }
114
- return removeBlank(el2);
115
- } else if (tag === 'DIV' && nChild(el) === 1) {
116
- fragment(el.firstElementChild, el2, el, box_cur);
117
104
  }
118
- const prev = el2.previousElementSibling;
119
- // keep moving el's first item to el2 until page height > H
120
- if (['UL', 'OL', 'BLOCKQUOTE', 'FIELDSET'].includes(tag) && nChild(el) > 1) while (true) {
121
- const item = el.firstChild;
122
- if (!item) break;
123
- el2.append(item);
124
- // usually there's no need to re-calculate size if item is not element (e.g., white space)
125
- if (item.nodeName.startsWith('#')) continue;
126
- if (box_cur.scrollHeight > H) {
105
+ if (tag === 'DIV') {
106
+ // fragment <div>'s children (e.g., #TOC > ul)
107
+ fragChildren(item => {
108
+ // fragment item if it can be further fragmented, otherwise put it back
109
+ el.prepend(item);
110
+ fr_tag.includes(item.tagName) ? fragment(item, el2, el) : nChild(el2) && nextPage();
111
+ });
112
+ } else if (tag === 'PRE') {
113
+ fragment(el.firstElementChild, el2, el);
114
+ } else if (tag === 'CODE') {
115
+ // split lines in <code> and try to move as many lines into el2 as possible
116
+ const i = splitCode(el2);
117
+ // i == 0 means not enough space to split code on current page
118
+ fillCode(el2, i); l_code.splice(0, i);
119
+ if (i > 0) {
120
+ l_code.join('').trim() === '' ? (l_code = []) : nextPage();
121
+ }
122
+ } else if (tag === 'TABLE') {
123
+ // when el has no rows left and el2 is not empty, clear el
124
+ const has_rows = splitTable(el, el2);
125
+ el2.innerHTML && (has_rows ? nextPage() : (el.innerHTML = ''));
126
+ } else {
127
+ // keep moving el's first item to el2 until page height > H
128
+ fr_tag.slice(1).includes(tag) && fragChildren(item => {
127
129
  // move item back to el if the clone el2 is not the only element on page or has more than one child
128
- (prev || nChild(el2) > 1) && el.insertBefore(item, el.firstChild);
130
+ (prev || nChild(el2) > 1 || container?.previousElementSibling) && el.prepend(item);
129
131
  // update the start number of <ol> on next page
130
132
  tag === 'OL' && (el.start += nChild(el2));
131
- break;
133
+ // don't open new page if el2 is empty (will open one below when testing el2_empty)
134
+ nChild(el2) && nextPage();
135
+ });
136
+ }
137
+ const el_empty = !l_code.length && removeBlank(el), el2_empty = removeBlank(el2);
138
+ // add/remove the fragment-* class and exit if el has become empty
139
+ if (el_empty) {
140
+ const cls2 = el2.classList;
141
+ if (parent) {
142
+ container.classList.contains(fr_1) && cls2.remove(fr_cls);
143
+ } else {
144
+ cls2.contains(fr_1) ? cls2.remove(fr_cls, fr_1) : cls2.add(fr_2);
132
145
  }
146
+ return;
133
147
  }
134
- // split lines in <code> and try to move as many lines into el2 as possible
135
- if (container && tag === 'CODE') {
136
- // figure out how many lines can fit the box via bisection
137
- let i = 0, i1 = 1, i2 = n = l_code.length;
138
- const sols = []; // solutions tried
139
- while (i2 - i1 > 1) {
140
- fillCode(el2, 0, i || 1);
141
- const delta = H - box_cur.offsetHeight;
142
- if (delta === 0) {
143
- i1 = i || 1; break;
144
- }
145
- if (delta < 0) {
146
- if (i <= 0) break;
147
- i2 = i;
148
- } else {
149
- i1 = i;
150
- }
151
- sols.push(i);
152
- // estimate the number of (more or less) lines needed
153
- const i3 = i + Math.round(delta / h_code);
154
- // if a solution has been tried, shorten step and (in/de)crement by 1
155
- i = sols.includes(i3) ? i + (delta > 0 ? 1 : -1) : i3;
156
- (delta > 0 && i >= n) && (i2 = n + 1, i = n); // solution may be n
148
+ // if el2 is empty, it means nothing in el fits the box; we have to start a new box
149
+ if (el2_empty) {
150
+ cls.remove(fr_cls, fr_1); parent || nextPage();
151
+ }
152
+ // keep fragmenting the remaining top-level el when el2 is not empty or not first element
153
+ if ((!el2_empty || prev) && !parent) fragment(el);
154
+ }
155
+ // split table rows
156
+ function splitTable(el, el2) {
157
+ const tb = el.tBodies[0], tb2 = tb.cloneNode(), rows = [...tb.rows], th = el.tHead;
158
+ el2.append(tb2);
159
+ // copy table header and footer
160
+ [th, el.tFoot].forEach(t => t && el2.append(t.cloneNode(true)));
161
+ for (let i = 0; i < rows.length; i++) {
162
+ const row = rows[i];
163
+ tb2.append(row);
164
+ if (box.offsetHeight > H) {
165
+ // clear the clone if current page can't fit even one row
166
+ tb.prepend(row); if (i === 0) el2.innerHTML = '';
167
+ break;
157
168
  }
158
- if (i > 0) {
159
- fillCode(el2, 0, i1); l_code.splice(0, i1);
169
+ }
170
+ return tb.rows.length;
171
+ }
172
+ // figure out how many lines can fit the box via bisection
173
+ function splitCode(el) {
174
+ let i = i1 = 1, n = l_code.length, i2 = n + 2;
175
+ const sols = []; // solutions tried
176
+ while (i2 > i1 + 1) {
177
+ fillCode(el, i);
178
+ const delta = H - box.offsetHeight;
179
+ if (delta === 0) return i;
180
+ if (delta < 0) {
181
+ if (i <= 1) return 0;
182
+ i2 = i;
160
183
  } else {
161
- el2.innerHTML = ''; fillCode(el, 0); l_code = []; // not fragmented
184
+ if (i >= n) return i;
185
+ i1 = i;
186
+ }
187
+ sols.push(i);
188
+ // estimate the number of (more or less) lines needed
189
+ const i3 = i + Math.round(delta / h_code);
190
+ // if a solution has been tried, shorten step and (in/de)crement by 1
191
+ i = sols.includes(i3) ? i + (delta > 0 ? 1 : -1) : i3;
192
+ (delta > 0 && i >= n) && (i2 = n + 2, i = n); // solution may be n
193
+ }
194
+ return i1;
195
+ }
196
+ // split <p> by testing if a range fits the current box
197
+ function splitP(el, el2) {
198
+ if (!el.parentNode) {
199
+ box_body.append(el); // move el into DOM to measure chars if removed
200
+ // see if we don't need to split it now
201
+ if (box.scrollHeight <= H) {
202
+ el2.innerHTML = el.innerHTML; el.innerHTML = ''; return;
203
+ }
204
+ }
205
+ const r = d.createRange(), ends = [], NF = NodeFilter;
206
+ // find the break position of each line
207
+ const walker = d.createTreeWalker(el, NF.SHOW_TEXT, node => {
208
+ let p = node.parentNode;
209
+ while (p !== el) {
210
+ // exclude block elements such as footnotes
211
+ if (p.tagName === 'DIV') return NF.FILTER_REJECT;
212
+ p = p.parentNode;
213
+ }
214
+ return node.textContent.trim() ? NF.FILTER_ACCEPT : NF.FILTER_SKIP;
215
+ });
216
+ let node = walker.nextNode(), prev;
217
+ while (node) {
218
+ const txt = node.textContent;
219
+ for (let i = 0; i < txt.length; i++) {
220
+ r.setStart(node, i); r.setEnd(node, i + 1);
221
+ const rect = r.getBoundingClientRect();
222
+ // if the previous char is at top-right of current char, assume line
223
+ // ends before current char (TODO: how about RTL languages?)
224
+ prev && prev.bottom <= rect.top && prev.right > rect.left && ends.push({node, i});
225
+ prev = rect;
226
+ }
227
+ node = walker.nextNode();
228
+ }
229
+ el.remove();
230
+ ends.push({node: el, i: el.childNodes.length});
231
+ r.setStart(el, 0); // start at beginning of paragraph
232
+ function fillLine(i, done) {
233
+ el2.innerHTML = '';
234
+ if (i < 0) return;
235
+ const loc = ends[i]; r.setEnd(loc.node, loc.i);
236
+ el2.append(r.cloneContents());
237
+ done && (r.deleteContents(), nextPage());
238
+ }
239
+ for (let i = 0; i < ends.length; i++) {
240
+ fillLine(i);
241
+ if (box.scrollHeight > H) {
242
+ fillLine(i - 1, true); break;
162
243
  }
163
- return i > 0;
164
244
  }
165
- const el2_empty = removeBlank(el2, true);
166
- el2_empty && cls.remove(fr_cls, fr_1);
167
- // if the clone is empty, remove it, otherwise keep fragmenting the remaining el
168
- if (!el2_empty || prev) fragment(container ? parent : el);
169
245
  }
170
246
 
171
247
  // use data-short-title of a header if exists, and fall back to inner text
@@ -212,6 +288,11 @@
212
288
 
213
289
  cls.add('pagesjs-filling');
214
290
 
291
+ // test how much space a single-line paragraph needs
292
+ const p = d.createElement('p'), H0 = box.scrollHeight;
293
+ p.innerText = 'A'; box_body.append(p);
294
+ H_min = box.scrollHeight - H0; p.remove();
295
+
215
296
  // add dot leaders to TOC
216
297
  $$('#TOC a[href^="#"]').forEach(a => {
217
298
  const s = d.createElement('span'), // move TOC item content into a span
@@ -222,24 +303,26 @@
222
303
  a.dataset.pageNumber = '000'; // placeholder for page numbers
223
304
  });
224
305
 
306
+ // temporarily move all elements out of DOM (to speed up rendering single pages)
225
307
  const els = [];
226
308
  $$('.body').forEach(el => {
227
- const ch = [...el.children];
309
+ // move <style> into <head> so it can be applied regardless of its presence in <body>
310
+ const ch = [...el.children].filter(el => el.tagName !== 'STYLE' || d.head.append(el));
228
311
  els.push(ch); ch.forEach(el => el.remove());
229
312
  });
230
313
  // iteratively add elements to pages
231
314
  $$('.frontmatter, .abstract, #TOC:not(.chapter-toc)').forEach(el => {
232
- (fill(el), book && box.after(newPage()));
315
+ (fill(el), book && nextPage());
233
316
  });
234
317
  $$('.body').forEach((el, i) => {
235
318
  // preserve book chapter classes if exist
236
319
  box_cls = ['chapter', 'appendix'].filter(i => el.classList.contains(i));
237
- book && (box.innerText === '' ? newPage(box) : box.after(newPage()));
320
+ book && (box.innerText === '' ? newPage(box) : nextPage());
238
321
  els[i].forEach(fill);
239
322
  // clean up container and self if empty
240
323
  removeBlank(el.parentNode); removeBlank(el);
241
324
  });
242
- boxes.slice(box_n).forEach(finish); // finish the rest of pages
325
+ finish(box); // finish the last box
243
326
  cls.remove('pagesjs-filling');
244
327
 
245
328
  // add page number, title, etc. to data-* attributes of page elements
package/js/pages.min.js CHANGED
@@ -1,2 +1,2 @@
1
- (e=>{function t(t,n=e){return n?.querySelector(t)}function s(t,n=e){return n?n.querySelectorAll(t):[]}function r(e){return e.childElementCount}const a=e.createElement("div"),i=s("h1").length>1,o=[],c="pagesjs-fragmented",l="fragment-first",f=["top","bottom"].map((t=>+getComputedStyle(e.documentElement).getPropertyValue(`--paper-margin-${t}`).replace("px","")||0));a.className="pagesjs-page",a.innerHTML='<div class="pagesjs-header"></div>\n<div class="pagesjs-body"></div>\n<div class="pagesjs-footer"></div>';let d,p,h,g,u=[],m=0,E=[];function L(e){const n=o.length;return n-m>1&&(o.slice(m,n-1).forEach(b),m=n-1),e&&!t(".pagesjs-body",e)&&e.insertAdjacentHTML("afterbegin",a.innerHTML),d=e||a.cloneNode(!0),p=d.children[1],u.length&&d.classList.add(...u),o.includes(d)||o.push(d),d}function b(e){const t=e.scrollHeight;if(t>h&&!e.dataset.pagesOffset){const n=function(e,t){let n=+e.dataset.pagesOffset;if(n)return n;if(n=Math.ceil(t/h),n<=1)return n;const r=f.concat([...s("thead",e)].map((e=>+e.offsetHeight))).reduce(((e,t)=>e+t));if(!r)return n;function a(){return Math.ceil((t+(n-1)*r)/h)}let i=a();for(;i>n;)n=i,i=a();return n}(e,t);n>1&&(e.dataset.pagesOffset=n)}e.remove()}function T(e,t=!1){if(!e)return!1;const n=""===(t?e.innerHTML:e.innerText).trim();return n&&e.remove(),n}function v(e){if(e.classList.contains("pagesjs-page"))d.after(L(e)),r(e)>3&&(p.append(...[...e.children].slice(3)),d.after(L()));else{if(p.append(e),d.scrollHeight<=h)return;const t=e.classList,n=e.innerHTML,r=o.length;if(j(e),"PRE"===e.tagName)for(let e=o.length-1;e>=r;e--)T(o[e])&&o.splice(e,1);t.contains(c)&&e.innerHTML!==n?t.add("fragment-last"):[e].concat(...s(`.${c}`,e)).forEach((e=>e.classList.remove(c,l))),E=[]}}function H(e,t,n){e.innerHTML=E.slice(t,n).join("\n")}function j(e,t,s,a){const i=e.tagName,f=e.classList,u=f.contains(c);if(s||u&&f.remove(l),!E.length&&d.scrollHeight<=h)return;s?f.add(c):u||f.add(c,l);const m=a||d,b=e.cloneNode();if(t?t.append(b):(p.append(b),m.after(L()),p.append(e)),"PRE"===i){const t=e.firstElementChild;if("CODE"==t?.tagName){const n=E.length;n||(E=t.innerHTML.split("\n"));let s=E.length;if(s>1&&""===E[s-1]&&(s-=1),s>1)if(n||(g=t.offsetHeight/s),t.innerHTML="",j(t,b,e,m)){if(""===E.join("").trim()&&(b.before(e),e.innerHTML=b.innerHTML,b.remove(),o.pop().remove(),L(o[o.length-1]),E=[]),!E.length)return;j(e)}else b.remove(),[t,e].forEach((e=>e.classList.remove(c,l))),j(e);else H(t,0)}return T(b)}"DIV"===i&&1===r(e)&&j(e.firstElementChild,b,e,m);const v=b.previousElementSibling;if(["UL","OL","BLOCKQUOTE","FIELDSET"].includes(i)&&r(e)>1)for(;;){const t=e.firstChild;if(!t)break;if(b.append(t),!t.nodeName.startsWith("#")&&m.scrollHeight>h){(v||r(b)>1)&&e.insertBefore(t,e.firstChild),"OL"===i&&(e.start+=r(b));break}}if(t&&"CODE"===i){let t=0,s=1,r=n=E.length;const a=[];for(;r-s>1;){H(b,0,t||1);const e=h-m.offsetHeight;if(0===e){s=t||1;break}if(e<0){if(t<=0)break;r=t}else s=t;a.push(t);const i=t+Math.round(e/g);t=a.includes(i)?t+(e>0?1:-1):i,e>0&&t>=n&&(r=n+1,t=n)}return t>0?(H(b,0,s),E.splice(0,s)):(b.innerHTML="",H(e,0),E=[]),t>0}const M=T(b,!0);M&&f.remove(c,l),M&&!v||j(t?s:e)}function M(e){return e&&(e.dataset.shortTitle||e.innerText)}const C=M(t("h1.title, .frontmatter h1, .title, h1")),y=(i?"h1":"h2")+":not(.frontmatter *)";function O(){if("complete"!==e.readyState)return setTimeout(O,10);const n=e.body.classList;if(n.contains("pagesjs"))return;n.add("pagesjs"),e.body.insertAdjacentElement("afterbegin",L()),h=d.clientHeight||window.innerHeight,s(":is(#TOC, .footnotes, .chapter-before, .chapter-after):is(.side-left, .side-right).side").forEach((e=>{e.classList.remove("side","side-left","side-right")})),n.add("pagesjs-filling"),s('#TOC a[href^="#"]').forEach((t=>{const n=e.createElement("span"),s=t.firstElementChild;for(s?.classList.contains("section-number")?s.after(n):t.insertAdjacentElement("afterbegin",n);n.nextSibling;)n.append(n.nextSibling);t.insertAdjacentHTML("beforeend",'<span class="dot-leader"></span>'),t.dataset.pageNumber="000"}));const r=[];s(".body").forEach((e=>{const t=[...e.children];r.push(t),t.forEach((e=>e.remove()))})),s(".frontmatter, .abstract, #TOC:not(.chapter-toc)").forEach((e=>{v(e),i&&d.after(L())})),s(".body").forEach(((e,t)=>{u=["chapter","appendix"].filter((t=>e.classList.contains(t))),i&&(""===d.innerText?L(d):d.after(L())),r[t].forEach(v),T(e.parentNode),T(e)})),o.slice(m).forEach(b),n.remove("pagesjs-filling");let a,c=0;o.forEach((e=>{if(i){if(t(".frontmatter",e))return;t(y,e)&&(a="")}const n=+e.dataset.pagesOffset||1;n>1&&e.classList.add("page-multiple"),c+=n,e.classList.add("page-"+(c%2==0?"even":"odd"));const r={pageNumber:c,mainTitle:C,pageTitle:a};let o;[e.children[0],e.children[2]].forEach((e=>{for(const t in r)r[t]&&(e.dataset[t]=r[t])})),a=M([...s(y,e)].pop())||a,s(".footnotes",e).forEach(((t,n)=>{0===n?(o=t,e.children[1].after(t)):(o.append(...t.children),t.remove())}))})),e.body.prepend(...o),s('#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:""}))}addEventListener("beforeprint",O);let N=sessionStorage.getItem("pagesjs");N&&O(),addEventListener("keypress",(e=>"p"===e.key&&(O(),N=N?"":"1",sessionStorage.setItem("pagesjs",N),N||location.reload())))})(document);
1
+ (e=>{function t(t,n=e){return n?.querySelector(t)}function n(t,n=e){return n?n.querySelectorAll(t):[]}function r(e){return e.childElementCount}const s=e.createElement("div"),i=n("h1").length>1,a=[],o=["TABLE","UL","OL","BLOCKQUOTE"],c="pagesjs-fragmented",l="fragment-first",d=["top","bottom"].map((t=>{const n=getComputedStyle(e.documentElement).getPropertyValue(`--paper-margin-${t}`);return parseFloat(n)||0}));s.className="pagesjs-page",s.innerHTML='<div class="pagesjs-header"></div>\n<div class="pagesjs-body"></div>\n<div class="pagesjs-footer"></div>';let f,p,g,u,h,m=[],E=[];function T(e){return e&&!t(".pagesjs-body",e)&&e.insertAdjacentHTML("afterbegin",s.innerHTML),f=e||s.cloneNode(!0),p=f.children[1],f.classList.add(...m),a.includes(f)||a.push(f),f}function L(e,t){const n=f;n.after(T(e)),t&&t(),H(n)}function H(e){const t=e.scrollHeight;if(t>g&&!e.dataset.pagesOffset){const r=function(e,t){let r=+e.dataset.pagesOffset;if(r)return r;if(r=Math.ceil(t/g),r<=1)return r;const s=d.concat([...n("thead",e)].map((e=>+e.offsetHeight))).reduce(((e,t)=>e+t));if(!s)return r;function i(){return Math.ceil((t+(r-1)*s)/g)}let a=i();for(;a>r;)r=a,a=i();return r}(e,t);r>1&&(e.dataset.pagesOffset=r)}e.remove()}function b(e){if(!e||"BODY"===e.tagName)return!1;const t=!e.innerText.trim();return t&&e.remove(),t}function N(e){e.classList.contains("pagesjs-page")?L(e,(()=>r(e)>3&&(p.append(...[...e.children].slice(3)),L()))):(e.innerText.trim()&&g-f.scrollHeight<u&&L(),p.append(e),f.scrollHeight>g&&(!function(e){E=[];const t=e.tagName,n=e.firstElementChild;if(o.includes(t))return!0;if("P"===t)return e.innerText.trim();if("DIV"===t){const t=e.children;return 1===t.length&&o.includes(n?.tagName)||[...t].filter((e=>"TABLE"===e.tagName)).length}if("PRE"!==t)return!1;if("CODE"!==n?.tagName)return!1;E=n.innerHTML.replace(/\n$/,"").split("\n");const r=E.length;return!(r<2)&&(h=n.offsetHeight/r,n.innerHTML="",!0)}(e)?L(0,(()=>p.append(e))):("P"!==e.tagName&&e.remove(),j(e))))}function v(e,t){e.innerHTML=E.slice(0,t).join("\n")}function j(t,n,s){const i=t.tagName,a=t.classList,d=a.contains(c);s?a.add(c):d?a.remove(l):a.add(c,l);const u=t.cloneNode();(n||p).append(u),"P"===i&&function(t,n){if(!t.parentNode&&(p.append(t),f.scrollHeight<=g))return n.innerHTML=t.innerHTML,void(t.innerHTML="");const r=e.createRange(),s=[],i=NodeFilter,a=e.createTreeWalker(t,i.SHOW_TEXT,(e=>{let n=e.parentNode;for(;n!==t;){if("DIV"===n.tagName)return i.FILTER_REJECT;n=n.parentNode}return e.textContent.trim()?i.FILTER_ACCEPT:i.FILTER_SKIP}));let o,c=a.nextNode();for(;c;){const e=c.textContent;for(let t=0;t<e.length;t++){r.setStart(c,t),r.setEnd(c,t+1);const e=r.getBoundingClientRect();o&&o.bottom<=e.top&&o.right>e.left&&s.push({node:c,i:t}),o=e}c=a.nextNode()}function l(e,t){if(n.innerHTML="",e<0)return;const i=s[e];r.setEnd(i.node,i.i),n.append(r.cloneContents()),t&&(r.deleteContents(),L())}t.remove(),s.push({node:t,i:t.childNodes.length}),r.setStart(t,0);for(let e=0;e<s.length;e++)if(l(e),f.scrollHeight>g){l(e-1,!0);break}}(t,u);const m=u.previousElementSibling;function T(e){for(let n of[...t.children])if(u.append(n),f.scrollHeight>g){e(n);break}}if("DIV"===i)T((e=>{t.prepend(e),o.includes(e.tagName)?j(e,u,t):r(u)&&L()}));else if("PRE"===i)j(t.firstElementChild,u,t);else if("CODE"===i){const e=function(e){let t=i1=1,n=E.length,r=n+2;const s=[];for(;r>i1+1;){v(e,t);const i=g-f.offsetHeight;if(0===i)return t;if(i<0){if(t<=1)return 0;r=t}else{if(t>=n)return t;i1=t}s.push(t);const a=t+Math.round(i/h);t=s.includes(a)?t+(i>0?1:-1):a,i>0&&t>=n&&(r=n+2,t=n)}return i1}(u);v(u,e),E.splice(0,e),e>0&&(""===E.join("").trim()?E=[]:L())}else if("TABLE"===i){const e=function(e,t){const n=e.tBodies[0],r=n.cloneNode(),s=[...n.rows],i=e.tHead;t.append(r),[i,e.tFoot].forEach((e=>e&&t.append(e.cloneNode(!0))));for(let e=0;e<s.length;e++){const i=s[e];if(r.append(i),f.offsetHeight>g){n.prepend(i),0===e&&(t.innerHTML="");break}}return n.rows.length}(t,u);u.innerHTML&&(e?L():t.innerHTML="")}else o.slice(1).includes(i)&&T((e=>{(m||r(u)>1||n?.previousElementSibling)&&t.prepend(e),"OL"===i&&(t.start+=r(u)),r(u)&&L()}));const H=!E.length&&b(t),N=b(u);if(H){const e=u.classList;s?n.classList.contains(l)&&e.remove(c):e.contains(l)?e.remove(c,l):e.add("fragment-last")}else N&&(a.remove(c,l),s||L()),N&&!m||s||j(t)}function C(e){return e&&(e.dataset.shortTitle||e.innerText)}const M=C(t("h1.title, .frontmatter h1, .title, h1")),S=(i?"h1":"h2")+":not(.frontmatter *)";function O(){if("complete"!==e.readyState)return setTimeout(O,10);const r=e.body.classList;if(r.contains("pagesjs"))return;r.add("pagesjs"),e.body.insertAdjacentElement("afterbegin",T()),g=f.clientHeight||window.innerHeight,n(":is(#TOC, .footnotes, .chapter-before, .chapter-after):is(.side-left, .side-right).side").forEach((e=>{e.classList.remove("side","side-left","side-right")})),r.add("pagesjs-filling");const s=e.createElement("p"),o=f.scrollHeight;s.innerText="A",p.append(s),u=f.scrollHeight-o,s.remove(),n('#TOC a[href^="#"]').forEach((t=>{const n=e.createElement("span"),r=t.firstElementChild;for(r?.classList.contains("section-number")?r.after(n):t.insertAdjacentElement("afterbegin",n);n.nextSibling;)n.append(n.nextSibling);t.insertAdjacentHTML("beforeend",'<span class="dot-leader"></span>'),t.dataset.pageNumber="000"}));const c=[];n(".body").forEach((t=>{const n=[...t.children].filter((t=>"STYLE"!==t.tagName||e.head.append(t)));c.push(n),n.forEach((e=>e.remove()))})),n(".frontmatter, .abstract, #TOC:not(.chapter-toc)").forEach((e=>{N(e),i&&L()})),n(".body").forEach(((e,t)=>{m=["chapter","appendix"].filter((t=>e.classList.contains(t))),i&&(""===f.innerText?T(f):L()),c[t].forEach(N),b(e.parentNode),b(e)})),H(f),r.remove("pagesjs-filling");let l,d=0;a.forEach((e=>{if(i){if(t(".frontmatter",e))return;t(S,e)&&(l="")}const r=+e.dataset.pagesOffset||1;r>1&&e.classList.add("page-multiple"),d+=r,e.classList.add("page-"+(d%2==0?"even":"odd"));const s={pageNumber:d,mainTitle:M,pageTitle:l};let a;[e.children[0],e.children[2]].forEach((e=>{for(const t in s)s[t]&&(e.dataset[t]=s[t])})),l=C([...n(S,e)].pop())||l,n(".footnotes",e).forEach(((t,n)=>{0===n?(a=t,e.children[1].after(t)):(a.append(...t.children),t.remove())}))})),e.body.prepend(...a),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:""}))}addEventListener("beforeprint",O);let y=sessionStorage.getItem("pagesjs");y&&O(),addEventListener("keypress",(e=>"p"===e.key&&(O(),y=y?"":"1",sessionStorage.setItem("pagesjs",y),y||location.reload())))})(document);
2
2
  //# sourceMappingURL=pages.min.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["d","$","s","el","querySelector","$$","querySelectorAll","nChild","childElementCount","tpl","createElement","book","length","boxes","fr_cls","fr_1","tb","map","i","getComputedStyle","documentElement","getPropertyValue","replace","className","innerHTML","box","box_body","H","h_code","box_cls","box_n","l_code","newPage","n","slice","forEach","finish","insertAdjacentHTML","cloneNode","children","classList","add","includes","push","h","scrollHeight","dataset","pagesOffset","Math","ceil","m","concat","offsetHeight","reduce","m1","m2","newPages","n2","calcPages","remove","removeBlank","html","v","innerText","trim","fill","contains","after","append","cls","h0","n0","fragment","tagName","splice","fillCode","i1","i2","join","container","parent","page","tag","frag","box_cur","el2","code","firstElementChild","initial","split","n_code","before","pop","prev","previousElementSibling","item","firstChild","nodeName","startsWith","insertBefore","start","sols","delta","i3","round","el2_empty","shortTitle","main","ps","paginate","readyState","setTimeout","body","insertAdjacentElement","clientHeight","window","innerHeight","a","nextSibling","pageNumber","els","ch","filter","parentNode","page_title","N","info","mainTitle","pageTitle","ft","key","prepend","p","CSS","escape","getAttribute","addEventListener","pg","sessionStorage","getItem","e","setItem","location","reload","document"],"sources":["pages.js"],"mappings":"AAEA,CAACA,IACC,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,CAEnD,MAAMC,EAAMT,EAAEU,cAAc,OAAQC,EAAON,EAAG,MAAMO,OAAS,EAAGC,EAAQ,GACtEC,EAAS,qBAAsBC,EAAO,iBACtCC,EAAK,CAAC,M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EAAKC,eAAeC,QAAQ,WAChCF,GAAM5B,IACN2B,iBAAiB,YAAYI,GAAe,MAAVA,EAAEV,MAClCrB,IAAY4B,EAAKA,EAAK,GAAK,IAAKC,eAAeG,QAAQ,UAAWJ,GAAKA,GAAMK,SAASC,WAEzF,EA7RD,CA6RGC","ignoreList":[]}
1
+ {"version":3,"names":["d","$","s","el","querySelector","$$","querySelectorAll","nChild","childElementCount","tpl","createElement","book","length","boxes","fr_tag","fr_cls","fr_1","tb","map","i","v","getComputedStyle","documentElement","getPropertyValue","parseFloat","className","innerHTML","box","box_body","H","H_min","h_code","box_cls","l_code","newPage","insertAdjacentHTML","cloneNode","children","classList","add","includes","push","nextPage","callback","cur","after","finish","h","scrollHeight","dataset","pagesOffset","n","Math","ceil","m","concat","offsetHeight","reduce","m1","m2","newPages","n2","calcPages","remove","removeBlank","tagName","innerText","trim","fill","contains","append","slice","t","c","firstElementChild","cs","filter","replace","split","n_code","breakable","fragment","fillCode","join","container","parent","tag","cls","frag","el2","parentNode","r","createRange","ends","NF","NodeFilter","walker","createTreeWalker","SHOW_TEXT","node","p","FILTER_REJECT","textContent","FILTER_ACCEPT","FILTER_SKIP","prev","nextNode","txt","setStart","setEnd","rect","getBoundingClientRect","bottom","top","right","left","fillLine","done","loc","cloneContents","deleteContents","childNodes","splitP","previousElementSibling","fragChildren","action","item","prepend","i1","i2","sols","delta","i3","round","splitCode","splice","has_rows","tBodies","tb2","rows","th","tHead","tFoot","forEach","row","splitTable","start","el_empty","el2_empty","cls2","shortTitle","main","ps","paginate","readyState","setTimeout","body","insertAdjacentElement","clientHeight","window","innerHeight","H0","a","nextSibling","pageNumber","els","ch","head","page_title","N","info","mainTitle","pageTitle","ft","key","pop","CSS","escape","getAttribute","addEventListener","pg","sessionStorage","getItem","e","setItem","location","reload","document"],"sources":["pages.js"],"mappings":"AAEA,CAACA,IACC,SAAUC,EAAEC,EAAGC,EAAKH,GAAK,OAAOG,GAAIC,cAAcF,EAAI,CACtD,SAASG,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AAQ,UAAWJ,GAAKA,GAAMK,SAASC,WAEzF,EAhXD,CAgXGC","ignoreList":[]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xiee/utils",
3
- "version": "1.13.70",
3
+ "version": "1.14.0",
4
4
  "description": "Miscellaneous tools and utilities to manipulate HTML pages",
5
5
  "scripts": {
6
6
  "test": "echo \"Error: no test specified\" && exit 1"