@xiee/utils
Advanced tools
Comparing version 1.12.23 to 1.12.24
// fold elements with <details>: https://yihui.org/en/2023/09/code-folding/ | ||
(d => { | ||
const cfg = d.currentScript?.dataset, cls = 'folder'; let status = !!cfg?.open; | ||
d.querySelectorAll(cfg?.selector || 'pre>code[class],pre[class]').forEach(el => { | ||
d.querySelectorAll(cfg?.selector || 'pre:not([class])>code[class],pre[class]').forEach(el => { | ||
const s1 = d.createElement('details'), s2 = d.createElement('summary'); | ||
@@ -6,0 +6,0 @@ s1.className = cls; s1.open = status; |
@@ -1,1 +0,1 @@ | ||
(e=>{const t=e.currentScript?.dataset,a="folder";let n=!!t?.open;if(e.querySelectorAll(t?.selector||"pre>code[class],pre[class]").forEach((r=>{const l=e.createElement("details"),o=e.createElement("summary");l.className=a,l.open=n,o.innerText=(t?.label||"Details")+(t?.tagName?` <${r.tagName}>`:""),"CODE"===r.tagName&&"PRE"===r.parentNode.tagName&&(r=r.parentNode),l.append(o),r.before(l),l.append(r)})),!t?.hasOwnProperty("button"))return;const r=e.querySelector(t.parent);let l=e.querySelector(t.button);if(!l&&!r)return;l||(l=e.createElement("button"),l.id="toggle-all",r.insertAdjacentElement(t.position||"afterbegin",l));const o=t.buttonLabel||"Show Details",c=t.buttonLabel2||"Hide Details";function s(){l.innerText=n?c:o}s(),l.onclick=t=>{n=!n,e.querySelectorAll(`details.${a}`).forEach((e=>{e.open=n})),s()}})(document); | ||
(e=>{const t=e.currentScript?.dataset,a="folder";let n=!!t?.open;if(e.querySelectorAll(t?.selector||"pre:not([class])>code[class],pre[class]").forEach((r=>{const l=e.createElement("details"),o=e.createElement("summary");l.className=a,l.open=n,o.innerText=(t?.label||"Details")+(t?.tagName?` <${r.tagName}>`:""),"CODE"===r.tagName&&"PRE"===r.parentNode.tagName&&(r=r.parentNode),l.append(o),r.before(l),l.append(r)})),!t?.hasOwnProperty("button"))return;const r=e.querySelector(t.parent);let l=e.querySelector(t.button);if(!l&&!r)return;l||(l=e.createElement("button"),l.id="toggle-all",r.insertAdjacentElement(t.position||"afterbegin",l));const o=t.buttonLabel||"Show Details",c=t.buttonLabel2||"Hide Details";function s(){l.innerText=n?c:o}s(),l.onclick=t=>{n=!n,e.querySelectorAll(`details.${a}`).forEach((e=>{e.open=n})),s()}})(document); |
{ | ||
"name": "@xiee/utils", | ||
"version": "1.12.23", | ||
"version": "1.12.24", | ||
"description": "Miscellaneous tools and utilities to manipulate HTML pages", | ||
@@ -5,0 +5,0 @@ "scripts": { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
134196