@xiee/utils 1.13.70 → 1.13.71

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/js/pages.js CHANGED
@@ -6,6 +6,7 @@
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}`);
@@ -15,20 +16,18 @@
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_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,156 @@
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 {
58
56
  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);
57
+ if (box.scrollHeight > H) {
58
+ // temporarily remove el from DOM if it can be fragmented, otherwise
59
+ // simply move it to the next page
60
+ breakable(el) ? (el.remove(), fragment(el)) : nextPage(0, () => box_body.append(el));
65
61
  }
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
62
  }
72
63
  }
73
- function fillCode(el, i1, i2) {
74
- el.innerHTML = l_code.slice(i1, i2).join('\n');
64
+ function fillCode(el, i) {
65
+ el.innerHTML = l_code.slice(0, i).join('\n');
66
+ }
67
+ function breakable(el) {
68
+ l_code = [];
69
+ const t = el.tagName, c = el.firstElementChild;
70
+ if (fr_tag.includes(t)) return true;
71
+ if (t === 'DIV') {
72
+ const cs = el.children;
73
+ return (cs.length === 1 && fr_tag.includes(c?.tagName)) ||
74
+ [...cs].filter(c => c.tagName === 'TABLE').length;
75
+ }
76
+ if (t !== 'PRE') return false;
77
+ if (c?.tagName !== 'CODE') return false;
78
+ // store all lines in l_code (TODO: ensure complete tags on each line)
79
+ l_code = c.innerHTML.replace(/\n$/, '').split('\n');
80
+ const n_code = l_code.length;
81
+ if (n_code < 2) return false;
82
+ h_code = c.offsetHeight / n_code; // approx line height
83
+ c.innerHTML = ''; // temporarily empty <code>; will use l_code
84
+ return true;
75
85
  }
76
86
  // break elements that are relatively easy to break (such as <ul>)
77
- function fragment(el, container, parent, page) {
87
+ function fragment(el, container, parent) {
78
88
  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);
89
+ parent ? cls.add(fr_cls) : (frag ? cls.remove(fr_1) : cls.add(fr_cls, fr_1));
90
+ const el2 = el.cloneNode(); // shallow clone (wrapper only)
91
+ (container || box_body).append(el2);
92
+ const prev = el2.previousElementSibling;
93
+ function fragChildren(action) {
94
+ for (let item of [...el.children]) {
95
+ el2.append(item);
96
+ if (box.scrollHeight > H) {
97
+ action(item); break;
98
+ }
113
99
  }
114
- return removeBlank(el2);
115
- } else if (tag === 'DIV' && nChild(el) === 1) {
116
- fragment(el.firstElementChild, el2, el, box_cur);
117
100
  }
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) {
101
+ if (tag === 'DIV') {
102
+ // fragment <div>'s children (e.g., #TOC > ul)
103
+ fragChildren(item => {
104
+ // fragment item if it can be further fragmented, otherwise put it back
105
+ el.prepend(item);
106
+ fr_tag.includes(item.tagName) ? fragment(item, el2, el) : nChild(el2) && nextPage();
107
+ });
108
+ } else if (tag === 'PRE') {
109
+ fragment(el.firstElementChild, el2, el);
110
+ } else if (tag === 'CODE') {
111
+ // split lines in <code> and try to move as many lines into el2 as possible
112
+ const i = splitCode(el2);
113
+ // i == 0 means not enough space to split code on current page
114
+ fillCode(el2, i); l_code.splice(0, i);
115
+ if (i > 0) {
116
+ l_code.join('').trim() === '' ? (l_code = []) : nextPage();
117
+ }
118
+ } else if (tag === 'TABLE') {
119
+ // when el has no rows left and el2 is not empty, clear el
120
+ splitTable(el, el2) ? nextPage() : (el2.innerHTML !== '' && (el.innerHTML = ''));
121
+ } else {
122
+ // keep moving el's first item to el2 until page height > H
123
+ fr_tag.slice(1).includes(tag) && fragChildren(item => {
127
124
  // 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);
125
+ (prev || nChild(el2) > 1 || container?.previousElementSibling) && el.prepend(item);
129
126
  // update the start number of <ol> on next page
130
127
  tag === 'OL' && (el.start += nChild(el2));
131
- break;
128
+ // don't open new page if el2 is empty (will open one below when testing el2_empty)
129
+ nChild(el2) && nextPage();
130
+ });
131
+ }
132
+ const el_empty = !l_code.length && removeBlank(el), el2_empty = removeBlank(el2);
133
+ // add/remove the fragment-* class and exit if el has become empty
134
+ if (el_empty) {
135
+ const cls2 = el2.classList;
136
+ if (parent) {
137
+ container.classList.contains(fr_1) && cls2.remove(fr_cls);
138
+ } else {
139
+ cls2.contains(fr_1) ? cls2.remove(fr_cls, fr_1) : cls2.add(fr_2);
132
140
  }
141
+ return;
133
142
  }
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
143
+ // if el2 is empty, it means nothing in el fits the box; we have to start a new box
144
+ if (el2_empty) {
145
+ cls.remove(fr_cls, fr_1); parent || nextPage();
146
+ }
147
+ // keep fragmenting the remaining top-level el when el2 is not empty or not first element
148
+ if ((!el2_empty || prev) && !parent) fragment(el);
149
+ }
150
+ // split table rows
151
+ function splitTable(el, el2) {
152
+ const tb = el.tBodies[0], tb2 = tb.cloneNode(), rows = [...tb.rows], th = el.tHead;
153
+ el2.append(tb2);
154
+ // copy table header and footer
155
+ [th, el.tFoot].forEach(t => t && el2.append(t.cloneNode(true)));
156
+ for (let i = 0; i < rows.length; i++) {
157
+ const row = rows[i];
158
+ tb2.append(row);
159
+ if (box.offsetHeight > H) {
160
+ // clear the clone if current page can't fit even one row
161
+ tb.prepend(row); if (i === 0) el2.innerHTML = '';
162
+ break;
157
163
  }
158
- if (i > 0) {
159
- fillCode(el2, 0, i1); l_code.splice(0, i1);
164
+ }
165
+ return tb.rows.length;
166
+ }
167
+ // figure out how many lines can fit the box via bisection
168
+ function splitCode(el) {
169
+ let i = i1 = 1, n = l_code.length, i2 = n + 2;
170
+ const sols = []; // solutions tried
171
+ while (i2 > i1 + 1) {
172
+ fillCode(el, i);
173
+ const delta = H - box.offsetHeight;
174
+ if (delta === 0) return i;
175
+ if (delta < 0) {
176
+ if (i <= 1) return 0;
177
+ i2 = i;
160
178
  } else {
161
- el2.innerHTML = ''; fillCode(el, 0); l_code = []; // not fragmented
179
+ if (i >= n) return i;
180
+ i1 = i;
162
181
  }
163
- return i > 0;
182
+ sols.push(i);
183
+ // estimate the number of (more or less) lines needed
184
+ const i3 = i + Math.round(delta / h_code);
185
+ // if a solution has been tried, shorten step and (in/de)crement by 1
186
+ i = sols.includes(i3) ? i + (delta > 0 ? 1 : -1) : i3;
187
+ (delta > 0 && i >= n) && (i2 = n + 2, i = n); // solution may be n
164
188
  }
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);
189
+ return i1;
169
190
  }
170
191
 
171
192
  // use data-short-title of a header if exists, and fall back to inner text
@@ -222,24 +243,26 @@
222
243
  a.dataset.pageNumber = '000'; // placeholder for page numbers
223
244
  });
224
245
 
246
+ // temporarily move all elements out of DOM (to speed up rendering single pages)
225
247
  const els = [];
226
248
  $$('.body').forEach(el => {
227
- const ch = [...el.children];
249
+ // move <style> into <head> so it can be applied regardless of its presence in <body>
250
+ const ch = [...el.children].filter(el => el.tagName !== 'STYLE' || d.head.append(el));
228
251
  els.push(ch); ch.forEach(el => el.remove());
229
252
  });
230
253
  // iteratively add elements to pages
231
254
  $$('.frontmatter, .abstract, #TOC:not(.chapter-toc)').forEach(el => {
232
- (fill(el), book && box.after(newPage()));
255
+ (fill(el), book && nextPage());
233
256
  });
234
257
  $$('.body').forEach((el, i) => {
235
258
  // preserve book chapter classes if exist
236
259
  box_cls = ['chapter', 'appendix'].filter(i => el.classList.contains(i));
237
- book && (box.innerText === '' ? newPage(box) : box.after(newPage()));
260
+ book && (box.innerText === '' ? newPage(box) : nextPage());
238
261
  els[i].forEach(fill);
239
262
  // clean up container and self if empty
240
263
  removeBlank(el.parentNode); removeBlank(el);
241
264
  });
242
- boxes.slice(box_n).forEach(finish); // finish the rest of pages
265
+ finish(box); // finish the last box
243
266
  cls.remove('pagesjs-filling');
244
267
 
245
268
  // 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 s(e){return e.childElementCount}const r=e.createElement("div"),a=n("h1").length>1,i=[],o=["TABLE","UL","OL","BLOCKQUOTE"],c="pagesjs-fragmented",l="fragment-first",d=["top","bottom"].map((t=>+getComputedStyle(e.documentElement).getPropertyValue(`--paper-margin-${t}`).replace("px","")||0));r.className="pagesjs-page",r.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=[];function E(e){return e&&!t(".pagesjs-body",e)&&e.insertAdjacentHTML("afterbegin",r.innerHTML),f=e||r.cloneNode(!0),p=f.children[1],f.classList.add(...h),i.includes(f)||i.push(f),f}function L(e,t){const n=f;n.after(E(e)),t&&t(),b(n)}function b(e){const t=e.scrollHeight;if(t>g&&!e.dataset.pagesOffset){const s=function(e,t){let s=+e.dataset.pagesOffset;if(s)return s;if(s=Math.ceil(t/g),s<=1)return s;const r=d.concat([...n("thead",e)].map((e=>+e.offsetHeight))).reduce(((e,t)=>e+t));if(!r)return s;function a(){return Math.ceil((t+(s-1)*r)/g)}let i=a();for(;i>s;)s=i,i=a();return s}(e,t);s>1&&(e.dataset.pagesOffset=s)}e.remove()}function T(e){if(!e||"BODY"===e.tagName)return!1;const t=""===e.innerText.trim();return t&&e.remove(),t}function v(e){e.classList.contains("pagesjs-page")?L(e,(()=>s(e)>3&&(p.append(...[...e.children].slice(3)),L()))):(p.append(e),f.scrollHeight>g&&(!function(e){m=[];const t=e.tagName,n=e.firstElementChild;if(o.includes(t))return!0;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;m=n.innerHTML.replace(/\n$/,"").split("\n");const s=m.length;return!(s<2)&&(u=n.offsetHeight/s,n.innerHTML="",!0)}(e)?L(0,(()=>p.append(e))):(e.remove(),H(e))))}function j(e,t){e.innerHTML=m.slice(0,t).join("\n")}function H(e,t,n){const r=e.tagName,a=e.classList,i=a.contains(c);n?a.add(c):i?a.remove(l):a.add(c,l);const d=e.cloneNode();(t||p).append(d);const h=d.previousElementSibling;function E(t){for(let n of[...e.children])if(d.append(n),f.scrollHeight>g){t(n);break}}if("DIV"===r)E((t=>{e.prepend(t),o.includes(t.tagName)?H(t,d,e):s(d)&&L()}));else if("PRE"===r)H(e.firstElementChild,d,e);else if("CODE"===r){const e=function(e){let t=i1=1,n=m.length,s=n+2;const r=[];for(;s>i1+1;){j(e,t);const a=g-f.offsetHeight;if(0===a)return t;if(a<0){if(t<=1)return 0;s=t}else{if(t>=n)return t;i1=t}r.push(t);const i=t+Math.round(a/u);t=r.includes(i)?t+(a>0?1:-1):i,a>0&&t>=n&&(s=n+2,t=n)}return i1}(d);j(d,e),m.splice(0,e),e>0&&(""===m.join("").trim()?m=[]:L())}else"TABLE"===r?!function(e,t){const n=e.tBodies[0],s=n.cloneNode(),r=[...n.rows],a=e.tHead;t.append(s),[a,e.tFoot].forEach((e=>e&&t.append(e.cloneNode(!0))));for(let e=0;e<r.length;e++){const a=r[e];if(s.append(a),f.offsetHeight>g){n.prepend(a),0===e&&(t.innerHTML="");break}}return n.rows.length}(e,d)?""!==d.innerHTML&&(e.innerHTML=""):L():o.slice(1).includes(r)&&E((n=>{(h||s(d)>1||t?.previousElementSibling)&&e.prepend(n),"OL"===r&&(e.start+=s(d)),s(d)&&L()}));const b=!m.length&&T(e),v=T(d);if(b){const e=d.classList;n?t.classList.contains(l)&&e.remove(c):e.contains(l)?e.remove(c,l):e.add("fragment-last")}else v&&(a.remove(c,l),n||L()),v&&!h||n||H(e)}function N(e){return e&&(e.dataset.shortTitle||e.innerText)}const O=N(t("h1.title, .frontmatter h1, .title, h1")),y=(a?"h1":"h2")+":not(.frontmatter *)";function C(){if("complete"!==e.readyState)return setTimeout(C,10);const s=e.body.classList;if(s.contains("pagesjs"))return;s.add("pagesjs"),e.body.insertAdjacentElement("afterbegin",E()),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")})),s.add("pagesjs-filling"),n('#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=[];n(".body").forEach((t=>{const n=[...t.children].filter((t=>"STYLE"!==t.tagName||e.head.append(t)));r.push(n),n.forEach((e=>e.remove()))})),n(".frontmatter, .abstract, #TOC:not(.chapter-toc)").forEach((e=>{v(e),a&&L()})),n(".body").forEach(((e,t)=>{h=["chapter","appendix"].filter((t=>e.classList.contains(t))),a&&(""===f.innerText?E(f):L()),r[t].forEach(v),T(e.parentNode),T(e)})),b(f),s.remove("pagesjs-filling");let o,c=0;i.forEach((e=>{if(a){if(t(".frontmatter",e))return;t(y,e)&&(o="")}const s=+e.dataset.pagesOffset||1;s>1&&e.classList.add("page-multiple"),c+=s,e.classList.add("page-"+(c%2==0?"even":"odd"));const r={pageNumber:c,mainTitle:O,pageTitle:o};let i;[e.children[0],e.children[2]].forEach((e=>{for(const t in r)r[t]&&(e.dataset[t]=r[t])})),o=N([...n(y,e)].pop())||o,n(".footnotes",e).forEach(((t,n)=>{0===n?(i=t,e.children[1].after(t)):(i.append(...t.children),t.remove())}))})),e.body.prepend(...i),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",C);let M=sessionStorage.getItem("pagesjs");M&&C(),addEventListener("keypress",(e=>"p"===e.key&&(C(),M=M?"":"1",sessionStorage.setItem("pagesjs",M),M||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,MAAO,UA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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","getComputedStyle","documentElement","getPropertyValue","replace","className","innerHTML","box","box_body","H","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","v","innerText","trim","fill","contains","append","slice","t","c","firstElementChild","cs","filter","split","n_code","breakable","fragment","fillCode","join","container","parent","tag","cls","frag","el2","prev","previousElementSibling","fragChildren","action","item","prepend","i1","i2","sols","delta","i3","round","splitCode","splice","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","a","nextSibling","pageNumber","els","ch","head","parentNode","page_title","N","info","mainTitle","pageTitle","ft","key","pop","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,GACtE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D,SAAS,GACzF,IAIJ7D,EAAEyH,KAAK5B,WAAWhF,GAGlBR,EAAG,qBAAqBuG,SAAQkB,IAC9B,MACEe,EAAI5I,EAAE,sBADG6I,IAAIC,OAAOjB,EAAEkB,aAAa,QAAQzH,QAAQ,KAAM,yBAE3DuG,EAAE/E,QAAQiF,WAAaa,EAAIA,EAAE9F,QAAQiF,WAAa,EAAE,GAExD,CACAiB,iBAAiB,cAAe3B,GAEhC,IAAI4B,EAAKC,eAAeC,QAAQ,WAChCF,GAAM5B,IACN2B,iBAAiB,YAAYI,GAAe,MAAVA,EAAEV,MAClCrB,IAAY4B,EAAKA,EAAK,GAAK,IAAKC,eAAeG,QAAQ,UAAWJ,GAAKA,GAAMK,SAASC,WAEzF,EApTD,CAoTGC","ignoreList":[]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xiee/utils",
3
- "version": "1.13.70",
3
+ "version": "1.13.71",
4
4
  "description": "Miscellaneous tools and utilities to manipulate HTML pages",
5
5
  "scripts": {
6
6
  "test": "echo \"Error: no test specified\" && exit 1"