@xiee/utils 1.14.15 → 1.14.16
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/manual.css +1 -1
- package/css/manual.min.css +1 -1
- package/css/manual.min.css.map +1 -1
- package/js/toc-highlight.js +10 -2
- package/js/toc-highlight.min.js +1 -1
- package/js/toc-highlight.min.js.map +1 -1
- package/package.json +1 -1
package/css/manual.css
CHANGED
package/css/manual.min.css
CHANGED
|
@@ -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
|
|
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 */
|
package/css/manual.min.css.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"mappings":"AACA,oDAEE,6BAEE,IACE,2BACA,gCAIN,mBACA,
|
|
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":[]}
|
package/js/toc-highlight.js
CHANGED
|
@@ -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
|
-
|
|
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
|
package/js/toc-highlight.min.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
(e=>{const t='a[href^="#"]',
|
|
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","
|
|
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,GACn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