@xiee/utils 1.13.67 → 1.13.68
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/css/pages.css +4 -6
- package/css/pages.min.css +1 -1
- package/css/pages.min.css.map +1 -1
- package/js/math-code.js +2 -2
- package/js/math-code.min.js +1 -1
- package/js/math-code.min.js.map +1 -1
- package/js/pages.js +81 -58
- package/js/pages.min.js +1 -1
- package/js/pages.min.js.map +1 -1
- package/package.json +1 -1
package/css/pages.css
CHANGED
|
@@ -41,9 +41,7 @@
|
|
|
41
41
|
height: var(--paper-height);
|
|
42
42
|
padding: var(--paper-margin-top) var(--paper-margin-right) var(--paper-margin-bottom) var(--paper-margin-left);
|
|
43
43
|
break-after: page;
|
|
44
|
-
|
|
45
|
-
display: flex;
|
|
46
|
-
}
|
|
44
|
+
display: flex;
|
|
47
45
|
flex-direction: column;
|
|
48
46
|
justify-content: space-between;
|
|
49
47
|
overflow: hidden;
|
|
@@ -57,7 +55,7 @@
|
|
|
57
55
|
border: none;
|
|
58
56
|
padding: 0;
|
|
59
57
|
margin-left: auto;
|
|
60
|
-
&:not(.
|
|
58
|
+
&:not(.chapter-toc):is(.fragment-first, :not(.pagesjs-fragmented))::before {
|
|
61
59
|
content: "Contents";
|
|
62
60
|
display: block;
|
|
63
61
|
font-weight: bold;
|
|
@@ -84,12 +82,12 @@
|
|
|
84
82
|
}
|
|
85
83
|
}
|
|
86
84
|
& > .pagesjs-body > .pagesjs-fragmented {
|
|
87
|
-
&:first
|
|
85
|
+
&:not(.fragment-first) {
|
|
88
86
|
&, & .pagesjs-fragmented {
|
|
89
87
|
border-top: none;
|
|
90
88
|
}
|
|
91
89
|
}
|
|
92
|
-
&:last
|
|
90
|
+
&:not(.fragment-last) {
|
|
93
91
|
&, & .pagesjs-fragmented {
|
|
94
92
|
border-bottom: none;
|
|
95
93
|
}
|
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;& .frontmatter,& .chapter{min-height:unset;box-shadow:none}&>*,&:not(:has(.frontmatter)):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;overflow:hidden
|
|
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;& .frontmatter,& .chapter{min-height:unset;box-shadow:none}&>*,&:not(:has(.frontmatter)):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}&>ul{columns:18em}& a{display:flex;&:after{content:attr(data-page-number);align-self:end}& .section-number{margin-right:.3em}& .dot-leader{border-bottom:1px dashed;flex:1 0 2em;margin:0 1ex 1ex}}}&>.pagesjs-body>.pagesjs-fragmented{&:not(.fragment-first){&,& .pagesjs-fragmented{border-top:none}}&:not(.fragment-last){&,& .pagesjs-fragmented{border-bottom:none}}}& .fullwidth{float:none;max-width:none;width:var(--paper-width);margin-left:calc(0px - var(--paper-margin-left));transform:none}& .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-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;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{height:auto;& .pagesjs-body:has(.footnotes){margin-bottom:1em}}}}@media print{.pagesjs{gap:0;margin:0;& .page-multiple{height:auto;padding-top:0;padding-bottom:0}}}
|
|
2
2
|
/*# sourceMappingURL=pages.min.css.map */
|
package/css/pages.min.css.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"mappings":"AAAA,0PAYA,0DAIA,2FAIA,6BAGA,wGAQE,2DAIA,oFAGA,
|
|
1
|
+
{"version":3,"mappings":"AAAA,0PAYA,0DAIA,2FAIA,6BAGA,wGAQE,2DAIA,oFAGA,iRASE,qBAGA,iFAGA,8CAIE,4JAOA,kBAGA,iBAEE,sDAIA,oCAGA,uEAOJ,oCACE,uBACE,yCAIF,sBACE,6CAKJ,gIAOA,iFAMA,wFAEE,sDAIF,2FAGA,wCAMJ,0FAKA,2GAIE,uCAGA,uCAIF,uGAIE,qBAGA,wCAIF,4CAIA,mBACE,SACE,wCAGA,gCAGA,kCAIF,+BAEE,4BAEE,qDAMN,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 .frontmatter, .chapter {\n min-height: unset;\n box-shadow: none;\n }\n & > *, &:not(:has(.frontmatter)):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 & > ul {\n columns: 18em;\n }\n a {\n display: flex;\n &::after {\n content: attr(data-page-number);\n align-self: end;\n }\n .section-number {\n margin-right: .3em;\n }\n .dot-leader {\n flex: 1 0 2em;\n border-bottom: dashed 1px;\n margin: 0 1ex 1ex;\n }\n }\n }\n & > .pagesjs-body > .pagesjs-fragmented {\n &:not(.fragment-first) {\n &, & .pagesjs-fragmented {\n border-top: none;\n }\n }\n &:not(.fragment-last) {\n &, & .pagesjs-fragmented {\n border-bottom: none;\n }\n }\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::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-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 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 height: auto;\n .pagesjs-body:has(.footnotes) {\n margin-bottom: 1em;\n }\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/math-code.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
// <code>$math$</code> to \(math\), and <code>$$math$$</code> to $$math$$:
|
|
2
2
|
// https://yihui.org/en/2018/07/latex-math-markdown/
|
|
3
|
-
|
|
3
|
+
document.querySelectorAll(':not(pre) > code:not(.nolatex)').forEach(code => {
|
|
4
4
|
// skip <pre> tags and <code> that has children or the nolatex class
|
|
5
|
-
if (code.
|
|
5
|
+
if (code.childElementCount > 0) return;
|
|
6
6
|
let text = code.textContent;
|
|
7
7
|
if (/^\$[^$]/.test(text) && /[^$]\$$/.test(text)) {
|
|
8
8
|
text = text.replace(/^\$/, '\\(').replace(/\$$/, '\\)');
|
package/js/math-code.min.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
document.querySelectorAll(":not(pre) > code:not(.nolatex)").forEach((t=>{if(t.childElementCount>0)return;let e=t.textContent;/^\$[^$]/.test(e)&&/[^$]\$$/.test(e)&&(e=e.replace(/^\$/,"\\(").replace(/\$$/,"\\)"),t.textContent=e),(/^\\\((.|\s)+\\\)$/.test(e)||/^\\\[(.|\s)+\\\]$/.test(e)||/^\$(.|\s)+\$$/.test(e)||/^\\begin\{([^}]+)\}(.|\s)+\\end\{[^}]+\}$/.test(e))&&(t.outerHTML=t.innerHTML)}));
|
|
2
2
|
//# sourceMappingURL=math-code.min.js.map
|
package/js/math-code.min.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["document","
|
|
1
|
+
{"version":3,"names":["document","querySelectorAll","forEach","code","childElementCount","text","textContent","test","replace","outerHTML","innerHTML"],"sources":["math-code.js"],"mappings":"AAEAA,SAASC,iBAAiB,kCAAkCC,SAAQC,IAElE,GAAIA,EAAKC,kBAAoB,EAAG,OAChC,IAAIC,EAAOF,EAAKG,YACZ,UAAUC,KAAKF,IAAS,UAAUE,KAAKF,KACzCA,EAAOA,EAAKG,QAAQ,MAAO,OAAOA,QAAQ,MAAO,OACjDL,EAAKG,YAAcD,IAEjB,oBAAoBE,KAAKF,IAAS,oBAAoBE,KAAKF,IAC3D,gBAAgBE,KAAKF,IACrB,4CAA4CE,KAAKF,MACnDF,EAAKM,UAAYN,EAAKO,UACxB","ignoreList":[]}
|
package/js/pages.js
CHANGED
|
@@ -5,9 +5,9 @@
|
|
|
5
5
|
function $$(s, el = d) { return el ? el.querySelectorAll(s) : []; }
|
|
6
6
|
function nChild(el) { return el.childElementCount; }
|
|
7
7
|
|
|
8
|
-
const tpl = d.createElement('div'), book = $$('h1').length > 1,
|
|
9
|
-
|
|
10
|
-
|
|
8
|
+
const tpl = d.createElement('div'), book = $$('h1').length > 1,
|
|
9
|
+
fr_cls = 'pagesjs-fragmented', fr_1 = 'fragment-first', fr_2 = 'fragment-last',
|
|
10
|
+
tb = ['top', 'bottom'].map(i => {
|
|
11
11
|
const v = getComputedStyle(d.documentElement).getPropertyValue(`--paper-margin-${i}`);
|
|
12
12
|
return +v.replace('px', '') || 0;
|
|
13
13
|
}); // top/bottom page margin
|
|
@@ -15,21 +15,28 @@
|
|
|
15
15
|
tpl.innerHTML = `<div class="pagesjs-header"></div>
|
|
16
16
|
<div class="pagesjs-body"></div>
|
|
17
17
|
<div class="pagesjs-footer"></div>`;
|
|
18
|
-
let box, box_body, H,
|
|
18
|
+
let box, box_body, box_cls = [], boxes = [], box_n = 0, H, h_code, l_code = [];
|
|
19
19
|
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
|
+
}
|
|
20
26
|
el && !$('.pagesjs-body', el) && el.insertAdjacentHTML('afterbegin', tpl.innerHTML);
|
|
21
27
|
box = el || tpl.cloneNode(true); box_body = box.children[1];
|
|
22
28
|
box_cls.length && box.classList.add(...box_cls);
|
|
23
|
-
boxes.push(box); // store new pages in boxes
|
|
29
|
+
boxes.includes(box) || boxes.push(box); // store new pages in boxes
|
|
24
30
|
return box;
|
|
25
31
|
}
|
|
26
|
-
|
|
32
|
+
// compute page numbers and temporarily remove the box
|
|
33
|
+
function finish(box) {
|
|
27
34
|
const h = box.scrollHeight;
|
|
28
35
|
if (h > H && !box.dataset.pagesOffset) {
|
|
29
36
|
const n = calcPages(box, h);
|
|
30
37
|
if (n > 1) box.dataset.pagesOffset = n;
|
|
31
38
|
}
|
|
32
|
-
box.
|
|
39
|
+
box.remove();
|
|
33
40
|
}
|
|
34
41
|
function removeBlank(el) {
|
|
35
42
|
if (!el) return false;
|
|
@@ -38,7 +45,6 @@
|
|
|
38
45
|
return v;
|
|
39
46
|
}
|
|
40
47
|
function fill(el) {
|
|
41
|
-
const n1 = boxes.length;
|
|
42
48
|
// if the element is already a page, just use it as the box
|
|
43
49
|
if (el.classList.contains('pagesjs-page')) {
|
|
44
50
|
box.after(newPage(el));
|
|
@@ -49,26 +55,26 @@
|
|
|
49
55
|
box.after(newPage()); // create a new empty page
|
|
50
56
|
}
|
|
51
57
|
} else {
|
|
52
|
-
// create a new box when too much content (exceeding original height)
|
|
53
|
-
if (box.scrollHeight > H) {
|
|
54
|
-
const [box2, box_body2] = [box, box_body]; // store old box
|
|
55
|
-
box2.after(newPage());
|
|
56
|
-
// if there's more than one child in the box, move the last child to next box
|
|
57
|
-
nChild(box_body2) > 1 && box_body.append(box_body2.lastChild);
|
|
58
|
-
}
|
|
59
58
|
box_body.append(el);
|
|
59
|
+
if (box.scrollHeight <= H) return;
|
|
60
|
+
const cls = el.classList;
|
|
61
|
+
// if el can be fragmented, add class *-last, otherwise remove class (e.g.,
|
|
62
|
+
// current box can't even hold el's first child so move whole el to new box)
|
|
63
|
+
const h0 = el.innerHTML;
|
|
60
64
|
fragment(el);
|
|
65
|
+
(cls.contains(fr_cls) && el.innerHTML !== h0) ? cls.add(fr_2) :
|
|
66
|
+
[el].concat(...$$(`.${fr_cls}`, el)).forEach(el => el.classList.remove(fr_cls, fr_1));
|
|
67
|
+
l_code = []; // clean up code lines
|
|
61
68
|
}
|
|
62
|
-
const n2 = boxes.length;
|
|
63
|
-
// mark all boxes (except the last one) with class 'pagesjs-done'
|
|
64
|
-
n2 > n1 && n2 > 1 && boxes.splice(0, n2 - 1).forEach(addOffset);
|
|
65
69
|
}
|
|
66
70
|
// break elements that are relatively easy to break (such as <ul>)
|
|
67
71
|
function fragment(el, container, parent, page) {
|
|
68
|
-
const tag = el.tagName, is_code = tag === 'CODE'
|
|
72
|
+
const tag = el.tagName, is_code = tag === 'CODE', cls = el.classList,
|
|
73
|
+
frag = cls.contains(fr_cls);
|
|
74
|
+
parent || frag && cls.remove(fr_1);
|
|
69
75
|
// if <code>, keep fragmenting; otherwise exit when box fits
|
|
70
|
-
if (!
|
|
71
|
-
|
|
76
|
+
if (!l_code.length && box.scrollHeight <= H) return;
|
|
77
|
+
parent ? cls.add(fr_cls) : (frag || cls.add(fr_cls, fr_1));
|
|
72
78
|
const box_cur = page || box, el2 = el.cloneNode(); // shallow clone (wrapper only)
|
|
73
79
|
// add the clone to current box, and move original el to next box
|
|
74
80
|
container ? container.append(el2) : (
|
|
@@ -77,12 +83,15 @@
|
|
|
77
83
|
// fragment <pre>'s <code> and <div>'s single child (e.g., #TOC > ul)
|
|
78
84
|
if (tag === 'PRE') {
|
|
79
85
|
const code = el.firstElementChild;
|
|
80
|
-
if (code?.tagName
|
|
81
|
-
const
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
+
if (code?.tagName == 'CODE') {
|
|
87
|
+
const initial = l_code.length;
|
|
88
|
+
// store all lines in l_code
|
|
89
|
+
if (!initial) l_code = code.innerHTML.split('\n');
|
|
90
|
+
let n_code = l_code.length;
|
|
91
|
+
if (n_code > 1 && l_code[n_code - 1] === '') n_code -= 1; // ignore trailing \n
|
|
92
|
+
if (n_code > 1) {
|
|
93
|
+
if (!initial) h_code = code.offsetHeight / n_code; // approx line height
|
|
94
|
+
code.innerHTML = ''; // temporarily empty <code>; will use l_code
|
|
86
95
|
fragment(code, el2, el, box_cur);
|
|
87
96
|
}
|
|
88
97
|
}
|
|
@@ -107,35 +116,45 @@
|
|
|
107
116
|
}
|
|
108
117
|
// split lines in <code> and try to move as many lines into el2 as possible
|
|
109
118
|
if (is_code) {
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
//
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
el2.innerHTML = code.slice(0, i).join('\n');
|
|
119
|
+
// figure out how many lines can fit the box via bisection
|
|
120
|
+
let i = 0, i1 = 1, i2 = n = l_code.length;
|
|
121
|
+
const sols = []; // solutions tried
|
|
122
|
+
function fillCode(el, i1, i2) {
|
|
123
|
+
el.innerHTML = l_code.slice(i1, i2).join('\n');
|
|
116
124
|
}
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
125
|
+
while (i2 - i1 > 1) {
|
|
126
|
+
fillCode(el2, 0, i || 1);
|
|
127
|
+
const delta = H - box_cur.offsetHeight;
|
|
128
|
+
if (delta === 0) {
|
|
129
|
+
i1 = i || 1; break;
|
|
120
130
|
}
|
|
121
|
-
if (
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
i += dir; fillCode();
|
|
127
|
-
if (box_cur.scrollHeight > H) {
|
|
128
|
-
i += -1; fillCode(); break;
|
|
131
|
+
if (delta < 0) {
|
|
132
|
+
if (i <= 0) break;
|
|
133
|
+
i2 = i;
|
|
134
|
+
} else {
|
|
135
|
+
i1 = i;
|
|
129
136
|
}
|
|
137
|
+
sols.push(i);
|
|
138
|
+
// estimate the number of (more or less) lines needed
|
|
139
|
+
const i3 = i + Math.round(delta / h_code);
|
|
140
|
+
// if a solution has been tried, shorten step and (in/de)crement by 1
|
|
141
|
+
i = sols.includes(i3) ? i + (delta > 0 ? 1 : -1) : i3;
|
|
142
|
+
(delta > 0 && i >= n) && (i2 = n + 1, i = n); // solution may be n
|
|
130
143
|
}
|
|
131
144
|
if (i > 0) {
|
|
132
|
-
|
|
133
|
-
|
|
145
|
+
fillCode(el2, 0, i1); l_code.splice(0, i1);
|
|
146
|
+
// exit if the rest of lines are empty
|
|
147
|
+
if (l_code.join('').trim() === '') {
|
|
148
|
+
container.before(parent); el.remove(); parent.append(el2);
|
|
149
|
+
boxes.pop().remove(); newPage(boxes[boxes.length - 1]);
|
|
150
|
+
return (l_code = []);
|
|
151
|
+
}
|
|
152
|
+
} else {
|
|
153
|
+
el2.innerHTML = ''; fillCode(el, 0); l_code = []; parent.classList.remove(fr_cls, fr_1);
|
|
134
154
|
}
|
|
135
155
|
}
|
|
136
156
|
const el2_empty = removeBlank(el2);
|
|
137
157
|
// if the clone is empty, remove it, otherwise keep fragmenting the remaining el
|
|
138
|
-
el2_empty && el.classList.remove(fr_cls);
|
|
139
158
|
if (!el2_empty || is_code || prev) fragment(container ? parent : el);
|
|
140
159
|
}
|
|
141
160
|
|
|
@@ -193,26 +212,30 @@
|
|
|
193
212
|
a.dataset.pageNumber = '000'; // placeholder for page numbers
|
|
194
213
|
});
|
|
195
214
|
|
|
215
|
+
const els = [];
|
|
216
|
+
$$('.body').forEach(el => {
|
|
217
|
+
const ch = [...el.children];
|
|
218
|
+
els.push(ch); ch.forEach(el => el.remove());
|
|
219
|
+
});
|
|
196
220
|
// iteratively add elements to pages
|
|
197
|
-
|
|
198
|
-
|
|
221
|
+
$$('.frontmatter, .abstract, #TOC:not(.chapter-toc)').forEach(el => {
|
|
222
|
+
(fill(el), book && box.after(newPage()));
|
|
199
223
|
});
|
|
200
|
-
$$('.body').forEach(el => {
|
|
224
|
+
$$('.body').forEach((el, i) => {
|
|
201
225
|
// preserve book chapter classes if exist
|
|
202
226
|
box_cls = ['chapter', 'appendix'].filter(i => el.classList.contains(i));
|
|
203
227
|
book && (box.innerText === '' ? newPage(box) : box.after(newPage()));
|
|
204
|
-
[
|
|
228
|
+
els[i].forEach(fill);
|
|
205
229
|
// clean up container and self if empty
|
|
206
230
|
removeBlank(el.parentNode); removeBlank(el);
|
|
207
231
|
});
|
|
208
|
-
boxes.forEach(
|
|
209
|
-
$$(`pre > code i.${cd_cls}`).forEach(el => el.remove());
|
|
232
|
+
boxes.slice(box_n).forEach(finish); // finish the rest of pages
|
|
210
233
|
cls.remove('pagesjs-filling');
|
|
211
234
|
|
|
212
235
|
// add page number, title, etc. to data-* attributes of page elements
|
|
213
236
|
let page_title, i = 0;
|
|
214
|
-
|
|
215
|
-
|
|
237
|
+
boxes = boxes.filter(box => !removeBlank(box)); // remove empty pages
|
|
238
|
+
boxes.forEach(box => {
|
|
216
239
|
if (book) {
|
|
217
240
|
if ($('.frontmatter', box)) return; // skip book frontmatter page
|
|
218
241
|
$(ps, box) && (page_title = ''); // empty title for first page of chapter
|
|
@@ -236,15 +259,15 @@
|
|
|
236
259
|
});
|
|
237
260
|
});
|
|
238
261
|
|
|
262
|
+
// unhide all pages
|
|
263
|
+
d.body.prepend(...boxes);
|
|
264
|
+
|
|
239
265
|
// add page numbers to TOC with data-* attributes
|
|
240
266
|
$$('#TOC a[href^="#"]').forEach(a => {
|
|
241
267
|
const id = CSS.escape(a.getAttribute('href').replace(/^#/, '')),
|
|
242
268
|
p = $(`.pagesjs-page:has(#${id}) .pagesjs-header`);
|
|
243
269
|
a.dataset.pageNumber = p ? p.dataset.pageNumber : '';
|
|
244
270
|
});
|
|
245
|
-
|
|
246
|
-
// unhide all pages
|
|
247
|
-
$$('.pagesjs-done').forEach(box => box.classList.remove('pagesjs-done'));
|
|
248
271
|
}
|
|
249
272
|
addEventListener('beforeprint', paginate);
|
|
250
273
|
// persistent pagination upon page reload (press p again to cancel it)
|
package/js/pages.min.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
(e=>{function t(t,n=e){return n?.querySelector(t)}function
|
|
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="pagesjs-fragmented",c="fragment-first",l=["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 f,d,p,h,g=[],u=[],m=0,E=[];function b(e){const n=u.length;return n-m>1&&(u.slice(m,n-1).forEach(L),m=n-1),e&&!t(".pagesjs-body",e)&&e.insertAdjacentHTML("afterbegin",a.innerHTML),f=e||a.cloneNode(!0),d=f.children[1],g.length&&f.classList.add(...g),u.includes(f)||u.push(f),f}function L(e){const t=e.scrollHeight;if(t>p&&!e.dataset.pagesOffset){const n=function(e,t){let n=+e.dataset.pagesOffset;if(n)return n;if(n=Math.ceil(t/p),n<=1)return n;const r=l.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)/p)}let i=a();for(;i>n;)n=i,i=a();return n}(e,t);n>1&&(e.dataset.pagesOffset=n)}e.remove()}function v(e){if(!e)return!1;const t=""===e.innerText.trim();return t&&e.remove(),t}function T(e){if(e.classList.contains("pagesjs-page"))f.after(b(e)),r(e)>3&&(d.append(...[...e.children].slice(3)),f.after(b()));else{if(d.append(e),f.scrollHeight<=p)return;const t=e.classList,n=e.innerHTML;j(e),t.contains(o)&&e.innerHTML!==n?t.add("fragment-last"):[e].concat(...s(`.${o}`,e)).forEach((e=>e.classList.remove(o,c))),E=[]}}function j(e,t,s,a){const i=e.tagName,l="CODE"===i,g=e.classList,m=g.contains(o);if(s||m&&g.remove(c),!E.length&&f.scrollHeight<=p)return;s?g.add(o):m||g.add(o,c);const L=a||f,T=e.cloneNode();if(t?t.append(T):(d.append(T),L.after(b()),d.append(e)),"PRE"===i){const y=e.firstElementChild;if("CODE"==y?.tagName){const O=E.length;O||(E=y.innerHTML.split("\n"));let M=E.length;M>1&&""===E[M-1]&&(M-=1),M>1&&(O||(h=y.offsetHeight/M),y.innerHTML="",j(y,T,e,L))}}else"DIV"===i&&1===r(e)&&j(e.firstElementChild,T,e,L);const H=T.previousElementSibling;if(["UL","OL","BLOCKQUOTE"].includes(i)&&r(e)>1)for(;;){const N=e.firstChild;if(!N)break;if(T.append(N),!N.nodeName.startsWith("#")&&L.scrollHeight>p){(H||r(T)>1)&&e.insertBefore(N,e.firstChild),"OL"===i&&(e.start+=r(T));break}}if(l){let S=0,x=1,k=n=E.length;const A=[];function C(e,t,n){e.innerHTML=E.slice(t,n).join("\n")}for(;k-x>1;){C(T,0,S||1);const D=p-L.offsetHeight;if(0===D){x=S||1;break}if(D<0){if(S<=0)break;k=S}else x=S;A.push(S);const I=S+Math.round(D/h);S=A.includes(I)?S+(D>0?1:-1):I,D>0&&S>=n&&(k=n+1,S=n)}if(S>0){if(C(T,0,x),E.splice(0,x),""===E.join("").trim())return t.before(s),e.remove(),s.append(T),u.pop().remove(),b(u[u.length-1]),E=[]}else T.innerHTML="",C(e,0),E=[],s.classList.remove(o,c)}(!v(T)||l||H)&&j(t?s:e)}function H(e){return e&&(e.dataset.shortTitle||e.innerText)}const C=H(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",b()),p=f.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=>{T(e),i&&f.after(b())})),s(".body").forEach(((e,t)=>{g=["chapter","appendix"].filter((t=>e.classList.contains(t))),i&&(""===f.innerText?b(f):f.after(b())),r[t].forEach(T),v(e.parentNode),v(e)})),u.slice(m).forEach(L),n.remove("pagesjs-filling");let a,o=0;u=u.filter((e=>!v(e))),u.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"),o+=n,e.classList.add("page-"+(o%2==0?"even":"odd"));const r={pageNumber:o,mainTitle:C,pageTitle:a};let c;[e.children[0],e.children[2]].forEach((e=>{for(const t in r)r[t]&&(e.dataset[t]=r[t])})),a=H([...s(y,e)].pop())||a,s(".footnotes",e).forEach(((t,n)=>{0===n?(c=t,e.children[1].after(t)):(c.append(...t.children),t.remove())}))})),e.body.prepend(...u),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 M=sessionStorage.getItem("pagesjs");M&&O(),addEventListener("keypress",(e=>"p"===e.key&&(O(),M=M?"":"1",sessionStorage.setItem("pagesjs",M),M||location.reload())))})(document);
|
|
2
2
|
//# sourceMappingURL=pages.min.js.map
|
package/js/pages.min.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["d","$","s","el","querySelector","$$","querySelectorAll","nChild","childElementCount","tpl","createElement","book","length","
|
|
1
|
+
{"version":3,"names":["d","$","s","el","querySelector","$$","querySelectorAll","nChild","childElementCount","tpl","createElement","book","length","fr_cls","fr_1","tb","map","i","getComputedStyle","documentElement","getPropertyValue","replace","className","innerHTML","box","box_body","H","h_code","box_cls","boxes","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","v","innerText","trim","fill","contains","after","append","cls","h0","fragment","container","parent","page","tag","tagName","is_code","frag","box_cur","el2","code","firstElementChild","initial","split","n_code","prev","previousElementSibling","item","firstChild","nodeName","startsWith","insertBefore","start","i1","i2","sols","fillCode","join","delta","i3","round","splice","before","pop","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,EAC3DC,EAAS,qBAAsBC,EAAO,iBACtCC,EAAK,CAAC,MAAO,UAAUC,KAAIC,IACfC,iBAAiBlB,EAAEmB,iBAAiBC,iBAAiB,kBAAkBH,KACvEI,QAAQ,KAAM,KAAO,IAEnCZ,EAAIa,UAAY,eAChBb,EAAIc,UAAY,2GAGhB,IAAIC,EAAKC,EAA+CC,EAAGC,EAAxCC,EAAU,GAAIC,EAAQ,GAAIC,EAAQ,EAAcC,EAAS,GAC5E,SAASC,EAAQ7B,GACf,MAAM8B,EAAIJ,EAAMjB,OAUhB,OARIqB,EAAIH,EAAQ,IACdD,EAAMK,MAAMJ,EAAOG,E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