@domphy/press 0.19.1 → 0.19.2
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/dist/{build-QKFFWX4D.js → build-DKE372GH.js} +21 -8
- package/dist/cli.js +2 -2
- package/dist/index.d.ts +18 -0
- package/dist/index.js +24 -23
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -472,25 +472,37 @@ function pageBadge(frontmatter) {
|
|
|
472
472
|
if (!text2) return null;
|
|
473
473
|
return { span: text2, class: `dp-badge dp-badge-${type} dp-page-badge` };
|
|
474
474
|
}
|
|
475
|
+
function resolveSlot(ctx, key, fallback) {
|
|
476
|
+
const override = ctx.config.themeConfig.slots?.[key];
|
|
477
|
+
return override ? override(ctx) : fallback(ctx);
|
|
478
|
+
}
|
|
475
479
|
function pageShell(ctx) {
|
|
480
|
+
const slots = ctx.config.themeConfig.slots;
|
|
481
|
+
const showSidebar = ctx.frontmatter.sidebar !== false;
|
|
476
482
|
const main = [];
|
|
477
483
|
const badge = pageBadge(ctx.frontmatter);
|
|
478
484
|
if (badge) main.push({ div: [badge], class: "dp-page-badge-row" });
|
|
479
485
|
main.push({ div: ctx.body, class: "dp-content" });
|
|
480
|
-
const pn =
|
|
486
|
+
const pn = resolveSlot(ctx, "prevNext", prevNext);
|
|
481
487
|
if (pn) main.push(pn);
|
|
482
|
-
const
|
|
483
|
-
if (
|
|
484
|
-
const
|
|
485
|
-
const
|
|
486
|
-
|
|
488
|
+
const docFooterEl = resolveSlot(ctx, "docFooter", docFooter);
|
|
489
|
+
if (docFooterEl) main.push(docFooterEl);
|
|
490
|
+
const sidebarEl = showSidebar ? resolveSlot(ctx, "sidebar", sidebar) : null;
|
|
491
|
+
const shellChildren = [
|
|
492
|
+
...sidebarEl ? [sidebarEl] : [],
|
|
493
|
+
{ main, class: `dp-main${showSidebar ? "" : " dp-main-full"}` }
|
|
494
|
+
];
|
|
495
|
+
const asideEl = resolveSlot(ctx, "aside", tocAside);
|
|
496
|
+
if (asideEl && showSidebar) shellChildren.push(asideEl);
|
|
497
|
+
const headerEl = resolveSlot(ctx, "header", header);
|
|
487
498
|
const bar = announcementBar(ctx.config);
|
|
499
|
+
const footerContent = slots?.footer ? slots.footer(ctx) : { footer: ctx.config.themeConfig.footerMessage ?? "", class: "dp-footer" };
|
|
488
500
|
return {
|
|
489
501
|
div: [
|
|
490
502
|
...bar ? [bar] : [],
|
|
491
|
-
|
|
503
|
+
...headerEl ? [headerEl] : [],
|
|
492
504
|
{ div: shellChildren, class: "dp-shell" },
|
|
493
|
-
|
|
505
|
+
...footerContent ? [footerContent] : []
|
|
494
506
|
]
|
|
495
507
|
};
|
|
496
508
|
}
|
|
@@ -1039,6 +1051,7 @@ a:hover{text-decoration:underline}
|
|
|
1039
1051
|
.dp-sidebar a[aria-current="page"]{color:${brand};font-weight:600;background:${bgSoft}}
|
|
1040
1052
|
.dp-sidebar-link-with-badge{display:flex;align-items:center}
|
|
1041
1053
|
.dp-main{padding:${ts(8)} ${ts(12)} ${ts(20)};min-width:0}
|
|
1054
|
+
.dp-main-full{grid-column:1 / -1;max-width:${contentMax};margin:0 auto}
|
|
1042
1055
|
.dp-content{max-width:${contentMax}}
|
|
1043
1056
|
.dp-aside{position:sticky;top:${headerH};max-height:calc(100vh - ${headerH});overflow-y:auto;padding:${ts(8)} ${ts(6)};font-size:13px}
|
|
1044
1057
|
.dp-aside-title{font-weight:700;margin-bottom:${ts(2)};color:${text}}
|
package/dist/cli.js
CHANGED
|
@@ -25,7 +25,7 @@ if (command === "build") {
|
|
|
25
25
|
const srcDir = resolve(process.cwd(), flag("--src") ?? config.srcDir ?? ".");
|
|
26
26
|
const outDir = resolve(process.cwd(), flag("--out") ?? config.outDir ?? "dist");
|
|
27
27
|
const publicDir = resolve(process.cwd(), "public");
|
|
28
|
-
const { buildSite } = await import("./build-
|
|
28
|
+
const { buildSite } = await import("./build-DKE372GH.js");
|
|
29
29
|
await buildSite({
|
|
30
30
|
config: { ...config, srcDir: config.srcDir ?? ".", outDir: config.outDir ?? "dist" },
|
|
31
31
|
srcDir,
|
|
@@ -39,7 +39,7 @@ if (command === "build") {
|
|
|
39
39
|
const srcDir = resolve(process.cwd(), flag("--src") ?? config.srcDir ?? ".");
|
|
40
40
|
const outDir = resolve(process.cwd(), flag("--out") ?? config.outDir ?? ".press-dev");
|
|
41
41
|
const publicDir = resolve(process.cwd(), "public");
|
|
42
|
-
const { buildSite } = await import("./build-
|
|
42
|
+
const { buildSite } = await import("./build-DKE372GH.js");
|
|
43
43
|
const { startDevServer } = await import("./serve-LQBYPP6C.js");
|
|
44
44
|
async function rebuild() {
|
|
45
45
|
const start = Date.now();
|
package/dist/index.d.ts
CHANGED
|
@@ -33,6 +33,22 @@ interface EditLink {
|
|
|
33
33
|
pattern: string;
|
|
34
34
|
text?: string;
|
|
35
35
|
}
|
|
36
|
+
/** Override built-in layout slots. Each function receives the full LayoutContext
|
|
37
|
+
* and must return a DomphyElement (or null to omit the slot entirely). */
|
|
38
|
+
interface LayoutSlots {
|
|
39
|
+
/** Replace the entire header bar. */
|
|
40
|
+
header?: (ctx: unknown) => DomphyElement | null;
|
|
41
|
+
/** Replace the sidebar navigation. */
|
|
42
|
+
sidebar?: (ctx: unknown) => DomphyElement | null;
|
|
43
|
+
/** Replace the TOC aside panel. */
|
|
44
|
+
aside?: (ctx: unknown) => DomphyElement | null;
|
|
45
|
+
/** Replace the prev/next pagination row. */
|
|
46
|
+
prevNext?: (ctx: unknown) => DomphyElement | null;
|
|
47
|
+
/** Replace the doc footer (edit link + last updated). */
|
|
48
|
+
docFooter?: (ctx: unknown) => DomphyElement | null;
|
|
49
|
+
/** Replace the page footer bar. */
|
|
50
|
+
footer?: (ctx: unknown) => DomphyElement | null;
|
|
51
|
+
}
|
|
36
52
|
interface ThemeConfig {
|
|
37
53
|
nav: NavItem[];
|
|
38
54
|
/** Keys are route prefixes (e.g. "/guide/"). Longest match wins. */
|
|
@@ -65,6 +81,8 @@ interface ThemeConfig {
|
|
|
65
81
|
text: string;
|
|
66
82
|
dismissible?: boolean;
|
|
67
83
|
};
|
|
84
|
+
/** Override individual layout slots with custom components. */
|
|
85
|
+
slots?: LayoutSlots;
|
|
68
86
|
}
|
|
69
87
|
interface LocaleConfig {
|
|
70
88
|
label: string;
|
package/dist/index.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
function
|
|
2
|
-
`),n=new Map,r=[],s=!1;for(let i of t){let a=
|
|
3
|
-
`),lineClasses:n,hasFocus:s}}function tt(e,t,n,r,s){let i=0;return e.replace(/<span class="line">/g,()=>{i++;let a=t.get(i)??"",l=["line"];return a?l.push(...a.split(" ")):n.has(i)&&l.push("highlighted"),r&&!a.includes("focus")&&l.push("dimmed"),`${s?`<span class="line-number">${i}</span>`:""}<span class="${l.join(" ")}">`})}async function J(){Y||(Y=Je({themes:[be],langs:Qe}));let e=await Y,t=new Set(e.getLoadedLanguages());return(n,r)=>{let s=$e[r?.toLowerCase()]??r?.toLowerCase();return!s||!t.has(s)?R(n):Ve(e.codeToHtml(n,{lang:s,theme:be}))}}function Q(e,t,n){let{lang:r,highlightLines:s,lineNumbers:i,title:a}=xe(t);if(r==="mermaid")return`<div class="dp-mermaid language-mermaid">${R(e.trim())}</div>`;let{cleanCode:l,lineClasses:c,hasFocus:g}=et(e),m=n(l.trimEnd(),r),d=tt(m,c,s,g,i),u=s.size>0||c.size>0,b=a?`<div class="code-block-title"><span>${R(a)}</span></div>`:"",k=[i?"line-numbers":"",u?"has-annotations":"",g?"has-focus":""].filter(Boolean).join(" ");return`<div class="code-block ${r?`language-${r}`:""}">${b}<div class="code-block-inner"><pre class="${k}"><code>${d}</code></pre><button class="code-copy-btn" type="button" aria-label="Copy code" data-copy>\u2398</button></div></div>`}import{navLink as Se}from"@domphy/app";import{toolbar as ee,toolbarSpacer as lt}from"@domphy/ui";import{readdirSync as nt,statSync as ot}from"fs";import{join as rt,posix as it,relative as st,sep as at}from"path";var ct=new Set(["snippets","demos","node_modules",".git"]);function ke(e){let r=e.split(at).join(it.sep).replace(/\.md$/,"").split("/");return r[r.length-1]==="index"?(r.pop(),r.length===0?"/":`/${r.join("/")}/`):`/${r.join("/")}`}function ve(e){return e==="/"?"index.html":`${e.replace(/^\/+/,"").replace(/\/+$/,"")}/index.html`}function we(e){let t=[];for(let n of nt(e)){let r=rt(e,n);if(ot(r).isDirectory()){if(ct.has(n)||n.startsWith("."))continue;t.push(...we(r))}else n.endsWith(".md")&&n.toLowerCase()!=="readme.md"&&t.push(r)}return t}function H(e){let n=we(e).map(r=>{let s=st(e,r),i=ke(s);return{route:i,outFile:ve(i),filePath:r}});return n.sort((r,s)=>r.route.localeCompare(s.route)),n}function V(e){let t=[];for(let n of e)n.link&&t.push({text:n.text,link:n.link}),n.items&&t.push(...V(n.items));return t}function O(e,t){let n="";for(let r of Object.keys(t.themeConfig.sidebar))e.startsWith(r)&&r.length>n.length&&(n=r);return n?t.themeConfig.sidebar[n]:[]}function Z(e,t){let n=V(O(e,t)),r=n.findIndex(s=>s.link===e||s.link===e.replace(/\/$/,"")||`${s.link}/`===e);return r===-1?{}:{prev:r>0?n[r-1]:void 0,next:r<n.length-1?n[r+1]:void 0}}var dt={github:"GitHub",twitter:"Twitter",discord:"Discord",youtube:"YouTube",linkedin:"LinkedIn",mastodon:"Mastodon",npm:"npm",bluesky:"Bluesky"};function pt(e){let t=e.icon.toLowerCase();return{a:[e.icon.startsWith("http")||e.icon.startsWith("/")?{img:null,src:e.icon,alt:e.ariaLabel??t,width:"18",height:"18"}:{span:"",class:`dp-social-icon dp-icon-${t}`,ariaHidden:"true"}],href:e.link,class:`dp-social-link dp-social-${t}`,ariaLabel:e.ariaLabel??dt[t]??e.icon,target:"_blank",rel:"noopener noreferrer"}}function ne(e,t,n){return{a:e,href:t,class:n,$:[Se({href:t})]}}function gt(e){return{div:[{span:e.text,class:"dp-nav-dropdown-label"},{div:e.items.map(t=>ne(t.text,t.link)),class:"dp-nav-dropdown-menu"}],class:"dp-nav-dropdown"}}function Ee(e){let t=e.themeConfig.announcementBar;if(!t)return null;let n=t.id?t.id:"",r=[{span:t.text,class:"dp-announcement-text"}];return t.dismissible!==!1&&r.push({button:"\u2715",type:"button",class:"dp-announcement-close",dataDismissAnnouncement:"",ariaLabel:"Dismiss"}),{div:r,class:"dp-announcement",...n?{dataId:n}:{}}}function ut(e){let{config:t,route:n}=e;if(!t.locales)return null;let r=Object.entries(t.locales);if(r.length<=1)return null;let s="/",i=n;for(let[c]of r)if(c!=="/"&&n.startsWith(c.replace(/\/$/,""))){s=c,i=n.slice(c.replace(/\/$/,"").length)||"/";break}let a=t.locales[s];if(!a)return null;let l=r.map(([c,g])=>{let d=(c==="/"?"":c.replace(/\/$/,""))+(i==="/"?"/":i);return{a:g.label,href:d,class:`dp-locale-option${c===s?" active":""}`,...c===s?{ariaCurrent:"true"}:{},lang:g.lang}});return{div:[{span:["\u{1F310} ",a.label],class:"dp-locale-current"},{div:l,class:"dp-locale-menu"}],class:"dp-locale-switcher",ariaLabel:"Select language"}}function Ce(e){let{config:t}=e,n=t.themeConfig.search!==!1,r=t.themeConfig.logo,s=r?typeof r=="string"?[{img:null,src:r,alt:t.title,class:"dp-logo-img"}]:[{img:null,src:r.light,alt:t.title,class:"dp-logo-img dp-logo-light"},{img:null,src:r.dark,alt:t.title,class:"dp-logo-img dp-logo-dark"}]:[],i=r?{a:s,href:t.base,class:"dp-logo"}:{a:t.title,href:t.base,class:"dp-logo"},a=(t.themeConfig.socialLinks??[]).map(pt),l=ut(e);return{header:[i,lt(),{nav:t.themeConfig.nav.map(c=>c.items?gt(c):ne(c.text,c.link)),$:[ee({gap:4})],class:"dp-nav",ariaLabel:"Primary"},{div:[...n?[{div:[{input:null,type:"search",placeholder:typeof t.themeConfig.search=="object"&&t.themeConfig.search.placeholder||"Search...",class:"dp-search-static",ariaLabel:"Search documentation"}],dataIsland:"search",class:"dp-search-slot"}]:[],...a,...l?[l]:[],{button:"\u25D0",type:"button",class:"dp-theme-toggle",ariaLabel:"Toggle dark mode",dataThemeToggle:""},{button:"\u2630",type:"button",class:"dp-menu-toggle",ariaLabel:"Toggle menu",dataMenuToggle:""}],$:[ee({gap:2})],class:"dp-header-actions"}],$:[ee({gap:4})],class:"dp-header"}}function De(e){return{span:e.text,class:`dp-badge dp-badge-${e.type??"tip"}`}}function te(e,t,n){return n?{a:[{span:e},De(n)],href:t,$:[Se({href:t})],class:"dp-sidebar-link-with-badge"}:ne(e,t)}function mt(e){let t=[],n=e.items&&e.items.length>0;if(e.link)t.push(te(e.text,e.link,e.badge));else{let s=[{span:e.text}];e.badge&&s.push(De(e.badge)),n&&s.push({button:e.collapsed?"\u203A":"\u2039",type:"button",class:"dp-sidebar-toggle",ariaLabel:e.collapsed?"Expand":"Collapse",dataSidebarToggle:""}),t.push({div:s,class:"dp-sidebar-title"})}if(e.items){let s=[];for(let i of e.items)if(i.items){s.push({div:i.text,class:"dp-sidebar-subtitle"});for(let a of i.items)a.link&&s.push(te(a.text,a.link,a.badge))}else i.link&&s.push(te(i.text,i.link,i.badge));t.push({div:s,class:"dp-sidebar-items"})}let r=["dp-sidebar-group",n&&e.collapsed?"collapsed":""].filter(Boolean).join(" ");return{div:t,class:r}}function ft(e){return{nav:O(e.route,e.config).map(mt),class:"dp-sidebar",ariaLabel:"Documentation"}}function ht(e){if(e.frontmatter.aside===!1)return null;let[t,n]=e.config.themeConfig.outline?.level??[2,3],r=e.toc.filter(i=>i.level>=t&&i.level<=n);return r.length===0?null:{aside:[{div:e.config.themeConfig.tocTitle??"On this page",class:"dp-aside-title"},{nav:r.map(i=>({a:i.text,href:`#${i.slug}`,class:`dp-toc-${i.level}`})),class:"dp-toc"}],class:"dp-aside"}}function bt(e){let{prev:t,next:n}=Z(e.route,e.config);return!t&&!n?null:{nav:[t?{a:[{small:"Previous"},{span:t.text}],href:t.link,class:"prev"}:{span:""},n?{a:[{small:"Next"},{span:n.text}],href:n.link,class:"next"}:{span:""}],class:"dp-prevnext",ariaLabel:"Page navigation"}}function yt(e){let{editLink:t}=e.config.themeConfig,n=e.config.lastUpdated,r=t&&e.filePath,s=n&&e.lastUpdated;if(!r&&!s&&!e.readingTime)return null;let i=[];if(s){let l=new Date(e.lastUpdated).toLocaleDateString("en-US",{year:"numeric",month:"long",day:"numeric"});i.push({span:["Last updated: ",{time:l,dateTime:e.lastUpdated,class:"dp-last-updated-date"}],class:"dp-last-updated"})}if(e.readingTime&&i.push({span:`${e.readingTime} min read`,class:"dp-reading-time"}),r){let l=t.pattern.replace(/:path/g,e.filePath);i.push({a:t.text??"Edit this page",href:l,class:"dp-edit-link",target:"_blank",rel:"noopener noreferrer"})}return{div:i,class:"dp-doc-footer"}}function $t(e){let t=e.badge;if(!t)return null;let n=typeof t=="string"?t:t.text??"",r=typeof t=="object"?t.type??"tip":"tip";return n?{span:n,class:`dp-badge dp-badge-${r} dp-page-badge`}:null}function oe(e){let t=[],n=$t(e.frontmatter);n&&t.push({div:[n],class:"dp-page-badge-row"}),t.push({div:e.body,class:"dp-content"});let r=bt(e);r&&t.push(r);let s=yt(e);s&&t.push(s);let i=[ft(e),{main:t,class:"dp-main"}],a=ht(e);a&&i.push(a);let l=Ee(e.config);return{div:[...l?[l]:[],Ce(e),{div:i,class:"dp-shell"},{footer:e.config.themeConfig.footerMessage??"",class:"dp-footer"}]}}function xt(e){let t=[];return e.name&&t.push({div:e.name,class:"dp-hero-name"}),e.text&&t.push({h1:e.text,class:"dp-hero-text"}),e.tagline&&t.push({p:e.tagline,class:"dp-hero-tagline"}),e.actions?.length&&t.push({div:e.actions.map(n=>({a:n.text,href:n.link,class:`dp-hero-action ${n.theme??"brand"}`})),class:"dp-hero-actions"}),{section:t,class:"dp-hero"}}function kt(e){return{div:e.map(t=>{let n=[];t.icon&&n.push({div:t.icon,class:"dp-feature-icon"}),n.push({div:t.title,class:"dp-feature-title"}),n.push({p:t.details,class:"dp-feature-details"});let r={div:n,class:"dp-feature"};return t.link?{a:[r],href:t.link,class:"dp-feature-link"}:r}),class:"dp-features"}}function re(e){let t=[],n=e.frontmatter.hero,r=e.frontmatter.features;n&&t.push(xt(n)),r?.length&&t.push(kt(r)),t.push({div:e.body,class:"dp-content dp-home"});let s=Ee(e.config);return{div:[...s?[s]:[],Ce(e),{main:t,class:"dp-main dp-main-home"},{footer:e.config.themeConfig.footerMessage??"",class:"dp-footer"}]}}import{readFileSync as vt}from"fs";import{dirname as Me,extname as wt,isAbsolute as St,resolve as Te}from"path";import{splitFrontmatter as Et,tokensToDomphy as Ct}from"@domphy/markdown";import Dt from"markdown-it";import Tt from"markdown-it-container";import Lt from"markdown-it-mark";import Mt from"markdown-it-sub";import _t from"markdown-it-sup";import jt from"markdown-it-include";import Le from"markdown-it-emoji";var It=jt,zt=Lt,At=Mt,Rt=_t,Pt=Le.full??Le,Ft=/^<<<\s+(\S+?)(?:\s+\[([^\]]*)\])?\s*$/gm,Nt={".ts":"ts",".tsx":"tsx",".js":"js",".jsx":"jsx",".mjs":"js",".cjs":"js",".json":"json",".css":"css",".html":"html",".vue":"vue",".md":"markdown",".sh":"bash",".bash":"bash",".yml":"yaml",".yaml":"yaml",".rb":"ruby",".py":"python",".go":"go",".rs":"rust"};function Ht(e,t,n){return e.startsWith("@/")?Te(Me(n),e.slice(2)):St(e)?e:Te(t,e)}function Ot(e,t,n){return e.replace(Ft,(r,s,i)=>{let a=Ht(s,t,n),l="```",c;try{c=vt(a,"utf8")}catch{return[l,`Could not import: ${s}`,l].join(`
|
|
4
|
-
`)}let g=
|
|
5
|
-
`)})}function Ut(e){return e.replace(/<script\b[^>]*>[\s\S]*?<\/script>/gi,"").replace(/^\s*\n/,"")}var ae={tip:"TIP",warning:"WARNING",info:"INFO",danger:"DANGER",note:"NOTE",abstract:"ABSTRACT",success:"SUCCESS",question:"QUESTION",failure:"FAILURE",bug:"BUG",example:"EXAMPLE",quote:"QUOTE"};function ie(e,t){return e.slice(e.indexOf(t)+t.length).trim()}function U(e,t,n,r,s,i){let a=new e(n,t,1);a.block=!0,s&&a.attrSet("class",s);let l=new e("inline","",0);l.content=i,l.children=[];let c=new e("text","",0);c.content=i,l.children.push(c);let g=new e(r,t,-1);return g.block=!0,[a,l,g]}function se(e,t){let n=new e("html_block","",0);return n.content=t,n.block=!0,n}function Bt(e,t,n,r,s){let i=t[n];i.tag="div",i.attrSet("class","code-group");let a=t[r];a.tag="div";let l=[];for(let d=n+1;d<r;d++){let u=t[d];if(u.type!=="fence")continue;let b=(u.info??"").trim(),k=b.match(/\[([^\]]+)\]/),z=b.split(/\s+/,1)[0]??"";l.push({token:u,label:k?k[1]:z||"Code"})}if(l.length===0)return t.slice(n,r+1);let c=l.map((d,u)=>`<input type="radio" name="cg-${s}" id="cgt-${s}-${u}"${u===0?" checked":""}>`).join(""),g=l.map((d,u)=>`<label for="cgt-${s}-${u}">${R(d.label)}</label>`).join(""),m=[se(e,`${c}<div class="tabs">${g}</div>`),se(e,'<div class="blocks">')];return l.forEach(d=>{d.token.info=(d.token.info??"").replace(/\[[^\]]*\]/,"").trim(),m.push(d.token)}),m.push(se(e,"</div>")),[i,...m,a]}function Wt(e){if(e.length===0)return e;let t=e[0].constructor,n=[],r=0,s=Object.keys(ae).join("|"),i=new RegExp(`^container_(${s})_open$`),a=new RegExp(`^container_(${s})_close$`);for(let l=0;l<e.length;l++){let c=e[l],g=c.type.match(i);if(g){let m=g[1];c.tag="div",c.attrSet("class",`custom-block ${m}`);let d=ie(c.info.trim(),m);n.push(c),n.push(...U(t,"p","paragraph_open","paragraph_close","custom-block-title",d||ae[m]||m.toUpperCase()));continue}if(a.test(c.type)){c.tag="div",n.push(c);continue}if(c.type==="container_details_open"){c.tag="details",c.attrSet("class","custom-block details"),n.push(c),n.push(...U(t,"summary","summary_open","summary_close",null,ie(c.info.trim(),"details")||"Details"));continue}if(c.type==="container_details_close"){c.tag="details",n.push(c);continue}if(c.type==="container_steps_open"){c.tag="div",c.attrSet("class","custom-block steps"),n.push(c);continue}if(c.type==="container_steps_close"){c.tag="div",n.push(c);continue}if(c.type==="container_card-grid_open"){c.tag="div",c.attrSet("class","custom-block card-grid"),n.push(c);continue}if(c.type==="container_card-grid_close"){c.tag="div",n.push(c);continue}if(c.type==="container_card_open"){c.tag="div",c.attrSet("class","custom-block card");let m=ie(c.info.trim(),"card");n.push(c),m&&n.push(...U(t,"p","paragraph_open","paragraph_close","card-title",m));continue}if(c.type==="container_card_close"){c.tag="div",n.push(c);continue}if(c.type==="container_link-card_open"){let m=c.info.trim().slice(9).trim(),d=m.match(/^\[([^\]]+)\]\(([^)]+)\)/),u=d?d[2]:"#",b=d?d[1]:m;c.tag="a",c.attrSet("class","custom-block link-card"),c.attrSet("href",u),n.push(c),b&&n.push(...U(t,"p","paragraph_open","paragraph_close","link-card-title",b));continue}if(c.type==="container_link-card_close"){c.tag="a",n.push(c);continue}if(c.type==="container_code-group_open"){let m=0,d=-1;for(let u=l;u<e.length;u++)if(e[u].type==="container_code-group_open")m++;else if(e[u].type==="container_code-group_close"&&(m--,m===0)){d=u;break}if(d===-1){n.push(c);continue}n.push(...Bt(t,e,l,d,r++)),l=d;continue}n.push(c)}return n}function qt(e){if(e.length===0)return e;let t=e[0].constructor;for(let n=1;n<e.length;n++){let r=e[n];if(r.type!=="inline"||!r.children?.length)continue;let s=e[n-1];if(s?.type!=="list_item_open")continue;let i=r.children[0];if(i.type!=="text")continue;let a=i.content;if(!(a.startsWith("[ ] ")||a.startsWith("[x] ")||a.startsWith("[X] ")))continue;let c=a[1].toLowerCase()==="x";i.content=a.slice(4),r.content=r.content.replace(/^\[[ xX]\] /,""),s.attrSet("class",((s.attrGet("class")??"")+" task-list-item").trim());let g=new t("html_inline","",0);g.content=`<input type="checkbox"${c?" checked":""} disabled class="task-list-check" aria-label="${c?"done":"todo"}">`,r.children.unshift(g)}return e}function Gt(e,t){let n=new Dt({html:!0,linkify:!0,typographer:!1});n.enable(["strikethrough","table"]),n.use(It,{root:e}),n.use(zt),n.use(At),n.use(Rt),n.use(Pt);let r=()=>"",s=Object.keys(ae);for(let i of[...s,"details","code-group","steps","card","card-grid","link-card"])n.use(Tt,i,{render:r});return n.core.ruler.push("press_containers",i=>(i.tokens=Wt(i.tokens),!0)),n.core.ruler.push("press_task_lists",i=>(i.tokens=qt(i.tokens),!0)),n.core.ruler.push("press_fences",i=>{for(let a of i.tokens){if(a.type!=="fence")continue;let l=Q(a.content,a.info??"",t);a.type="html_block",a.content=l,a.tag=""}return!0}),n.core.ruler.push("press_external_links",i=>{for(let a of i.tokens)if(!(a.type!=="inline"||!a.children))for(let l of a.children){if(l.type!=="link_open")continue;let c=l.attrGet("href")??"";(c.startsWith("http://")||c.startsWith("https://"))&&(l.attrSet("target","_blank"),l.attrSet("rel","noopener noreferrer"))}return!0}),n.core.ruler.push("press_image_lazy",i=>{for(let a of i.tokens)if(!(a.type!=="inline"||!a.children))for(let l of a.children)l.type==="image"&&l.attrSet("loading","lazy");return!0}),n}function Kt(e){let n=(e.split(/[\\/]/).pop()??e).replace(/\.md$/i,"");if(n.toLowerCase()==="index"){let r=e.split(/[\\/]/).filter(Boolean);return r[r.length-2]??n}return n}function Xt(e){return e.find(t=>t.level===1)?.text}function _e(e){return e.map(t=>{if(!t||typeof t!="object"||Array.isArray(t))return t;let n=t,r=Object.keys(n).find(i=>/^h[1-6]$/.test(i));if(r&&typeof n.id=="string"){let i=n.id,a=Array.isArray(n[r])?[...n[r]]:n[r]!=null?[n[r]]:[];return a.push({a:"#",href:`#${i}`,class:"header-anchor",ariaHidden:"true"}),{...n,[r]:a}}let s=Object.keys(n).find(i=>/^[a-z][a-z0-9]*$/.test(i)&&i!=="style"&&i!=="class"&&!i.startsWith("data")&&!i.startsWith("on")&&!i.startsWith("aria")&&!i.startsWith("_")&&i!=="$"&&i!=="href"&&i!=="src"&&i!=="id"&&i!=="type"&&i!=="name");return s&&Array.isArray(n[s])?{...n,[s]:_e(n[s])}:t})}async function ce(e,t){let{filePath:n,docsDir:r,highlight:s}=t,i=Me(n),{frontmatter:a,content:l}=Et(e),c=Ut(l),g=Ot(c,i,r),d=Gt(r,s).parse(g,{}),{body:u,toc:b}=Ct(d,{highlight:s}),k=_e(u),G=(typeof a.title=="string"?a.title:void 0)??Xt(b)??Kt(n);return{frontmatter:a,body:k,toc:b,islands:[],title:G}}import{ElementNode as Yt,RecordState as Jt}from"@domphy/core";import{themeColor as je,themeSpacing as _}from"@domphy/theme";import{card as Qt,inputSearch as Vt,link as Zt,menu as en,small as tn}from"@domphy/ui";var nn=3,on=2,rn=1;function ze(e){let t=[];for(let n of e.toLowerCase().split(/[^\p{L}\p{N}]+/u))n.length>=2&&t.push(n);return t}function le(e,t,n,r){for(let s of ze(n)){let i=e.get(s);i||(i=new Map,e.set(s,i));let a=i.get(t);(a===void 0||r>a)&&i.set(t,r)}}function de(e){let t=[],n=new Map;for(let s of e){let i=t.length;t.push({route:s.route,pageTitle:s.title,heading:s.title,slug:"",isPage:!0}),le(n,i,s.title,nn),le(n,i,s.text,rn);for(let a of s.toc){let l=t.length;t.push({route:s.route,pageTitle:s.title,heading:a.text,slug:a.slug,isPage:!1}),le(n,l,a.text,on)}}let r={};for(let[s,i]of Array.from(n.entries()).sort((a,l)=>a[0]<l[0]?-1:1))r[s]=Array.from(i.entries()).sort((a,l)=>a[0]-l[0]).map(([a,l])=>[a,l]);return JSON.stringify({entries:t,postings:r})}function Ae(e,t,n=10){let r=JSON.parse(e),s=ze(t);if(s.length===0)return[];let i=new Map,a=new Map;for(let c of s){let g=new Set;for(let m in r.postings){if(m!==c&&!m.startsWith(c))continue;let d=m===c;for(let[u,b]of r.postings[m]){let k=d?b:b*.5;i.set(u,(i.get(u)??0)+k),g.has(u)||(g.add(u),a.set(u,(a.get(u)??0)+1))}}}let l=[];for(let[c,g]of i){let m=r.entries[c],d=a.get(c)??0;l.push({route:m.route,pageTitle:m.pageTitle,heading:m.heading,slug:m.slug,isPage:m.isPage,score:d*100+g,href:m.slug?`${m.route}#${m.slug}`:m.route})}return l.sort((c,g)=>g.score!==c.score?g.score-c.score:c.route!==g.route?c.route<g.route?-1:1:c.isPage===g.isPage?0:c.isPage?-1:1),l.slice(0,n)}function Re(e,t){return`dp-search-${e}-option-${t}`}var sn=0;function an(e,t,n,r){let s=Re(n,t);return{a:[{div:e.isPage?e.pageTitle:e.heading},e.isPage?null:{small:e.pageTitle,$:[tn({color:"neutral"})]}],href:e.href,role:"option",id:s,ariaSelected:i=>r.get("active",i)===t||void 0,onClick:()=>{r.set("open",!1)},onMouseEnter:()=>{r.set("active",t)},$:[Zt({color:"neutral",accentColor:"primary"})],style:{display:"flex",flexDirection:"column",gap:_(1),paddingBlock:_(2),paddingInline:_(3),borderRadius:_(1),backgroundColor:i=>r.get("active",i)===t?je(i,"shift-3","primary"):je(i,"inherit","neutral")},_key:e.href}}function Ie(e,t){let n=e.get("index"),r=e.get("query"),s=n&&r.trim()?Ae(n,r,t):[];e.set("results",s),e.set("active",-1),e.set("open",s.length>0)}function Pe(e={}){let{indexUrl:t="/search-index.json",placeholder:n="Search docs\u2026",limit:r=10}=e,s=++sn,i=`dp-search-${s}-listbox`,a=new Jt({index:null,query:"",results:[],open:!1,active:-1}),l=null;function c(d){d&&(a.set("open",!1),window.location.assign(d.href))}let g={input:null,type:"search",placeholder:n,autocomplete:"off",role:"combobox",ariaExpanded:d=>a.get("open",d)?"true":"false",ariaControls:i,ariaAutocomplete:"list",ariaActiveDescendant:d=>{let u=a.get("active",d);return u>=0?Re(s,u):void 0},value:d=>a.get("query",d),onInput:d=>{a.set("query",d.target.value),l&&clearTimeout(l),l=setTimeout(()=>Ie(a,r),120)},onFocus:()=>{a.get("results").length>0&&a.set("open",!0)},onKeyDown:d=>{let u=a.get("results");if(d.key==="Escape"){a.set("open",!1),a.set("active",-1);return}if(d.key==="ArrowDown"){if(!u.length)return;d.preventDefault(),a.set("open",!0),a.set("active",(a.get("active")+1)%u.length);return}if(d.key==="ArrowUp"){if(!u.length)return;d.preventDefault(),a.set("active",(a.get("active")-1+u.length)%u.length);return}if(d.key==="Enter"){let b=a.get("active");c(b>=0?u[b]:u[0])}},$:[Vt({color:"neutral",accentColor:"primary"})],style:{width:"100%"}},m={div:d=>a.get("open",d)?a.get("results",d).map((u,b)=>an(u,b,s,a)):[],id:i,role:"listbox",$:[en({selectable:!1,color:"neutral"}),Qt({color:"neutral"})],style:{display:d=>a.get("open",d)?"block":"none",position:"absolute",insetInlineStart:0,insetInlineEnd:0,marginBlockStart:_(1),maxHeight:_(80),overflowY:"auto",zIndex:"50"}};return{div:[g,m],role:"search",style:{position:"relative",display:"block",width:"100%"},_onMount:d=>{fetch(t).then(k=>k.text()).then(k=>{a.set("index",k),a.get("query").trim()&&Ie(a,r)}).catch(()=>{});let u=d.domElement,b=k=>{u.contains(k.target)||a.set("open",!1)};document.addEventListener("pointerdown",b),d.setMetadata("dpSearchHandler",b)},_onRemove:d=>{let u=d.getMetadata("dpSearchHandler");u&&document.removeEventListener("pointerdown",u),l&&clearTimeout(l)}}}function cn(e,t={}){for(;e.firstChild;)e.removeChild(e.firstChild);let n=new Yt(Pe(t));return n.render(e),n}import{themeColor as ln,themeSpacing as dn}from"@domphy/theme";var h=(e,t)=>ln(null,e,t),o=e=>dn(e),v=h("inherit"),x=h("shift-1"),L=h("shift-2"),f=h("shift-3"),y=h("shift-6"),C=h("shift-9"),D=h("shift-11"),$=h("shift-9","primary"),pn=h("shift-10","primary"),j=o(14),Fe=o(62),gn=o(56),Ne=o(190);function pe(){return`
|
|
1
|
+
function Je(e){return{base:"/",srcDir:".",outDir:"dist",head:[],...e,themeConfig:Object.assign({nav:[],sidebar:{}},e.themeConfig)}}import{cpSync as mn,existsSync as Oe,mkdirSync as me,readFileSync as fn,rmSync as Ue,writeFileSync as W}from"fs";import{dirname as Be,join as I,relative as hn,resolve as bn}from"path";import{fileURLToPath as yn}from"url";import{execSync as $n}from"child_process";import{createApp as xn,defineRoutes as kn}from"@domphy/app";import{themeCSS as vn}from"@domphy/theme";import{createHighlighter as Qe}from"shiki";var $e="github-light",Ve=["typescript","javascript","tsx","jsx","json","bash","shellscript","html","css","vue","svelte","markdown","diff","yaml","ruby","python","go","rust","sql"],ke={ts:"typescript",js:"javascript",sh:"bash",shell:"bash",zsh:"bash",md:"markdown",yml:"yaml",htm:"html",rb:"ruby",py:"python"},J=null;function R(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""")}function Ze(e){let t=e.match(/<code[^>]*>([\s\S]*)<\/code>/);return t?t[1]:e}function ve(e){let t=(e.match(/^(\S+)/)??[])[1]??"",n=ke[t.toLowerCase()]??t.toLowerCase(),r=e.includes(":line-numbers"),s=e.match(/\[([^\]]*[a-zA-Z.][^\]]*)\]/),i=s?s[1]:null,a=e.match(/\{([0-9,\s\-]+)\}/),l=new Set;if(a)for(let c of a[1].split(",")){let g=c.trim().split("-").map(Number);if(g.length===1&&!isNaN(g[0]))l.add(g[0]);else if(g.length===2)for(let m=g[0];m<=g[1];m++)l.add(m)}return{lang:n,highlightLines:l,lineNumbers:r,title:i}}var xe=/\s*\/\/ \[!code ([^\]]+)\]\s*$/,et={"++":"diff add","--":"diff remove",highlight:"highlighted",focus:"focus",error:"highlighted error",warning:"highlighted warning"};function tt(e){let t=e.split(`
|
|
2
|
+
`),n=new Map,r=[],s=!1;for(let i of t){let a=xe.exec(i);if(a){let l=a[1].trim(),c=et[l];c&&(c.includes("focus")&&(s=!0),n.set(r.length+1,c)),r.push(i.replace(xe,""))}else r.push(i)}return{cleanCode:r.join(`
|
|
3
|
+
`),lineClasses:n,hasFocus:s}}function nt(e,t,n,r,s){let i=0;return e.replace(/<span class="line">/g,()=>{i++;let a=t.get(i)??"",l=["line"];return a?l.push(...a.split(" ")):n.has(i)&&l.push("highlighted"),r&&!a.includes("focus")&&l.push("dimmed"),`${s?`<span class="line-number">${i}</span>`:""}<span class="${l.join(" ")}">`})}async function Q(){J||(J=Qe({themes:[$e],langs:Ve}));let e=await J,t=new Set(e.getLoadedLanguages());return(n,r)=>{let s=ke[r?.toLowerCase()]??r?.toLowerCase();return!s||!t.has(s)?R(n):Ze(e.codeToHtml(n,{lang:s,theme:$e}))}}function V(e,t,n){let{lang:r,highlightLines:s,lineNumbers:i,title:a}=ve(t);if(r==="mermaid")return`<div class="dp-mermaid language-mermaid">${R(e.trim())}</div>`;let{cleanCode:l,lineClasses:c,hasFocus:g}=tt(e),m=n(l.trimEnd(),r),d=nt(m,c,s,g,i),u=s.size>0||c.size>0,b=a?`<div class="code-block-title"><span>${R(a)}</span></div>`:"",k=[i?"line-numbers":"",u?"has-annotations":"",g?"has-focus":""].filter(Boolean).join(" ");return`<div class="code-block ${r?`language-${r}`:""}">${b}<div class="code-block-inner"><pre class="${k}"><code>${d}</code></pre><button class="code-copy-btn" type="button" aria-label="Copy code" data-copy>\u2398</button></div></div>`}import{navLink as Ce}from"@domphy/app";import{toolbar as te,toolbarSpacer as dt}from"@domphy/ui";import{readdirSync as ot,statSync as rt}from"fs";import{join as it,posix as st,relative as at,sep as ct}from"path";var lt=new Set(["snippets","demos","node_modules",".git"]);function we(e){let r=e.split(ct).join(st.sep).replace(/\.md$/,"").split("/");return r[r.length-1]==="index"?(r.pop(),r.length===0?"/":`/${r.join("/")}/`):`/${r.join("/")}`}function Se(e){return e==="/"?"index.html":`${e.replace(/^\/+/,"").replace(/\/+$/,"")}/index.html`}function Ee(e){let t=[];for(let n of ot(e)){let r=it(e,n);if(rt(r).isDirectory()){if(lt.has(n)||n.startsWith("."))continue;t.push(...Ee(r))}else n.endsWith(".md")&&n.toLowerCase()!=="readme.md"&&t.push(r)}return t}function O(e){let n=Ee(e).map(r=>{let s=at(e,r),i=we(s);return{route:i,outFile:Se(i),filePath:r}});return n.sort((r,s)=>r.route.localeCompare(s.route)),n}function Z(e){let t=[];for(let n of e)n.link&&t.push({text:n.text,link:n.link}),n.items&&t.push(...Z(n.items));return t}function U(e,t){let n="";for(let r of Object.keys(t.themeConfig.sidebar))e.startsWith(r)&&r.length>n.length&&(n=r);return n?t.themeConfig.sidebar[n]:[]}function ee(e,t){let n=Z(U(e,t)),r=n.findIndex(s=>s.link===e||s.link===e.replace(/\/$/,"")||`${s.link}/`===e);return r===-1?{}:{prev:r>0?n[r-1]:void 0,next:r<n.length-1?n[r+1]:void 0}}var pt={github:"GitHub",twitter:"Twitter",discord:"Discord",youtube:"YouTube",linkedin:"LinkedIn",mastodon:"Mastodon",npm:"npm",bluesky:"Bluesky"};function gt(e){let t=e.icon.toLowerCase();return{a:[e.icon.startsWith("http")||e.icon.startsWith("/")?{img:null,src:e.icon,alt:e.ariaLabel??t,width:"18",height:"18"}:{span:"",class:`dp-social-icon dp-icon-${t}`,ariaHidden:"true"}],href:e.link,class:`dp-social-link dp-social-${t}`,ariaLabel:e.ariaLabel??pt[t]??e.icon,target:"_blank",rel:"noopener noreferrer"}}function oe(e,t,n){return{a:e,href:t,class:n,$:[Ce({href:t})]}}function ut(e){return{div:[{span:e.text,class:"dp-nav-dropdown-label"},{div:e.items.map(t=>oe(t.text,t.link)),class:"dp-nav-dropdown-menu"}],class:"dp-nav-dropdown"}}function De(e){let t=e.themeConfig.announcementBar;if(!t)return null;let n=t.id?t.id:"",r=[{span:t.text,class:"dp-announcement-text"}];return t.dismissible!==!1&&r.push({button:"\u2715",type:"button",class:"dp-announcement-close",dataDismissAnnouncement:"",ariaLabel:"Dismiss"}),{div:r,class:"dp-announcement",...n?{dataId:n}:{}}}function mt(e){let{config:t,route:n}=e;if(!t.locales)return null;let r=Object.entries(t.locales);if(r.length<=1)return null;let s="/",i=n;for(let[c]of r)if(c!=="/"&&n.startsWith(c.replace(/\/$/,""))){s=c,i=n.slice(c.replace(/\/$/,"").length)||"/";break}let a=t.locales[s];if(!a)return null;let l=r.map(([c,g])=>{let d=(c==="/"?"":c.replace(/\/$/,""))+(i==="/"?"/":i);return{a:g.label,href:d,class:`dp-locale-option${c===s?" active":""}`,...c===s?{ariaCurrent:"true"}:{},lang:g.lang}});return{div:[{span:["\u{1F310} ",a.label],class:"dp-locale-current"},{div:l,class:"dp-locale-menu"}],class:"dp-locale-switcher",ariaLabel:"Select language"}}function Te(e){let{config:t}=e,n=t.themeConfig.search!==!1,r=t.themeConfig.logo,s=r?typeof r=="string"?[{img:null,src:r,alt:t.title,class:"dp-logo-img"}]:[{img:null,src:r.light,alt:t.title,class:"dp-logo-img dp-logo-light"},{img:null,src:r.dark,alt:t.title,class:"dp-logo-img dp-logo-dark"}]:[],i=r?{a:s,href:t.base,class:"dp-logo"}:{a:t.title,href:t.base,class:"dp-logo"},a=(t.themeConfig.socialLinks??[]).map(gt),l=mt(e);return{header:[i,dt(),{nav:t.themeConfig.nav.map(c=>c.items?ut(c):oe(c.text,c.link)),$:[te({gap:4})],class:"dp-nav",ariaLabel:"Primary"},{div:[...n?[{div:[{input:null,type:"search",placeholder:typeof t.themeConfig.search=="object"&&t.themeConfig.search.placeholder||"Search...",class:"dp-search-static",ariaLabel:"Search documentation"}],dataIsland:"search",class:"dp-search-slot"}]:[],...a,...l?[l]:[],{button:"\u25D0",type:"button",class:"dp-theme-toggle",ariaLabel:"Toggle dark mode",dataThemeToggle:""},{button:"\u2630",type:"button",class:"dp-menu-toggle",ariaLabel:"Toggle menu",dataMenuToggle:""}],$:[te({gap:2})],class:"dp-header-actions"}],$:[te({gap:4})],class:"dp-header"}}function Le(e){return{span:e.text,class:`dp-badge dp-badge-${e.type??"tip"}`}}function ne(e,t,n){return n?{a:[{span:e},Le(n)],href:t,$:[Ce({href:t})],class:"dp-sidebar-link-with-badge"}:oe(e,t)}function ft(e){let t=[],n=e.items&&e.items.length>0;if(e.link)t.push(ne(e.text,e.link,e.badge));else{let s=[{span:e.text}];e.badge&&s.push(Le(e.badge)),n&&s.push({button:e.collapsed?"\u203A":"\u2039",type:"button",class:"dp-sidebar-toggle",ariaLabel:e.collapsed?"Expand":"Collapse",dataSidebarToggle:""}),t.push({div:s,class:"dp-sidebar-title"})}if(e.items){let s=[];for(let i of e.items)if(i.items){s.push({div:i.text,class:"dp-sidebar-subtitle"});for(let a of i.items)a.link&&s.push(ne(a.text,a.link,a.badge))}else i.link&&s.push(ne(i.text,i.link,i.badge));t.push({div:s,class:"dp-sidebar-items"})}let r=["dp-sidebar-group",n&&e.collapsed?"collapsed":""].filter(Boolean).join(" ");return{div:t,class:r}}function ht(e){return{nav:U(e.route,e.config).map(ft),class:"dp-sidebar",ariaLabel:"Documentation"}}function bt(e){if(e.frontmatter.aside===!1)return null;let[t,n]=e.config.themeConfig.outline?.level??[2,3],r=e.toc.filter(i=>i.level>=t&&i.level<=n);return r.length===0?null:{aside:[{div:e.config.themeConfig.tocTitle??"On this page",class:"dp-aside-title"},{nav:r.map(i=>({a:i.text,href:`#${i.slug}`,class:`dp-toc-${i.level}`})),class:"dp-toc"}],class:"dp-aside"}}function yt(e){let{prev:t,next:n}=ee(e.route,e.config);return!t&&!n?null:{nav:[t?{a:[{small:"Previous"},{span:t.text}],href:t.link,class:"prev"}:{span:""},n?{a:[{small:"Next"},{span:n.text}],href:n.link,class:"next"}:{span:""}],class:"dp-prevnext",ariaLabel:"Page navigation"}}function $t(e){let{editLink:t}=e.config.themeConfig,n=e.config.lastUpdated,r=t&&e.filePath,s=n&&e.lastUpdated;if(!r&&!s&&!e.readingTime)return null;let i=[];if(s){let l=new Date(e.lastUpdated).toLocaleDateString("en-US",{year:"numeric",month:"long",day:"numeric"});i.push({span:["Last updated: ",{time:l,dateTime:e.lastUpdated,class:"dp-last-updated-date"}],class:"dp-last-updated"})}if(e.readingTime&&i.push({span:`${e.readingTime} min read`,class:"dp-reading-time"}),r){let l=t.pattern.replace(/:path/g,e.filePath);i.push({a:t.text??"Edit this page",href:l,class:"dp-edit-link",target:"_blank",rel:"noopener noreferrer"})}return{div:i,class:"dp-doc-footer"}}function xt(e){let t=e.badge;if(!t)return null;let n=typeof t=="string"?t:t.text??"",r=typeof t=="object"?t.type??"tip":"tip";return n?{span:n,class:`dp-badge dp-badge-${r} dp-page-badge`}:null}function F(e,t,n){let r=e.config.themeConfig.slots?.[t];return r?r(e):n(e)}function re(e){let t=e.config.themeConfig.slots,n=e.frontmatter.sidebar!==!1,r=[],s=xt(e.frontmatter);s&&r.push({div:[s],class:"dp-page-badge-row"}),r.push({div:e.body,class:"dp-content"});let i=F(e,"prevNext",yt);i&&r.push(i);let a=F(e,"docFooter",$t);a&&r.push(a);let l=n?F(e,"sidebar",ht):null,c=[...l?[l]:[],{main:r,class:`dp-main${n?"":" dp-main-full"}`}],g=F(e,"aside",bt);g&&n&&c.push(g);let m=F(e,"header",Te),d=De(e.config),u=t?.footer?t.footer(e):{footer:e.config.themeConfig.footerMessage??"",class:"dp-footer"};return{div:[...d?[d]:[],...m?[m]:[],{div:c,class:"dp-shell"},...u?[u]:[]]}}function kt(e){let t=[];return e.name&&t.push({div:e.name,class:"dp-hero-name"}),e.text&&t.push({h1:e.text,class:"dp-hero-text"}),e.tagline&&t.push({p:e.tagline,class:"dp-hero-tagline"}),e.actions?.length&&t.push({div:e.actions.map(n=>({a:n.text,href:n.link,class:`dp-hero-action ${n.theme??"brand"}`})),class:"dp-hero-actions"}),{section:t,class:"dp-hero"}}function vt(e){return{div:e.map(t=>{let n=[];t.icon&&n.push({div:t.icon,class:"dp-feature-icon"}),n.push({div:t.title,class:"dp-feature-title"}),n.push({p:t.details,class:"dp-feature-details"});let r={div:n,class:"dp-feature"};return t.link?{a:[r],href:t.link,class:"dp-feature-link"}:r}),class:"dp-features"}}function ie(e){let t=[],n=e.frontmatter.hero,r=e.frontmatter.features;n&&t.push(kt(n)),r?.length&&t.push(vt(r)),t.push({div:e.body,class:"dp-content dp-home"});let s=De(e.config);return{div:[...s?[s]:[],Te(e),{main:t,class:"dp-main dp-main-home"},{footer:e.config.themeConfig.footerMessage??"",class:"dp-footer"}]}}import{readFileSync as wt}from"fs";import{dirname as _e,extname as St,isAbsolute as Et,resolve as Me}from"path";import{splitFrontmatter as Ct,tokensToDomphy as Dt}from"@domphy/markdown";import Tt from"markdown-it";import Lt from"markdown-it-container";import Mt from"markdown-it-mark";import jt from"markdown-it-sub";import _t from"markdown-it-sup";import It from"markdown-it-include";import je from"markdown-it-emoji";var zt=It,At=Mt,Rt=jt,Ft=_t,Pt=je.full??je,Nt=/^<<<\s+(\S+?)(?:\s+\[([^\]]*)\])?\s*$/gm,Ht={".ts":"ts",".tsx":"tsx",".js":"js",".jsx":"jsx",".mjs":"js",".cjs":"js",".json":"json",".css":"css",".html":"html",".vue":"vue",".md":"markdown",".sh":"bash",".bash":"bash",".yml":"yaml",".yaml":"yaml",".rb":"ruby",".py":"python",".go":"go",".rs":"rust"};function Ot(e,t,n){return e.startsWith("@/")?Me(_e(n),e.slice(2)):Et(e)?e:Me(t,e)}function Ut(e,t,n){return e.replace(Nt,(r,s,i)=>{let a=Ot(s,t,n),l="```",c;try{c=wt(a,"utf8")}catch{return[l,`Could not import: ${s}`,l].join(`
|
|
4
|
+
`)}let g=Ht[St(a).toLowerCase()]??"",m=i?`${g} [${i}]`:g;return[l+m,c.trimEnd(),l].join(`
|
|
5
|
+
`)})}function Bt(e){return e.replace(/<script\b[^>]*>[\s\S]*?<\/script>/gi,"").replace(/^\s*\n/,"")}var ce={tip:"TIP",warning:"WARNING",info:"INFO",danger:"DANGER",note:"NOTE",abstract:"ABSTRACT",success:"SUCCESS",question:"QUESTION",failure:"FAILURE",bug:"BUG",example:"EXAMPLE",quote:"QUOTE"};function se(e,t){return e.slice(e.indexOf(t)+t.length).trim()}function B(e,t,n,r,s,i){let a=new e(n,t,1);a.block=!0,s&&a.attrSet("class",s);let l=new e("inline","",0);l.content=i,l.children=[];let c=new e("text","",0);c.content=i,l.children.push(c);let g=new e(r,t,-1);return g.block=!0,[a,l,g]}function ae(e,t){let n=new e("html_block","",0);return n.content=t,n.block=!0,n}function Wt(e,t,n,r,s){let i=t[n];i.tag="div",i.attrSet("class","code-group");let a=t[r];a.tag="div";let l=[];for(let d=n+1;d<r;d++){let u=t[d];if(u.type!=="fence")continue;let b=(u.info??"").trim(),k=b.match(/\[([^\]]+)\]/),z=b.split(/\s+/,1)[0]??"";l.push({token:u,label:k?k[1]:z||"Code"})}if(l.length===0)return t.slice(n,r+1);let c=l.map((d,u)=>`<input type="radio" name="cg-${s}" id="cgt-${s}-${u}"${u===0?" checked":""}>`).join(""),g=l.map((d,u)=>`<label for="cgt-${s}-${u}">${R(d.label)}</label>`).join(""),m=[ae(e,`${c}<div class="tabs">${g}</div>`),ae(e,'<div class="blocks">')];return l.forEach(d=>{d.token.info=(d.token.info??"").replace(/\[[^\]]*\]/,"").trim(),m.push(d.token)}),m.push(ae(e,"</div>")),[i,...m,a]}function qt(e){if(e.length===0)return e;let t=e[0].constructor,n=[],r=0,s=Object.keys(ce).join("|"),i=new RegExp(`^container_(${s})_open$`),a=new RegExp(`^container_(${s})_close$`);for(let l=0;l<e.length;l++){let c=e[l],g=c.type.match(i);if(g){let m=g[1];c.tag="div",c.attrSet("class",`custom-block ${m}`);let d=se(c.info.trim(),m);n.push(c),n.push(...B(t,"p","paragraph_open","paragraph_close","custom-block-title",d||ce[m]||m.toUpperCase()));continue}if(a.test(c.type)){c.tag="div",n.push(c);continue}if(c.type==="container_details_open"){c.tag="details",c.attrSet("class","custom-block details"),n.push(c),n.push(...B(t,"summary","summary_open","summary_close",null,se(c.info.trim(),"details")||"Details"));continue}if(c.type==="container_details_close"){c.tag="details",n.push(c);continue}if(c.type==="container_steps_open"){c.tag="div",c.attrSet("class","custom-block steps"),n.push(c);continue}if(c.type==="container_steps_close"){c.tag="div",n.push(c);continue}if(c.type==="container_card-grid_open"){c.tag="div",c.attrSet("class","custom-block card-grid"),n.push(c);continue}if(c.type==="container_card-grid_close"){c.tag="div",n.push(c);continue}if(c.type==="container_card_open"){c.tag="div",c.attrSet("class","custom-block card");let m=se(c.info.trim(),"card");n.push(c),m&&n.push(...B(t,"p","paragraph_open","paragraph_close","card-title",m));continue}if(c.type==="container_card_close"){c.tag="div",n.push(c);continue}if(c.type==="container_link-card_open"){let m=c.info.trim().slice(9).trim(),d=m.match(/^\[([^\]]+)\]\(([^)]+)\)/),u=d?d[2]:"#",b=d?d[1]:m;c.tag="a",c.attrSet("class","custom-block link-card"),c.attrSet("href",u),n.push(c),b&&n.push(...B(t,"p","paragraph_open","paragraph_close","link-card-title",b));continue}if(c.type==="container_link-card_close"){c.tag="a",n.push(c);continue}if(c.type==="container_code-group_open"){let m=0,d=-1;for(let u=l;u<e.length;u++)if(e[u].type==="container_code-group_open")m++;else if(e[u].type==="container_code-group_close"&&(m--,m===0)){d=u;break}if(d===-1){n.push(c);continue}n.push(...Wt(t,e,l,d,r++)),l=d;continue}n.push(c)}return n}function Gt(e){if(e.length===0)return e;let t=e[0].constructor;for(let n=1;n<e.length;n++){let r=e[n];if(r.type!=="inline"||!r.children?.length)continue;let s=e[n-1];if(s?.type!=="list_item_open")continue;let i=r.children[0];if(i.type!=="text")continue;let a=i.content;if(!(a.startsWith("[ ] ")||a.startsWith("[x] ")||a.startsWith("[X] ")))continue;let c=a[1].toLowerCase()==="x";i.content=a.slice(4),r.content=r.content.replace(/^\[[ xX]\] /,""),s.attrSet("class",((s.attrGet("class")??"")+" task-list-item").trim());let g=new t("html_inline","",0);g.content=`<input type="checkbox"${c?" checked":""} disabled class="task-list-check" aria-label="${c?"done":"todo"}">`,r.children.unshift(g)}return e}function Kt(e,t){let n=new Tt({html:!0,linkify:!0,typographer:!1});n.enable(["strikethrough","table"]),n.use(zt,{root:e}),n.use(At),n.use(Rt),n.use(Ft),n.use(Pt);let r=()=>"",s=Object.keys(ce);for(let i of[...s,"details","code-group","steps","card","card-grid","link-card"])n.use(Lt,i,{render:r});return n.core.ruler.push("press_containers",i=>(i.tokens=qt(i.tokens),!0)),n.core.ruler.push("press_task_lists",i=>(i.tokens=Gt(i.tokens),!0)),n.core.ruler.push("press_fences",i=>{for(let a of i.tokens){if(a.type!=="fence")continue;let l=V(a.content,a.info??"",t);a.type="html_block",a.content=l,a.tag=""}return!0}),n.core.ruler.push("press_external_links",i=>{for(let a of i.tokens)if(!(a.type!=="inline"||!a.children))for(let l of a.children){if(l.type!=="link_open")continue;let c=l.attrGet("href")??"";(c.startsWith("http://")||c.startsWith("https://"))&&(l.attrSet("target","_blank"),l.attrSet("rel","noopener noreferrer"))}return!0}),n.core.ruler.push("press_image_lazy",i=>{for(let a of i.tokens)if(!(a.type!=="inline"||!a.children))for(let l of a.children)l.type==="image"&&l.attrSet("loading","lazy");return!0}),n}function Xt(e){let n=(e.split(/[\\/]/).pop()??e).replace(/\.md$/i,"");if(n.toLowerCase()==="index"){let r=e.split(/[\\/]/).filter(Boolean);return r[r.length-2]??n}return n}function Yt(e){return e.find(t=>t.level===1)?.text}function Ie(e){return e.map(t=>{if(!t||typeof t!="object"||Array.isArray(t))return t;let n=t,r=Object.keys(n).find(i=>/^h[1-6]$/.test(i));if(r&&typeof n.id=="string"){let i=n.id,a=Array.isArray(n[r])?[...n[r]]:n[r]!=null?[n[r]]:[];return a.push({a:"#",href:`#${i}`,class:"header-anchor",ariaHidden:"true"}),{...n,[r]:a}}let s=Object.keys(n).find(i=>/^[a-z][a-z0-9]*$/.test(i)&&i!=="style"&&i!=="class"&&!i.startsWith("data")&&!i.startsWith("on")&&!i.startsWith("aria")&&!i.startsWith("_")&&i!=="$"&&i!=="href"&&i!=="src"&&i!=="id"&&i!=="type"&&i!=="name");return s&&Array.isArray(n[s])?{...n,[s]:Ie(n[s])}:t})}async function le(e,t){let{filePath:n,docsDir:r,highlight:s}=t,i=_e(n),{frontmatter:a,content:l}=Ct(e),c=Bt(l),g=Ut(c,i,r),d=Kt(r,s).parse(g,{}),{body:u,toc:b}=Dt(d,{highlight:s}),k=Ie(u),K=(typeof a.title=="string"?a.title:void 0)??Yt(b)??Xt(n);return{frontmatter:a,body:k,toc:b,islands:[],title:K}}import{ElementNode as Jt,RecordState as Qt}from"@domphy/core";import{themeColor as ze,themeSpacing as j}from"@domphy/theme";import{card as Vt,inputSearch as Zt,link as en,menu as tn,small as nn}from"@domphy/ui";var on=3,rn=2,sn=1;function Re(e){let t=[];for(let n of e.toLowerCase().split(/[^\p{L}\p{N}]+/u))n.length>=2&&t.push(n);return t}function de(e,t,n,r){for(let s of Re(n)){let i=e.get(s);i||(i=new Map,e.set(s,i));let a=i.get(t);(a===void 0||r>a)&&i.set(t,r)}}function pe(e){let t=[],n=new Map;for(let s of e){let i=t.length;t.push({route:s.route,pageTitle:s.title,heading:s.title,slug:"",isPage:!0}),de(n,i,s.title,on),de(n,i,s.text,sn);for(let a of s.toc){let l=t.length;t.push({route:s.route,pageTitle:s.title,heading:a.text,slug:a.slug,isPage:!1}),de(n,l,a.text,rn)}}let r={};for(let[s,i]of Array.from(n.entries()).sort((a,l)=>a[0]<l[0]?-1:1))r[s]=Array.from(i.entries()).sort((a,l)=>a[0]-l[0]).map(([a,l])=>[a,l]);return JSON.stringify({entries:t,postings:r})}function Fe(e,t,n=10){let r=JSON.parse(e),s=Re(t);if(s.length===0)return[];let i=new Map,a=new Map;for(let c of s){let g=new Set;for(let m in r.postings){if(m!==c&&!m.startsWith(c))continue;let d=m===c;for(let[u,b]of r.postings[m]){let k=d?b:b*.5;i.set(u,(i.get(u)??0)+k),g.has(u)||(g.add(u),a.set(u,(a.get(u)??0)+1))}}}let l=[];for(let[c,g]of i){let m=r.entries[c],d=a.get(c)??0;l.push({route:m.route,pageTitle:m.pageTitle,heading:m.heading,slug:m.slug,isPage:m.isPage,score:d*100+g,href:m.slug?`${m.route}#${m.slug}`:m.route})}return l.sort((c,g)=>g.score!==c.score?g.score-c.score:c.route!==g.route?c.route<g.route?-1:1:c.isPage===g.isPage?0:c.isPage?-1:1),l.slice(0,n)}function Pe(e,t){return`dp-search-${e}-option-${t}`}var an=0;function cn(e,t,n,r){let s=Pe(n,t);return{a:[{div:e.isPage?e.pageTitle:e.heading},e.isPage?null:{small:e.pageTitle,$:[nn({color:"neutral"})]}],href:e.href,role:"option",id:s,ariaSelected:i=>r.get("active",i)===t||void 0,onClick:()=>{r.set("open",!1)},onMouseEnter:()=>{r.set("active",t)},$:[en({color:"neutral",accentColor:"primary"})],style:{display:"flex",flexDirection:"column",gap:j(1),paddingBlock:j(2),paddingInline:j(3),borderRadius:j(1),backgroundColor:i=>r.get("active",i)===t?ze(i,"shift-3","primary"):ze(i,"inherit","neutral")},_key:e.href}}function Ae(e,t){let n=e.get("index"),r=e.get("query"),s=n&&r.trim()?Fe(n,r,t):[];e.set("results",s),e.set("active",-1),e.set("open",s.length>0)}function Ne(e={}){let{indexUrl:t="/search-index.json",placeholder:n="Search docs\u2026",limit:r=10}=e,s=++an,i=`dp-search-${s}-listbox`,a=new Qt({index:null,query:"",results:[],open:!1,active:-1}),l=null;function c(d){d&&(a.set("open",!1),window.location.assign(d.href))}let g={input:null,type:"search",placeholder:n,autocomplete:"off",role:"combobox",ariaExpanded:d=>a.get("open",d)?"true":"false",ariaControls:i,ariaAutocomplete:"list",ariaActiveDescendant:d=>{let u=a.get("active",d);return u>=0?Pe(s,u):void 0},value:d=>a.get("query",d),onInput:d=>{a.set("query",d.target.value),l&&clearTimeout(l),l=setTimeout(()=>Ae(a,r),120)},onFocus:()=>{a.get("results").length>0&&a.set("open",!0)},onKeyDown:d=>{let u=a.get("results");if(d.key==="Escape"){a.set("open",!1),a.set("active",-1);return}if(d.key==="ArrowDown"){if(!u.length)return;d.preventDefault(),a.set("open",!0),a.set("active",(a.get("active")+1)%u.length);return}if(d.key==="ArrowUp"){if(!u.length)return;d.preventDefault(),a.set("active",(a.get("active")-1+u.length)%u.length);return}if(d.key==="Enter"){let b=a.get("active");c(b>=0?u[b]:u[0])}},$:[Zt({color:"neutral",accentColor:"primary"})],style:{width:"100%"}},m={div:d=>a.get("open",d)?a.get("results",d).map((u,b)=>cn(u,b,s,a)):[],id:i,role:"listbox",$:[tn({selectable:!1,color:"neutral"}),Vt({color:"neutral"})],style:{display:d=>a.get("open",d)?"block":"none",position:"absolute",insetInlineStart:0,insetInlineEnd:0,marginBlockStart:j(1),maxHeight:j(80),overflowY:"auto",zIndex:"50"}};return{div:[g,m],role:"search",style:{position:"relative",display:"block",width:"100%"},_onMount:d=>{fetch(t).then(k=>k.text()).then(k=>{a.set("index",k),a.get("query").trim()&&Ae(a,r)}).catch(()=>{});let u=d.domElement,b=k=>{u.contains(k.target)||a.set("open",!1)};document.addEventListener("pointerdown",b),d.setMetadata("dpSearchHandler",b)},_onRemove:d=>{let u=d.getMetadata("dpSearchHandler");u&&document.removeEventListener("pointerdown",u),l&&clearTimeout(l)}}}function ln(e,t={}){for(;e.firstChild;)e.removeChild(e.firstChild);let n=new Jt(Ne(t));return n.render(e),n}import{themeColor as dn,themeSpacing as pn}from"@domphy/theme";var h=(e,t)=>dn(null,e,t),o=e=>pn(e),v=h("inherit"),x=h("shift-1"),L=h("shift-2"),f=h("shift-3"),y=h("shift-6"),C=h("shift-9"),D=h("shift-11"),$=h("shift-9","primary"),gn=h("shift-10","primary"),_=o(14),He=o(62),un=o(56),ge=o(190);function ue(){return`
|
|
6
6
|
/* ------------------------------------------------------------------ reset */
|
|
7
7
|
*,*::before,*::after{box-sizing:border-box}
|
|
8
|
-
html{scroll-behavior:smooth;scroll-padding-top:calc(${
|
|
8
|
+
html{scroll-behavior:smooth;scroll-padding-top:calc(${_} + ${o(4)})}
|
|
9
9
|
body{margin:0;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Helvetica,Arial,sans-serif;background:${v};color:${C};line-height:1.6;font-size:16px}
|
|
10
10
|
a{color:${$};text-decoration:none}
|
|
11
11
|
a:hover{text-decoration:underline}
|
|
@@ -60,8 +60,8 @@ a:hover{text-decoration:underline}
|
|
|
60
60
|
.dp-icon-discord{-webkit-mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M20.317 4.37a19.791 19.791 0 0 0-4.885-1.515.074.074 0 0 0-.079.037c-.21.375-.444.864-.608 1.25a18.27 18.27 0 0 0-5.487 0 12.64 12.64 0 0 0-.617-1.25.077.077 0 0 0-.079-.037A19.736 19.736 0 0 0 3.677 4.37a.07.07 0 0 0-.032.027C.533 9.046-.32 13.58.099 18.057c.01.044.032.084.064.107a19.9 19.9 0 0 0 5.993 3.03.078.078 0 0 0 .084-.028 14.09 14.09 0 0 0 1.226-1.994.076.076 0 0 0-.041-.106 13.107 13.107 0 0 1-1.872-.892.077.077 0 0 1-.008-.128 10.2 10.2 0 0 0 .372-.292.074.074 0 0 1 .077-.01c3.928 1.793 8.18 1.793 12.062 0a.074.074 0 0 1 .078.01 10.2 10.2 0 0 0 .373.292.077.077 0 0 1-.006.127 12.299 12.299 0 0 1-1.873.892.077.077 0 0 0-.041.107c.36.698.772 1.362 1.225 1.993a.076.076 0 0 0 .084.028 19.839 19.839 0 0 0 6.002-3.03.077.077 0 0 0 .032-.054c.5-5.177-.838-9.674-3.549-13.66a.061.061 0 0 0-.031-.03z'/%3E%3C/svg%3E") center/contain no-repeat;mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M20.317 4.37a19.791 19.791 0 0 0-4.885-1.515.074.074 0 0 0-.079.037c-.21.375-.444.864-.608 1.25a18.27 18.27 0 0 0-5.487 0 12.64 12.64 0 0 0-.617-1.25.077.077 0 0 0-.079-.037A19.736 19.736 0 0 0 3.677 4.37a.07.07 0 0 0-.032.027C.533 9.046-.32 13.58.099 18.057c.01.044.032.084.064.107a19.9 19.9 0 0 0 5.993 3.03.078.078 0 0 0 .084-.028 14.09 14.09 0 0 0 1.226-1.994.076.076 0 0 0-.041-.106 13.107 13.107 0 0 1-1.872-.892.077.077 0 0 1-.008-.128 10.2 10.2 0 0 0 .372-.292.074.074 0 0 1 .077-.01c3.928 1.793 8.18 1.793 12.062 0a.074.074 0 0 1 .078.01 10.2 10.2 0 0 0 .373.292.077.077 0 0 1-.006.127 12.299 12.299 0 0 1-1.873.892.077.077 0 0 0-.041.107c.36.698.772 1.362 1.225 1.993a.076.076 0 0 0 .084.028 19.839 19.839 0 0 0 6.002-3.03.077.077 0 0 0 .032-.054c.5-5.177-.838-9.674-3.549-13.66a.061.061 0 0 0-.031-.03z'/%3E%3C/svg%3E") center/contain no-repeat}
|
|
61
61
|
|
|
62
62
|
/* ------------------------------------------------------------------ layout */
|
|
63
|
-
.dp-shell{display:grid;grid-template-columns:${
|
|
64
|
-
.dp-sidebar{position:sticky;top:${
|
|
63
|
+
.dp-shell{display:grid;grid-template-columns:${He} minmax(0,1fr) ${un};align-items:start;max-width:1440px;margin:0 auto}
|
|
64
|
+
.dp-sidebar{position:sticky;top:${_};max-height:calc(100vh - ${_});overflow-y:auto;padding:${o(6)} ${o(3)} ${o(12)} ${o(6)};border-right:1px solid ${f}}
|
|
65
65
|
.dp-sidebar-group{margin-bottom:${o(3.5)}}
|
|
66
66
|
.dp-sidebar-title{display:flex;align-items:center;gap:${o(1.5)};font-size:13px;font-weight:700;color:${D};margin:${o(2)} 0 ${o(1)}}
|
|
67
67
|
.dp-sidebar-subtitle{font-size:12px;color:${y};padding:${o(1)} ${o(3)};font-weight:600}
|
|
@@ -74,8 +74,9 @@ a:hover{text-decoration:underline}
|
|
|
74
74
|
.dp-sidebar a[aria-current="page"]{color:${$};font-weight:600;background:${x}}
|
|
75
75
|
.dp-sidebar-link-with-badge{display:flex;align-items:center}
|
|
76
76
|
.dp-main{padding:${o(8)} ${o(12)} ${o(20)};min-width:0}
|
|
77
|
-
.dp-
|
|
78
|
-
.dp-
|
|
77
|
+
.dp-main-full{grid-column:1 / -1;max-width:${ge};margin:0 auto}
|
|
78
|
+
.dp-content{max-width:${ge}}
|
|
79
|
+
.dp-aside{position:sticky;top:${_};max-height:calc(100vh - ${_});overflow-y:auto;padding:${o(8)} ${o(6)};font-size:13px}
|
|
79
80
|
.dp-aside-title{font-weight:700;margin-bottom:${o(2)};color:${C}}
|
|
80
81
|
.dp-toc a{display:block;padding:${o(.75)} 0;color:${y}}
|
|
81
82
|
.dp-toc a:hover{color:${$};text-decoration:none}
|
|
@@ -217,7 +218,7 @@ details.custom-block summary{cursor:pointer;font-weight:600}
|
|
|
217
218
|
.dp-hero-actions{display:flex;gap:${o(3)};justify-content:center;margin-top:${o(7)};flex-wrap:wrap}
|
|
218
219
|
.dp-hero-action{padding:${o(2.5)} ${o(5.5)};border-radius:${o(5.5)};font-weight:600;font-size:15px}
|
|
219
220
|
.dp-hero-action.brand{background:${$};color:${v}}
|
|
220
|
-
.dp-hero-action.brand:hover{background:${
|
|
221
|
+
.dp-hero-action.brand:hover{background:${gn};text-decoration:none}
|
|
221
222
|
.dp-hero-action.alt{background:${x};color:${C};border:1px solid ${f}}
|
|
222
223
|
.dp-hero-action.alt:hover{border-color:${$};text-decoration:none}
|
|
223
224
|
.dp-features{display:grid;grid-template-columns:repeat(auto-fit,minmax(${o(60)},1fr));gap:${o(4)};margin:${o(10)} 0}
|
|
@@ -228,30 +229,30 @@ details.custom-block summary{cursor:pointer;font-weight:600}
|
|
|
228
229
|
.dp-feature-link{display:block;color:inherit}
|
|
229
230
|
.dp-feature-link:hover{text-decoration:none}
|
|
230
231
|
.dp-feature-link:hover .dp-feature{border-color:${$}}
|
|
231
|
-
.dp-home{max-width:${
|
|
232
|
+
.dp-home{max-width:${ge};margin:0 auto}
|
|
232
233
|
|
|
233
234
|
/* ---------------------------------------------------------------- shiki dark */
|
|
234
235
|
html[data-theme="dark"] .shiki,html[data-theme="dark"] .shiki span{color:var(--shiki-dark,inherit) !important}
|
|
235
236
|
|
|
236
237
|
/* -------------------------------------------------------------- responsive */
|
|
237
238
|
@media(max-width:1200px){
|
|
238
|
-
.dp-shell{grid-template-columns:${
|
|
239
|
+
.dp-shell{grid-template-columns:${He} minmax(0,1fr)}
|
|
239
240
|
.dp-aside{display:none}
|
|
240
241
|
}
|
|
241
242
|
@media(max-width:860px){
|
|
242
243
|
.dp-shell{grid-template-columns:1fr}
|
|
243
244
|
.dp-menu-toggle{display:block}
|
|
244
|
-
.dp-sidebar{position:fixed;top:${
|
|
245
|
+
.dp-sidebar{position:fixed;top:${_};left:0;bottom:0;width:80%;max-width:${o(80)};background:${v};z-index:25;transform:translateX(-100%);transition:transform .2s ease;max-height:none}
|
|
245
246
|
html[data-sidebar="open"] .dp-sidebar{transform:translateX(0)}
|
|
246
247
|
.dp-nav{display:none}
|
|
247
248
|
.dp-main{padding:${o(6)} ${o(5)} ${o(16)}}
|
|
248
249
|
.dp-search-slot{width:${o(35)}}
|
|
249
250
|
}
|
|
250
|
-
`}var
|
|
251
|
+
`}var wn=Be(yn(import.meta.url));function q(e,t){if(e!=null){if(typeof e=="string"){e.trimStart().startsWith("<")||t.push(e);return}if(typeof e=="number"){t.push(String(e));return}if(Array.isArray(e)){for(let n of e)q(n,t);return}if(typeof e=="object")for(let[n,r]of Object.entries(e))n.startsWith("_")||n==="$"||n==="style"||n==="class"||n.startsWith("data")||n==="href"||n==="id"||q(r,t)}}function Sn(e){let t={};for(let n of e.split(";")){let r=n.indexOf(":");if(r===-1)continue;let s=n.slice(0,r).trim(),i=n.slice(r+1).trim();!s||!i||(t[s.replace(/-([a-z])/g,(a,l)=>l.toUpperCase())]=i)}return t}function fe(e){if(Array.isArray(e)){for(let n of e)fe(n);return}if(!e||typeof e!="object")return;let t=e;typeof t.style=="string"&&(t.style=Sn(t.style));for(let n of Object.values(t))n&&(typeof n=="object"||Array.isArray(n))&&fe(n)}function En(e){for(let t of e){if(!t||typeof t!="object"||Array.isArray(t))continue;let n=t;if("p"in n){let r=[];q(n.p,r);let s=r.join(" ").replace(/\s+/g," ").trim();if(s.length>10)return s.slice(0,160)}}return""}function Cn(e){return Math.max(1,Math.round(e.split(/\s+/).length/200))}function Dn(e){try{return $n(`git log -1 --format="%aI" -- "${e}"`,{encoding:"utf8",stdio:["pipe","pipe","ignore"],timeout:5e3}).trim()||void 0}catch{return}}async function Tn(e,t){if(!t)return;let n=I(wn,"islands.js"),r=`import{bootstrap}from${JSON.stringify(n)};bootstrap({search:{kind:"search",id:"search"}});`,s=I(e,"_press_islands_entry.js");me(e,{recursive:!0}),W(s,r,"utf8");let{build:i}=await import("esbuild");await i({entryPoints:{"press-islands":s},bundle:!0,splitting:!1,format:"esm",outdir:I(e,"assets"),entryNames:"[name]",minify:!0,sourcemap:!1,target:"es2020",define:{"process.env.NODE_ENV":'"production"'},logLevel:"error"}),Ue(s)}function Ln(e,t){return`<?xml version="1.0" encoding="UTF-8"?>
|
|
251
252
|
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
|
|
252
253
|
${e.map(r=>` <url><loc>${r==="/"?`${t}/`:`${t}${r}`.replace(/\/+$/,"")+"/"}</loc></url>`).join(`
|
|
253
254
|
`)}
|
|
254
|
-
</urlset>`}var
|
|
255
|
+
</urlset>`}var Mn=`(function(){
|
|
255
256
|
try{var t=localStorage.getItem('dp-theme');if(t)document.documentElement.setAttribute('data-theme',t);}catch(_){}
|
|
256
257
|
addEventListener('click',function(e){
|
|
257
258
|
var el=e.target.closest&&e.target.closest('[data-theme-toggle]');
|
|
@@ -268,8 +269,8 @@ addEventListener('click',function(e){
|
|
|
268
269
|
addEventListener('DOMContentLoaded',function(){
|
|
269
270
|
try{document.querySelectorAll('.dp-announcement[data-id]').forEach(function(b){if(localStorage.getItem('dp-dismiss-'+b.getAttribute('data-id')))b.remove();});}catch(_){}
|
|
270
271
|
});
|
|
271
|
-
})();`;function
|
|
272
|
-
<script type="module" src="${t.base}assets/press-islands.js"></script>`:"",l=t.themeConfig.mermaid?
|
|
272
|
+
})();`;function jn(e){return`<script type="module">import mermaid from '${typeof e=="object"&&e.cdn?e.cdn:"https://cdn.jsdelivr.net/npm/mermaid@11/dist/mermaid.esm.min.mjs"}';mermaid.initialize({startOnLoad:false,theme:document.documentElement.getAttribute('data-theme')==='dark'?'dark':'default'});document.addEventListener('DOMContentLoaded',()=>mermaid.run({querySelector:'.dp-mermaid'}));</script>`}function _n(e,t,n,r,s,i){let a=n?`
|
|
273
|
+
<script type="module" src="${t.base}assets/press-islands.js"></script>`:"",l=t.themeConfig.mermaid?jn(t.themeConfig.mermaid):"";return`<!DOCTYPE html>
|
|
273
274
|
<html lang="${i}">
|
|
274
275
|
<head>
|
|
275
276
|
<meta charset="utf-8">
|
|
@@ -282,15 +283,15 @@ ${s.join(`
|
|
|
282
283
|
${l}
|
|
283
284
|
<style>${r}</style>
|
|
284
285
|
<style id="domphy-style">${e.css}</style>
|
|
285
|
-
<script>${
|
|
286
|
+
<script>${Mn}</script>
|
|
286
287
|
</head>
|
|
287
288
|
<body>
|
|
288
289
|
<div id="domphy-app">${e.html}</div>${a}
|
|
289
290
|
</body>
|
|
290
|
-
</html>`}async function
|
|
291
|
-
${
|
|
291
|
+
</html>`}async function In(e){let{config:t,srcDir:n,outDir:r,publicDir:s}=e,i=t.themeConfig.search!==!1,a=!!t.lastUpdated,c=O(n).map(p=>({...p,localeKey:"/"}));if(t.locales)for(let[p,w]of Object.entries(t.locales)){if(p==="/")continue;let S=bn(n,p.replace(/^\//,"").replace(/\/$/,""));if(Oe(S))for(let E of O(S)){let T=p.replace(/\/$/,"");c.push({filePath:E.filePath,route:T+E.route,outFile:E.outFile==="index.html"?p.replace(/^\//,"")+"index.html":p.replace(/^\//,"")+E.outFile,localeKey:p})}}console.log(`Discovered ${c.length} pages.`);let g=await Q(),m=vn()+ue(),d=[],u=[];for(let p of c){let w=fn(p.filePath,"utf8"),S=await le(w,{filePath:p.filePath,docsDir:n,repoRoot:n,highlight:g});if(S.frontmatter.draft===!0){console.log(` \u21B7 ${p.route} (draft, skipped)`);continue}fe(S.body);let E=[];q(S.body,E);let T=E.join(" ").replace(/\s+/g," ").trim(),M=Cn(T),X=a?Dn(p.filePath):void 0,A=hn(n,p.filePath).replace(/\\/g,"/");d.push({route:p.route,outFile:p.outFile,title:S.title,localeKey:p.localeKey,doc:S,lastUpdated:X,readingTime:M,filePath:p.filePath,relPath:A}),u.push({route:p.route,title:S.title,text:T.slice(0,2e4),toc:S.toc})}let b=new Map,k=new Map,z=kn(d.map(p=>{let w=t.locales?.[p.localeKey],S=w?.themeConfig?{...t.themeConfig,...w.themeConfig}:t.themeConfig,E={...t,themeConfig:S},T=w?.lang??"en",M={route:p.route,title:p.title,body:p.doc.body,toc:p.doc.toc,frontmatter:p.doc.frontmatter,config:E,lastUpdated:p.lastUpdated,readingTime:p.readingTime,filePath:p.relPath},X=p.route==="/"||p.localeKey!=="/"&&p.route===p.localeKey,A=typeof p.doc.frontmatter.description=="string"?p.doc.frontmatter.description:En(p.doc.body)||t.description,H=w?.title??t.title,Y=p.title===H?H:`${p.title} | ${H}`,Ke=p.route==="/"?`${t.hostname}/`:`${t.hostname}${p.route}/`,Xe=Array.isArray(p.doc.frontmatter.head)?p.doc.frontmatter.head.filter(Ye=>typeof Ye=="string"):[];return b.set(p.route,Xe),k.set(p.route,T),{path:p.route,metadata:{title:Y,description:A,metadataBase:t.hostname,openGraph:{title:Y,description:A,url:p.route==="/"?"/":`${p.route}/`,siteName:H,type:"website"},twitter:{card:"summary",title:Y,description:A},alternates:{canonical:Ke}},page:()=>X?ie(M):re(M)}})),K=xn(z);Ue(r,{recursive:!0,force:!0}),me(r,{recursive:!0});let N=[],ye=0;for(let p of d)try{let w=await K.renderToString(p.route),S=b.get(p.route)??[],E=k.get(p.route)??"en",T=_n(w,t,i,m,S,E),M=I(r,p.outFile);me(Be(M),{recursive:!0}),W(M,T,"utf8"),ye+=T.length,w.status!==200&&console.warn(` ! ${p.route} -> status ${w.status}`)}catch(w){N.push({route:p.route,error:String(w.message||w)})}if(N.length>0){console.warn(`
|
|
292
|
+
${N.length} page(s) failed:`);for(let p of N)console.warn(` \u2717 ${p.route}: ${p.error}`)}await Tn(r,i),W(I(r,"search-index.json"),pe(u),"utf8"),s&&Oe(s)&&mn(s,r,{recursive:!0}),t.hostname&&W(I(r,"sitemap.xml"),Ln(d.map(p=>p.route),t.hostname),"utf8"),console.log(`Built ${d.length} pages (${(ye/1024).toFixed(0)} KB) \u2192 ${r}`)}import{createReadStream as G,existsSync as he,readFileSync as zn,statSync as An}from"fs";import{createServer as We}from"http";import{extname as be,join as P,normalize as Rn}from"path";var qe={".html":"text/html; charset=utf-8",".js":"text/javascript; charset=utf-8",".mjs":"text/javascript; charset=utf-8",".css":"text/css; charset=utf-8",".json":"application/json; charset=utf-8",".svg":"image/svg+xml",".png":"image/png",".jpg":"image/jpeg",".jpeg":"image/jpeg",".webp":"image/webp",".gif":"image/gif",".ico":"image/x-icon",".woff":"font/woff",".woff2":"font/woff2",".ttf":"font/ttf",".txt":"text/plain; charset=utf-8",".map":"application/json; charset=utf-8",".xml":"application/xml; charset=utf-8"},Fn="<script>(function(){var es=new EventSource('/_dev/sse');es.onmessage=function(e){if(e.data==='reload')location.reload();};es.onerror=function(){setTimeout(function(){location.reload();},2000);};})();</script>";function Ge(e,t){let n=Rn(decodeURIComponent(t.split("?")[0])).replace(/^(\.\.[/\\])+/,""),r=be(n)?[P(e,n)]:[P(e,n,"index.html"),P(e,`${n}.html`)];for(let s of r)if(he(s)&&An(s).isFile())return s;return null}function Pn(e,t){let n=We((r,s)=>{let i=Ge(e,r.url??"/");if(!i){let a=P(e,"404.html");s.statusCode=404,s.setHeader("content-type","text/html; charset=utf-8"),he(a)?G(a).pipe(s):s.end("404 Not Found");return}s.statusCode=200,s.setHeader("content-type",qe[be(i)]??"application/octet-stream"),G(i).pipe(s)});return n.listen(t,()=>console.log(`DomphyPress preview: http://localhost:${t}/`)),n}function Nn(e,t){let n=new Set,r=We((s,i)=>{let a=s.url??"/";if(a==="/_dev/sse"){i.writeHead(200,{"Content-Type":"text/event-stream","Cache-Control":"no-cache",Connection:"keep-alive"}),i.write(`data: connected
|
|
292
293
|
|
|
293
|
-
`),n.add(i),s.on("close",()=>n.delete(i));return}let l=
|
|
294
|
+
`),n.add(i),s.on("close",()=>n.delete(i));return}let l=Ge(e,a);if(!l){i.statusCode=404,i.setHeader("content-type","text/html; charset=utf-8");let g=P(e,"404.html");he(g)?G(g).pipe(i):i.end("404 Not Found");return}let c=qe[be(l)]??"application/octet-stream";if(i.statusCode=200,i.setHeader("content-type",c),c.startsWith("text/html")){let g=zn(l,"utf8");i.end(g.replace("</body>",`${Fn}</body>`))}else G(l).pipe(i)});return r.listen(t,()=>console.log(`DomphyPress dev: http://localhost:${t}/ (live reload active)`)),{server:r,notify:()=>{for(let s of n)try{s.write(`data: reload
|
|
294
295
|
|
|
295
|
-
`)}catch{n.delete(s)}}}}export{
|
|
296
|
+
`)}catch{n.delete(s)}}}}export{pe as buildSearchIndex,In as buildSite,Q as createHighlighter,Je as defineConfig,O as discoverPages,Z as flattenSidebar,ie as homeShell,ln as mountSearch,Se as outFileForRoute,re as pageShell,ve as parseFenceInfo,ue as pressCSS,ee as prevNextForRoute,Fe as queryIndex,le as renderDoc,V as renderFence,we as routeForFile,Ne as searchWidget,U as sidebarForRoute,Nn as startDevServer,Pn as startServer};
|
|
296
297
|
//# sourceMappingURL=index.js.map
|