@xiee/utils 1.13.8 → 1.13.10

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.
@@ -7,10 +7,13 @@ jobs:
7
7
  if: ${{ startsWith(github.ref, 'refs/tags/v') }}
8
8
  steps:
9
9
  - uses: actions/checkout@v4
10
+ with:
11
+ fetch-depth: 0
10
12
  - uses: actions/setup-node@v4
11
13
  with:
12
14
  registry-url: 'https://registry.npmjs.org'
13
15
  - run: ./build.sh
16
+ - run: PREVIOUS_COMMIT=${{ github.event.before }} CURRENT_COMMIT=${{ github.sha }} ./purge.sh || true
14
17
  - run: npm publish --access public
15
18
  env:
16
19
  NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
package/css/pages.css CHANGED
@@ -55,7 +55,7 @@
55
55
  border: none;
56
56
  padding: 0;
57
57
  margin-left: auto;
58
- &::before {
58
+ &:not(.pagesjs-page:has(#TOC) ~ .pagesjs-page *)::before {
59
59
  content: "Contents";
60
60
  display: block;
61
61
  font-weight: bold;
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;--paper-margin:var(--paper-margin-top)var(--paper-margin-right)var(--paper-margin-bottom)var(--paper-margin-left);--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}& .pagesjs-page{width:var(--paper-width);height:var(--paper-height);padding:var(--paper-margin);page-break-after:always;flex-direction:column;justify-content:space-between;display:flex;& img{max-width:100%}& pre{white-space:pre-wrap}& .chapter-before,& .chapter-after,& .pencil:has(+.chapter-before){display:none}& #TOC{border:none;margin-left:auto;padding:0;&: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}}}& .footnotes:before{content:"";border-top:1px solid;max-width:20em;display:block}&:first-child:is(.page-book *){padding:0;& .pagesjs-header,& .pagesjs-footer{display:none}& .frontmatter{padding:var(--paper-margin);height:100%;margin:0;& .title{margin-top:calc(0px - var(--paper-margin-top))}&>div{margin:0 calc(0px - var(--paper-margin-right))0 calc(0px - var(--paper-margin-left))}}}}}.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{background-color:#f7f7f7;& .pagesjs-page{background-color:#fff}& .page-multiple{overflow-y:auto}}.pagesjs-filling{display:block;& .pagesjs-page{height:auto}}}@media print{.pagesjs{gap:0;margin:0;& .page-multiple{padding-top:0 padding-bottom: 0}}}
1
+ :root{--paper-width:210mm;--paper-height:297mm;--paper-margin-top:40px;--paper-margin-right:80px;--paper-margin-bottom:40px;--paper-margin-left:80px;--paper-margin:var(--paper-margin-top)var(--paper-margin-right)var(--paper-margin-bottom)var(--paper-margin-left);--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}& .pagesjs-page{width:var(--paper-width);height:var(--paper-height);padding:var(--paper-margin);page-break-after:always;flex-direction:column;justify-content:space-between;display:flex;& img{max-width:100%}& pre{white-space:pre-wrap}& .chapter-before,& .chapter-after,& .pencil:has(+.chapter-before){display:none}& #TOC{border:none;margin-left:auto;padding:0;&:not(.pagesjs-page:has(#TOC)~.pagesjs-page *):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}}}& .footnotes:before{content:"";border-top:1px solid;max-width:20em;display:block}&:first-child:is(.page-book *){padding:0;& .pagesjs-header,& .pagesjs-footer{display:none}& .frontmatter{padding:var(--paper-margin);height:100%;margin:0;& .title{margin-top:calc(0px - var(--paper-margin-top))}&>div{margin:0 calc(0px - var(--paper-margin-right))0 calc(0px - var(--paper-margin-left))}}}}}.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{background-color:#f7f7f7;& .pagesjs-page{background-color:#fff}& .page-multiple{overflow-y:auto}}.pagesjs-filling{display:block;& .pagesjs-page{height:auto}}}@media print{.pagesjs{gap:0;margin:0;& .page-multiple{padding-top:0 padding-bottom: 0}}}
2
2
  /*# sourceMappingURL=pages.min.css.map */
@@ -1 +1 @@
1
- {"version":3,"mappings":"AAAA,4WAaA,0DAIA,2FAIA,6BAGA,wGAQE,2DAIA,yLAQE,qBAGA,2BAGA,gFAGA,8CAIE,4FAOA,kBAGA,iBAEE,sDAIA,oCAGA,uEAOJ,iFAMA,yCAEE,iDAGA,gEAIE,wDAGA,+FAOR,0FAKA,2GAIE,uCAGA,uCAIF,uGAIE,qBAGA,wCAIF,4CAIA,mBACE,kCAEE,sCAGA,kCAIF,+BAEE,8BAKJ,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 --paper-margin: var(--paper-margin-top) var(--paper-margin-right) var(--paper-margin-bottom) var(--paper-margin-left);\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 .pagesjs-page {\n width: var(--paper-width);\n height: var(--paper-height);\n padding: var(--paper-margin);\n \tpage-break-after: always;\n display: flex;\n flex-direction: column;\n justify-content: space-between;\n img {\n max-width: 100%;\n }\n pre {\n white-space: pre-wrap;\n }\n .chapter-before, .chapter-after, .pencil:has(+ .chapter-before) {\n display: none;\n }\n #TOC {\n border: none;\n padding: 0;\n margin-left: auto;\n &::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 .footnotes::before {\n content: \"\";\n display: block;\n max-width: 20em;\n border-top: solid 1px;\n }\n &:first-child:is(.page-book *) {\n padding: 0;\n .pagesjs-header, .pagesjs-footer {\n display: none;\n }\n .frontmatter {\n margin: 0;\n padding: var(--paper-margin);\n height: 100%;\n .title {\n margin-top: calc(0px - var(--paper-margin-top));\n }\n & > div {\n margin: 0 calc(0px - var(--paper-margin-right)) 0 calc(0px - var(--paper-margin-left));\n }\n }\n }\n }\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 background-color: #f7f7f7;\n .pagesjs-page {\n background-color: white;\n }\n .page-multiple {\n overflow-y: auto;\n }\n }\n .pagesjs-filling {\n display: block;\n .pagesjs-page {\n height: auto;\n }\n }\n}\n@media print {\n .pagesjs {\n margin: 0;\n gap: 0;\n .page-multiple {\n padding-top: 0\n padding-bottom: 0;\n }\n }\n}\n"],"names":[]}
1
+ {"version":3,"mappings":"AAAA,4WAaA,0DAIA,2FAIA,6BAGA,wGAQE,2DAIA,yLAQE,qBAGA,2BAGA,gFAGA,8CAIE,yIAOA,kBAGA,iBAEE,sDAIA,oCAGA,uEAOJ,iFAMA,yCAEE,iDAGA,gEAIE,wDAGA,+FAOR,0FAKA,2GAIE,uCAGA,uCAIF,uGAIE,qBAGA,wCAIF,4CAIA,mBACE,kCAEE,sCAGA,kCAIF,+BAEE,8BAKJ,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 --paper-margin: var(--paper-margin-top) var(--paper-margin-right) var(--paper-margin-bottom) var(--paper-margin-left);\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 .pagesjs-page {\n width: var(--paper-width);\n height: var(--paper-height);\n padding: var(--paper-margin);\n \tpage-break-after: always;\n display: flex;\n flex-direction: column;\n justify-content: space-between;\n img {\n max-width: 100%;\n }\n pre {\n white-space: pre-wrap;\n }\n .chapter-before, .chapter-after, .pencil:has(+ .chapter-before) {\n display: none;\n }\n #TOC {\n border: none;\n padding: 0;\n margin-left: auto;\n &:not(.pagesjs-page:has(#TOC) ~ .pagesjs-page *)::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 .footnotes::before {\n content: \"\";\n display: block;\n max-width: 20em;\n border-top: solid 1px;\n }\n &:first-child:is(.page-book *) {\n padding: 0;\n .pagesjs-header, .pagesjs-footer {\n display: none;\n }\n .frontmatter {\n margin: 0;\n padding: var(--paper-margin);\n height: 100%;\n .title {\n margin-top: calc(0px - var(--paper-margin-top));\n }\n & > div {\n margin: 0 calc(0px - var(--paper-margin-right)) 0 calc(0px - var(--paper-margin-left));\n }\n }\n }\n }\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 background-color: #f7f7f7;\n .pagesjs-page {\n background-color: white;\n }\n .page-multiple {\n overflow-y: auto;\n }\n }\n .pagesjs-filling {\n display: block;\n .pagesjs-page {\n height: auto;\n }\n }\n}\n@media print {\n .pagesjs {\n margin: 0;\n gap: 0;\n .page-multiple {\n padding-top: 0\n padding-bottom: 0;\n }\n }\n}\n"],"names":[]}
package/js/pages.js CHANGED
@@ -9,9 +9,11 @@
9
9
  tpl.innerHTML = `<div class="pagesjs-header"></div>
10
10
  <div class="pagesjs-body"></div>
11
11
  <div class="pagesjs-footer"></div>`;
12
- let box, box_body, H;
12
+ let box, box_body, H, box_cls = [];
13
13
  function newPage(el) {
14
+ el && !$('.pagesjs-body', el) && el.insertAdjacentHTML('afterbegin', tpl.innerHTML);
14
15
  box = el || tpl.cloneNode(true); box_body = box.children[1];
16
+ box_cls.length && box.classList.add(...box_cls);
15
17
  return box;
16
18
  }
17
19
  function removeBlank(el) {
@@ -23,32 +25,54 @@
23
25
  function fill(el) {
24
26
  // if the element is already a page, just use it as the box
25
27
  if (el.classList.contains('pagesjs-page')) {
26
- box.after(el);
27
- !$('.pagesjs-body', el) && el.insertAdjacentHTML('afterbegin', tpl.innerHTML);
28
+ box.after(newPage(el));
28
29
  // if current element is not empty, fill its content into the box
29
30
  if (el.childElementCount > 3) {
30
- el.children[1].append(...[...el.children].slice(3));
31
- el.after(newPage()); // create a new empty page
32
- } else {
33
- newPage(el);
31
+ box_body.append(...[...el.children].slice(3));
32
+ // TODO: should we fragment this page if it's too long?
33
+ box.after(newPage()); // create a new empty page
34
34
  }
35
- return el;
35
+ return;
36
36
  }
37
37
  // create a new box when too much content (exceeding original height)
38
38
  if (box.scrollHeight > H) {
39
- const box2 = tpl.cloneNode(true), box_body2 = box2.children[1];
40
- box.after(box2);
41
- // if there's more than one child in the box, move the last child out
42
- box_body.childElementCount > 1 && box_body2.append(box_body.lastElementChild);
43
- [box, box_body] = [box2, box_body2];
39
+ const [box2, box_body2] = [box, box_body]; // store old box
40
+ box2.after(newPage());
41
+ // if there's more than one child in the box, move the last child to next box
42
+ box_body2.childElementCount > 1 && box_body.append(box_body2.lastElementChild);
44
43
  }
45
44
  box_body.append(el);
46
- return box;
45
+ fragment(el);
46
+ }
47
+ // break elements that are relatively easy to break (such as <ul>)
48
+ function fragment(el, container, parent, page) {
49
+ if (box.scrollHeight <= H) return;
50
+ const box_cur = page || box, el2 = el.cloneNode(); // shallow clone (wrapper only)
51
+ // add the clone to current box, and move original el to next box
52
+ container ? container.append(el2) : (
53
+ box_body.append(el2), box_cur.after(newPage()), box_body.append(el)
54
+ );
55
+ // for DIVs containing a single child (e.g., #TOC > ul), try to break the child
56
+ if (el.tagName === 'DIV' && el.childElementCount === 1) {
57
+ fragment(el.firstElementChild, el2, el, box_cur);
58
+ }
59
+ // keep moving el's first item to el2 until page height > H
60
+ if (['UL', 'BLOCKQUOTE'].indexOf(el.tagName) > -1 && el.childElementCount > 1) while (true) {
61
+ const item = el.firstChild;
62
+ if (!item) break;
63
+ el2.append(item);
64
+ if (box_cur.scrollHeight > H) {
65
+ el.insertBefore(item, el.firstChild);
66
+ break;
67
+ }
68
+ }
69
+ el2.lastChild || el2.remove(); // remove the clone if empty
70
+ fragment(container ? parent : el);
47
71
  }
48
72
 
49
73
  // use data-short-title of a header if exists, and fall back to inner text
50
74
  function shortTitle(h) {
51
- return h && (h.dataset['shortTitle'] || h.innerText);
75
+ return h && (h.dataset.shortTitle || h.innerText);
52
76
  }
53
77
  const main = shortTitle($('h1.title, .frontmatter h1, .title, h1')), // main title
54
78
  ps = (book ? 'h1' : 'h2') + ':not(.frontmatter *)', // page title selector
@@ -61,7 +85,7 @@
61
85
  // an estimate; if not accurate, use <div class="pagesjs-page" data-pages-offset="N">
62
86
  // to provide a number manually)
63
87
  function calcPages(box) {
64
- let n = +box.dataset['pagesOffset'];
88
+ let n = +box.dataset.pagesOffset;
65
89
  if (n) return n;
66
90
  const h = box.scrollHeight;
67
91
  n = Math.ceil(h/H);
@@ -92,19 +116,17 @@
92
116
 
93
117
  cls.add('pagesjs-filling');
94
118
  // iteratively add elements to pages
95
- $$('.frontmatter, #TOC, .abstract').forEach(el => {
96
- book ? (box_body.append(el), box.after(newPage())) : fill(el);
97
- });
119
+ $$('.frontmatter, #TOC, .abstract').forEach(el => (fill(el), book && box.after(newPage())));
98
120
  $$('.body').forEach(el => {
99
121
  // preserve book chapter classes if exist
100
- const extra = ['chapter', 'appendix'].filter(i => el.classList.contains(i));
122
+ box_cls = ['chapter', 'appendix'].filter(i => el.classList.contains(i));
123
+ newPage(box);
101
124
  book && box.innerText !== '' && box.after(newPage());
102
- [...el.children].map(c => fill(c).classList.add(...extra));
103
- el.childElementCount === 0 && el.remove();
125
+ [...el.children].map(fill);
126
+ // clean up container and self if empty
127
+ removeBlank(el.parentNode); removeBlank(el);
104
128
  });
105
129
  cls.remove('pagesjs-filling');
106
- // clean up an empty div for books
107
- book && removeBlank(box.nextElementSibling);
108
130
 
109
131
  // add dot leaders to TOC
110
132
  const toc = $('#TOC');
@@ -114,7 +136,7 @@
114
136
  n?.classList.contains('section-number') ? n.after(s) : a.insertAdjacentElement('afterbegin', s);
115
137
  while (s.nextSibling) s.append(s.nextSibling);
116
138
  a.insertAdjacentHTML('beforeend', '<span class="dot-leader"></span>');
117
- a.dataset['pageNumber'] = '000'; // placeholder for page numbers
139
+ a.dataset.pageNumber = '000'; // placeholder for page numbers
118
140
  });
119
141
 
120
142
  // add page number, title, etc. to data-* attributes of page elements
@@ -143,7 +165,7 @@
143
165
  // add page numbers to TOC with data-* attributes
144
166
  $$('a[href^="#"]', toc).forEach(a => {
145
167
  const p = $(`.pagesjs-page:has(${a.getAttribute('href')}) .pagesjs-header`);
146
- a.dataset['pageNumber'] = p ? p.dataset['pageNumber'] : '';
168
+ a.dataset.pageNumber = p ? p.dataset.pageNumber : '';
147
169
  });
148
170
  }
149
171
  addEventListener('beforeprint', paginate);
package/js/pages.min.js CHANGED
@@ -1 +1 @@
1
- (e=>{function t(t,n=e){return n?.querySelector(t)}function n(t,n=e){return n?n.querySelectorAll(t):[]}const a=e.createElement("div"),r=n("h1").length>1;let s,i,o;function c(e){return s=e||a.cloneNode(!0),i=s.children[1],s}function l(e){if(!e)return!1;const t=""===e.innerText.trim();return t&&e.remove(),t}function d(e){if(e.classList.contains("pagesjs-page"))return s.after(e),!t(".pagesjs-body",e)&&e.insertAdjacentHTML("afterbegin",a.innerHTML),e.childElementCount>3?(e.children[1].append(...[...e.children].slice(3)),e.after(c())):c(e),e;if(s.scrollHeight>o){const e=a.cloneNode(!0),t=e.children[1];s.after(e),i.childElementCount>1&&t.append(i.lastElementChild),[s,i]=[e,t]}return i.append(e),s}function p(e){return e&&(e.dataset.shortTitle||e.innerText)}a.className="pagesjs-page",a.innerHTML='<div class="pagesjs-header"></div>\n<div class="pagesjs-body"></div>\n<div class="pagesjs-footer"></div>';const f=p(t("h1.title, .frontmatter h1, .title, h1")),g=(r?"h1":"h2")+":not(.frontmatter *)",h=["top","bottom"].map((t=>+getComputedStyle(e.documentElement).getPropertyValue(`--paper-margin-${t}`).replace("px","")||0));function u(){const a=e.body.classList;if(a.contains("pagesjs"))return;a.add("pagesjs"),r&&a.add("page-book"),e.body.insertAdjacentElement("afterbegin",c()),o=s.clientHeight||window.innerHeight,n(":is(#TOC, .footnotes):is(.side-left, .side-right).side").forEach((e=>{e.classList.remove("side","side-left","side-right")})),a.add("pagesjs-filling"),n(".frontmatter, #TOC, .abstract").forEach((e=>{r?(i.append(e),s.after(c())):d(e)})),n(".body").forEach((e=>{const t=["chapter","appendix"].filter((t=>e.classList.contains(t)));r&&""!==s.innerText&&s.after(c()),[...e.children].map((e=>d(e).classList.add(...t))),0===e.childElementCount&&e.remove()})),a.remove("pagesjs-filling"),r&&l(s.nextElementSibling);const u=t("#TOC");n('a[href^="#"]',u).forEach((t=>{const n=e.createElement("span"),a=t.firstElementChild;for(a?.classList.contains("section-number")?a.after(n):t.insertAdjacentElement("afterbegin",n);n.nextSibling;)n.append(n.nextSibling);t.insertAdjacentHTML("beforeend",'<span class="dot-leader"></span>'),t.dataset.pageNumber="000"}));let m,b=0;n(".pagesjs-page").forEach((e=>{if(l(e))return;r&&t(g,e)&&(m="");const a=function(e){let t=+e.dataset.pagesOffset;if(t)return t;const a=e.scrollHeight;if(t=Math.ceil(a/o),t<=1)return t;const r=h.concat([...n("thead",e)].map((e=>+e.offsetHeight))).reduce(((e,t)=>e+t));if(!r)return t;function s(){return Math.ceil((a+(t-1)*r)/o)}let i=s();for(;i>t;)t=i,i=s();return t}(e);a>1&&e.classList.add("page-multiple"),b+=a;const s={pageNumber:b,mainTitle:f,pageTitle:m};let i;[e.children[0],e.children[2]].forEach((e=>{for(const t in s)s[t]&&(e.dataset[t]=s[t])})),m=p([...n(g,e)].pop())||m,n(".footnotes",e).forEach(((t,n)=>{0===n?(i=t,e.children[1].after(t)):(i.append(...t.children),t.remove())}))})),n('a[href^="#"]',u).forEach((e=>{const n=t(`.pagesjs-page:has(${e.getAttribute("href")}) .pagesjs-header`);e.dataset.pageNumber=n?n.dataset.pageNumber:""}))}addEventListener("beforeprint",u);let m=sessionStorage.getItem("pagesjs");m&&u(),addEventListener("keypress",(e=>"p"===e.key&&(u(),m=m?"":"1",sessionStorage.setItem("pagesjs",m),m||location.reload())))})(document);
1
+ (e=>{function t(t,n=e){return n?.querySelector(t)}function n(t,n=e){return n?n.querySelectorAll(t):[]}const a=e.createElement("div"),r=n("h1").length>1;a.className="pagesjs-page",a.innerHTML='<div class="pagesjs-header"></div>\n<div class="pagesjs-body"></div>\n<div class="pagesjs-footer"></div>';let s,i,o,l=[];function c(e){return e&&!t(".pagesjs-body",e)&&e.insertAdjacentHTML("afterbegin",a.innerHTML),s=e||a.cloneNode(!0),i=s.children[1],l.length&&s.classList.add(...l),s}function d(e){if(!e)return!1;const t=""===e.innerText.trim();return t&&e.remove(),t}function f(e){if(e.classList.contains("pagesjs-page"))return s.after(c(e)),void(e.childElementCount>3&&(i.append(...[...e.children].slice(3)),s.after(c())));if(s.scrollHeight>o){const[e,t]=[s,i];e.after(c()),t.childElementCount>1&&i.append(t.lastElementChild)}i.append(e),p(e)}function p(e,t,n,a){if(s.scrollHeight<=o)return;const r=a||s,l=e.cloneNode();if(t?t.append(l):(i.append(l),r.after(c()),i.append(e)),"DIV"===e.tagName&&1===e.childElementCount&&p(e.firstElementChild,l,e,r),["UL","BLOCKQUOTE"].indexOf(e.tagName)>-1&&e.childElementCount>1)for(;;){const t=e.firstChild;if(!t)break;if(l.append(t),r.scrollHeight>o){e.insertBefore(t,e.firstChild);break}}l.lastChild||l.remove(),p(t?n:e)}function g(e){return e&&(e.dataset.shortTitle||e.innerText)}const h=g(t("h1.title, .frontmatter h1, .title, h1")),u=(r?"h1":"h2")+":not(.frontmatter *)",m=["top","bottom"].map((t=>+getComputedStyle(e.documentElement).getPropertyValue(`--paper-margin-${t}`).replace("px","")||0));function b(){const a=e.body.classList;if(a.contains("pagesjs"))return;a.add("pagesjs"),r&&a.add("page-book"),e.body.insertAdjacentElement("afterbegin",c()),o=s.clientHeight||window.innerHeight,n(":is(#TOC, .footnotes):is(.side-left, .side-right).side").forEach((e=>{e.classList.remove("side","side-left","side-right")})),a.add("pagesjs-filling"),n(".frontmatter, #TOC, .abstract").forEach((e=>(f(e),r&&s.after(c())))),n(".body").forEach((e=>{l=["chapter","appendix"].filter((t=>e.classList.contains(t))),c(s),r&&""!==s.innerText&&s.after(c()),[...e.children].map(f),d(e.parentNode),d(e)})),a.remove("pagesjs-filling");const i=t("#TOC");n('a[href^="#"]',i).forEach((t=>{const n=e.createElement("span"),a=t.firstElementChild;for(a?.classList.contains("section-number")?a.after(n):t.insertAdjacentElement("afterbegin",n);n.nextSibling;)n.append(n.nextSibling);t.insertAdjacentHTML("beforeend",'<span class="dot-leader"></span>'),t.dataset.pageNumber="000"}));let p,b=0;n(".pagesjs-page").forEach((e=>{if(d(e))return;r&&t(u,e)&&(p="");const a=function(e){let t=+e.dataset.pagesOffset;if(t)return t;const a=e.scrollHeight;if(t=Math.ceil(a/o),t<=1)return t;const r=m.concat([...n("thead",e)].map((e=>+e.offsetHeight))).reduce(((e,t)=>e+t));if(!r)return t;function s(){return Math.ceil((a+(t-1)*r)/o)}let i=s();for(;i>t;)t=i,i=s();return t}(e);a>1&&e.classList.add("page-multiple"),b+=a;const s={pageNumber:b,mainTitle:h,pageTitle:p};let i;[e.children[0],e.children[2]].forEach((e=>{for(const t in s)s[t]&&(e.dataset[t]=s[t])})),p=g([...n(u,e)].pop())||p,n(".footnotes",e).forEach(((t,n)=>{0===n?(i=t,e.children[1].after(t)):(i.append(...t.children),t.remove())}))})),n('a[href^="#"]',i).forEach((e=>{const n=t(`.pagesjs-page:has(${e.getAttribute("href")}) .pagesjs-header`);e.dataset.pageNumber=n?n.dataset.pageNumber:""}))}addEventListener("beforeprint",b);let E=sessionStorage.getItem("pagesjs");E&&b(),addEventListener("keypress",(e=>"p"===e.key&&(b(),E=E?"":"1",sessionStorage.setItem("pagesjs",E),E||location.reload())))})(document);
@@ -1 +1 @@
1
- {"version":3,"names":["d","$","s","el","querySelector","$$","querySelectorAll","tpl","createElement","book","length","box","box_body","H","newPage","cloneNode","children","removeBlank","v","innerText","trim","remove","fill","classList","contains","after","insertAdjacentHTML","innerHTML","childElementCount","append","slice","scrollHeight","box2","box_body2","lastElementChild","shortTitle","h","dataset","className","main","ps","tb","map","i","getComputedStyle","documentElement","getPropertyValue","replace","paginate","cls","body","add","insertAdjacentElement","clientHeight","window","innerHeight","forEach","extra","filter","c","nextElementSibling","toc","a","n","firstElementChild","nextSibling","page_title","N","Math","ceil","m","concat","offsetHeight","reduce","m1","m2","newPages","n2","calcPages","info","pageNumber","mainTitle","pageTitle","ft","key","pop","p","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,CAElE,MAAMK,EAAMP,EAAEQ,cAAc,OAAQC,EAAOJ,EAAG,MAAMK,OAAS,EAK7D,IAAIC,EAAKC,EAAUC,EACnB,SAASC,EAAQX,GAEf,OADAQ,EAAMR,GAAMI,EAAIQ,WAAU,GAAOH,EAAWD,EAAIK,SAAS,GAClDL,CACT,CACA,SAASM,EAAYd,GACnB,IAAKA,EAAI,OAAO,EAChB,MAAMe,EAA4B,KAAxBf,EAAGgB,UAAUC,OAEvB,OADAF,GAAKf,EAAGkB,SACDH,CACT,CACA,SAASI,EAAKnB,GAEZ,GAAIA,EAAGoB,UAAUC,SAAS,gBAUxB,OATAb,EAAIc,MAAMtB,IACTF,EAAE,gBAAiBE,IAAOA,EAAGuB,mBAAmB,aAAcnB,EAAIoB,WAE/DxB,EAAGyB,kBAAoB,GACzBzB,EAAGa,SAAS,GAAGa,UAAU,IAAI1B,EAAGa,UAAUc,MAAM,IAChD3B,EAAGsB,MAAMX,MAETA,EAAQX,GAEHA,EAGT,GAAIQ,EAAIoB,aAAelB,EAAG,CACxB,MAAMmB,EAAOzB,EAAIQ,WAAU,GAAOkB,EAAYD,EAAKhB,SAAS,GAC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,SAAS,IAAIwC,SAAQrD,IACzC,IAAK,MAAMiF,KAAOL,EAAMA,EAAKK,KAASjF,EAAGkC,QAAQ+C,GAAOL,EAAKK,GAAK,IAGpElB,EAAa/B,EAAW,IAAI9B,EAAGmC,EAAI7B,IAAM0E,QAAUnB,EAGnD7D,EAAG,aAAcM,GAAK6C,SAAQ,CAACrD,EAAIwC,KAC3B,IAANA,GAAWwC,EAAKhF,EAAIQ,EAAIK,SAAS,GAAGS,MAAMtB,KAAQgF,EAAGtD,UAAU1B,EAAGa,UAAWb,EAAGkB,SAAS,GACzF,IAIJhB,EAAG,eAAgBwD,GAAKL,SAAQM,IAC9B,MAAMwB,EAAIrF,EAAE,qBAAqB6D,EAAEyB,aAAa,4BAChDzB,EAAEzB,QAAoB,WAAIiD,EAAIA,EAAEjD,QAAoB,WAAI,EAAE,GAE9D,CACAmD,iBAAiB,cAAexC,GAEhC,IAAIyC,EAAKC,eAAeC,QAAQ,WAChCF,GAAMzC,IACNwC,iBAAiB,YAAYI,GAAe,MAAVA,EAAER,MAClCpC,IAAYyC,EAAKA,EAAK,GAAK,IAAKC,eAAeG,QAAQ,UAAWJ,GAAKA,GAAMK,SAASC,WAEzF,EAzJD,CAyJGC","ignoreList":[]}
1
+ {"version":3,"names":["d","$","s","el","querySelector","$$","querySelectorAll","tpl","createElement","book","length","className","innerHTML","box","box_body","H","box_cls","newPage","insertAdjacentHTML","cloneNode","children","classList","add","removeBlank","v","innerText","trim","remove","fill","contains","after","childElementCount","append","slice","scrollHeight","box2","box_body2","lastElementChild","fragment","container","parent","page","box_cur","el2","tagName","firstElementChild","indexOf","item","firstChild","insertBefore","lastChild","shortTitle","h","dataset","main","ps","tb","map","i","getComputedStyle","documentElement","getPropertyValue","replace","paginate","cls","body","insertAdjacentElement","clientHeight","window","innerHeight","forEach","filter","parentNode","toc","a","n","nextSibling","pageNumber","page_title","N","pagesOffset","Math","ceil","m","concat","offsetHeight","reduce","m1","m2","newPages","n2","calcPages","info","mainTitle","pageTitle","ft","key","pop","p","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,CAElE,MAAMK,EAAMP,EAAEQ,cAAc,OAAQC,EAAOJ,EAAG,MAAMK,OAAS,EAC7DH,EAAII,UAAY,eAChBJ,EAAIK,UAAY,2GAGhB,IAAIC,EAAKC,EAAUC,EAAGC,EAAU,GAChC,SAASC,EAAQd,GAIf,OAHAA,IAAOF,EAAE,gBAAiBE,IAAOA,EAAGe,mBAAmB,aAAcX,EAAIK,WACzEC,EAAMV,GAAMI,EAAIY,WAAU,GAAOL,EAAWD,EAAIO,SAAS,GACzDJ,EAAQN,QAAUG,EAAIQ,UAAUC,OAAON,GAChCH,CACT,CACA,SAASU,EAAYpB,GACnB,IAAKA,EAAI,OAAO,EAChB,MAAMqB,EAA4B,KAAxBrB,EAAGsB,UAAUC,OAEvB,OADAF,GAAKrB,EAAGwB,SACDH,CACT,CACA,SAASI,EAAKzB,GAEZ,GAAIA,EAAGkB,UAAUQ,SAAS,gBAQxB,OAPAhB,EAAIiB,MAAMb,EAAQd,SAEdA,EAAG4B,kBAAoB,IACzBjB,EAASkB,UAAU,IAAI7B,EAAGiB,UAAUa,MAAM,IAE1CpB,EAAIiB,MAAMb,OAKd,GAAIJ,EAAIqB,aAAenB,EAAG,CACxB,MAAOoB,EAAMC,GAAa,CAACvB,EAAKC,GAChCqB,EAAKL,MAAMb,KAEXmB,EAAUL,kBAAoB,GAAKjB,EAASkB,OAAOI,EAAUC,iBAC/D,CACAvB,EAASkB,OAAO7B,GAChBmC,EAASnC,EACX,CAEA,SAASmC,EAASnC,EAAIoC,EAAWC,EAAQC,GACvC,GAAI5B,EAAIqB,cAAgBnB,EA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AAI2E,EAAKD,IACT,KAAOC,EAAKf,GACVA,EAAIe,EAAIA,EAAKD,IAEf,OAAOd,CACT,CA6CcgB,CAAU9E,GAChBkE,EAAI,GAAGlE,EAAIQ,UAAUC,IAAI,iBAC7BoC,GAAKqB,EACL,MAAMa,EAAO,CACXf,WAAcnB,EAAGmC,UAAavC,EAAMwC,UAAahB,GAOnD,IAAIiB,EALJ,CAAClF,EAAIO,SAAS,GAAIP,EAAIO,SAAS,IAAIkD,SAAQnE,IACzC,IAAK,MAAM6F,KAAOJ,EAAMA,EAAKI,KAAS7F,EAAGkD,QAAQ2C,GAAOJ,EAAKI,GAAK,IAGpElB,EAAa3B,EAAW,IAAI9C,EAAGkD,EAAI1C,IAAMoF,QAAUnB,EAGnDzE,EAAG,aAAcQ,GAAKyD,SAAQ,CAACnE,EAAIuD,KAC3B,IAANA,GAAWqC,EAAK5F,EAAIU,EAAIO,SAAS,GAAGU,MAAM3B,KAAQ4F,EAAG/D,UAAU7B,EAAGiB,UAAWjB,EAAGwB,SAAS,GACzF,IAIJtB,EAAG,eAAgBoE,GAAKH,SAAQI,IAC9B,MAAMwB,EAAIjG,EAAE,qBAAqByE,EAAEyB,aAAa,4BAChDzB,EAAErB,QAAQwB,WAAaqB,EAAIA,EAAE7C,QAAQwB,WAAa,EAAE,GAExD,CACAuB,iBAAiB,cAAerC,GAEhC,IAAIsC,EAAKC,eAAeC,QAAQ,WAChCF,GAAMtC,IACNqC,iBAAiB,YAAYI,GAAe,MAAVA,EAAER,MAClCjC,IAAYsC,EAAKA,EAAK,GAAK,IAAKC,eAAeG,QAAQ,UAAWJ,GAAKA,GAAMK,SAASC,WAEzF,EA/KD,CA+KGC","ignoreList":[]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xiee/utils",
3
- "version": "1.13.8",
3
+ "version": "1.13.10",
4
4
  "description": "Miscellaneous tools and utilities to manipulate HTML pages",
5
5
  "scripts": {
6
6
  "test": "echo \"Error: no test specified\" && exit 1"
package/purge.sh ADDED
@@ -0,0 +1,9 @@
1
+ #!/bin/sh
2
+
3
+ # purge jsdevlivr cache for assets modified between current and previous tags
4
+ JSD_URL="https://purge.jsdelivr.net/npm/@xiee/utils"
5
+
6
+ for i in $(git diff --name-only $PREVIOUS_COMMIT $CURRENT_COMMIT | grep -E "[.](css|js)$"); do
7
+ curl "${JSD_URL}/${i}"
8
+ curl "${JSD_URL}/${i%.*}.min.${i##.}"
9
+ done