@xiee/utils 1.14.119 → 1.14.121

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.
@@ -23,4 +23,4 @@ jobs:
23
23
  - run: sudo npm install -g npm@latest
24
24
  - run: ./build.sh
25
25
  - run: npm publish
26
- - run: ./purge.sh || true
26
+ - run: ./purge.sh
package/css/default.css CHANGED
@@ -7,7 +7,7 @@ body {
7
7
  print-color-adjust: exact;
8
8
  -webkit-print-color-adjust: exact;
9
9
  }
10
- .abstract, code, .footnotes, footer, #refs, .caption { font-size: .9em; }
10
+ .abstract, .footnotes, footer, #refs, .caption { font-size: .9em; }
11
11
  li li { font-size: .95em; }
12
12
  ul:has(li > input[type="checkbox"]) { list-style: none; padding-left: 1em; }
13
13
  *, :before, :after { box-sizing: border-box; }
@@ -17,7 +17,6 @@ pre {
17
17
  white-space: pre-wrap; word-break: break-word;
18
18
  code { display: block; padding: 1em; overflow-x: auto; }
19
19
  }
20
- code { font-family: 'DejaVu Sans Mono', 'Droid Sans Mono', 'Lucida Console', Consolas, Monaco, monospace; }
21
20
  :not(pre, th) > code, code[class], div > .caption { background: #f8f8f8; }
22
21
  pre > code:is(:not([class]), .language-plain, .language-none, .plain), .box, .figure, .table { background: inherit; border: 1px solid #eee; }
23
22
  pre > code {
@@ -1,2 +1,2 @@
1
- body{-webkit-print-color-adjust:exact;print-color-adjust:exact;max-width:800px;margin:auto;padding:1em;font-family:sans-serif;line-height:1.5}.abstract,code,.footnotes,footer,#refs,.caption{font-size:.9em}li li{font-size:.95em}ul:has(li>input[type=checkbox]){padding-left:1em;list-style:none}*,:before,:after{box-sizing:border-box}a{color:#4682b4}pre,img{max-width:100%}pre{white-space:pre-wrap;word-break:break-word;& code{padding:1em;display:block;overflow-x:auto}}code{font-family:DejaVu Sans Mono,Droid Sans Mono,Lucida Console,Consolas,Monaco,monospace}:not(pre,th)>code,code[class],div>.caption{background:#f8f8f8}pre>code:is(:not([class]),.language-plain,.language-none,.plain),.box,.figure,.table{background:inherit;border:1px solid #eee}pre>code{&.message{border-color:#9eeaf9}&.warning{background:#fff3cd;border-color:#fff3cd}&.error{background:#f8d7da;border-color:#f8d7da}}.fenced-chunk{border-left:1px solid #666}.code-fence{opacity:.4;border:1px dashed #666;border-left:2px solid;&:hover{opacity:inherit}}.box,.figure,.table,table{margin:1em auto}div>.caption{padding:1px 1em}.figure{& p:has(img,svg),& pre:has(svg){text-align:center}}.flex-col{justify-content:space-between;display:flex}table{&:only-child:not(.table>*){margin:auto}& th,& td{font-variant-numeric:tabular-nums;padding:5px}&:not([class]){& thead,& tfoot,& tr:nth-child(2n){background:#f5f5f5}& thead th{border-bottom:1px solid #ddd}border-top:1px solid #666;border-bottom:1px solid #666}}blockquote{color:#666;border-left:.5em solid #eee;margin:0;padding:1px 1em}hr,.footnotes:before{border:1px dashed #ddd}.frontmatter{text-align:center}#TOC{& a{text-decoration:none}& ul{columns:24em;padding-left:1em;list-style:none}&>ul{padding:0}& ul ul{border-left:1px solid #b0c4de}}.body h2{border-bottom:1px solid #666}.body .appendix,.appendix~h2{border-bottom-style:dashed}.main-number:after{content:"."}span[class^=ref-number-]{font-weight:700}.ref-number-fig:after,.ref-number-tab:after{content:":"}.cross-ref-chp:before{content:"Chapter "}.cross-ref-sec:before{content:"Section "}.cross-ref-apd:before{content:"Appendix "}.cross-ref-fig:before,.ref-number-fig:before{content:"Figure "}.cross-ref-tab:before,.ref-number-tab:before{content:"Table "}.cross-ref-eqn:before,.MathJax_ref:has(mjx-mtext>mjx-c+mjx-c):before{content:"Equation "}.abstract,#refs{&:before{margin:1em auto;font-weight:700;display:block}}.abstract:before{content:"Abstract";text-align:center}#refs:before{content:"Bibliography";font-size:1.5em}.ref-paren-open:before{content:"("}.ref-paren-close:after{content:")"}.ref-semicolon:after{content:"; "}.ref-and:after{content:" and "}.ref-et-al:after{content:" et al.";font-style:italic}.footnote-ref a{&:before{content:"["}&:after{content:"]"}}section.footnotes{margin-top:2em;&:before{content:"";max-width:20em;display:block}}.fade{opacity:.6;background:repeating-linear-gradient(135deg,#fff,#fff 30px,#ddd 32px 32px)}@media (prefers-color-scheme:dark){html,img,video,iframe{filter:invert()}.no-invert{filter:none}body{background:#ededed}}@media print{body{max-width:100%}tr,img{break-inside:avoid}}@media only screen and (width>=992px){body:not(.pagesjs) pre:has(.line-numbers):not(:hover){white-space:pre}}
1
+ body{-webkit-print-color-adjust:exact;print-color-adjust:exact;max-width:800px;margin:auto;padding:1em;font-family:sans-serif;line-height:1.5}.abstract,.footnotes,footer,#refs,.caption{font-size:.9em}li li{font-size:.95em}ul:has(li>input[type=checkbox]){padding-left:1em;list-style:none}*,:before,:after{box-sizing:border-box}a{color:#4682b4}pre,img{max-width:100%}pre{white-space:pre-wrap;word-break:break-word;& code{padding:1em;display:block;overflow-x:auto}}:not(pre,th)>code,code[class],div>.caption{background:#f8f8f8}pre>code:is(:not([class]),.language-plain,.language-none,.plain),.box,.figure,.table{background:inherit;border:1px solid #eee}pre>code{&.message{border-color:#9eeaf9}&.warning{background:#fff3cd;border-color:#fff3cd}&.error{background:#f8d7da;border-color:#f8d7da}}.fenced-chunk{border-left:1px solid #666}.code-fence{opacity:.4;border:1px dashed #666;border-left:2px solid;&:hover{opacity:inherit}}.box,.figure,.table,table{margin:1em auto}div>.caption{padding:1px 1em}.figure{& p:has(img,svg),& pre:has(svg){text-align:center}}.flex-col{justify-content:space-between;display:flex}table{&:only-child:not(.table>*){margin:auto}& th,& td{font-variant-numeric:tabular-nums;padding:5px}&:not([class]){& thead,& tfoot,& tr:nth-child(2n){background:#f5f5f5}& thead th{border-bottom:1px solid #ddd}border-top:1px solid #666;border-bottom:1px solid #666}}blockquote{color:#666;border-left:.5em solid #eee;margin:0;padding:1px 1em}hr,.footnotes:before{border:1px dashed #ddd}.frontmatter{text-align:center}#TOC{& a{text-decoration:none}& ul{columns:24em;padding-left:1em;list-style:none}&>ul{padding:0}& ul ul{border-left:1px solid #b0c4de}}.body h2{border-bottom:1px solid #666}.body .appendix,.appendix~h2{border-bottom-style:dashed}.main-number:after{content:"."}span[class^=ref-number-]{font-weight:700}.ref-number-fig:after,.ref-number-tab:after{content:":"}.cross-ref-chp:before{content:"Chapter "}.cross-ref-sec:before{content:"Section "}.cross-ref-apd:before{content:"Appendix "}.cross-ref-fig:before,.ref-number-fig:before{content:"Figure "}.cross-ref-tab:before,.ref-number-tab:before{content:"Table "}.cross-ref-eqn:before,.MathJax_ref:has(mjx-mtext>mjx-c+mjx-c):before{content:"Equation "}.abstract,#refs{&:before{margin:1em auto;font-weight:700;display:block}}.abstract:before{content:"Abstract";text-align:center}#refs:before{content:"Bibliography";font-size:1.5em}.ref-paren-open:before{content:"("}.ref-paren-close:after{content:")"}.ref-semicolon:after{content:"; "}.ref-and:after{content:" and "}.ref-et-al:after{content:" et al.";font-style:italic}.footnote-ref a{&:before{content:"["}&:after{content:"]"}}section.footnotes{margin-top:2em;&:before{content:"";max-width:20em;display:block}}.fade{opacity:.6;background:repeating-linear-gradient(135deg,#fff,#fff 30px,#ddd 32px 32px)}@media (prefers-color-scheme:dark){html,img,video,iframe{filter:invert()}.no-invert{filter:none}body{background:#ededed}}@media print{body{max-width:100%}tr,img{break-inside:avoid}}@media only screen and (width>=992px){body:not(.pagesjs) pre:has(.line-numbers):not(:hover){white-space:pre}}
2
2
  /*# sourceMappingURL=default.min.css.map */
@@ -1 +1 @@
1
- {"version":3,"mappings":"AAAA,8IASA,+DACA,sBACA,iEACA,uCACA,gBACA,uBACA,+CAEE,kDAEF,2FACA,8DACA,8HACA,SACE,+BACA,kDACA,iDAEF,yCACA,oEAIE,yBAEF,0CACA,6BACA,QAAU,mDACV,qDACA,MACE,uCACA,wDACA,eACE,sDACA,wCACW,wDAIf,2EAMA,4CACA,+BACA,KACE,yBACA,mDACA,eACA,uCAEF,sCACA,wDACA,+BACA,yCACA,wDACA,yCACA,yCACA,0CACA,+DACA,8DACA,yFACA,gBACE,wDAEF,sDACA,oDACA,mCACA,mCACA,kCACA,+BACA,qDACA,gBACE,qBACA,qBAEF,iCAEE,kDAEF,4FAIA,mCACE,sCACA,uBACA,yBAEF,aACE,oBACA,2BAEF,sCACE","sources":["default.css"],"sourcesContent":["body {\n font-family: sans-serif;\n max-width: 800px;\n margin: auto;\n padding: 1em;\n line-height: 1.5;\n print-color-adjust: exact;\n -webkit-print-color-adjust: exact;\n}\n.abstract, code, .footnotes, footer, #refs, .caption { font-size: .9em; }\nli li { font-size: .95em; }\nul:has(li > input[type=\"checkbox\"]) { list-style: none; padding-left: 1em; }\n*, :before, :after { box-sizing: border-box; }\na { color: steelblue; }\npre, img { max-width: 100%; }\npre {\n white-space: pre-wrap; word-break: break-word;\n code { display: block; padding: 1em; overflow-x: auto; }\n}\ncode { font-family: 'DejaVu Sans Mono', 'Droid Sans Mono', 'Lucida Console', Consolas, Monaco, monospace; }\n:not(pre, th) > code, code[class], div > .caption { background: #f8f8f8; }\npre > code:is(:not([class]), .language-plain, .language-none, .plain), .box, .figure, .table { background: inherit; border: 1px solid #eee; }\npre > code {\n &.message { border-color: #9eeaf9; }\n &.warning { background: #fff3cd; border-color: #fff3cd; }\n &.error { background: #f8d7da; border-color: #f8d7da; }\n}\n.fenced-chunk { border-left: 1px solid #666; }\n.code-fence {\n opacity: .4;\n border: 1px dashed #666;\n border-left: 2px solid;\n &:hover { opacity: inherit; }\n}\n.box, .figure, .table, table { margin: 1em auto; }\ndiv > .caption { padding: 1px 1em; }\n.figure { p:has(img, svg), pre:has(svg) { text-align: center; } }\n.flex-col { display: flex; justify-content: space-between; }\ntable {\n &:only-child:not(.table > *) { margin: auto; }\n th, td { padding: 5px; font-variant-numeric: tabular-nums; }\n &:not([class]) {\n thead, tfoot, tr:nth-child(even) { background: whitesmoke; }\n thead th { border-bottom: 1px solid #ddd; }\n border-top: 1px solid #666;\n border-bottom: 1px solid #666;\n }\n}\nblockquote {\n color: #666;\n margin: 0;\n padding: 1px 1em;\n border-left: .5em solid #eee;\n}\nhr, .footnotes::before { border: 1px dashed #ddd; }\n.frontmatter { text-align: center; }\n#TOC {\n a { text-decoration: none; }\n ul { list-style: none; padding-left: 1em; columns: 24em; }\n & > ul { padding: 0; }\n ul ul { border-left: 1px solid lightsteelblue; }\n}\n.body h2 { border-bottom: 1px solid #666; }\n.body .appendix, .appendix ~ h2 { border-bottom-style: dashed; }\n.main-number::after { content: \".\"; }\nspan[class^=\"ref-number-\"] { font-weight: bold; }\n.ref-number-fig::after, .ref-number-tab::after { content: \":\"; }\n.cross-ref-chp::before { content: \"Chapter \"; }\n.cross-ref-sec::before { content: \"Section \"; }\n.cross-ref-apd::before { content: \"Appendix \"; }\n.cross-ref-fig::before, .ref-number-fig::before { content: \"Figure \"; }\n.cross-ref-tab::before, .ref-number-tab::before { content: \"Table \"; }\n.cross-ref-eqn::before, .MathJax_ref:has(mjx-mtext > mjx-c + mjx-c)::before { content: \"Equation \"; }\n.abstract, #refs {\n &::before { display: block; margin: 1em auto; font-weight: bold; }\n}\n.abstract::before { content: \"Abstract\"; text-align: center; }\n#refs::before { content: \"Bibliography\"; font-size: 1.5em; }\n.ref-paren-open::before { content: \"(\"; }\n.ref-paren-close::after { content: \")\"; }\n.ref-semicolon::after { content: \"; \"; }\n.ref-and::after { content: \" and \"; }\n.ref-et-al::after { content: \" et al.\"; font-style: italic; }\n.footnote-ref a {\n &::before { content: \"[\"; }\n &::after { content: \"]\"; }\n}\nsection.footnotes {\n margin-top: 2em;\n &::before { content: \"\"; display: block; max-width: 20em; }\n}\n.fade {\n background: repeating-linear-gradient(135deg, white, white 30px, #ddd 32px, #ddd 32px);\n opacity: 0.6;\n}\n@media (prefers-color-scheme: dark) {\n html, img, video, iframe { filter: invert(1); }\n .no-invert { filter: none; }\n body { background: #ededed; }\n}\n@media print {\n body { max-width: 100%; }\n tr, img { break-inside: avoid; }\n}\n@media only screen and (min-width: 992px) {\n body:not(.pagesjs) pre:has(.line-numbers):not(:hover) { white-space: pre; }\n}\n"],"names":[]}
1
+ {"version":3,"mappings":"AAAA,8IASA,0DACA,sBACA,iEACA,uCACA,gBACA,uBACA,+CAEE,kDAEF,8DACA,8HACA,SACE,+BACA,kDACA,iDAEF,yCACA,oEAIE,yBAEF,0CACA,6BACA,QAAU,mDACV,qDACA,MACE,uCACA,wDACA,eACE,sDACA,wCACW,wDAIf,2EAMA,4CACA,+BACA,KACE,yBACA,mDACA,eACA,uCAEF,sCACA,wDACA,+BACA,yCACA,wDACA,yCACA,yCACA,0CACA,+DACA,8DACA,yFACA,gBACE,wDAEF,sDACA,oDACA,mCACA,mCACA,kCACA,+BACA,qDACA,gBACE,qBACA,qBAEF,iCAEE,kDAEF,4FAIA,mCACE,sCACA,uBACA,yBAEF,aACE,oBACA,2BAEF,sCACE","sources":["default.css"],"sourcesContent":["body {\n font-family: sans-serif;\n max-width: 800px;\n margin: auto;\n padding: 1em;\n line-height: 1.5;\n print-color-adjust: exact;\n -webkit-print-color-adjust: exact;\n}\n.abstract, .footnotes, footer, #refs, .caption { font-size: .9em; }\nli li { font-size: .95em; }\nul:has(li > input[type=\"checkbox\"]) { list-style: none; padding-left: 1em; }\n*, :before, :after { box-sizing: border-box; }\na { color: steelblue; }\npre, img { max-width: 100%; }\npre {\n white-space: pre-wrap; word-break: break-word;\n code { display: block; padding: 1em; overflow-x: auto; }\n}\n:not(pre, th) > code, code[class], div > .caption { background: #f8f8f8; }\npre > code:is(:not([class]), .language-plain, .language-none, .plain), .box, .figure, .table { background: inherit; border: 1px solid #eee; }\npre > code {\n &.message { border-color: #9eeaf9; }\n &.warning { background: #fff3cd; border-color: #fff3cd; }\n &.error { background: #f8d7da; border-color: #f8d7da; }\n}\n.fenced-chunk { border-left: 1px solid #666; }\n.code-fence {\n opacity: .4;\n border: 1px dashed #666;\n border-left: 2px solid;\n &:hover { opacity: inherit; }\n}\n.box, .figure, .table, table { margin: 1em auto; }\ndiv > .caption { padding: 1px 1em; }\n.figure { p:has(img, svg), pre:has(svg) { text-align: center; } }\n.flex-col { display: flex; justify-content: space-between; }\ntable {\n &:only-child:not(.table > *) { margin: auto; }\n th, td { padding: 5px; font-variant-numeric: tabular-nums; }\n &:not([class]) {\n thead, tfoot, tr:nth-child(even) { background: whitesmoke; }\n thead th { border-bottom: 1px solid #ddd; }\n border-top: 1px solid #666;\n border-bottom: 1px solid #666;\n }\n}\nblockquote {\n color: #666;\n margin: 0;\n padding: 1px 1em;\n border-left: .5em solid #eee;\n}\nhr, .footnotes::before { border: 1px dashed #ddd; }\n.frontmatter { text-align: center; }\n#TOC {\n a { text-decoration: none; }\n ul { list-style: none; padding-left: 1em; columns: 24em; }\n & > ul { padding: 0; }\n ul ul { border-left: 1px solid lightsteelblue; }\n}\n.body h2 { border-bottom: 1px solid #666; }\n.body .appendix, .appendix ~ h2 { border-bottom-style: dashed; }\n.main-number::after { content: \".\"; }\nspan[class^=\"ref-number-\"] { font-weight: bold; }\n.ref-number-fig::after, .ref-number-tab::after { content: \":\"; }\n.cross-ref-chp::before { content: \"Chapter \"; }\n.cross-ref-sec::before { content: \"Section \"; }\n.cross-ref-apd::before { content: \"Appendix \"; }\n.cross-ref-fig::before, .ref-number-fig::before { content: \"Figure \"; }\n.cross-ref-tab::before, .ref-number-tab::before { content: \"Table \"; }\n.cross-ref-eqn::before, .MathJax_ref:has(mjx-mtext > mjx-c + mjx-c)::before { content: \"Equation \"; }\n.abstract, #refs {\n &::before { display: block; margin: 1em auto; font-weight: bold; }\n}\n.abstract::before { content: \"Abstract\"; text-align: center; }\n#refs::before { content: \"Bibliography\"; font-size: 1.5em; }\n.ref-paren-open::before { content: \"(\"; }\n.ref-paren-close::after { content: \")\"; }\n.ref-semicolon::after { content: \"; \"; }\n.ref-and::after { content: \" and \"; }\n.ref-et-al::after { content: \" et al.\"; font-style: italic; }\n.footnote-ref a {\n &::before { content: \"[\"; }\n &::after { content: \"]\"; }\n}\nsection.footnotes {\n margin-top: 2em;\n &::before { content: \"\"; display: block; max-width: 20em; }\n}\n.fade {\n background: repeating-linear-gradient(135deg, white, white 30px, #ddd 32px, #ddd 32px);\n opacity: 0.6;\n}\n@media (prefers-color-scheme: dark) {\n html, img, video, iframe { filter: invert(1); }\n .no-invert { filter: none; }\n body { background: #ededed; }\n}\n@media print {\n body { max-width: 100%; }\n tr, img { break-inside: avoid; }\n}\n@media only screen and (min-width: 992px) {\n body:not(.pagesjs) pre:has(.line-numbers):not(:hover) { white-space: pre; }\n}\n"],"names":[]}
package/js/fullwidth.js CHANGED
@@ -2,6 +2,7 @@
2
2
  document.querySelectorAll('pre,table,#TableOfContents').forEach(node => {
3
3
  function fullwidth(el) {
4
4
  el.classList.add('fullwidth');
5
+ el.dataset.autoFullwidth = ''; // so sidenotes.js only undoes what we added
5
6
  }
6
7
  // skip if already in .fullwidth container (or .tabset)
7
8
  if (node.closest('.fullwidth,.tabset')) return;
@@ -1,2 +1,2 @@
1
- document.querySelectorAll("pre,table,#TableOfContents").forEach(t=>{function e(t){t.classList.add("fullwidth")}if(!t.closest(".fullwidth,.tabset"))switch(t.tagName){case"PRE":const l=t.firstElementChild;"CODE"===l?.tagName&&l.scrollWidth>l.offsetWidth&&e(l.parentNode);break;case"TABLE":const s=t.parentElement;s&&s.offsetWidth<t.offsetWidth&&e(t);break;default:t.querySelectorAll("a").forEach(l=>{!t.classList.contains("fullwidth")&&l.getClientRects().length>1&&e(t)})}});
1
+ document.querySelectorAll("pre,table,#TableOfContents").forEach(t=>{function e(t){t.classList.add("fullwidth"),t.dataset.autoFullwidth=""}if(!t.closest(".fullwidth,.tabset"))switch(t.tagName){case"PRE":const l=t.firstElementChild;"CODE"===l?.tagName&&l.scrollWidth>l.offsetWidth&&e(l.parentNode);break;case"TABLE":const a=t.parentElement;a&&a.offsetWidth<t.offsetWidth&&e(t);break;default:t.querySelectorAll("a").forEach(l=>{!t.classList.contains("fullwidth")&&l.getClientRects().length>1&&e(t)})}});
2
2
  //# sourceMappingURL=fullwidth.min.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["document","querySelectorAll","forEach","node","fullwidth","el","classList","add","closest","tagName","firstElementChild","scrollWidth","offsetWidth","parentNode","p","parentElement","a","contains","getClientRects","length"],"sources":["fullwidth.js"],"mappings":"AACAA,SAASC,iBAAiB,8BAA8BC,QAAQC,IAC9D,SAASC,EAAUC,GACjBA,EAAGC,UAAUC,IAAI,YACnB,CAEA,IAAIJ,EAAKK,QAAQ,sBACjB,OAAQL,EAAKM,SACX,IAAK,MACH,MAAMJ,EAAKF,EAAKO,kBACA,SAAhBL,GAAII,SAAsBJ,EAAGM,YAAcN,EAAGO,aAAeR,EAAUC,EAAGQ,YAC1E,MACF,IAAK,QACH,MAAMC,EAAIX,EAAKY,cACfD,GAAKA,EAAEF,YAAcT,EAAKS,aAAeR,EAAUD,GACnD,MACF,QAEEA,EAAKF,iBAAiB,KAAKC,QAAQc,KAEhCb,EAAKG,UAAUW,SAAS,cAAgBD,EAAEE,iBAAiBC,OAAS,GAAKf,EAAUD","ignoreList":[]}
1
+ {"version":3,"names":["document","querySelectorAll","forEach","node","fullwidth","el","classList","add","dataset","autoFullwidth","closest","tagName","firstElementChild","scrollWidth","offsetWidth","parentNode","p","parentElement","a","contains","getClientRects","length"],"sources":["fullwidth.js"],"mappings":"AACAA,SAASC,iBAAiB,8BAA8BC,QAAQC,IAC9D,SAASC,EAAUC,GACjBA,EAAGC,UAAUC,IAAI,aACjBF,EAAGG,QAAQC,cAAgB,EAC7B,CAEA,IAAIN,EAAKO,QAAQ,sBACjB,OAAQP,EAAKQ,SACX,IAAK,MACH,MAAMN,EAAKF,EAAKS,kBACA,SAAhBP,GAAIM,SAAsBN,EAAGQ,YAAcR,EAAGS,aAAeV,EAAUC,EAAGU,YAC1E,MACF,IAAK,QACH,MAAMC,EAAIb,EAAKc,cACfD,GAAKA,EAAEF,YAAcX,EAAKW,aAAeV,EAAUD,GACnD,MACF,QAEEA,EAAKF,iBAAiB,KAAKC,QAAQgB,KAEhCf,EAAKG,UAAUa,SAAS,cAAgBD,EAAEE,iBAAiBC,OAAS,GAAKjB,EAAUD","ignoreList":[]}
package/js/sidenotes.js CHANGED
@@ -34,9 +34,10 @@
34
34
  });
35
35
  // also add side classes to TOC
36
36
  d.getElementById('TOC')?.classList.add('side', 'side-left');
37
- // if a sidenote collapses with any fullwidth element, remove the side class
37
+ // if a sidenote collapses with an auto-added fullwidth element, remove its fullwidth class
38
+ // (a user-specified .fullwidth is kept)
38
39
  const sides = d.querySelectorAll('.side.side-right, .side.side-left'), fulls = [];
39
- d.querySelectorAll('.fullwidth').forEach(el => {
40
+ d.querySelectorAll('[data-auto-fullwidth]').forEach(el => {
40
41
  fulls.push([el, el.getBoundingClientRect()]);
41
42
  });
42
43
  // add a class to document body if it has sidenotes
@@ -1,2 +1,2 @@
1
- (e=>{e.querySelectorAll('.footnotes > ol > li[id^="fn"], #refs > [id^="ref-"]').forEach(t=>{const o=`a[href="#${t.id}"]`;e.querySelectorAll(`${o} > sup, sup > ${o}, .citation > ${o}, ${o}.citation`).forEach(o=>{const r=o.parentNode;("A"===o.tagName?o:r).removeAttribute("href");const s=e.createElement("div");for(s.className="side side-right footnotes",/^fn/.test(t.id)?(s.innerHTML=t.innerHTML,s.firstElementChild.insertAdjacentHTML("afterbegin",`<span class="bg-number">${o.innerText}</span> `),s.querySelector('a[href^="#fnref"]')?.remove()):s.innerHTML=t.outerHTML;"#text"===s.lastChild?.nodeName&&!s.lastChild.textContent.trim();)s.lastChild.remove();s.querySelectorAll(".fullwidth").forEach(e=>e.classList.remove("fullwidth"));const i=o.classList.contains("citation")?o:r;i.after(s),i.classList.add("note-ref"),t.remove()})}),e.querySelectorAll(".footnotes, #refs").forEach(e=>{e.innerText.trim()||e.remove()}),e.getElementById("TOC")?.classList.add("side","side-left");const t=e.querySelectorAll(".side.side-right, .side.side-left"),o=[];e.querySelectorAll(".fullwidth").forEach(e=>{o.push([e,e.getBoundingClientRect()])}),t.length&&e.body.classList.add("has-sidenotes"),t.forEach(e=>{const t=e.getBoundingClientRect();for(let e of o){const o=e[1];t.right<o.left||t.left>o.right||t.bottom<o.top||t.top>o.bottom||e[0].classList.remove("fullwidth")}})})(document);
1
+ (e=>{e.querySelectorAll('.footnotes > ol > li[id^="fn"], #refs > [id^="ref-"]').forEach(t=>{const o=`a[href="#${t.id}"]`;e.querySelectorAll(`${o} > sup, sup > ${o}, .citation > ${o}, ${o}.citation`).forEach(o=>{const r=o.parentNode;("A"===o.tagName?o:r).removeAttribute("href");const s=e.createElement("div");for(s.className="side side-right footnotes",/^fn/.test(t.id)?(s.innerHTML=t.innerHTML,s.firstElementChild.insertAdjacentHTML("afterbegin",`<span class="bg-number">${o.innerText}</span> `),s.querySelector('a[href^="#fnref"]')?.remove()):s.innerHTML=t.outerHTML;"#text"===s.lastChild?.nodeName&&!s.lastChild.textContent.trim();)s.lastChild.remove();s.querySelectorAll(".fullwidth").forEach(e=>e.classList.remove("fullwidth"));const i=o.classList.contains("citation")?o:r;i.after(s),i.classList.add("note-ref"),t.remove()})}),e.querySelectorAll(".footnotes, #refs").forEach(e=>{e.innerText.trim()||e.remove()}),e.getElementById("TOC")?.classList.add("side","side-left");const t=e.querySelectorAll(".side.side-right, .side.side-left"),o=[];e.querySelectorAll("[data-auto-fullwidth]").forEach(e=>{o.push([e,e.getBoundingClientRect()])}),t.length&&e.body.classList.add("has-sidenotes"),t.forEach(e=>{const t=e.getBoundingClientRect();for(let e of o){const o=e[1];t.right<o.left||t.left>o.right||t.bottom<o.top||t.top>o.bottom||e[0].classList.remove("fullwidth")}})})(document);
2
2
  //# sourceMappingURL=sidenotes.min.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["d","querySelectorAll","forEach","el","h","id","a","a2","parentNode","tagName","removeAttribute","s","createElement","className","test","innerHTML","firstElementChild","insertAdjacentHTML","innerText","querySelector","remove","outerHTML","lastChild","nodeName","textContent","trim","classList","a3","contains","after","add","getElementById","sides","fulls","push","getBoundingClientRect","length","body","r1","f","r2","right","left","bottom","top","document"],"sources":["sidenotes.js"],"mappings":"AACA,CAACA,IACCA,EAAEC,iBAAiB,wDAAwDC,QAAQC,IAEjF,MAAMC,EAAI,YAAYD,EAAGE,OACzBL,EAAEC,iBAAiB,GAAGG,kBAAkBA,kBAAkBA,MAAMA,cAAcF,QAAQI,IACpF,MAAMC,EAAKD,EAAEE,YACE,MAAdF,EAAEG,QAAkBH,EAAIC,GAAIG,gBAAgB,QAC7C,MAAMC,EAAIX,EAAEY,cAAc,OAU1B,IATAD,EAAEE,UAAY,4BACV,MAAMC,KAAKX,EAAGE,KAChBM,EAAEI,UAAYZ,EAAGY,UAEjBJ,EAAEK,kBAAkBC,mBAAmB,aAAc,2BAA2BX,EAAEY,qBAClFP,EAAEQ,cAAc,sBAAsBC,UAEtCT,EAAEI,UAAYZ,EAAGkB,UAEc,UAA1BV,EAAEW,WAAWC,WAAyBZ,EAAEW,UAAUE,YAAYC,QACnEd,EAAEW,UAAUF,SAGdT,EAAEV,iBAAiB,cAAcC,QAAQC,GAAMA,EAAGuB,UAAUN,OAAO,cAEnE,MAAMO,EAAKrB,EAAEoB,UAAUE,SAAS,YAActB,EAAIC,EAClDoB,EAAGE,MAAMlB,GACTgB,EAAGD,UAAUI,IAAI,YACjB3B,EAAGiB,aAIPpB,EAAEC,iBAAiB,qBAAqBC,QAAQC,IAC9CA,EAAGe,UAAUO,QAAUtB,EAAGiB,WAG5BpB,EAAE+B,eAAe,QAAQL,UAAUI,IAAI,OAAQ,aAE/C,MAAME,EAAQhC,EAAEC,iBAAiB,qCAAsCgC,EAAQ,GAC/EjC,EAAEC,iBAAiB,cAAcC,QAAQC,IACvC8B,EAAMC,KAAK,CAAC/B,EAAIA,EAAGgC,4BAGrBH,EAAMI,QAAUpC,EAAEqC,KAAKX,UAAUI,IAAI,iBACrCE,EAAM9B,QAAQS,IACZ,MAAM2B,EAAK3B,EAAEwB,wBACb,IAAK,IAAII,KAAKN,EAAO,CACnB,MAAMO,EAAKD,EAAE,GACPD,EAAGG,MAAQD,EAAGE,MAAQJ,EAAGI,KAAOF,EAAGC,OAASH,EAAGK,OAASH,EAAGI,KAAON,EAAGM,IAAMJ,EAAGG,QAClFJ,EAAE,GAAGb,UAAUN,OAAO,YAE1B,GAEH,EAnDD,CAmDGyB","ignoreList":[]}
1
+ {"version":3,"names":["d","querySelectorAll","forEach","el","h","id","a","a2","parentNode","tagName","removeAttribute","s","createElement","className","test","innerHTML","firstElementChild","insertAdjacentHTML","innerText","querySelector","remove","outerHTML","lastChild","nodeName","textContent","trim","classList","a3","contains","after","add","getElementById","sides","fulls","push","getBoundingClientRect","length","body","r1","f","r2","right","left","bottom","top","document"],"sources":["sidenotes.js"],"mappings":"AACA,CAACA,IACCA,EAAEC,iBAAiB,wDAAwDC,QAAQC,IAEjF,MAAMC,EAAI,YAAYD,EAAGE,OACzBL,EAAEC,iBAAiB,GAAGG,kBAAkBA,kBAAkBA,MAAMA,cAAcF,QAAQI,IACpF,MAAMC,EAAKD,EAAEE,YACE,MAAdF,EAAEG,QAAkBH,EAAIC,GAAIG,gBAAgB,QAC7C,MAAMC,EAAIX,EAAEY,cAAc,OAU1B,IATAD,EAAEE,UAAY,4BACV,MAAMC,KAAKX,EAAGE,KAChBM,EAAEI,UAAYZ,EAAGY,UAEjBJ,EAAEK,kBAAkBC,mBAAmB,aAAc,2BAA2BX,EAAEY,qBAClFP,EAAEQ,cAAc,sBAAsBC,UAEtCT,EAAEI,UAAYZ,EAAGkB,UAEc,UAA1BV,EAAEW,WAAWC,WAAyBZ,EAAEW,UAAUE,YAAYC,QACnEd,EAAEW,UAAUF,SAGdT,EAAEV,iBAAiB,cAAcC,QAAQC,GAAMA,EAAGuB,UAAUN,OAAO,cAEnE,MAAMO,EAAKrB,EAAEoB,UAAUE,SAAS,YAActB,EAAIC,EAClDoB,EAAGE,MAAMlB,GACTgB,EAAGD,UAAUI,IAAI,YACjB3B,EAAGiB,aAIPpB,EAAEC,iBAAiB,qBAAqBC,QAAQC,IAC9CA,EAAGe,UAAUO,QAAUtB,EAAGiB,WAG5BpB,EAAE+B,eAAe,QAAQL,UAAUI,IAAI,OAAQ,aAG/C,MAAME,EAAQhC,EAAEC,iBAAiB,qCAAsCgC,EAAQ,GAC/EjC,EAAEC,iBAAiB,yBAAyBC,QAAQC,IAClD8B,EAAMC,KAAK,CAAC/B,EAAIA,EAAGgC,4BAGrBH,EAAMI,QAAUpC,EAAEqC,KAAKX,UAAUI,IAAI,iBACrCE,EAAM9B,QAAQS,IACZ,MAAM2B,EAAK3B,EAAEwB,wBACb,IAAK,IAAII,KAAKN,EAAO,CACnB,MAAMO,EAAKD,EAAE,GACPD,EAAGG,MAAQD,EAAGE,MAAQJ,EAAGI,KAAOF,EAAGC,OAASH,EAAGK,OAASH,EAAGI,KAAON,EAAGM,IAAMJ,EAAGG,QAClFJ,EAAE,GAAGb,UAAUN,OAAO,YAE1B,GAEH,EApDD,CAoDGyB","ignoreList":[]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xiee/utils",
3
- "version": "1.14.119",
3
+ "version": "1.14.121",
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 CHANGED
@@ -12,5 +12,12 @@ for i in $(git diff --name-only $tag1 $tag2 | grep -E "[.](css|js)$"); do
12
12
  fi
13
13
  done
14
14
 
15
- # visit the latest index page and make sure it's accessible
16
- curl -sSfL "https://cdn.jsdelivr.net/npm/@xiee/utils@${tag2}/" | grep ${tag2#v}
15
+ # wait (up to ~10 min) for the new version to show up on jsdelivr
16
+ url="https://cdn.jsdelivr.net/npm/@xiee/utils@${tag2}/"
17
+ trap 'echo "$url"' EXIT
18
+ for i in $(seq 20); do
19
+ sleep 30
20
+ curl -sSfL "$url" | grep -q "${tag2#v}" && exit 0
21
+ done
22
+ echo "${tag2} not available on jsdelivr" >&2
23
+ exit 1