@xiee/utils 1.14.15 → 1.14.17

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/css/article.css CHANGED
@@ -68,14 +68,14 @@ body, blockquote, .side { background: #fafafa; }
68
68
  .fullwidth {
69
69
  max-width: calc(100vw - 2em);
70
70
  margin: 1em 0 1em 50%;
71
- & * {
72
- max-width: calc(100vw - 4em);
73
- margin: auto 0;
74
- }
75
71
  transform: translateX(-50%);
76
72
  float: left;
77
73
  min-width: 100%;
78
74
  background: #fff;
75
+ & * {
76
+ max-width: calc(100vw - 4em);
77
+ margin: auto 0;
78
+ }
79
79
  & :is(figcaption, .caption) {
80
80
  margin-left: calc(50% - 400px);
81
81
  width: 800px;
@@ -1,2 +1,2 @@
1
- :root{--side-width:200px;--side-gap:2em;--side-margin:calc(0px - var(--side-width) - var(--side-gap))}body,blockquote,.side{background:#fafafa}.body,.body~.appendix,.frontmatter,.fullwidth,.embed-left,.embed-right{background:#fff;margin-top:2em;padding:1em;box-shadow:0 0 8px #ccc}.appendix,.footnotes,.body .side{font-size:.9em}.body~.appendix,.frontmatter{background:0 0}.appendix h2{border-bottom:1px dashed #666}#TOC{top:0}.bg-number{color:#fff;background:#789;border-radius:5px;padding:1px 5px}.side{width:var(--side-width);max-height:100vh;margin:0 auto;overflow:auto}.side-left{float:left;clear:left;margin-left:var(--side-margin);&:not(.body>*){margin-left:calc(var(--side-margin) + 1em)}position:sticky}.side-right{float:right;clear:right;margin-right:var(--side-margin)}.quote-left,.quote-right{width:45%}.embed-left,.embed-right{margin-top:auto;padding:0}.quote-left,.embed-left{float:left;margin-right:1em}.quote-right,.embed-right{float:right;margin-left:1em}.embed-left{margin-left:var(--side-margin)}.embed-right{margin-right:var(--side-margin)}:is(.side,.embed-left,.embed-right)>:first-child{margin-top:0}:is(.embed-left,.embed-right)>:last-child{margin-bottom:0}:is(.quote-left,.quote-right){&>:first-child{padding-top:.1px}&>:last-child{padding-bottom:.1px}}.fullwidth{max-width:calc(100vw - 2em);margin:1em 0 1em 50%;& *{max-width:calc(100vw - 4em);margin:auto 0}float:left;background:#fff;min-width:100%;transform:translate(-50%)& :is(figcaption,.caption){width:800px;margin-left:calc(50% - 400px);padding:1em 1em 0}}.fullscroll{& *{max-width:initial}&,& figure,& .figure{overflow-x:auto}}@media (width>=1264.02px){#TOC.side{& .active{color:#32cd32}& li li .active{border-left:3px solid;margin-left:calc(-1em - 3px);padding-left:1em}&:has(.active) li:not(:has(.active)) ul{display:none}}.note-ref{cursor:pointer}.note-ref:hover+.side{z-index:1;box-sizing:content-box;background:#f8f8f8;margin-left:1em;padding:.5em;display:inline-block;position:absolute}}@media (width<=1264px){body:not(.pagesjs){& #TOC{position:initial;float:none;columns:2;border:1px solid #eee;border-radius:5px;padding:1em}& .side{width:100%}& :is(main,.body) .side{color:#2f4f4f;padding:0 2em}& .side-left,& .side-right{clear:both;background:0 0;margin:1em auto}& :not(.note-ref)+.side{float:none}& .footnote-ref+.footnotes{float:left}& .side>:last-child{margin-bottom:0}& .embed-left,& .embed-right{float:inherit;margin:auto;padding:1em}}}@media (width<=800px){body:not(.pagesjs){padding:initial;& main,& .body{padding:0 .5em}& #TOC{columns:1}& .quote-left,& .quote-right{width:inherit;float:inherit;margin:auto}& .fullwidth{margin:initial;transform:initial;float:none;min-width:initial;background:0 0;border:none;& :is(figcaption,.caption){margin:initial;padding:initial}&:not(.fullscroll) *{max-width:100%}}}}@media print{body{background:0 0}}
1
+ :root{--side-width:200px;--side-gap:2em;--side-margin:calc(0px - var(--side-width) - var(--side-gap))}body,blockquote,.side{background:#fafafa}.body,.body~.appendix,.frontmatter,.fullwidth,.embed-left,.embed-right{background:#fff;margin-top:2em;padding:1em;box-shadow:0 0 8px #ccc}.appendix,.footnotes,.body .side{font-size:.9em}.body~.appendix,.frontmatter{background:0 0}.appendix h2{border-bottom:1px dashed #666}#TOC{top:0}.bg-number{color:#fff;background:#789;border-radius:5px;padding:1px 5px}.side{width:var(--side-width);max-height:100vh;margin:0 auto;overflow:auto}.side-left{float:left;clear:left;margin-left:var(--side-margin);&:not(.body>*){margin-left:calc(var(--side-margin) + 1em)}position:sticky}.side-right{float:right;clear:right;margin-right:var(--side-margin)}.quote-left,.quote-right{width:45%}.embed-left,.embed-right{margin-top:auto;padding:0}.quote-left,.embed-left{float:left;margin-right:1em}.quote-right,.embed-right{float:right;margin-left:1em}.embed-left{margin-left:var(--side-margin)}.embed-right{margin-right:var(--side-margin)}:is(.side,.embed-left,.embed-right)>:first-child{margin-top:0}:is(.embed-left,.embed-right)>:last-child{margin-bottom:0}:is(.quote-left,.quote-right){&>:first-child{padding-top:.1px}&>:last-child{padding-bottom:.1px}}.fullwidth{float:left;background:#fff;min-width:100%;max-width:calc(100vw - 2em);margin:1em 0 1em 50%;transform:translate(-50%);& *{max-width:calc(100vw - 4em);margin:auto 0}& :is(figcaption,.caption){width:800px;margin-left:calc(50% - 400px);padding:1em 1em 0}}.fullscroll{& *{max-width:initial}&,& figure,& .figure{overflow-x:auto}}@media (width>=1264.02px){#TOC.side{& .active{color:#32cd32}& li li .active{border-left:3px solid;margin-left:calc(-1em - 3px);padding-left:1em}&:has(.active) li:not(:has(.active)) ul{display:none}}.note-ref{cursor:pointer}.note-ref:hover+.side{z-index:1;box-sizing:content-box;background:#f8f8f8;margin-left:1em;padding:.5em;display:inline-block;position:absolute}}@media (width<=1264px){body:not(.pagesjs){& #TOC{position:initial;float:none;columns:2;border:1px solid #eee;border-radius:5px;padding:1em}& .side{width:100%}& :is(main,.body) .side{color:#2f4f4f;padding:0 2em}& .side-left,& .side-right{clear:both;background:0 0;margin:1em auto}& :not(.note-ref)+.side{float:none}& .footnote-ref+.footnotes{float:left}& .side>:last-child{margin-bottom:0}& .embed-left,& .embed-right{float:inherit;margin:auto;padding:1em}}}@media (width<=800px){body:not(.pagesjs){padding:initial;& main,& .body{padding:0 .5em}& #TOC{columns:1}& .quote-left,& .quote-right{width:inherit;float:inherit;margin:auto}& .fullwidth{margin:initial;transform:initial;float:none;min-width:initial;background:0 0;border:none;& :is(figcaption,.caption){margin:initial;padding:initial}&:not(.fullscroll) *{max-width:100%}}}}@media print{body{background:0 0}}
2
2
  /*# sourceMappingURL=article.min.css.map */
@@ -1 +1 @@
1
- {"version":3,"mappings":"AAAA,sGAKA,yCACA,0IAMA,gDACA,4CACA,2CACA,WACA,wEAQA,2EAMA,gEAIE,0DAGS,gBAEX,oEAKA,mCACA,mDAIA,oDAIA,sDAIA,2CACA,6CACA,8DACA,0DACA,8BACE,gCACA,mCAIF,4DAGE,8CAIU,mEAIV,wFAMF,YACE,sBACA,sCAGF,0BACE,UACE,wBAGA,oFAKA,sDAIF,yBACA,+IAUF,uBACE,mBACE,iGAQA,mBACA,oDAIA,qEAKA,mCACA,sCACA,oCACA,qEAOJ,sBACE,mCAEE,8BACA,iBACA,qEAKA,sGAOE,0DAIA,uCAKN,aACE","sources":["article.css"],"sourcesContent":[":root {\n --side-width: 200px;\n --side-gap: 2em;\n --side-margin: calc(0px - var(--side-width) - var(--side-gap));\n}\nbody, blockquote, .side { background: #fafafa; }\n.body, .body ~ .appendix, .frontmatter, .fullwidth, .embed-left, .embed-right {\n margin-top: 2em;\n padding: 1em;\n box-shadow: 0 0 8px #ccc;\n background: #fff;\n}\n.appendix, .footnotes, .body .side { font-size: .9em; }\n.body ~ .appendix, .frontmatter { background: none; }\n.appendix h2 { border-bottom: 1px dashed #666; }\n#TOC { top: 0; }\n.bg-number {\n padding: 1px 5px;\n border-radius: 5px;\n background: lightslategray;\n color: #fff;\n}\n\n/* left/right elements*/\n.side {\n width: var(--side-width);\n margin: 0 auto;\n max-height: 100vh;\n overflow: auto;\n}\n.side-left {\n float: left;\n clear: left;\n margin-left: var(--side-margin);\n &:not(.body > *) {\n margin-left: calc(var(--side-margin) + 1em);\n }\n position: sticky;\n}\n.side-right {\n float: right;\n clear: right;\n margin-right: var(--side-margin);\n}\n.quote-left, .quote-right { width: 45%; }\n.embed-left, .embed-right {\n margin-top: auto;\n padding: 0;\n}\n.quote-left, .embed-left {\n float: left;\n margin-right: 1em;\n}\n.quote-right, .embed-right {\n float: right;\n margin-left: 1em;\n}\n.embed-left { margin-left: var(--side-margin); }\n.embed-right { margin-right: var(--side-margin); }\n:is(.side, .embed-left, .embed-right) > :first-child { margin-top: 0; }\n:is(.embed-left, .embed-right) > :last-child { margin-bottom: 0; }\n:is(.quote-left, .quote-right) {\n & > :first-child { padding-top: .1px; }\n & > :last-child { padding-bottom: .1px; }\n}\n\n/* wide elements */\n.fullwidth {\n max-width: calc(100vw - 2em);\n margin: 1em 0 1em 50%;\n & * {\n max-width: calc(100vw - 4em);\n margin: auto 0;\n }\n transform: translateX(-50%);\n float: left;\n min-width: 100%;\n background: #fff;\n & :is(figcaption, .caption) {\n margin-left: calc(50% - 400px);\n width: 800px;\n padding: 1em 1em 0;\n }\n}\n.fullscroll {\n & * { max-width: initial; }\n &, & figure, & .figure { overflow-x: auto; }\n}\n\n@media (min-width: 1264.02px) {\n #TOC.side {\n .active {\n color: limegreen;\n }\n li li .active {\n border-left: 3px solid;\n margin-left: calc(-1em - 3px);\n padding-left: 1em;\n }\n &:has(.active) li:not(:has(.active)) ul {\n display: none;\n }\n }\n .note-ref { cursor: pointer; }\n .note-ref:hover + .side {\n display: inline-block;\n background: #f8f8f8;\n position: absolute;\n z-index: 1;\n margin-left: 1em;\n padding: .5em;\n box-sizing: content-box;\n }\n}\n@media (max-width: 1264px) {\n body:not(.pagesjs) {\n #TOC {\n border: 1px solid #eee;\n border-radius: 5px;\n padding: 1em;\n position: initial;\n float: none;\n columns: 2;\n }\n .side { width: 100%; }\n :is(main, .body) .side {\n padding: 0 2em;\n color: darkslategray;\n }\n .side-left, .side-right {\n clear: both;\n margin: 1em auto;\n background: none;\n }\n :not(.note-ref) + .side { float: none; }\n .footnote-ref + .footnotes { float: left; }\n .side > :last-child { margin-bottom: 0; }\n .embed-left, .embed-right {\n float: inherit;\n margin: auto;\n padding: 1em;\n }\n }\n}\n@media (max-width: 800px) {\n body:not(.pagesjs) {\n padding: initial;\n main, .body { padding: 0 .5em 0; }\n #TOC { columns: 1; }\n .quote-left, .quote-right {\n width: inherit;\n float: inherit;\n margin: auto;\n }\n .fullwidth {\n margin: initial;\n transform: initial;\n float: none;\n min-width: initial;\n background: none;\n border: none;\n & :is(figcaption, .caption) {\n margin: initial;\n padding: initial;\n }\n &:not(.fullscroll) * { max-width: 100%; }\n }\n }\n}\n\n@media print {\n body {\n background: none;\n }\n}\n"],"names":[]}
1
+ {"version":3,"mappings":"AAAA,sGAKA,yCACA,0IAMA,gDACA,4CACA,2CACA,WACA,wEAQA,2EAMA,gEAIE,0DAGS,gBAEX,oEAKA,mCACA,mDAIA,oDAIA,sDAIA,2CACA,6CACA,8DACA,0DACA,8BACE,gCACA,mCAIF,gIAOE,8CAIA,wFAMF,YACE,sBACA,sCAGF,0BACE,UACE,wBAGA,oFAKA,sDAIF,yBACA,+IAUF,uBACE,mBACE,iGAQA,mBACA,oDAIA,qEAKA,mCACA,sCACA,oCACA,qEAOJ,sBACE,mCAEE,8BACA,iBACA,qEAKA,sGAOE,0DAIA,uCAKN,aACE","sources":["article.css"],"sourcesContent":[":root {\n --side-width: 200px;\n --side-gap: 2em;\n --side-margin: calc(0px - var(--side-width) - var(--side-gap));\n}\nbody, blockquote, .side { background: #fafafa; }\n.body, .body ~ .appendix, .frontmatter, .fullwidth, .embed-left, .embed-right {\n margin-top: 2em;\n padding: 1em;\n box-shadow: 0 0 8px #ccc;\n background: #fff;\n}\n.appendix, .footnotes, .body .side { font-size: .9em; }\n.body ~ .appendix, .frontmatter { background: none; }\n.appendix h2 { border-bottom: 1px dashed #666; }\n#TOC { top: 0; }\n.bg-number {\n padding: 1px 5px;\n border-radius: 5px;\n background: lightslategray;\n color: #fff;\n}\n\n/* left/right elements*/\n.side {\n width: var(--side-width);\n margin: 0 auto;\n max-height: 100vh;\n overflow: auto;\n}\n.side-left {\n float: left;\n clear: left;\n margin-left: var(--side-margin);\n &:not(.body > *) {\n margin-left: calc(var(--side-margin) + 1em);\n }\n position: sticky;\n}\n.side-right {\n float: right;\n clear: right;\n margin-right: var(--side-margin);\n}\n.quote-left, .quote-right { width: 45%; }\n.embed-left, .embed-right {\n margin-top: auto;\n padding: 0;\n}\n.quote-left, .embed-left {\n float: left;\n margin-right: 1em;\n}\n.quote-right, .embed-right {\n float: right;\n margin-left: 1em;\n}\n.embed-left { margin-left: var(--side-margin); }\n.embed-right { margin-right: var(--side-margin); }\n:is(.side, .embed-left, .embed-right) > :first-child { margin-top: 0; }\n:is(.embed-left, .embed-right) > :last-child { margin-bottom: 0; }\n:is(.quote-left, .quote-right) {\n & > :first-child { padding-top: .1px; }\n & > :last-child { padding-bottom: .1px; }\n}\n\n/* wide elements */\n.fullwidth {\n max-width: calc(100vw - 2em);\n margin: 1em 0 1em 50%;\n transform: translateX(-50%);\n float: left;\n min-width: 100%;\n background: #fff;\n & * {\n max-width: calc(100vw - 4em);\n margin: auto 0;\n }\n & :is(figcaption, .caption) {\n margin-left: calc(50% - 400px);\n width: 800px;\n padding: 1em 1em 0;\n }\n}\n.fullscroll {\n & * { max-width: initial; }\n &, & figure, & .figure { overflow-x: auto; }\n}\n\n@media (min-width: 1264.02px) {\n #TOC.side {\n .active {\n color: limegreen;\n }\n li li .active {\n border-left: 3px solid;\n margin-left: calc(-1em - 3px);\n padding-left: 1em;\n }\n &:has(.active) li:not(:has(.active)) ul {\n display: none;\n }\n }\n .note-ref { cursor: pointer; }\n .note-ref:hover + .side {\n display: inline-block;\n background: #f8f8f8;\n position: absolute;\n z-index: 1;\n margin-left: 1em;\n padding: .5em;\n box-sizing: content-box;\n }\n}\n@media (max-width: 1264px) {\n body:not(.pagesjs) {\n #TOC {\n border: 1px solid #eee;\n border-radius: 5px;\n padding: 1em;\n position: initial;\n float: none;\n columns: 2;\n }\n .side { width: 100%; }\n :is(main, .body) .side {\n padding: 0 2em;\n color: darkslategray;\n }\n .side-left, .side-right {\n clear: both;\n margin: 1em auto;\n background: none;\n }\n :not(.note-ref) + .side { float: none; }\n .footnote-ref + .footnotes { float: left; }\n .side > :last-child { margin-bottom: 0; }\n .embed-left, .embed-right {\n float: inherit;\n margin: auto;\n padding: 1em;\n }\n }\n}\n@media (max-width: 800px) {\n body:not(.pagesjs) {\n padding: initial;\n main, .body { padding: 0 .5em 0; }\n #TOC { columns: 1; }\n .quote-left, .quote-right {\n width: inherit;\n float: inherit;\n margin: auto;\n }\n .fullwidth {\n margin: initial;\n transform: initial;\n float: none;\n min-width: initial;\n background: none;\n border: none;\n & :is(figcaption, .caption) {\n margin: initial;\n padding: initial;\n }\n &:not(.fullscroll) * { max-width: 100%; }\n }\n }\n}\n\n@media print {\n body {\n background: none;\n }\n}\n"],"names":[]}
package/css/manual.css CHANGED
@@ -10,7 +10,7 @@
10
10
  }
11
11
  }
12
12
  dt { font-weight: bold; }
13
- .side .pkg-desc dd { margin-left: 0; }
13
+ .side .pkg-desc dd { margin: 0 0 .5em; }
14
14
  code.fade::before {
15
15
  content: "🚫";
16
16
  float: right;
@@ -1,2 +1,2 @@
1
- .table-full,h3[id^=sec\:arguments]+table{width:100%;& td{vertical-align:baseline;&>p{&:first-child{margin-top:0}&:last-child{margin-bottom:0}}}}dt{font-weight:700}.side .pkg-desc dd{margin-left:0}code.fade:before{content:"🚫";float:right;font-size:1.5em;line-height:1}@media only screen{body:not(.pagesjs) pre:not([class]){max-height:300px;overflow-y:auto}}.orcid{vertical-align:middle;width:1em;height:1em}
1
+ .table-full,h3[id^=sec\:arguments]+table{width:100%;& td{vertical-align:baseline;&>p{&:first-child{margin-top:0}&:last-child{margin-bottom:0}}}}dt{font-weight:700}.side .pkg-desc dd{margin:0 0 .5em}code.fade:before{content:"🚫";float:right;font-size:1.5em;line-height:1}@media only screen{body:not(.pagesjs) pre:not([class]){max-height:300px;overflow-y:auto}}.orcid{vertical-align:middle;width:1em;height:1em}
2
2
  /*# sourceMappingURL=manual.min.css.map */
@@ -1 +1 @@
1
- {"version":3,"mappings":"AACA,oDAEE,6BAEE,IACE,2BACA,gCAIN,mBACA,iCACA,0EAMA,mBACE,sEAKF","sources":["manual.css"],"sourcesContent":["/* mainly for litedown::pkg_manual() */\n.table-full, h3[id^=\"sec:arguments\"] + table {\n width: 100%;\n td {\n vertical-align: baseline;\n & > p {\n &:first-child { margin-top: 0; }\n &:last-child { margin-bottom: 0; }\n }\n }\n}\ndt { font-weight: bold; }\n.side .pkg-desc dd { margin-left: 0; }\ncode.fade::before {\n content: \"🚫\";\n float: right;\n font-size: 1.5em;\n line-height: 1;\n}\n@media only screen {\n body:not(.pagesjs) pre:not([class]) {\n max-height: 300px;\n overflow-y: auto;\n }\n}\n.orcid {\n width: 1em;\n height: 1em;\n vertical-align: middle;\n}\n"],"names":[]}
1
+ {"version":3,"mappings":"AACA,oDAEE,6BAEE,IACE,2BACA,gCAIN,mBACA,mCACA,0EAMA,mBACE,sEAKF","sources":["manual.css"],"sourcesContent":["/* mainly for litedown::pkg_manual() */\n.table-full, h3[id^=\"sec:arguments\"] + table {\n width: 100%;\n td {\n vertical-align: baseline;\n & > p {\n &:first-child { margin-top: 0; }\n &:last-child { margin-bottom: 0; }\n }\n }\n}\ndt { font-weight: bold; }\n.side .pkg-desc dd { margin: 0 0 .5em; }\ncode.fade::before {\n content: \"🚫\";\n float: right;\n font-size: 1.5em;\n line-height: 1;\n}\n@media only screen {\n body:not(.pagesjs) pre:not([class]) {\n max-height: 300px;\n overflow-y: auto;\n }\n}\n.orcid {\n width: 1em;\n height: 1em;\n vertical-align: middle;\n}\n"],"names":[]}
@@ -7,7 +7,7 @@
7
7
  links.forEach(a => dict[a.getAttribute('href').replace('#', '')] = a);
8
8
  const ids = Object.keys(dict);
9
9
 
10
- let id_active;
10
+ let id_active, id_last;
11
11
  // status: 1 if an id is currently in the viewport, otherwise 0
12
12
  const status = Array(ids.length).fill(0);
13
13
  // create a new Intersection Observer instance
@@ -23,10 +23,18 @@
23
23
  // if a heading exits from bottom and no heading is in view, activate previous ID
24
24
  id_active = i > 0 ? ids[i - 1] : undefined;
25
25
  }
26
+ if (id_active === id_last) return;
26
27
  for (const i in dict) {
27
28
  dict[i].classList.toggle('active', i === id_active);
28
29
  }
29
- dict[id_active]?.scrollIntoView();
30
+ id_last = id_active;
31
+ // in case the active TOC item is not in the view, scroll TOC to make it visible
32
+ const a = dict[id_active];
33
+ if (!a || toc.scrollHeight <= toc.clientHeight) return;
34
+ const ra = a.getBoundingClientRect(), rt = toc.getBoundingClientRect();
35
+ if (ra.top < rt.top || ra.bottom > rt.bottom) toc.scrollTo({
36
+ top: a.offsetTop, behavior: 'smooth'
37
+ });
30
38
  }));
31
39
 
32
40
  // observe all section headings associated with TOC links
@@ -1,2 +1,2 @@
1
- (e=>{const t='a[href^="#"]',r=e.querySelector(`:is(#TableOfContents, #TOC):has(${t})`);if(!r)return;const n=r.querySelectorAll(t),o={};n.forEach(e=>o[e.getAttribute("href").replace("#","")]=e);const c=Object.keys(o);let s;const i=Array(c.length).fill(0),l=new IntersectionObserver(e=>e.forEach(e=>{const t=e.target.id,r=c.indexOf(t);if(r<0)return;i[r]=+e.isIntersecting;const n=i.indexOf(1);if(n>-1)s=c[n];else{if(!s||e.boundingClientRect.top<0)return;s=r>0?c[r-1]:void 0}for(const e in o)o[e].classList.toggle("active",e===s);o[s]?.scrollIntoView()}));e.querySelectorAll("h1,h2,h3,h4,h5,h6").forEach(e=>{1===e.nodeType&&o.hasOwnProperty(e.id)&&l.observe(e)})})(document);
1
+ (e=>{const t='a[href^="#"]',o=e.querySelector(`:is(#TableOfContents, #TOC):has(${t})`);if(!o)return;const n=o.querySelectorAll(t),r={};n.forEach(e=>r[e.getAttribute("href").replace("#","")]=e);const i=Object.keys(r);let c,s;const l=Array(i.length).fill(0),f=new IntersectionObserver(e=>e.forEach(e=>{const t=e.target.id,n=i.indexOf(t);if(n<0)return;l[n]=+e.isIntersecting;const f=l.indexOf(1);if(f>-1)c=i[f];else{if(!c||e.boundingClientRect.top<0)return;c=n>0?i[n-1]:void 0}if(c===s)return;for(const e in r)r[e].classList.toggle("active",e===c);s=c;const h=r[c];if(!h||o.scrollHeight<=o.clientHeight)return;const a=h.getBoundingClientRect(),g=o.getBoundingClientRect();(a.top<g.top||a.bottom>g.bottom)&&o.scrollTo({top:h.offsetTop,behavior:"smooth"})}));e.querySelectorAll("h1,h2,h3,h4,h5,h6").forEach(e=>{1===e.nodeType&&r.hasOwnProperty(e.id)&&f.observe(e)})})(document);
2
2
  //# sourceMappingURL=toc-highlight.min.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["d","s","toc","querySelector","links","querySelectorAll","dict","forEach","a","getAttribute","replace","ids","Object","keys","id_active","status","Array","length","fill","observer","IntersectionObserver","els","el","id","target","i","indexOf","isIntersecting","n","boundingClientRect","top","undefined","classList","toggle","scrollIntoView","h","nodeType","hasOwnProperty","observe","document"],"sources":["toc-highlight.js"],"mappings":"AACA,CAACA,IAEC,MAAMC,EAAI,eAAgBC,EAAMF,EAAEG,cAAc,mCAAmCF,MACnF,IAAKC,EAAK,OACV,MAAME,EAAQF,EAAIG,iBAAiBJ,GAAIK,EAAO,CAAC,EAC/CF,EAAMG,QAAQC,GAAKF,EAAKE,EAAEC,aAAa,QAAQC,QAAQ,IAAK,KAAOF,GACnE,MAAMG,EAAMC,OAAOC,KAAKP,GAExB,IAAIQ,EAEJ,MAAMC,EAASC,MAAML,EAAIM,QAAQC,KAAK,GAEhCC,EAAW,IAAIC,qBAAqBC,GAAOA,EAAId,QAAQe,IAC3D,MAAMC,EAAKD,EAAGE,OAAOD,GAAIE,EAAId,EAAIe,QAAQH,GACzC,GAAIE,EAAI,EAAG,OACXV,EAAOU,IAAMH,EAAGK,eAChB,MAAMC,EAAIb,EAAOW,QAAQ,GACzB,GAAIE,GAAK,EACPd,EAAYH,EAAIiB,OACX,CACL,IAAKd,GAAaQ,EAAGO,mBAAmBC,IAAM,EAAG,OAEjDhB,EAAYW,EAAI,EAAId,EAAIc,EAAI,QAAKM,CACnC,CACA,IAAK,MAAMN,KAAKnB,EACdA,EAAKmB,GAAGO,UAAUC,OAAO,SAAUR,IAAMX,GAE3CR,EAAKQ,IAAYoB,oBAInBlC,EAAEK,iBAAiB,qBAAqBE,QAAQ4B,IAC/B,IAAfA,EAAEC,UAAkB9B,EAAK+B,eAAeF,EAAEZ,KAAOJ,EAASmB,QAAQH,IAErE,EAlCD,CAkCGI","ignoreList":[]}
1
+ {"version":3,"names":["d","s","toc","querySelector","links","querySelectorAll","dict","forEach","a","getAttribute","replace","ids","Object","keys","id_active","id_last","status","Array","length","fill","observer","IntersectionObserver","els","el","id","target","i","indexOf","isIntersecting","n","boundingClientRect","top","undefined","classList","toggle","scrollHeight","clientHeight","ra","getBoundingClientRect","rt","bottom","scrollTo","offsetTop","behavior","h","nodeType","hasOwnProperty","observe","document"],"sources":["toc-highlight.js"],"mappings":"AACA,CAACA,IAEC,MAAMC,EAAI,eAAgBC,EAAMF,EAAEG,cAAc,mCAAmCF,MACnF,IAAKC,EAAK,OACV,MAAME,EAAQF,EAAIG,iBAAiBJ,GAAIK,EAAO,CAAC,EAC/CF,EAAMG,QAAQC,GAAKF,EAAKE,EAAEC,aAAa,QAAQC,QAAQ,IAAK,KAAOF,GACnE,MAAMG,EAAMC,OAAOC,KAAKP,GAExB,IAAIQ,EAAWC,EAEf,MAAMC,EAASC,MAAMN,EAAIO,QAAQC,KAAK,GAEhCC,EAAW,IAAIC,qBAAqBC,GAAOA,EAAIf,QAAQgB,IAC3D,MAAMC,EAAKD,EAAGE,OAAOD,GAAIE,EAAIf,EAAIgB,QAAQH,GACzC,GAAIE,EAAI,EAAG,OACXV,EAAOU,IAAMH,EAAGK,eAChB,MAAMC,EAAIb,EAAOW,QAAQ,GACzB,GAAIE,GAAK,EACPf,EAAYH,EAAIkB,OACX,CACL,IAAKf,GAAaS,EAAGO,mBAAmBC,IAAM,EAAG,OAEjDjB,EAAYY,EAAI,EAAIf,EAAIe,EAAI,QAAKM,CACnC,CACA,GAAIlB,IAAcC,EAAS,OAC3B,IAAK,MAAMW,KAAKpB,EACdA,EAAKoB,GAAGO,UAAUC,OAAO,SAAUR,IAAMZ,GAE3CC,EAAUD,EAEV,MAAMN,EAAIF,EAAKQ,GACf,IAAKN,GAAKN,EAAIiC,cAAgBjC,EAAIkC,aAAc,OAChD,MAAMC,EAAK7B,EAAE8B,wBAAyBC,EAAKrC,EAAIoC,yBAC3CD,EAAGN,IAAMQ,EAAGR,KAAOM,EAAGG,OAASD,EAAGC,SAAQtC,EAAIuC,SAAS,CACzDV,IAAKvB,EAAEkC,UAAWC,SAAU,cAKhC3C,EAAEK,iBAAiB,qBAAqBE,QAAQqC,IAC/B,IAAfA,EAAEC,UAAkBvC,EAAKwC,eAAeF,EAAEpB,KAAOJ,EAAS2B,QAAQH,IAErE,EA1CD,CA0CGI","ignoreList":[]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xiee/utils",
3
- "version": "1.14.15",
3
+ "version": "1.14.17",
4
4
  "description": "Miscellaneous tools and utilities to manipulate HTML pages",
5
5
  "scripts": {
6
6
  "test": "echo \"Error: no test specified\" && exit 1"