@stacksjs/bunpress 0.1.21 → 0.2.1
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/bin/cli.d.ts +3 -0
- package/dist/bin/cli.js +1 -1
- package/dist/bin/commands/doctor.d.ts +1 -0
- package/dist/bin/commands/seo.d.ts +19 -0
- package/dist/{chunk-qrp18ybj.js → chunk-desvs9bx.js} +1 -1
- package/dist/chunk-em1tv2bw.js +38 -0
- package/dist/{chunk-kxr6zf7e.js → chunk-kfbpnqaw.js} +1308 -696
- package/dist/chunk-qqn901qf.js +393 -0
- package/dist/{chunk-qdmkac4z.js → chunk-qzhr4d2q.js} +10 -11
- package/dist/chunk-y3z183hg.js +10 -0
- package/dist/chunk-yfwm5337.js +2 -0
- package/dist/{chunk-m0g9vk1e.js → chunk-zkdm5pr7.js} +401 -194
- package/dist/src/build-manifest.d.ts +22 -0
- package/dist/src/config.d.ts +12 -0
- package/dist/src/data-loader.d.ts +6 -3
- package/dist/src/highlighter.d.ts +2 -1
- package/dist/src/i18n.d.ts +67 -0
- package/dist/src/index.d.ts +2 -0
- package/dist/src/index.js +1 -1
- package/dist/src/markdown-fences.d.ts +37 -0
- package/dist/src/page-meta.d.ts +19 -0
- package/dist/src/search-index.d.ts +61 -0
- package/dist/src/serve.d.ts +20 -5
- package/dist/src/toc.d.ts +20 -2
- package/dist/src/types.d.ts +80 -8
- package/dist/templates/blocks/alerts/caution.stx +2 -2
- package/dist/templates/blocks/alerts/important.stx +2 -2
- package/dist/templates/blocks/alerts/note.stx +2 -2
- package/dist/templates/blocks/alerts/tip.stx +2 -2
- package/dist/templates/blocks/alerts/warning.stx +2 -2
- package/dist/templates/blocks/containers/danger.stx +2 -2
- package/dist/templates/blocks/containers/details.stx +2 -2
- package/dist/templates/blocks/containers/info.stx +2 -2
- package/dist/templates/blocks/containers/raw.stx +1 -1
- package/dist/templates/blocks/containers/tip.stx +2 -2
- package/dist/templates/blocks/containers/warning.stx +2 -2
- package/dist/templates/copy-page.stx +81 -0
- package/dist/templates/doc-footer.stx +51 -0
- package/dist/templates/footer.stx +45 -0
- package/dist/templates/hero.stx +9 -2
- package/dist/templates/layout-doc.stx +8 -125
- package/dist/templates/layout-home.stx +7 -14
- package/dist/templates/layout-page.stx +7 -14
- package/dist/templates/locale-switcher.stx +115 -0
- package/dist/templates/navbar.stx +49 -0
- package/dist/templates/page-outline.stx +149 -0
- package/dist/templates/page-toc.stx +1 -1
- package/dist/templates/search-algolia.stx +85 -0
- package/dist/templates/search.stx +661 -0
- package/dist/templates/sidebar-section.stx +44 -11
- package/dist/templates/sidebar.stx +11 -2
- package/dist/themes/vitepress/index.ts +558 -165
- package/package.json +16 -7
- package/dist/chunk-9cm3e4r4.js +0 -688
- package/dist/chunk-mjhqecp5.js +0 -467
- package/dist/chunk-wmvgjzgh.js +0 -3
- package/dist/chunk-zmxtnx2v.js +0 -8
|
@@ -1,31 +1,32 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{
|
|
3
|
-
`).map((
|
|
4
|
-
`);try{let J
|
|
5
|
-
`);return(await Promise.all(
|
|
6
|
-
`)}catch(
|
|
7
|
-
`).map((q)=>`<span class="line">${
|
|
8
|
-
`)}}function
|
|
2
|
+
import{A as EQ,C as y,F as $J,G as TQ,H as DQ,I as PJ,J as yJ,L as LQ,M as HQ,N as PQ,P as yQ,Y as YJ,Z as SQ,_ as kQ}from"./chunk-zkdm5pr7.js";import{$ as l,aa as LJ,ba as HJ,ca as RQ,da as AQ,ea as MQ,fa as FQ,ga as DJ,ha as wQ,ia as IQ}from"./chunk-em1tv2bw.js";var{Glob:GQ,YAML:jQ}=globalThis.Bun;import{stat as OQ}from"fs/promises";import{join as XJ}from"path";import s from"process";var{Glob:dQ}=globalThis.Bun;import{join as pJ,resolve as cQ}from"path";import lQ from"process";var t=new Map;function sQ(J,Z,Q){let Y=Z.split("."),$=J;for(let X=0;X<Y.length-1;X++){let q=Y[X];if(typeof $[q]!=="object"||$[q]===null)$[q]={};$=$[q]}$[Y[Y.length-1]]=Q}async function fJ(J,Z){let Q=Z?cQ(lQ.cwd(),Z):pJ(J,".data");if(t.has(Q))return t.get(Q);let Y={};try{let $=new dQ("**/*.json");for await(let X of $.scan({cwd:Q,absolute:!1}))try{let q=await Bun.file(pJ(Q,X)).text(),W=X.replace(/\.json$/,"").replace(/[/\\]/g,".");sQ(Y,W,JSON.parse(q))}catch{}}catch{}return t.set(Q,Y),Y}function uJ(){t.clear()}import{createHighlighter as iQ,highlight as rQ,listLanguages as oQ}from"ts-syntax-highlighter";var m=null;function E0(){m=null}async function gJ(){if(m)return m;return m=await iQ({theme:"github-light",cache:!0}),m}var NJ=null;function hJ(){if(NJ)return NJ;let J=new Map;try{for(let Z of oQ()){J.set(Z.id.toLowerCase(),Z.id);for(let Q of Z.aliases??[])J.set(Q.toLowerCase(),Z.id)}}catch{}return NJ=J,J}function mJ(J){let Z=J.toLowerCase().trim();return hJ().get(Z)??Z}function dJ(J){return hJ().has(J.toLowerCase().trim())}function e(J){return J.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function aQ(J,Z){let Q=/<span[^>]*class="token[^"]*"[^>]*>([^<]*)<\/span>/g,Y=[],$;while(($=Q.exec(Z))!==null){let W=$[1].replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,'"').replace(/�*39;/g,"'");if(W)Y.push({text:W,span:$[0]})}if(Y.length===0)return Z;let X="",q=0;for(let W=0;W<Y.length;W++){let{text:z,span:K}=Y[W],V=J.indexOf(z,q);if(V===-1){X+=K;continue}if(V>q){let _=J.substring(q,V);if(/^\s+$/.test(_))X+=_}X+=K,q=V+z.length}return X}async function BJ(J,Z,Q="github-light"){let Y=mJ(Z);if(!dJ(Y))return J.split(`
|
|
3
|
+
`).map((X)=>`<span class="line">${e(X)}</span>`).join(`
|
|
4
|
+
`);try{let $=J.split(`
|
|
5
|
+
`);return(await Promise.all($.map(async(q)=>{if(!q.trim())return`<span class="line">${q}</span>`;let z=(await rQ(q,Y,{theme:Q})).html;if(z=z.replace(/<div[^>]*class="syntax-wrapper"[^>]*>/g,""),z=z.replace(/<\/div>\s*$/g,""),z=z.replace(/<pre[^>]*>/g,""),z=z.replace(/<\/pre>/g,""),z=z.replace(/<code[^>]*>/g,""),z=z.replace(/<\/code>/g,""),z=aQ(q,z.trim()),!z.startsWith('<span class="line">'))z=`<span class="line">${z}</span>`;return z}))).join(`
|
|
6
|
+
`)}catch($){return console.warn(`Failed to highlight code for language "${Z}":`,$),J.split(`
|
|
7
|
+
`).map((q)=>`<span class="line">${e(q)}</span>`).join(`
|
|
8
|
+
`)}}function R0(J,Z){let Q=mJ(Z);if(!dJ(Q))return e(J);return e(J)}function cJ(){return`
|
|
9
9
|
/* Basic syntax highlighting styles for ts-syntax-highlighter */
|
|
10
10
|
/* The actual theme colors are injected by ts-syntax-highlighter */
|
|
11
11
|
|
|
12
|
-
/*
|
|
13
|
-
pre
|
|
12
|
+
/* Fallback presentation for code blocks that are NOT rendered by a BunPress
|
|
13
|
+
* theme (a theme owns \`pre[data-lang]\` / \`[class*='language-']\` and styles
|
|
14
|
+
* them itself). Scoping keeps this sheet from fighting the theme. */
|
|
15
|
+
pre:not([data-lang]):not([class*='language-']) {
|
|
14
16
|
overflow-x: auto;
|
|
15
17
|
padding: 1rem;
|
|
16
18
|
border-radius: 0.5rem;
|
|
17
19
|
background: #f6f8fa;
|
|
18
20
|
color: #24292f;
|
|
19
|
-
white-space: pre-wrap; /* Preserve whitespace and allow wrapping */
|
|
20
|
-
word-wrap: break-word;
|
|
21
21
|
}
|
|
22
22
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
23
|
+
/* Code is scrolled, never wrapped: wrapping mid-token destroys indentation
|
|
24
|
+
* and makes line highlighting/diff markers line up with the wrong rows. */
|
|
25
|
+
pre code {
|
|
26
|
+
font-family: var(--bp-font-family-mono, 'Consolas', 'Monaco', 'Courier New', monospace);
|
|
27
|
+
line-height: 1.6;
|
|
27
28
|
color: inherit;
|
|
28
|
-
white-space:
|
|
29
|
+
white-space: pre;
|
|
29
30
|
}
|
|
30
31
|
|
|
31
32
|
/* Token spans inherit color from parent or use their inline styles */
|
|
@@ -39,9 +40,10 @@ code {
|
|
|
39
40
|
color: inherit;
|
|
40
41
|
}
|
|
41
42
|
|
|
42
|
-
/* Dark theme support
|
|
43
|
+
/* Dark theme support. Gated on html.dark so an explicit light choice (or a
|
|
44
|
+
* site with darkMode: 'light') is never overridden by the OS preference. */
|
|
43
45
|
@media (prefers-color-scheme: dark) {
|
|
44
|
-
pre {
|
|
46
|
+
html.dark pre:not([data-lang]):not([class*='language-']) {
|
|
45
47
|
background: #0d1117;
|
|
46
48
|
color: #e6edf3;
|
|
47
49
|
}
|
|
@@ -51,16 +53,31 @@ code {
|
|
|
51
53
|
}
|
|
52
54
|
}
|
|
53
55
|
|
|
54
|
-
/* Line highlighting
|
|
56
|
+
/* Line highlighting
|
|
57
|
+
* -------------------------------------------------------------------------
|
|
58
|
+
* Lines are emitted as \`<span class="line">\u2026</span>\\n\` so that the code
|
|
59
|
+
* element's textContent still round-trips to real source (the copy button
|
|
60
|
+
* relies on it). The trailing newline is what breaks the line under
|
|
61
|
+
* \`white-space: pre\` \u2014 so .line MUST stay inline, otherwise every row
|
|
62
|
+
* renders followed by an empty one. Rows that need a full-width background
|
|
63
|
+
* opt into inline-block instead. */
|
|
55
64
|
.line {
|
|
56
|
-
display:
|
|
65
|
+
display: inline;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
.line.highlighted,
|
|
69
|
+
.line.diff-add,
|
|
70
|
+
.line.diff-remove,
|
|
71
|
+
.line.has-error,
|
|
72
|
+
.line.has-warning {
|
|
73
|
+
display: inline-block;
|
|
74
|
+
min-width: 100%;
|
|
57
75
|
}
|
|
58
76
|
|
|
59
77
|
.line.highlighted {
|
|
60
78
|
background-color: rgba(255, 255, 0, 0.1);
|
|
61
|
-
border
|
|
62
|
-
|
|
63
|
-
margin-left: -0.5rem;
|
|
79
|
+
/* Inset shadow instead of a border so the gutter accent never shifts code. */
|
|
80
|
+
box-shadow: inset 3px 0 #fbbf24;
|
|
64
81
|
}
|
|
65
82
|
|
|
66
83
|
/* Focus mode */
|
|
@@ -76,24 +93,24 @@ code {
|
|
|
76
93
|
/* Diff highlighting */
|
|
77
94
|
.line.diff-add {
|
|
78
95
|
background-color: rgba(16, 185, 129, 0.1);
|
|
79
|
-
|
|
96
|
+
box-shadow: inset 3px 0 #10b981;
|
|
80
97
|
}
|
|
81
98
|
|
|
82
99
|
.line.diff-remove {
|
|
83
100
|
background-color: rgba(239, 68, 68, 0.1);
|
|
84
|
-
|
|
101
|
+
box-shadow: inset 3px 0 #ef4444;
|
|
85
102
|
text-decoration: line-through;
|
|
86
103
|
}
|
|
87
104
|
|
|
88
105
|
/* Error and warning indicators */
|
|
89
106
|
.line.has-error {
|
|
90
107
|
background-color: rgba(239, 68, 68, 0.05);
|
|
91
|
-
|
|
108
|
+
box-shadow: inset 3px 0 #ef4444;
|
|
92
109
|
}
|
|
93
110
|
|
|
94
111
|
.line.has-warning {
|
|
95
112
|
background-color: rgba(245, 158, 11, 0.05);
|
|
96
|
-
|
|
113
|
+
box-shadow: inset 3px 0 #f59e0b;
|
|
97
114
|
}
|
|
98
115
|
|
|
99
116
|
/* Line numbers */
|
|
@@ -115,7 +132,8 @@ code {
|
|
|
115
132
|
color: #9ca3af;
|
|
116
133
|
}
|
|
117
134
|
}
|
|
118
|
-
`}async function
|
|
135
|
+
`}async function A0(){await gJ()}async function M0(){return gJ()}import{stat as nQ}from"fs/promises";import{relative as lJ,resolve as c}from"path";import tQ from"process";var d=new Map;async function eQ(J){let Z=c(J);if(d.has(Z))return d.get(Z);try{let Q=Bun.spawn(["git","log","--pretty=format:%cI","--name-only","--relative","--no-merges","--","."],{cwd:Z,stdout:"pipe",stderr:"ignore"}),[Y,$]=await Promise.all([Q.exited,new Response(Q.stdout).text()]);if(Y!==0)return d.set(Z,null),null;let X=new Map,q="";for(let W of $.split(`
|
|
136
|
+
`)){if(!W.trim())continue;if(/^\d{4}-\d{2}-\d{2}T/.test(W)){q=W.trim();continue}if(q&&!X.has(W))X.set(W,q)}return d.set(Z,X),X}catch{return d.set(Z,null),null}}async function sJ(J,Z){let Q=await eQ(J);if(Q){let Y=lJ(c(J),c(Z)).replace(/\\/g,"/"),$=Q.get(Y);if($)return $}try{return(await nQ(Z)).mtime.toISOString()}catch{return null}}function iJ(J,Z,Q){let Y=lJ(c(tQ.cwd(),Z),c(Q)).replace(/\\/g,"/");return J.includes(":path")?J.replace(":path",Y):`${J.replace(/\/$/,"")}/${Y}`}function rJ(J,Z,Q){let Y=new Date(J);if(Number.isNaN(Y.getTime()))return"";try{return new Intl.DateTimeFormat(Z,Q??{dateStyle:"medium"}).format(Y)}catch{return Y.toISOString().slice(0,10)}}import{join as EJ}from"path";var JJ=new Map,oJ="\x00BPCODE",aJ="\x00";async function JZ(J,Z){let Q=EJ(J,Z);if(JJ.has(Q))return JJ.get(Q);let Y=[EJ(J,`${Z}.stx`),EJ(J,Z,"index.stx")],$=null;for(let X of Y){let q=Bun.file(X);if(await q.exists()){$=await q.text();break}}return JJ.set(Q,$),$}function nJ(){JJ.clear()}function QZ(J,Z){try{let Q=Object.keys(Z),Y=Q.map(($)=>Z[$]);return Function(...Q,`"use strict"; return (${J});`)(...Y)}catch{return}}function ZZ(J,Z){let Q={};if(!J)return Q;let Y=/([:@]?[\w-]+)(?:=(?:"([^"]*)"|'([^']*)'|\{([^}]*)\}))?/g,$;while($=Y.exec(J)){let X=$[1];if(!X)continue;let q=X.startsWith(":"),W=X.replace(/^[:@]/,""),z=$[2],K=$[3],V=$[4],_=z??K??V;if(_===void 0)Q[W]=!0;else if(q||V!==void 0)Q[W]=QZ(_,Z);else Q[W]=_}return Q}async function RJ(J,Z,Q,Y=0){if(Y>10||!J.includes("<"))return J;let $=[],X=J.replace(/```[\s\S]*?```/g,(_)=>{return $.push(_),`${oJ}${$.length-1}${aJ}`}).replace(/`[^`\n]*`/g,(_)=>{return $.push(_),`${oJ}${$.length-1}${aJ}`}),q=/<([A-Z][A-Za-z0-9]*)((?:\s[^>]*?)?)(\/?)>/g,W="",z=0,K=!1,V;while(V=q.exec(X)){let _=V[0],G=V[1],E=V[2],B=V[3],j=await JZ(Z,G);if(j==null)continue;K=!0,W+=X.slice(z,V.index);let U="",O=V.index+_.length;if(!B){let R=new RegExp(`</${G}>`,"g");R.lastIndex=O;let A=R.exec(X);if(A)U=X.slice(O,A.index).trim(),O=A.index+A[0].length}let N=ZZ(E.trim(),Q),M;try{let{renderString:R}=await import("@stacksjs/stx/render");M=await R(j,{...Q,...N,slot:U},{injectCSS:!1,templateOnly:!0})}catch(R){let A=R instanceof Error?R.message:String(R);throw Error(`Failed to render BunPress component ${G}: ${A}`,{cause:R})}W+=M,z=O,q.lastIndex=O}if(W+=X.slice(z),W=W.replace(/\u0000BPCODE(\d+)\u0000/g,(_,G)=>$[Number(G)]??""),K)return RJ(W,Z,Q,Y+1);return W}import{join as JQ}from"path";var $Z=JQ(import.meta.dir,"templates"),QJ=new Map;async function YZ(J){if(QJ.has(J))return QJ.get(J);let Z=JQ($Z,`${J}.stx`),Q=Bun.file(Z);if(!await Q.exists())throw Error(`Template not found: ${J}`);let Y=await Q.text();return QJ.set(J,Y),Y}async function T(J,Z){let Q=await YZ(J);return XZ(Q,Z)}function QQ(){QJ.clear()}function XZ(J,Z){return J.replace(/\{!!\s*([\w.]+)\s*!!\}|\{\{\s*([\w.]+)\s*\}\}/g,(Q,Y,$)=>{if(Y!==void 0)return eJ(tJ(Z,Y));return qZ(eJ(tJ(Z,$)))})}function tJ(J,Z){return Z.split(".").reduce((Q,Y)=>{if(Q==null||typeof Q!=="object")return;return Q[Y]},J)}function eJ(J){if(J==null)return"";return String(J)}function qZ(J){return J.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}var ZQ=`/**
|
|
119
137
|
* VitePress Theme for BunPress - Layout & Chrome
|
|
120
138
|
* -------------------------------------------------------------------------- */
|
|
121
139
|
|
|
@@ -164,9 +182,15 @@ code {
|
|
|
164
182
|
}
|
|
165
183
|
|
|
166
184
|
.BPNavBarTitle {
|
|
167
|
-
|
|
168
|
-
|
|
185
|
+
/* block (not inline-flex) so text-overflow applies: a long site title must
|
|
186
|
+
* yield instead of sliding underneath the icons on the right. min-width:0
|
|
187
|
+
* lets the flex item actually shrink below its content width. */
|
|
188
|
+
display: block;
|
|
189
|
+
min-width: 0;
|
|
190
|
+
overflow: hidden;
|
|
191
|
+
text-overflow: ellipsis;
|
|
169
192
|
font-size: 16px;
|
|
193
|
+
line-height: 1.5;
|
|
170
194
|
font-weight: 750;
|
|
171
195
|
color: var(--bp-c-text-1);
|
|
172
196
|
white-space: nowrap;
|
|
@@ -267,60 +291,68 @@ code {
|
|
|
267
291
|
background-color: var(--bp-c-bg-soft);
|
|
268
292
|
}
|
|
269
293
|
|
|
270
|
-
/* Search
|
|
294
|
+
/* Search trigger. A button that looks like a field: the real input lives in
|
|
295
|
+
* the search dialog it opens. */
|
|
271
296
|
.BPNavBarSearch {
|
|
272
|
-
position: relative;
|
|
273
297
|
display: flex;
|
|
274
298
|
align-items: center;
|
|
275
|
-
|
|
276
|
-
width: 100%;
|
|
277
|
-
}
|
|
278
|
-
|
|
279
|
-
.BPNavBarSearch-icon {
|
|
280
|
-
position: absolute;
|
|
281
|
-
left: 12px;
|
|
282
|
-
width: 16px;
|
|
283
|
-
height: 16px;
|
|
284
|
-
color: var(--bp-c-text-3);
|
|
285
|
-
pointer-events: none;
|
|
286
|
-
}
|
|
287
|
-
|
|
288
|
-
.BPNavBarSearch-input {
|
|
299
|
+
gap: 8px;
|
|
289
300
|
width: 100%;
|
|
301
|
+
max-width: 240px;
|
|
290
302
|
height: 32px;
|
|
291
|
-
padding: 0
|
|
292
|
-
font: inherit;
|
|
303
|
+
padding: 0 8px 0 10px;
|
|
304
|
+
font-family: inherit;
|
|
293
305
|
font-size: 13px;
|
|
306
|
+
text-align: left;
|
|
307
|
+
color: var(--bp-c-text-3);
|
|
294
308
|
background-color: var(--bp-c-bg-alt);
|
|
295
309
|
border: 1px solid var(--bp-c-divider);
|
|
296
|
-
border-radius:
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
transition: border-color 0.25s, background-color 0.25s;
|
|
300
|
-
}
|
|
301
|
-
|
|
302
|
-
.BPNavBarSearch-input::placeholder {
|
|
303
|
-
color: var(--bp-c-text-3);
|
|
310
|
+
border-radius: 6px;
|
|
311
|
+
cursor: pointer;
|
|
312
|
+
transition: border-color 0.25s, background-color 0.25s, color 0.25s;
|
|
304
313
|
}
|
|
305
314
|
|
|
306
|
-
.BPNavBarSearch
|
|
307
|
-
|
|
315
|
+
.BPNavBarSearch:hover {
|
|
316
|
+
color: var(--bp-c-text-2);
|
|
308
317
|
border-color: var(--bp-c-brand-1);
|
|
309
318
|
background-color: var(--bp-c-bg);
|
|
310
319
|
}
|
|
311
320
|
|
|
321
|
+
.BPNavBarSearch:focus-visible {
|
|
322
|
+
outline: 2px solid var(--bp-c-brand-1);
|
|
323
|
+
outline-offset: 2px;
|
|
324
|
+
}
|
|
325
|
+
|
|
326
|
+
.BPNavBarSearch-icon {
|
|
327
|
+
width: 15px;
|
|
328
|
+
height: 15px;
|
|
329
|
+
flex-shrink: 0;
|
|
330
|
+
}
|
|
331
|
+
|
|
332
|
+
.BPNavBarSearch-label {
|
|
333
|
+
flex: 1;
|
|
334
|
+
min-width: 0;
|
|
335
|
+
overflow: hidden;
|
|
336
|
+
text-overflow: ellipsis;
|
|
337
|
+
white-space: nowrap;
|
|
338
|
+
}
|
|
339
|
+
|
|
312
340
|
.BPNavBarSearch-kbd {
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
padding: 2px 6px;
|
|
341
|
+
flex-shrink: 0;
|
|
342
|
+
padding: 1px 5px;
|
|
316
343
|
font-size: 11px;
|
|
317
344
|
font-weight: 600;
|
|
318
345
|
font-family: inherit;
|
|
346
|
+
line-height: 1.5;
|
|
319
347
|
color: var(--bp-c-text-3);
|
|
320
348
|
background-color: var(--bp-c-bg);
|
|
321
349
|
border: 1px solid var(--bp-c-divider);
|
|
322
350
|
border-radius: 4px;
|
|
323
|
-
|
|
351
|
+
}
|
|
352
|
+
|
|
353
|
+
.BPSocialLinks-text {
|
|
354
|
+
font-size: 13px;
|
|
355
|
+
font-weight: 500;
|
|
324
356
|
}
|
|
325
357
|
|
|
326
358
|
/* Social/icon links cluster */
|
|
@@ -401,16 +433,51 @@ code {
|
|
|
401
433
|
|
|
402
434
|
/* Mobile sidebar drawer behaviour */
|
|
403
435
|
@media (max-width: 959px) {
|
|
436
|
+
/* Collapses to an icon button rather than disappearing: search is the main
|
|
437
|
+
* way to get around a docs site on a phone, where the sidebar is behind a
|
|
438
|
+
* drawer and the TOC behind a disclosure. */
|
|
404
439
|
.BPNavBarSearch {
|
|
440
|
+
width: 36px;
|
|
441
|
+
max-width: none;
|
|
442
|
+
padding: 0;
|
|
443
|
+
justify-content: center;
|
|
444
|
+
background-color: transparent;
|
|
445
|
+
border-color: transparent;
|
|
446
|
+
}
|
|
447
|
+
.BPNavBarSearch-label,
|
|
448
|
+
.BPNavBarSearch-kbd {
|
|
405
449
|
display: none;
|
|
406
450
|
}
|
|
451
|
+
.BPNavBarSearch-icon {
|
|
452
|
+
width: 18px;
|
|
453
|
+
height: 18px;
|
|
454
|
+
}
|
|
407
455
|
.BPSocialLinks {
|
|
408
|
-
|
|
409
|
-
|
|
456
|
+
/* The divider separates the nav links from the icons \u2014 with the links
|
|
457
|
+
* hidden it is a rule floating against the title, so drop it. */
|
|
458
|
+
padding-left: 0;
|
|
459
|
+
border-left: none;
|
|
460
|
+
gap: 4px;
|
|
410
461
|
}
|
|
411
462
|
.BPNavBarMenu {
|
|
412
463
|
display: none;
|
|
413
464
|
}
|
|
465
|
+
.BPNavBar {
|
|
466
|
+
padding: 0 16px;
|
|
467
|
+
gap: 12px;
|
|
468
|
+
}
|
|
469
|
+
.BPNavBarStart {
|
|
470
|
+
gap: 8px;
|
|
471
|
+
}
|
|
472
|
+
.BPNavBarEnd {
|
|
473
|
+
gap: 4px;
|
|
474
|
+
}
|
|
475
|
+
}
|
|
476
|
+
|
|
477
|
+
@media (max-width: 419px) {
|
|
478
|
+
.BPNavBarTitle {
|
|
479
|
+
font-size: 15px;
|
|
480
|
+
}
|
|
414
481
|
}
|
|
415
482
|
|
|
416
483
|
/**
|
|
@@ -418,7 +485,7 @@ code {
|
|
|
418
485
|
* -------------------------------------------------------------------------- */
|
|
419
486
|
|
|
420
487
|
.BPHero-name {
|
|
421
|
-
font-size:
|
|
488
|
+
font-size: clamp(18px, 4vw, 24px);
|
|
422
489
|
font-weight: 700;
|
|
423
490
|
letter-spacing: -0.02em;
|
|
424
491
|
line-height: 1.2;
|
|
@@ -429,36 +496,29 @@ code {
|
|
|
429
496
|
background-clip: text;
|
|
430
497
|
}
|
|
431
498
|
|
|
499
|
+
/* Fluid rather than stepped: a fixed 48px headline on a 375px phone puts a
|
|
500
|
+
* single long word (\`documentation\`) wider than the viewport, and a hard
|
|
501
|
+
* breakpoint only moves the problem to the widths either side of it. */
|
|
432
502
|
.BPHero-text {
|
|
433
|
-
font-size:
|
|
503
|
+
font-size: clamp(30px, 8vw, 56px);
|
|
434
504
|
font-weight: 800;
|
|
435
505
|
letter-spacing: -0.02em;
|
|
436
506
|
line-height: 1.1;
|
|
437
507
|
color: var(--bp-c-text-1);
|
|
438
508
|
margin: 0 0 8px;
|
|
509
|
+
/* Last resort for a word that still cannot fit at the minimum size. */
|
|
510
|
+
overflow-wrap: break-word;
|
|
439
511
|
}
|
|
440
512
|
|
|
441
513
|
.BPHero-tagline {
|
|
442
514
|
max-width: 720px;
|
|
443
|
-
font-size:
|
|
515
|
+
font-size: clamp(16px, 2.4vw, 20px);
|
|
444
516
|
font-weight: 400;
|
|
445
517
|
line-height: 1.6;
|
|
446
518
|
color: var(--bp-c-text-2);
|
|
447
519
|
margin: 12px 0 0;
|
|
448
520
|
}
|
|
449
521
|
|
|
450
|
-
@media (min-width: 960px) {
|
|
451
|
-
.BPHero-name {
|
|
452
|
-
font-size: 24px;
|
|
453
|
-
}
|
|
454
|
-
.BPHero-text {
|
|
455
|
-
font-size: 56px;
|
|
456
|
-
}
|
|
457
|
-
.BPHero-tagline {
|
|
458
|
-
font-size: 20px;
|
|
459
|
-
}
|
|
460
|
-
}
|
|
461
|
-
|
|
462
522
|
.BPHero-actions {
|
|
463
523
|
display: flex;
|
|
464
524
|
flex-wrap: wrap;
|
|
@@ -598,6 +658,13 @@ code {
|
|
|
598
658
|
* Wrapped as .BPHome-content > .bp-doc.vp-doc.container by markdownToHtml.
|
|
599
659
|
* -------------------------------------------------------------------------- */
|
|
600
660
|
|
|
661
|
+
/* The nav is fixed, so the home layout has to reserve its height. Previously
|
|
662
|
+
* only the hero's own top padding cleared it, which meant any change to that
|
|
663
|
+
* padding slid the first line of the hero under the bar. */
|
|
664
|
+
.BPHome {
|
|
665
|
+
padding-top: var(--bp-nav-height, 64px);
|
|
666
|
+
}
|
|
667
|
+
|
|
601
668
|
.BPHome-content {
|
|
602
669
|
padding: 48px 24px 96px;
|
|
603
670
|
}
|
|
@@ -617,6 +684,17 @@ code {
|
|
|
617
684
|
* Inline content \u2014 badges, external link icons
|
|
618
685
|
* -------------------------------------------------------------------------- */
|
|
619
686
|
|
|
687
|
+
/* The UA default is pure yellow with forced black text, which is jarring in
|
|
688
|
+
* light mode and unreadable against a dark page. */
|
|
689
|
+
.bp-doc mark {
|
|
690
|
+
padding: 1px 3px;
|
|
691
|
+
border-radius: 3px;
|
|
692
|
+
background-color: var(--bp-c-warning-soft, rgba(234, 179, 8, 0.28));
|
|
693
|
+
color: inherit;
|
|
694
|
+
-webkit-box-decoration-break: clone;
|
|
695
|
+
box-decoration-break: clone;
|
|
696
|
+
}
|
|
697
|
+
|
|
620
698
|
.badge {
|
|
621
699
|
display: inline-block;
|
|
622
700
|
padding: 2px 8px;
|
|
@@ -666,14 +744,8 @@ code {
|
|
|
666
744
|
* -------------------------------------------------------------------------- */
|
|
667
745
|
|
|
668
746
|
/* Subtle row hover on tables */
|
|
669
|
-
.bp-doc tr:hover {
|
|
670
|
-
background-color: var(--bp-c-
|
|
671
|
-
}
|
|
672
|
-
|
|
673
|
-
/* Mobile-safe table scroll */
|
|
674
|
-
.bp-doc table {
|
|
675
|
-
width: 100%;
|
|
676
|
-
max-width: 100%;
|
|
747
|
+
.bp-doc tbody tr:hover {
|
|
748
|
+
background-color: var(--bp-c-default-soft, var(--bp-c-gray-soft));
|
|
677
749
|
}
|
|
678
750
|
|
|
679
751
|
/* Slightly stronger blockquote with brand-tinted accent */
|
|
@@ -707,23 +779,85 @@ code {
|
|
|
707
779
|
color: var(--bp-c-brand-1);
|
|
708
780
|
}
|
|
709
781
|
|
|
782
|
+
/**
|
|
783
|
+
* Layout scrollbars
|
|
784
|
+
* --------------------------------------------------------------------------
|
|
785
|
+
* The doc layout scrolls in independent panes, so on any platform with
|
|
786
|
+
* always-visible scrollbars the reader gets full-height grey tracks down the
|
|
787
|
+
* middle of the page. Thin them to match the code-block treatment. (The TOC
|
|
788
|
+
* aside hides its scrollbar outright \u2014 see page-toc.stx.)
|
|
789
|
+
*/
|
|
790
|
+
|
|
791
|
+
.BPSidebar,
|
|
792
|
+
.BPContent--doc {
|
|
793
|
+
scrollbar-width: thin;
|
|
794
|
+
scrollbar-color: var(--bp-c-divider) transparent;
|
|
795
|
+
}
|
|
796
|
+
|
|
797
|
+
.BPSidebar::-webkit-scrollbar,
|
|
798
|
+
.BPContent--doc::-webkit-scrollbar {
|
|
799
|
+
width: 8px;
|
|
800
|
+
height: 8px;
|
|
801
|
+
}
|
|
802
|
+
|
|
803
|
+
.BPSidebar::-webkit-scrollbar-track,
|
|
804
|
+
.BPContent--doc::-webkit-scrollbar-track {
|
|
805
|
+
background: transparent;
|
|
806
|
+
}
|
|
807
|
+
|
|
808
|
+
.BPSidebar::-webkit-scrollbar-thumb,
|
|
809
|
+
.BPContent--doc::-webkit-scrollbar-thumb {
|
|
810
|
+
background-color: var(--bp-c-divider);
|
|
811
|
+
border-radius: 4px;
|
|
812
|
+
}
|
|
813
|
+
|
|
814
|
+
.BPSidebar:hover::-webkit-scrollbar-thumb,
|
|
815
|
+
.BPContent--doc:hover::-webkit-scrollbar-thumb {
|
|
816
|
+
background-color: var(--bp-c-text-3);
|
|
817
|
+
}
|
|
818
|
+
|
|
819
|
+
/**
|
|
820
|
+
* Keyboard focus
|
|
821
|
+
* --------------------------------------------------------------------------
|
|
822
|
+
* :focus-visible only, so pointer users never see a ring, but every
|
|
823
|
+
* interactive control in the chrome is reachable and visible by keyboard.
|
|
824
|
+
*/
|
|
825
|
+
|
|
826
|
+
.BPNavBarTitle:focus-visible,
|
|
827
|
+
.BPNavBarMenu a:focus-visible,
|
|
828
|
+
.BPSocialLinks > a:focus-visible,
|
|
829
|
+
.BPNavBarHamburger:focus-visible,
|
|
830
|
+
.theme-toggle:focus-visible,
|
|
831
|
+
.BPSidebarItem-link:focus-visible,
|
|
832
|
+
.sidebar-section-toggle:focus-visible,
|
|
833
|
+
.BPDocAside a:focus-visible,
|
|
834
|
+
.bp-doc a:focus-visible,
|
|
835
|
+
.BPButton:focus-visible {
|
|
836
|
+
outline: 2px solid var(--bp-c-brand-1);
|
|
837
|
+
outline-offset: 2px;
|
|
838
|
+
border-radius: 3px;
|
|
839
|
+
}
|
|
840
|
+
|
|
710
841
|
/**
|
|
711
842
|
* Mobile nav / sidebar drawer
|
|
712
843
|
* -------------------------------------------------------------------------- */
|
|
713
844
|
|
|
714
845
|
.BPNavBarHamburger {
|
|
715
846
|
display: none;
|
|
716
|
-
|
|
717
|
-
|
|
847
|
+
/* 40px keeps the hit area at the minimum comfortable touch target even
|
|
848
|
+
* though the icon itself is 20px. */
|
|
849
|
+
width: 40px;
|
|
850
|
+
height: 40px;
|
|
851
|
+
flex-shrink: 0;
|
|
718
852
|
background: transparent;
|
|
719
853
|
border: none;
|
|
720
854
|
cursor: pointer;
|
|
721
855
|
align-items: center;
|
|
722
856
|
justify-content: center;
|
|
723
857
|
color: var(--bp-c-text-2);
|
|
724
|
-
border-radius:
|
|
858
|
+
border-radius: 8px;
|
|
725
859
|
padding: 0;
|
|
726
|
-
margin-left: -
|
|
860
|
+
margin-left: -8px;
|
|
727
861
|
}
|
|
728
862
|
|
|
729
863
|
.BPNavBarHamburger:hover {
|
|
@@ -756,7 +890,13 @@ code {
|
|
|
756
890
|
|
|
757
891
|
.BPSidebar-backdrop {
|
|
758
892
|
position: fixed;
|
|
759
|
-
|
|
893
|
+
/* Starts below the nav: the drawer opens under the bar, so scrimming the
|
|
894
|
+
* bar too dims the very controls (menu button, theme toggle) that stay
|
|
895
|
+
* live while the drawer is open. */
|
|
896
|
+
top: var(--bp-nav-height, 64px);
|
|
897
|
+
right: 0;
|
|
898
|
+
bottom: 0;
|
|
899
|
+
left: 0;
|
|
760
900
|
background-color: rgba(0, 0, 0, 0.32);
|
|
761
901
|
opacity: 0;
|
|
762
902
|
pointer-events: none;
|
|
@@ -772,10 +912,21 @@ code {
|
|
|
772
912
|
.BPContent--doc {
|
|
773
913
|
left: 0;
|
|
774
914
|
}
|
|
915
|
+
|
|
916
|
+
.BPDoc {
|
|
917
|
+
padding: 24px 20px 64px;
|
|
918
|
+
}
|
|
775
919
|
}
|
|
776
|
-
|
|
920
|
+
|
|
921
|
+
/* Small phones: reclaim horizontal space from the gutters. */
|
|
922
|
+
@media (max-width: 419px) {
|
|
923
|
+
.BPDoc {
|
|
924
|
+
padding: 20px 16px 56px;
|
|
925
|
+
}
|
|
926
|
+
}
|
|
927
|
+
`;function AJ(){return`
|
|
777
928
|
/* VitePress Theme for BunPress */
|
|
778
|
-
|
|
929
|
+
${`/**
|
|
779
930
|
* VitePress Theme for BunPress
|
|
780
931
|
* Colors: Solid
|
|
781
932
|
* -------------------------------------------------------------------------- */
|
|
@@ -1004,6 +1155,9 @@ code {
|
|
|
1004
1155
|
--bp-z-index-layout-top: 40;
|
|
1005
1156
|
--bp-z-index-backdrop: 50;
|
|
1006
1157
|
--bp-z-index-sidebar: 60;
|
|
1158
|
+
/* Above the sidebar drawer: search opens over everything, including a
|
|
1159
|
+
* drawer left open behind it. */
|
|
1160
|
+
--bp-z-index-search: 200;
|
|
1007
1161
|
}
|
|
1008
1162
|
|
|
1009
1163
|
@media (min-width: 960px) {
|
|
@@ -1117,37 +1271,43 @@ code {
|
|
|
1117
1271
|
--bp-custom-block-font-size: 14px;
|
|
1118
1272
|
--bp-custom-block-code-font-size: 13px;
|
|
1119
1273
|
|
|
1120
|
-
|
|
1274
|
+
/* The *-border colour is drawn only on the leading edge (see .custom-block),
|
|
1275
|
+
* so it carries the block's identity \u2014 hence a solid accent, not transparent.
|
|
1276
|
+
* Info/note are neutral, so they take a mid-grey: --bp-c-default-1 is a
|
|
1277
|
+
* near-white tint that vanishes against the block's own soft background. */
|
|
1278
|
+
--bp-custom-block-info-border: var(--bp-c-text-3);
|
|
1121
1279
|
--bp-custom-block-info-text: var(--bp-c-text-1);
|
|
1122
1280
|
--bp-custom-block-info-bg: var(--bp-c-default-soft);
|
|
1123
1281
|
--bp-custom-block-info-code-bg: var(--bp-c-default-soft);
|
|
1124
1282
|
|
|
1125
|
-
|
|
1283
|
+
/* note carries a brand-coloured title and icon, so its rail matches those
|
|
1284
|
+
* rather than the neutral background it shares with info. */
|
|
1285
|
+
--bp-custom-block-note-border: var(--bp-c-note-1);
|
|
1126
1286
|
--bp-custom-block-note-text: var(--bp-c-text-1);
|
|
1127
1287
|
--bp-custom-block-note-bg: var(--bp-c-default-soft);
|
|
1128
1288
|
--bp-custom-block-note-code-bg: var(--bp-c-default-soft);
|
|
1129
1289
|
|
|
1130
|
-
--bp-custom-block-tip-border:
|
|
1290
|
+
--bp-custom-block-tip-border: var(--bp-c-tip-1);
|
|
1131
1291
|
--bp-custom-block-tip-text: var(--bp-c-text-1);
|
|
1132
1292
|
--bp-custom-block-tip-bg: var(--bp-c-tip-soft);
|
|
1133
1293
|
--bp-custom-block-tip-code-bg: var(--bp-c-tip-soft);
|
|
1134
1294
|
|
|
1135
|
-
--bp-custom-block-important-border:
|
|
1295
|
+
--bp-custom-block-important-border: var(--bp-c-important-1);
|
|
1136
1296
|
--bp-custom-block-important-text: var(--bp-c-text-1);
|
|
1137
1297
|
--bp-custom-block-important-bg: var(--bp-c-important-soft);
|
|
1138
1298
|
--bp-custom-block-important-code-bg: var(--bp-c-important-soft);
|
|
1139
1299
|
|
|
1140
|
-
--bp-custom-block-warning-border:
|
|
1300
|
+
--bp-custom-block-warning-border: var(--bp-c-warning-1);
|
|
1141
1301
|
--bp-custom-block-warning-text: var(--bp-c-text-1);
|
|
1142
1302
|
--bp-custom-block-warning-bg: var(--bp-c-warning-soft);
|
|
1143
1303
|
--bp-custom-block-warning-code-bg: var(--bp-c-warning-soft);
|
|
1144
1304
|
|
|
1145
|
-
--bp-custom-block-danger-border:
|
|
1305
|
+
--bp-custom-block-danger-border: var(--bp-c-danger-1);
|
|
1146
1306
|
--bp-custom-block-danger-text: var(--bp-c-text-1);
|
|
1147
1307
|
--bp-custom-block-danger-bg: var(--bp-c-danger-soft);
|
|
1148
1308
|
--bp-custom-block-danger-code-bg: var(--bp-c-danger-soft);
|
|
1149
1309
|
|
|
1150
|
-
--bp-custom-block-caution-border:
|
|
1310
|
+
--bp-custom-block-caution-border: var(--bp-c-caution-1);
|
|
1151
1311
|
--bp-custom-block-caution-text: var(--bp-c-text-1);
|
|
1152
1312
|
--bp-custom-block-caution-bg: var(--bp-c-caution-soft);
|
|
1153
1313
|
--bp-custom-block-caution-code-bg: var(--bp-c-caution-soft);
|
|
@@ -1335,8 +1495,8 @@ code {
|
|
|
1335
1495
|
|
|
1336
1496
|
.bpi-corner-down-left {
|
|
1337
1497
|
--icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cg fill='none' stroke='black' stroke-linecap='round' stroke-linejoin='round' stroke-width='2'%3E%3Cpath d='M20 4v7a4 4 0 0 1-4 4H4'/%3E%3Cpath d='m9 10l-5 5l5 5'/%3E%3C/g%3E%3C/svg%3E");
|
|
1338
|
-
}
|
|
1339
|
-
|
|
1498
|
+
}`}
|
|
1499
|
+
${`/**
|
|
1340
1500
|
* VitePress Theme for BunPress - Base Styles
|
|
1341
1501
|
* -------------------------------------------------------------------------- */
|
|
1342
1502
|
|
|
@@ -1604,6 +1764,10 @@ mjx-container > svg {
|
|
|
1604
1764
|
position: relative;
|
|
1605
1765
|
font-weight: 600;
|
|
1606
1766
|
outline: none;
|
|
1767
|
+
/* Anchor jumps \u2014 from the outline, the sidebar or an external deep link \u2014
|
|
1768
|
+
* otherwise land the heading flush against the top edge of the scroll
|
|
1769
|
+
* container, with no separation from the chrome above it. */
|
|
1770
|
+
scroll-margin-top: 24px;
|
|
1607
1771
|
}
|
|
1608
1772
|
|
|
1609
1773
|
.bp-doc h1 {
|
|
@@ -1715,6 +1879,12 @@ mjx-container > svg {
|
|
|
1715
1879
|
transition: color 0.5s;
|
|
1716
1880
|
}
|
|
1717
1881
|
|
|
1882
|
+
/* Zeroing every paragraph margin ran a multi-paragraph quote together as if
|
|
1883
|
+
* it were one block of prose. */
|
|
1884
|
+
.bp-doc blockquote > p + p {
|
|
1885
|
+
margin-top: 16px;
|
|
1886
|
+
}
|
|
1887
|
+
|
|
1718
1888
|
.bp-doc a {
|
|
1719
1889
|
font-weight: 500;
|
|
1720
1890
|
color: var(--bp-c-brand-1);
|
|
@@ -1735,27 +1905,72 @@ mjx-container > svg {
|
|
|
1735
1905
|
* Lists
|
|
1736
1906
|
* -------------------------------------------------------------------------- */
|
|
1737
1907
|
|
|
1908
|
+
/* Markers hang in the gutter (\`outside\`) so wrapped lines stay flush with the
|
|
1909
|
+
* first line \u2014 the single biggest readability win for multi-line bullets. The
|
|
1910
|
+
* indent is wide enough for two-digit ordered markers without clipping. */
|
|
1738
1911
|
.bp-doc ul,
|
|
1739
1912
|
.bp-doc ol {
|
|
1740
|
-
padding-left: 1.
|
|
1913
|
+
padding-left: 1.5rem;
|
|
1741
1914
|
margin: 16px 0;
|
|
1915
|
+
list-style-position: outside;
|
|
1742
1916
|
}
|
|
1743
1917
|
|
|
1744
1918
|
.bp-doc ul {
|
|
1745
|
-
list-style: disc;
|
|
1919
|
+
list-style-type: disc;
|
|
1746
1920
|
}
|
|
1747
1921
|
|
|
1748
1922
|
.bp-doc ol {
|
|
1749
|
-
list-style: decimal;
|
|
1923
|
+
list-style-type: decimal;
|
|
1750
1924
|
}
|
|
1751
1925
|
|
|
1752
|
-
.bp-doc li
|
|
1753
|
-
margin
|
|
1926
|
+
.bp-doc li {
|
|
1927
|
+
margin: 6px 0;
|
|
1928
|
+
line-height: 1.75;
|
|
1929
|
+
}
|
|
1930
|
+
|
|
1931
|
+
.bp-doc li::marker {
|
|
1932
|
+
color: var(--bp-c-text-3);
|
|
1754
1933
|
}
|
|
1755
1934
|
|
|
1935
|
+
.bp-doc ol > li::marker {
|
|
1936
|
+
font-variant-numeric: tabular-nums;
|
|
1937
|
+
}
|
|
1938
|
+
|
|
1939
|
+
/* A nested list belongs to its parent item, so it hugs it rather than
|
|
1940
|
+
* inheriting the full inter-item gap. */
|
|
1756
1941
|
.bp-doc li > ol,
|
|
1757
1942
|
.bp-doc li > ul {
|
|
1758
|
-
margin:
|
|
1943
|
+
margin: 6px 0 0;
|
|
1944
|
+
padding-left: 1.5rem;
|
|
1945
|
+
}
|
|
1946
|
+
|
|
1947
|
+
.bp-doc ul ul {
|
|
1948
|
+
list-style-type: circle;
|
|
1949
|
+
}
|
|
1950
|
+
|
|
1951
|
+
.bp-doc ul ul ul {
|
|
1952
|
+
list-style-type: square;
|
|
1953
|
+
}
|
|
1954
|
+
|
|
1955
|
+
/* Loose lists (blank lines between items) wrap each item's text in a <p>.
|
|
1956
|
+
* Without this the paragraph's 16px margins double the list's spacing. */
|
|
1957
|
+
.bp-doc li > p {
|
|
1958
|
+
margin: 0;
|
|
1959
|
+
}
|
|
1960
|
+
|
|
1961
|
+
.bp-doc li > p + p {
|
|
1962
|
+
margin-top: 12px;
|
|
1963
|
+
}
|
|
1964
|
+
|
|
1965
|
+
/* Block content inside an item stays indented with the item, and never
|
|
1966
|
+
* bleeds full-width the way a top-level code block does. */
|
|
1967
|
+
.bp-doc li > pre,
|
|
1968
|
+
.bp-doc li > div[class*='language-'],
|
|
1969
|
+
.bp-doc li > pre[data-lang],
|
|
1970
|
+
.bp-doc li > blockquote,
|
|
1971
|
+
.bp-doc li > .table-responsive,
|
|
1972
|
+
.bp-doc li > .custom-block {
|
|
1973
|
+
margin: 12px 0;
|
|
1759
1974
|
}
|
|
1760
1975
|
|
|
1761
1976
|
/* Task list styles */
|
|
@@ -1764,16 +1979,29 @@ mjx-container > svg {
|
|
|
1764
1979
|
padding-left: 0;
|
|
1765
1980
|
}
|
|
1766
1981
|
|
|
1982
|
+
/* A list of task items has checkboxes where the markers would be, so the
|
|
1983
|
+
* marker gutter is dead space. Scoped with :has() so a list that merely
|
|
1984
|
+
* contains one task item keeps its indent for the plain items. */
|
|
1985
|
+
.bp-doc ul:has(> .task-list-item) {
|
|
1986
|
+
padding-left: 0;
|
|
1987
|
+
list-style: none;
|
|
1988
|
+
}
|
|
1989
|
+
|
|
1767
1990
|
.bp-doc .task-list-item {
|
|
1768
1991
|
display: flex;
|
|
1769
1992
|
align-items: flex-start;
|
|
1770
1993
|
gap: 0.5rem;
|
|
1771
1994
|
}
|
|
1772
1995
|
|
|
1996
|
+
/* .task-list-item-checkbox is what Bun.markdown emits; .task-list-checkbox is
|
|
1997
|
+
* kept for content that ships its own task-list markup. */
|
|
1998
|
+
.bp-doc .task-list-item-checkbox,
|
|
1773
1999
|
.bp-doc .task-list-checkbox {
|
|
1774
|
-
|
|
2000
|
+
/* Nudged down to sit on the first line's cap height rather than its top. */
|
|
2001
|
+
margin: 0.3em 0 0;
|
|
1775
2002
|
width: 1rem;
|
|
1776
2003
|
height: 1rem;
|
|
2004
|
+
flex-shrink: 0;
|
|
1777
2005
|
accent-color: var(--bp-c-brand-1);
|
|
1778
2006
|
cursor: default;
|
|
1779
2007
|
}
|
|
@@ -1787,39 +2015,115 @@ mjx-container > svg {
|
|
|
1787
2015
|
* Table
|
|
1788
2016
|
* -------------------------------------------------------------------------- */
|
|
1789
2017
|
|
|
2018
|
+
/* The scroll container owns overflow, so the table itself stays a real table.
|
|
2019
|
+
* (\`display: block\` on <table> collapses column sizing \u2014 the table shrinks to
|
|
2020
|
+
* its content instead of filling the row, and cell widths stop balancing.) */
|
|
2021
|
+
.bp-doc .table-responsive {
|
|
2022
|
+
margin: 20px 0;
|
|
2023
|
+
overflow-x: auto;
|
|
2024
|
+
overscroll-behavior-x: contain;
|
|
2025
|
+
border: 1px solid var(--bp-c-divider);
|
|
2026
|
+
border-radius: 8px;
|
|
2027
|
+
/* Clip the corner radius against the header's background fill. */
|
|
2028
|
+
background-color: var(--bp-c-bg);
|
|
2029
|
+
}
|
|
2030
|
+
|
|
1790
2031
|
.bp-doc table {
|
|
1791
|
-
display:
|
|
2032
|
+
display: table;
|
|
2033
|
+
width: 100%;
|
|
1792
2034
|
border-collapse: collapse;
|
|
1793
2035
|
margin: 20px 0;
|
|
1794
|
-
|
|
2036
|
+
font-size: 14px;
|
|
2037
|
+
line-height: 1.6;
|
|
2038
|
+
}
|
|
2039
|
+
|
|
2040
|
+
/* Inside a scroll wrapper the wrapper supplies the outer spacing and frame. */
|
|
2041
|
+
.bp-doc .table-responsive > table {
|
|
2042
|
+
margin: 0;
|
|
2043
|
+
border: none;
|
|
1795
2044
|
}
|
|
1796
2045
|
|
|
1797
2046
|
.bp-doc tr {
|
|
1798
|
-
background-color:
|
|
1799
|
-
|
|
1800
|
-
transition: background-color 0.5s;
|
|
2047
|
+
background-color: transparent;
|
|
2048
|
+
transition: background-color 0.25s;
|
|
1801
2049
|
}
|
|
1802
2050
|
|
|
1803
|
-
.bp-doc tr:nth-child(2n) {
|
|
2051
|
+
.bp-doc tbody tr:nth-child(2n) {
|
|
1804
2052
|
background-color: var(--bp-c-bg-soft);
|
|
1805
2053
|
}
|
|
1806
2054
|
|
|
1807
2055
|
.bp-doc th,
|
|
1808
2056
|
.bp-doc td {
|
|
1809
|
-
|
|
1810
|
-
|
|
2057
|
+
/* Row rules only \u2014 a full grid double-draws against the wrapper border and
|
|
2058
|
+
* makes dense config tables read as noise. */
|
|
2059
|
+
border-bottom: 1px solid var(--bp-c-divider);
|
|
2060
|
+
padding: 10px 16px;
|
|
2061
|
+
text-align: left;
|
|
2062
|
+
vertical-align: top;
|
|
1811
2063
|
}
|
|
1812
2064
|
|
|
1813
|
-
.bp-doc th {
|
|
1814
|
-
|
|
1815
|
-
font-size: 14px;
|
|
2065
|
+
.bp-doc thead th {
|
|
2066
|
+
font-size: 13px;
|
|
1816
2067
|
font-weight: 600;
|
|
2068
|
+
letter-spacing: 0.01em;
|
|
1817
2069
|
color: var(--bp-c-text-2);
|
|
1818
2070
|
background-color: var(--bp-c-bg-soft);
|
|
2071
|
+
border-bottom: 1px solid var(--bp-c-divider);
|
|
2072
|
+
white-space: nowrap;
|
|
2073
|
+
}
|
|
2074
|
+
|
|
2075
|
+
/* Last row sits flush against the wrapper's own bottom border. */
|
|
2076
|
+
.bp-doc tbody tr:last-child > th,
|
|
2077
|
+
.bp-doc tbody tr:last-child > td {
|
|
2078
|
+
border-bottom: none;
|
|
1819
2079
|
}
|
|
1820
2080
|
|
|
1821
2081
|
.bp-doc td {
|
|
1822
2082
|
font-size: 14px;
|
|
2083
|
+
color: var(--bp-c-text-1);
|
|
2084
|
+
}
|
|
2085
|
+
|
|
2086
|
+
/* Long identifiers (\`preserveDirectoryStructure\`, \`Record<string, string>\`)
|
|
2087
|
+
* must not dictate column widths. \`anywhere\` \u2014 unlike \`break-word\` \u2014 also
|
|
2088
|
+
* lowers the cell's intrinsic minimum, which is what lets the auto table
|
|
2089
|
+
* algorithm hand the spare width to the prose column instead. */
|
|
2090
|
+
.bp-doc td > code,
|
|
2091
|
+
.bp-doc th > code {
|
|
2092
|
+
white-space: normal;
|
|
2093
|
+
overflow-wrap: anywhere;
|
|
2094
|
+
}
|
|
2095
|
+
|
|
2096
|
+
/* Narrow screens: a multi-column table squeezed into a phone width degenerates
|
|
2097
|
+
* into one word per line. Give it a readable floor and let the wrapper scroll
|
|
2098
|
+
* horizontally instead \u2014 scrolling a table beats shredding it. */
|
|
2099
|
+
@media (max-width: 767px) {
|
|
2100
|
+
.bp-doc .table-responsive > table {
|
|
2101
|
+
min-width: 38rem;
|
|
2102
|
+
}
|
|
2103
|
+
|
|
2104
|
+
.bp-doc thead th {
|
|
2105
|
+
white-space: normal;
|
|
2106
|
+
}
|
|
2107
|
+
|
|
2108
|
+
.bp-doc th,
|
|
2109
|
+
.bp-doc td {
|
|
2110
|
+
padding: 10px 12px;
|
|
2111
|
+
}
|
|
2112
|
+
}
|
|
2113
|
+
|
|
2114
|
+
/* Alignment from GFM's \`:---:\` / \`---:\` syntax must win over the default. */
|
|
2115
|
+
.bp-doc th[align='center'],
|
|
2116
|
+
.bp-doc td[align='center'],
|
|
2117
|
+
.bp-doc th[style*='center'],
|
|
2118
|
+
.bp-doc td[style*='center'] {
|
|
2119
|
+
text-align: center;
|
|
2120
|
+
}
|
|
2121
|
+
|
|
2122
|
+
.bp-doc th[align='right'],
|
|
2123
|
+
.bp-doc td[align='right'],
|
|
2124
|
+
.bp-doc th[style*='right'],
|
|
2125
|
+
.bp-doc td[style*='right'] {
|
|
2126
|
+
text-align: right;
|
|
1823
2127
|
}
|
|
1824
2128
|
|
|
1825
2129
|
/**
|
|
@@ -1846,6 +2150,19 @@ mjx-container > svg {
|
|
|
1846
2150
|
padding: 3px 6px;
|
|
1847
2151
|
background-color: var(--bp-code-bg);
|
|
1848
2152
|
transition: color 0.25s, background-color 0.5s;
|
|
2153
|
+
/* Without clone, a code span that wraps loses its padding and rounding on
|
|
2154
|
+
* the broken edges, so a wrapped identifier reads as ragged half-boxes. */
|
|
2155
|
+
-webkit-box-decoration-break: clone;
|
|
2156
|
+
box-decoration-break: clone;
|
|
2157
|
+
}
|
|
2158
|
+
|
|
2159
|
+
/* Inline code sits on a text baseline, so it must not add leading of its own
|
|
2160
|
+
* \u2014 otherwise a paragraph containing code is spaced wider than its neighbours. */
|
|
2161
|
+
.bp-doc p > code,
|
|
2162
|
+
.bp-doc li > code,
|
|
2163
|
+
.bp-doc td > code,
|
|
2164
|
+
.bp-doc th > code {
|
|
2165
|
+
line-height: 1.4;
|
|
1849
2166
|
}
|
|
1850
2167
|
|
|
1851
2168
|
.bp-doc a > code {
|
|
@@ -1867,36 +2184,28 @@ mjx-container > svg {
|
|
|
1867
2184
|
* Code blocks
|
|
1868
2185
|
* -------------------------------------------------------------------------- */
|
|
1869
2186
|
|
|
2187
|
+
/* Inset, not full-bleed. The old \`margin: 16px -24px\` hard-coded the content
|
|
2188
|
+
* container's padding: once that padding changed on small screens the bleed
|
|
2189
|
+
* overshot it, hanging the block 8px off each edge and leaving the content
|
|
2190
|
+
* pane with a phantom horizontal scroll. Inset also matches how every other
|
|
2191
|
+
* block element here behaves (containers, tables, alerts). */
|
|
1870
2192
|
.bp-doc div[class*='language-'],
|
|
1871
2193
|
.bp-doc pre[data-lang],
|
|
1872
2194
|
.bp-block {
|
|
1873
2195
|
position: relative;
|
|
1874
|
-
margin: 16px
|
|
2196
|
+
margin: 16px 0;
|
|
2197
|
+
border-radius: 8px;
|
|
1875
2198
|
background-color: var(--bp-code-block-bg);
|
|
1876
2199
|
overflow-x: auto;
|
|
1877
2200
|
transition: background-color 0.5s;
|
|
1878
2201
|
}
|
|
1879
2202
|
|
|
1880
|
-
|
|
1881
|
-
|
|
1882
|
-
|
|
1883
|
-
.bp-block {
|
|
1884
|
-
border-radius: 8px;
|
|
1885
|
-
margin: 16px 0;
|
|
1886
|
-
}
|
|
1887
|
-
}
|
|
1888
|
-
|
|
1889
|
-
@media (max-width: 639px) {
|
|
1890
|
-
.bp-doc li div[class*='language-'],
|
|
1891
|
-
.bp-doc li pre[data-lang] {
|
|
1892
|
-
border-radius: 8px 0 0 8px;
|
|
1893
|
-
}
|
|
1894
|
-
}
|
|
1895
|
-
|
|
2203
|
+
/* Wrapper divs that belong to one code group are pulled together. Bare
|
|
2204
|
+
* \`pre[data-lang]\` siblings are NOT a group \u2014 they are independent examples,
|
|
2205
|
+
* and the negative margin made consecutive blocks overlap into one slab. */
|
|
1896
2206
|
.bp-doc div[class*='language-'] + div[class*='language-'],
|
|
1897
2207
|
.bp-doc div[class$='-api'] + div[class*='language-'],
|
|
1898
|
-
.bp-doc div[class*='language-'] + div[class$='-api'] > div[class*='language-']
|
|
1899
|
-
.bp-doc pre[data-lang] + pre[data-lang] {
|
|
2208
|
+
.bp-doc div[class*='language-'] + div[class$='-api'] > div[class*='language-'] {
|
|
1900
2209
|
margin-top: -8px;
|
|
1901
2210
|
}
|
|
1902
2211
|
|
|
@@ -1913,13 +2222,20 @@ mjx-container > svg {
|
|
|
1913
2222
|
.bp-doc pre[data-lang] {
|
|
1914
2223
|
position: relative;
|
|
1915
2224
|
z-index: 1;
|
|
1916
|
-
margin: 0;
|
|
1917
2225
|
padding: 20px 0;
|
|
1918
|
-
background: transparent;
|
|
1919
2226
|
overflow-x: auto;
|
|
1920
2227
|
text-align: left;
|
|
1921
2228
|
}
|
|
1922
2229
|
|
|
2230
|
+
/* A pre nested in a language wrapper is not the block \u2014 the wrapper is \u2014 so it
|
|
2231
|
+
* contributes neither margin nor background of its own. A bare pre[data-lang]
|
|
2232
|
+
* IS the block and must keep the margin set above; zeroing it here (the rule
|
|
2233
|
+
* this splits out of) is what let consecutive blocks run together. */
|
|
2234
|
+
.bp-doc [class*='language-'] pre {
|
|
2235
|
+
margin: 0;
|
|
2236
|
+
background: transparent;
|
|
2237
|
+
}
|
|
2238
|
+
|
|
1923
2239
|
.bp-doc [class*='language-'] code,
|
|
1924
2240
|
.bp-doc pre[data-lang] code {
|
|
1925
2241
|
display: block;
|
|
@@ -1932,14 +2248,21 @@ mjx-container > svg {
|
|
|
1932
2248
|
transition: color 0.5s;
|
|
1933
2249
|
}
|
|
1934
2250
|
|
|
2251
|
+
/* Marked rows bleed through the code element's 24px gutters so the band spans
|
|
2252
|
+
* the full block, not just the text column. min-width (rather than width) keeps
|
|
2253
|
+
* a line longer than the block from being clipped mid-band when it scrolls. */
|
|
2254
|
+
.bp-doc [class*='language-'] code :is(.highlighted, .diff, .diff-add, .diff-remove, .has-error, .has-warning),
|
|
2255
|
+
.bp-doc pre[data-lang] code :is(.highlighted, .diff, .diff-add, .diff-remove, .has-error, .has-warning) {
|
|
2256
|
+
display: inline-block;
|
|
2257
|
+
margin: 0 -24px;
|
|
2258
|
+
padding: 0 24px;
|
|
2259
|
+
min-width: calc(100% + 2 * 24px);
|
|
2260
|
+
transition: background-color 0.5s;
|
|
2261
|
+
}
|
|
2262
|
+
|
|
1935
2263
|
.bp-doc [class*='language-'] code .highlighted,
|
|
1936
2264
|
.bp-doc pre[data-lang] code .highlighted {
|
|
1937
2265
|
background-color: var(--bp-code-line-highlight-color);
|
|
1938
|
-
transition: background-color 0.5s;
|
|
1939
|
-
margin: 0 -24px;
|
|
1940
|
-
padding: 0 24px;
|
|
1941
|
-
width: calc(100% + 2 * 24px);
|
|
1942
|
-
display: inline-block;
|
|
1943
2266
|
}
|
|
1944
2267
|
|
|
1945
2268
|
.bp-doc [class*='language-'] code .highlighted.error,
|
|
@@ -1952,65 +2275,63 @@ mjx-container > svg {
|
|
|
1952
2275
|
background-color: var(--bp-code-line-warning-color);
|
|
1953
2276
|
}
|
|
1954
2277
|
|
|
1955
|
-
|
|
1956
|
-
|
|
1957
|
-
|
|
1958
|
-
|
|
1959
|
-
|
|
1960
|
-
width: calc(100% + 2 * 24px);
|
|
1961
|
-
display: inline-block;
|
|
1962
|
-
}
|
|
1963
|
-
|
|
1964
|
-
.bp-doc [class*='language-'] code .diff::before,
|
|
1965
|
-
.bp-doc pre[data-lang] code .diff::before {
|
|
1966
|
-
position: absolute;
|
|
1967
|
-
left: 10px;
|
|
1968
|
-
}
|
|
1969
|
-
|
|
1970
|
-
/* Focus lines with blur effect - matches VitePress exactly */
|
|
1971
|
-
.bp-doc [class*='language-'] .has-focused-lines .line:not(.has-focus),
|
|
1972
|
-
.bp-doc pre[data-lang] .has-focused-lines .line:not(.has-focus) {
|
|
2278
|
+
/* Focus lines: unfocused rows blur back until the block is hovered.
|
|
2279
|
+
* The renderer marks them \`.dimmed\` (see processCodeBlock) \u2014 the upstream
|
|
2280
|
+
* \`:not(.has-focus)\` form never matched this markup. */
|
|
2281
|
+
.bp-doc [class*='language-'] .line.dimmed,
|
|
2282
|
+
.bp-doc pre[data-lang] .line.dimmed {
|
|
1973
2283
|
filter: blur(0.095rem);
|
|
1974
|
-
opacity: 0.4;
|
|
1975
|
-
transition: filter 0.35s, opacity 0.35s;
|
|
1976
|
-
}
|
|
1977
|
-
|
|
1978
|
-
/* VitePress has a second rule that overrides the opacity to 0.7 */
|
|
1979
|
-
.bp-doc [class*='language-'] .has-focused-lines .line:not(.has-focus),
|
|
1980
|
-
.bp-doc pre[data-lang] .has-focused-lines .line:not(.has-focus) {
|
|
1981
2284
|
opacity: 0.7;
|
|
1982
2285
|
transition: filter 0.35s, opacity 0.35s;
|
|
1983
2286
|
}
|
|
1984
2287
|
|
|
1985
|
-
.bp-doc [class*='language-']:hover .
|
|
1986
|
-
.bp-doc pre[data-lang]:hover .
|
|
2288
|
+
.bp-doc [class*='language-']:hover .line.dimmed,
|
|
2289
|
+
.bp-doc pre[data-lang]:hover .line.dimmed {
|
|
1987
2290
|
filter: blur(0);
|
|
1988
2291
|
opacity: 1;
|
|
1989
2292
|
}
|
|
1990
2293
|
|
|
1991
|
-
|
|
1992
|
-
|
|
2294
|
+
/* Both class spellings: \`.diff.remove\` is the upstream form, \`.diff-remove\`
|
|
2295
|
+
* is what processCodeBlock emits. */
|
|
2296
|
+
.bp-doc [class*='language-'] code :is(.diff.remove, .diff-remove),
|
|
2297
|
+
.bp-doc pre[data-lang] code :is(.diff.remove, .diff-remove) {
|
|
1993
2298
|
background-color: var(--bp-code-line-diff-remove-color);
|
|
1994
|
-
opacity: 0.7;
|
|
1995
2299
|
}
|
|
1996
2300
|
|
|
1997
|
-
.bp-doc [class*='language-'] code .diff.remove::before,
|
|
1998
|
-
.bp-doc pre[data-lang] code .diff.remove::before {
|
|
2301
|
+
.bp-doc [class*='language-'] code :is(.diff.remove, .diff-remove)::before,
|
|
2302
|
+
.bp-doc pre[data-lang] code :is(.diff.remove, .diff-remove)::before {
|
|
1999
2303
|
content: '-';
|
|
2000
2304
|
color: var(--bp-code-line-diff-remove-symbol-color);
|
|
2001
2305
|
}
|
|
2002
2306
|
|
|
2003
|
-
.bp-doc [class*='language-'] code .diff.add,
|
|
2004
|
-
.bp-doc pre[data-lang] code .diff.add {
|
|
2307
|
+
.bp-doc [class*='language-'] code :is(.diff.add, .diff-add),
|
|
2308
|
+
.bp-doc pre[data-lang] code :is(.diff.add, .diff-add) {
|
|
2005
2309
|
background-color: var(--bp-code-line-diff-add-color);
|
|
2006
2310
|
}
|
|
2007
2311
|
|
|
2008
|
-
.bp-doc [class*='language-'] code .diff.add::before,
|
|
2009
|
-
.bp-doc pre[data-lang] code .diff.add::before {
|
|
2312
|
+
.bp-doc [class*='language-'] code :is(.diff.add, .diff-add)::before,
|
|
2313
|
+
.bp-doc pre[data-lang] code :is(.diff.add, .diff-add)::before {
|
|
2010
2314
|
content: '+';
|
|
2011
2315
|
color: var(--bp-code-line-diff-add-symbol-color);
|
|
2012
2316
|
}
|
|
2013
2317
|
|
|
2318
|
+
/* The +/- glyph lives in the 24px gutter the row bleeds into. */
|
|
2319
|
+
.bp-doc [class*='language-'] code :is(.diff, .diff-add, .diff-remove)::before,
|
|
2320
|
+
.bp-doc pre[data-lang] code :is(.diff, .diff-add, .diff-remove)::before {
|
|
2321
|
+
position: absolute;
|
|
2322
|
+
left: 8px;
|
|
2323
|
+
}
|
|
2324
|
+
|
|
2325
|
+
.bp-doc [class*='language-'] code :is(.has-error, .highlighted.error),
|
|
2326
|
+
.bp-doc pre[data-lang] code :is(.has-error, .highlighted.error) {
|
|
2327
|
+
background-color: var(--bp-code-line-error-color);
|
|
2328
|
+
}
|
|
2329
|
+
|
|
2330
|
+
.bp-doc [class*='language-'] code :is(.has-warning, .highlighted.warning),
|
|
2331
|
+
.bp-doc pre[data-lang] code :is(.has-warning, .highlighted.warning) {
|
|
2332
|
+
background-color: var(--bp-code-line-warning-color);
|
|
2333
|
+
}
|
|
2334
|
+
|
|
2014
2335
|
/* Line numbers */
|
|
2015
2336
|
.bp-doc div[class*='language-'].line-numbers-mode,
|
|
2016
2337
|
.bp-doc pre[data-lang].line-numbers-mode {
|
|
@@ -2180,7 +2501,7 @@ mjx-container > svg {
|
|
|
2180
2501
|
.bp-doc .custom-block .bp-code-group .tabs {
|
|
2181
2502
|
margin: 0;
|
|
2182
2503
|
border-radius: 8px 8px 0 0;
|
|
2183
|
-
}
|
|
2504
|
+
}`}
|
|
2184
2505
|
${`/**
|
|
2185
2506
|
* VitePress Theme for BunPress - Layout & Chrome
|
|
2186
2507
|
* -------------------------------------------------------------------------- */
|
|
@@ -2230,9 +2551,15 @@ ${`/**
|
|
|
2230
2551
|
}
|
|
2231
2552
|
|
|
2232
2553
|
.BPNavBarTitle {
|
|
2233
|
-
|
|
2234
|
-
|
|
2554
|
+
/* block (not inline-flex) so text-overflow applies: a long site title must
|
|
2555
|
+
* yield instead of sliding underneath the icons on the right. min-width:0
|
|
2556
|
+
* lets the flex item actually shrink below its content width. */
|
|
2557
|
+
display: block;
|
|
2558
|
+
min-width: 0;
|
|
2559
|
+
overflow: hidden;
|
|
2560
|
+
text-overflow: ellipsis;
|
|
2235
2561
|
font-size: 16px;
|
|
2562
|
+
line-height: 1.5;
|
|
2236
2563
|
font-weight: 750;
|
|
2237
2564
|
color: var(--bp-c-text-1);
|
|
2238
2565
|
white-space: nowrap;
|
|
@@ -2333,60 +2660,68 @@ ${`/**
|
|
|
2333
2660
|
background-color: var(--bp-c-bg-soft);
|
|
2334
2661
|
}
|
|
2335
2662
|
|
|
2336
|
-
/* Search
|
|
2663
|
+
/* Search trigger. A button that looks like a field: the real input lives in
|
|
2664
|
+
* the search dialog it opens. */
|
|
2337
2665
|
.BPNavBarSearch {
|
|
2338
|
-
position: relative;
|
|
2339
2666
|
display: flex;
|
|
2340
2667
|
align-items: center;
|
|
2341
|
-
|
|
2342
|
-
width: 100%;
|
|
2343
|
-
}
|
|
2344
|
-
|
|
2345
|
-
.BPNavBarSearch-icon {
|
|
2346
|
-
position: absolute;
|
|
2347
|
-
left: 12px;
|
|
2348
|
-
width: 16px;
|
|
2349
|
-
height: 16px;
|
|
2350
|
-
color: var(--bp-c-text-3);
|
|
2351
|
-
pointer-events: none;
|
|
2352
|
-
}
|
|
2353
|
-
|
|
2354
|
-
.BPNavBarSearch-input {
|
|
2668
|
+
gap: 8px;
|
|
2355
2669
|
width: 100%;
|
|
2670
|
+
max-width: 240px;
|
|
2356
2671
|
height: 32px;
|
|
2357
|
-
padding: 0
|
|
2358
|
-
font: inherit;
|
|
2672
|
+
padding: 0 8px 0 10px;
|
|
2673
|
+
font-family: inherit;
|
|
2359
2674
|
font-size: 13px;
|
|
2675
|
+
text-align: left;
|
|
2676
|
+
color: var(--bp-c-text-3);
|
|
2360
2677
|
background-color: var(--bp-c-bg-alt);
|
|
2361
2678
|
border: 1px solid var(--bp-c-divider);
|
|
2362
|
-
border-radius:
|
|
2363
|
-
|
|
2364
|
-
|
|
2365
|
-
transition: border-color 0.25s, background-color 0.25s;
|
|
2366
|
-
}
|
|
2367
|
-
|
|
2368
|
-
.BPNavBarSearch-input::placeholder {
|
|
2369
|
-
color: var(--bp-c-text-3);
|
|
2679
|
+
border-radius: 6px;
|
|
2680
|
+
cursor: pointer;
|
|
2681
|
+
transition: border-color 0.25s, background-color 0.25s, color 0.25s;
|
|
2370
2682
|
}
|
|
2371
2683
|
|
|
2372
|
-
.BPNavBarSearch
|
|
2373
|
-
|
|
2684
|
+
.BPNavBarSearch:hover {
|
|
2685
|
+
color: var(--bp-c-text-2);
|
|
2374
2686
|
border-color: var(--bp-c-brand-1);
|
|
2375
2687
|
background-color: var(--bp-c-bg);
|
|
2376
2688
|
}
|
|
2377
2689
|
|
|
2690
|
+
.BPNavBarSearch:focus-visible {
|
|
2691
|
+
outline: 2px solid var(--bp-c-brand-1);
|
|
2692
|
+
outline-offset: 2px;
|
|
2693
|
+
}
|
|
2694
|
+
|
|
2695
|
+
.BPNavBarSearch-icon {
|
|
2696
|
+
width: 15px;
|
|
2697
|
+
height: 15px;
|
|
2698
|
+
flex-shrink: 0;
|
|
2699
|
+
}
|
|
2700
|
+
|
|
2701
|
+
.BPNavBarSearch-label {
|
|
2702
|
+
flex: 1;
|
|
2703
|
+
min-width: 0;
|
|
2704
|
+
overflow: hidden;
|
|
2705
|
+
text-overflow: ellipsis;
|
|
2706
|
+
white-space: nowrap;
|
|
2707
|
+
}
|
|
2708
|
+
|
|
2378
2709
|
.BPNavBarSearch-kbd {
|
|
2379
|
-
|
|
2380
|
-
|
|
2381
|
-
padding: 2px 6px;
|
|
2710
|
+
flex-shrink: 0;
|
|
2711
|
+
padding: 1px 5px;
|
|
2382
2712
|
font-size: 11px;
|
|
2383
2713
|
font-weight: 600;
|
|
2384
2714
|
font-family: inherit;
|
|
2715
|
+
line-height: 1.5;
|
|
2385
2716
|
color: var(--bp-c-text-3);
|
|
2386
2717
|
background-color: var(--bp-c-bg);
|
|
2387
2718
|
border: 1px solid var(--bp-c-divider);
|
|
2388
2719
|
border-radius: 4px;
|
|
2389
|
-
|
|
2720
|
+
}
|
|
2721
|
+
|
|
2722
|
+
.BPSocialLinks-text {
|
|
2723
|
+
font-size: 13px;
|
|
2724
|
+
font-weight: 500;
|
|
2390
2725
|
}
|
|
2391
2726
|
|
|
2392
2727
|
/* Social/icon links cluster */
|
|
@@ -2467,16 +2802,51 @@ ${`/**
|
|
|
2467
2802
|
|
|
2468
2803
|
/* Mobile sidebar drawer behaviour */
|
|
2469
2804
|
@media (max-width: 959px) {
|
|
2805
|
+
/* Collapses to an icon button rather than disappearing: search is the main
|
|
2806
|
+
* way to get around a docs site on a phone, where the sidebar is behind a
|
|
2807
|
+
* drawer and the TOC behind a disclosure. */
|
|
2470
2808
|
.BPNavBarSearch {
|
|
2809
|
+
width: 36px;
|
|
2810
|
+
max-width: none;
|
|
2811
|
+
padding: 0;
|
|
2812
|
+
justify-content: center;
|
|
2813
|
+
background-color: transparent;
|
|
2814
|
+
border-color: transparent;
|
|
2815
|
+
}
|
|
2816
|
+
.BPNavBarSearch-label,
|
|
2817
|
+
.BPNavBarSearch-kbd {
|
|
2471
2818
|
display: none;
|
|
2472
2819
|
}
|
|
2820
|
+
.BPNavBarSearch-icon {
|
|
2821
|
+
width: 18px;
|
|
2822
|
+
height: 18px;
|
|
2823
|
+
}
|
|
2473
2824
|
.BPSocialLinks {
|
|
2474
|
-
|
|
2475
|
-
|
|
2825
|
+
/* The divider separates the nav links from the icons \u2014 with the links
|
|
2826
|
+
* hidden it is a rule floating against the title, so drop it. */
|
|
2827
|
+
padding-left: 0;
|
|
2828
|
+
border-left: none;
|
|
2829
|
+
gap: 4px;
|
|
2476
2830
|
}
|
|
2477
2831
|
.BPNavBarMenu {
|
|
2478
2832
|
display: none;
|
|
2479
2833
|
}
|
|
2834
|
+
.BPNavBar {
|
|
2835
|
+
padding: 0 16px;
|
|
2836
|
+
gap: 12px;
|
|
2837
|
+
}
|
|
2838
|
+
.BPNavBarStart {
|
|
2839
|
+
gap: 8px;
|
|
2840
|
+
}
|
|
2841
|
+
.BPNavBarEnd {
|
|
2842
|
+
gap: 4px;
|
|
2843
|
+
}
|
|
2844
|
+
}
|
|
2845
|
+
|
|
2846
|
+
@media (max-width: 419px) {
|
|
2847
|
+
.BPNavBarTitle {
|
|
2848
|
+
font-size: 15px;
|
|
2849
|
+
}
|
|
2480
2850
|
}
|
|
2481
2851
|
|
|
2482
2852
|
/**
|
|
@@ -2484,7 +2854,7 @@ ${`/**
|
|
|
2484
2854
|
* -------------------------------------------------------------------------- */
|
|
2485
2855
|
|
|
2486
2856
|
.BPHero-name {
|
|
2487
|
-
font-size:
|
|
2857
|
+
font-size: clamp(18px, 4vw, 24px);
|
|
2488
2858
|
font-weight: 700;
|
|
2489
2859
|
letter-spacing: -0.02em;
|
|
2490
2860
|
line-height: 1.2;
|
|
@@ -2495,36 +2865,29 @@ ${`/**
|
|
|
2495
2865
|
background-clip: text;
|
|
2496
2866
|
}
|
|
2497
2867
|
|
|
2868
|
+
/* Fluid rather than stepped: a fixed 48px headline on a 375px phone puts a
|
|
2869
|
+
* single long word (\`documentation\`) wider than the viewport, and a hard
|
|
2870
|
+
* breakpoint only moves the problem to the widths either side of it. */
|
|
2498
2871
|
.BPHero-text {
|
|
2499
|
-
font-size:
|
|
2872
|
+
font-size: clamp(30px, 8vw, 56px);
|
|
2500
2873
|
font-weight: 800;
|
|
2501
2874
|
letter-spacing: -0.02em;
|
|
2502
2875
|
line-height: 1.1;
|
|
2503
2876
|
color: var(--bp-c-text-1);
|
|
2504
2877
|
margin: 0 0 8px;
|
|
2878
|
+
/* Last resort for a word that still cannot fit at the minimum size. */
|
|
2879
|
+
overflow-wrap: break-word;
|
|
2505
2880
|
}
|
|
2506
2881
|
|
|
2507
2882
|
.BPHero-tagline {
|
|
2508
2883
|
max-width: 720px;
|
|
2509
|
-
font-size:
|
|
2884
|
+
font-size: clamp(16px, 2.4vw, 20px);
|
|
2510
2885
|
font-weight: 400;
|
|
2511
2886
|
line-height: 1.6;
|
|
2512
2887
|
color: var(--bp-c-text-2);
|
|
2513
2888
|
margin: 12px 0 0;
|
|
2514
2889
|
}
|
|
2515
2890
|
|
|
2516
|
-
@media (min-width: 960px) {
|
|
2517
|
-
.BPHero-name {
|
|
2518
|
-
font-size: 24px;
|
|
2519
|
-
}
|
|
2520
|
-
.BPHero-text {
|
|
2521
|
-
font-size: 56px;
|
|
2522
|
-
}
|
|
2523
|
-
.BPHero-tagline {
|
|
2524
|
-
font-size: 20px;
|
|
2525
|
-
}
|
|
2526
|
-
}
|
|
2527
|
-
|
|
2528
2891
|
.BPHero-actions {
|
|
2529
2892
|
display: flex;
|
|
2530
2893
|
flex-wrap: wrap;
|
|
@@ -2664,6 +3027,13 @@ ${`/**
|
|
|
2664
3027
|
* Wrapped as .BPHome-content > .bp-doc.vp-doc.container by markdownToHtml.
|
|
2665
3028
|
* -------------------------------------------------------------------------- */
|
|
2666
3029
|
|
|
3030
|
+
/* The nav is fixed, so the home layout has to reserve its height. Previously
|
|
3031
|
+
* only the hero's own top padding cleared it, which meant any change to that
|
|
3032
|
+
* padding slid the first line of the hero under the bar. */
|
|
3033
|
+
.BPHome {
|
|
3034
|
+
padding-top: var(--bp-nav-height, 64px);
|
|
3035
|
+
}
|
|
3036
|
+
|
|
2667
3037
|
.BPHome-content {
|
|
2668
3038
|
padding: 48px 24px 96px;
|
|
2669
3039
|
}
|
|
@@ -2683,6 +3053,17 @@ ${`/**
|
|
|
2683
3053
|
* Inline content \u2014 badges, external link icons
|
|
2684
3054
|
* -------------------------------------------------------------------------- */
|
|
2685
3055
|
|
|
3056
|
+
/* The UA default is pure yellow with forced black text, which is jarring in
|
|
3057
|
+
* light mode and unreadable against a dark page. */
|
|
3058
|
+
.bp-doc mark {
|
|
3059
|
+
padding: 1px 3px;
|
|
3060
|
+
border-radius: 3px;
|
|
3061
|
+
background-color: var(--bp-c-warning-soft, rgba(234, 179, 8, 0.28));
|
|
3062
|
+
color: inherit;
|
|
3063
|
+
-webkit-box-decoration-break: clone;
|
|
3064
|
+
box-decoration-break: clone;
|
|
3065
|
+
}
|
|
3066
|
+
|
|
2686
3067
|
.badge {
|
|
2687
3068
|
display: inline-block;
|
|
2688
3069
|
padding: 2px 8px;
|
|
@@ -2732,14 +3113,8 @@ ${`/**
|
|
|
2732
3113
|
* -------------------------------------------------------------------------- */
|
|
2733
3114
|
|
|
2734
3115
|
/* Subtle row hover on tables */
|
|
2735
|
-
.bp-doc tr:hover {
|
|
2736
|
-
background-color: var(--bp-c-
|
|
2737
|
-
}
|
|
2738
|
-
|
|
2739
|
-
/* Mobile-safe table scroll */
|
|
2740
|
-
.bp-doc table {
|
|
2741
|
-
width: 100%;
|
|
2742
|
-
max-width: 100%;
|
|
3116
|
+
.bp-doc tbody tr:hover {
|
|
3117
|
+
background-color: var(--bp-c-default-soft, var(--bp-c-gray-soft));
|
|
2743
3118
|
}
|
|
2744
3119
|
|
|
2745
3120
|
/* Slightly stronger blockquote with brand-tinted accent */
|
|
@@ -2773,23 +3148,85 @@ ${`/**
|
|
|
2773
3148
|
color: var(--bp-c-brand-1);
|
|
2774
3149
|
}
|
|
2775
3150
|
|
|
3151
|
+
/**
|
|
3152
|
+
* Layout scrollbars
|
|
3153
|
+
* --------------------------------------------------------------------------
|
|
3154
|
+
* The doc layout scrolls in independent panes, so on any platform with
|
|
3155
|
+
* always-visible scrollbars the reader gets full-height grey tracks down the
|
|
3156
|
+
* middle of the page. Thin them to match the code-block treatment. (The TOC
|
|
3157
|
+
* aside hides its scrollbar outright \u2014 see page-toc.stx.)
|
|
3158
|
+
*/
|
|
3159
|
+
|
|
3160
|
+
.BPSidebar,
|
|
3161
|
+
.BPContent--doc {
|
|
3162
|
+
scrollbar-width: thin;
|
|
3163
|
+
scrollbar-color: var(--bp-c-divider) transparent;
|
|
3164
|
+
}
|
|
3165
|
+
|
|
3166
|
+
.BPSidebar::-webkit-scrollbar,
|
|
3167
|
+
.BPContent--doc::-webkit-scrollbar {
|
|
3168
|
+
width: 8px;
|
|
3169
|
+
height: 8px;
|
|
3170
|
+
}
|
|
3171
|
+
|
|
3172
|
+
.BPSidebar::-webkit-scrollbar-track,
|
|
3173
|
+
.BPContent--doc::-webkit-scrollbar-track {
|
|
3174
|
+
background: transparent;
|
|
3175
|
+
}
|
|
3176
|
+
|
|
3177
|
+
.BPSidebar::-webkit-scrollbar-thumb,
|
|
3178
|
+
.BPContent--doc::-webkit-scrollbar-thumb {
|
|
3179
|
+
background-color: var(--bp-c-divider);
|
|
3180
|
+
border-radius: 4px;
|
|
3181
|
+
}
|
|
3182
|
+
|
|
3183
|
+
.BPSidebar:hover::-webkit-scrollbar-thumb,
|
|
3184
|
+
.BPContent--doc:hover::-webkit-scrollbar-thumb {
|
|
3185
|
+
background-color: var(--bp-c-text-3);
|
|
3186
|
+
}
|
|
3187
|
+
|
|
3188
|
+
/**
|
|
3189
|
+
* Keyboard focus
|
|
3190
|
+
* --------------------------------------------------------------------------
|
|
3191
|
+
* :focus-visible only, so pointer users never see a ring, but every
|
|
3192
|
+
* interactive control in the chrome is reachable and visible by keyboard.
|
|
3193
|
+
*/
|
|
3194
|
+
|
|
3195
|
+
.BPNavBarTitle:focus-visible,
|
|
3196
|
+
.BPNavBarMenu a:focus-visible,
|
|
3197
|
+
.BPSocialLinks > a:focus-visible,
|
|
3198
|
+
.BPNavBarHamburger:focus-visible,
|
|
3199
|
+
.theme-toggle:focus-visible,
|
|
3200
|
+
.BPSidebarItem-link:focus-visible,
|
|
3201
|
+
.sidebar-section-toggle:focus-visible,
|
|
3202
|
+
.BPDocAside a:focus-visible,
|
|
3203
|
+
.bp-doc a:focus-visible,
|
|
3204
|
+
.BPButton:focus-visible {
|
|
3205
|
+
outline: 2px solid var(--bp-c-brand-1);
|
|
3206
|
+
outline-offset: 2px;
|
|
3207
|
+
border-radius: 3px;
|
|
3208
|
+
}
|
|
3209
|
+
|
|
2776
3210
|
/**
|
|
2777
3211
|
* Mobile nav / sidebar drawer
|
|
2778
3212
|
* -------------------------------------------------------------------------- */
|
|
2779
3213
|
|
|
2780
3214
|
.BPNavBarHamburger {
|
|
2781
3215
|
display: none;
|
|
2782
|
-
|
|
2783
|
-
|
|
3216
|
+
/* 40px keeps the hit area at the minimum comfortable touch target even
|
|
3217
|
+
* though the icon itself is 20px. */
|
|
3218
|
+
width: 40px;
|
|
3219
|
+
height: 40px;
|
|
3220
|
+
flex-shrink: 0;
|
|
2784
3221
|
background: transparent;
|
|
2785
3222
|
border: none;
|
|
2786
3223
|
cursor: pointer;
|
|
2787
3224
|
align-items: center;
|
|
2788
3225
|
justify-content: center;
|
|
2789
3226
|
color: var(--bp-c-text-2);
|
|
2790
|
-
border-radius:
|
|
3227
|
+
border-radius: 8px;
|
|
2791
3228
|
padding: 0;
|
|
2792
|
-
margin-left: -
|
|
3229
|
+
margin-left: -8px;
|
|
2793
3230
|
}
|
|
2794
3231
|
|
|
2795
3232
|
.BPNavBarHamburger:hover {
|
|
@@ -2822,7 +3259,13 @@ ${`/**
|
|
|
2822
3259
|
|
|
2823
3260
|
.BPSidebar-backdrop {
|
|
2824
3261
|
position: fixed;
|
|
2825
|
-
|
|
3262
|
+
/* Starts below the nav: the drawer opens under the bar, so scrimming the
|
|
3263
|
+
* bar too dims the very controls (menu button, theme toggle) that stay
|
|
3264
|
+
* live while the drawer is open. */
|
|
3265
|
+
top: var(--bp-nav-height, 64px);
|
|
3266
|
+
right: 0;
|
|
3267
|
+
bottom: 0;
|
|
3268
|
+
left: 0;
|
|
2826
3269
|
background-color: rgba(0, 0, 0, 0.32);
|
|
2827
3270
|
opacity: 0;
|
|
2828
3271
|
pointer-events: none;
|
|
@@ -2838,16 +3281,31 @@ ${`/**
|
|
|
2838
3281
|
.BPContent--doc {
|
|
2839
3282
|
left: 0;
|
|
2840
3283
|
}
|
|
3284
|
+
|
|
3285
|
+
.BPDoc {
|
|
3286
|
+
padding: 24px 20px 64px;
|
|
3287
|
+
}
|
|
3288
|
+
}
|
|
3289
|
+
|
|
3290
|
+
/* Small phones: reclaim horizontal space from the gutters. */
|
|
3291
|
+
@media (max-width: 419px) {
|
|
3292
|
+
.BPDoc {
|
|
3293
|
+
padding: 20px 16px 56px;
|
|
3294
|
+
}
|
|
2841
3295
|
}
|
|
2842
3296
|
`}
|
|
2843
|
-
|
|
3297
|
+
${`/**
|
|
2844
3298
|
* VitePress Theme for BunPress - Custom Blocks
|
|
2845
3299
|
* -------------------------------------------------------------------------- */
|
|
2846
3300
|
|
|
2847
3301
|
.custom-block {
|
|
2848
|
-
|
|
3302
|
+
/* Accent lives on the leading edge only \u2014 the other sides stay zero-width so
|
|
3303
|
+
* a variant's \`border-color\` can't paint a full outline. The tint alone is
|
|
3304
|
+
* easy to miss when scanning; a 4px rail reads at any zoom level. */
|
|
3305
|
+
border: 0 solid transparent;
|
|
3306
|
+
border-left-width: 4px;
|
|
2849
3307
|
border-radius: 8px;
|
|
2850
|
-
padding:
|
|
3308
|
+
padding: 14px 16px;
|
|
2851
3309
|
line-height: 24px;
|
|
2852
3310
|
font-size: var(--bp-custom-block-font-size);
|
|
2853
3311
|
color: var(--bp-c-text-2);
|
|
@@ -3013,18 +3471,75 @@ ${`/**
|
|
|
3013
3471
|
}
|
|
3014
3472
|
|
|
3015
3473
|
.custom-block-title {
|
|
3016
|
-
|
|
3474
|
+
margin-bottom: 6px;
|
|
3475
|
+
font-weight: 700;
|
|
3476
|
+
font-size: 13px;
|
|
3477
|
+
letter-spacing: 0.03em;
|
|
3478
|
+
text-transform: uppercase;
|
|
3479
|
+
}
|
|
3480
|
+
|
|
3481
|
+
/* The title supplies the block's leading margin, so the first body paragraph
|
|
3482
|
+
* must not add one on top of it. */
|
|
3483
|
+
.custom-block-title + * {
|
|
3484
|
+
margin-top: 0;
|
|
3017
3485
|
}
|
|
3018
3486
|
|
|
3019
3487
|
.custom-block p + p {
|
|
3020
3488
|
margin: 8px 0;
|
|
3021
3489
|
}
|
|
3022
3490
|
|
|
3023
|
-
|
|
3024
|
-
|
|
3491
|
+
/* The native disclosure triangle is unstyleable and sits at a different size
|
|
3492
|
+
* and colour in every engine, so it is replaced with a chevron that matches
|
|
3493
|
+
* the rest of the chrome. */
|
|
3494
|
+
.custom-block.details summary,
|
|
3495
|
+
.bp-doc .custom-block.details summary {
|
|
3496
|
+
display: flex;
|
|
3497
|
+
align-items: center;
|
|
3498
|
+
gap: 8px;
|
|
3499
|
+
margin: 0;
|
|
3025
3500
|
font-weight: 700;
|
|
3026
3501
|
cursor: pointer;
|
|
3027
3502
|
user-select: none;
|
|
3503
|
+
list-style: none;
|
|
3504
|
+
}
|
|
3505
|
+
|
|
3506
|
+
.custom-block.details summary::-webkit-details-marker {
|
|
3507
|
+
display: none;
|
|
3508
|
+
}
|
|
3509
|
+
|
|
3510
|
+
.custom-block.details summary::marker {
|
|
3511
|
+
content: '';
|
|
3512
|
+
}
|
|
3513
|
+
|
|
3514
|
+
.custom-block.details summary::before {
|
|
3515
|
+
content: '';
|
|
3516
|
+
flex-shrink: 0;
|
|
3517
|
+
width: 12px;
|
|
3518
|
+
height: 12px;
|
|
3519
|
+
background-color: currentColor;
|
|
3520
|
+
transition: transform 0.2s ease;
|
|
3521
|
+
--icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 18l6-6-6-6'/%3E%3C/svg%3E");
|
|
3522
|
+
-webkit-mask-image: var(--icon);
|
|
3523
|
+
mask-image: var(--icon);
|
|
3524
|
+
-webkit-mask-size: contain;
|
|
3525
|
+
mask-size: contain;
|
|
3526
|
+
-webkit-mask-repeat: no-repeat;
|
|
3527
|
+
mask-repeat: no-repeat;
|
|
3528
|
+
}
|
|
3529
|
+
|
|
3530
|
+
.custom-block.details[open] summary::before {
|
|
3531
|
+
transform: rotate(90deg);
|
|
3532
|
+
}
|
|
3533
|
+
|
|
3534
|
+
.custom-block.details summary:focus-visible {
|
|
3535
|
+
outline: 2px solid var(--bp-c-brand-1);
|
|
3536
|
+
outline-offset: 2px;
|
|
3537
|
+
border-radius: 3px;
|
|
3538
|
+
}
|
|
3539
|
+
|
|
3540
|
+
/* Body content only gains its top margin once the block is open. */
|
|
3541
|
+
.bp-doc .custom-block.details[open] summary {
|
|
3542
|
+
margin-bottom: 8px;
|
|
3028
3543
|
}
|
|
3029
3544
|
|
|
3030
3545
|
.custom-block.details summary + p {
|
|
@@ -3083,21 +3598,27 @@ ${`/**
|
|
|
3083
3598
|
* GitHub-Flavored Alerts (VitePress style)
|
|
3084
3599
|
* -------------------------------------------------------------------------- */
|
|
3085
3600
|
|
|
3601
|
+
/* Same box treatment as .custom-block \u2014 alerts and containers say the same
|
|
3602
|
+
* kind of thing, so they must not look like two unrelated systems. */
|
|
3086
3603
|
.github-alert {
|
|
3087
|
-
border:
|
|
3604
|
+
border: 0 solid transparent;
|
|
3605
|
+
border-left-width: 4px;
|
|
3088
3606
|
border-radius: 8px;
|
|
3089
|
-
padding:
|
|
3607
|
+
padding: 14px 16px;
|
|
3090
3608
|
line-height: 24px;
|
|
3091
3609
|
font-size: var(--bp-custom-block-font-size);
|
|
3092
3610
|
margin: 16px 0;
|
|
3093
3611
|
}
|
|
3094
3612
|
|
|
3095
|
-
.
|
|
3613
|
+
/* The title is a <p>, so .bp-doc's 16px paragraph margins have to be beaten
|
|
3614
|
+
* on specificity \u2014 otherwise the label floats half a line above its body. */
|
|
3615
|
+
.github-alert-title,
|
|
3616
|
+
.bp-doc .github-alert-title {
|
|
3096
3617
|
display: flex;
|
|
3097
3618
|
align-items: center;
|
|
3098
3619
|
gap: 8px;
|
|
3620
|
+
margin: 0 0 6px;
|
|
3099
3621
|
font-weight: 600;
|
|
3100
|
-
margin-bottom: 8px;
|
|
3101
3622
|
}
|
|
3102
3623
|
|
|
3103
3624
|
.github-alert-icon {
|
|
@@ -3110,14 +3631,24 @@ ${`/**
|
|
|
3110
3631
|
line-height: 24px;
|
|
3111
3632
|
}
|
|
3112
3633
|
|
|
3113
|
-
.github-alert-content p
|
|
3114
|
-
|
|
3634
|
+
.github-alert-content p,
|
|
3635
|
+
.bp-doc .github-alert-content p {
|
|
3636
|
+
margin: 0;
|
|
3115
3637
|
}
|
|
3116
3638
|
|
|
3117
|
-
.github-alert-content p
|
|
3639
|
+
.github-alert-content p + p,
|
|
3640
|
+
.bp-doc .github-alert-content p + p {
|
|
3641
|
+
margin-top: 12px;
|
|
3642
|
+
}
|
|
3643
|
+
|
|
3644
|
+
.bp-doc .github-alert-content > :first-child {
|
|
3118
3645
|
margin-top: 0;
|
|
3119
3646
|
}
|
|
3120
3647
|
|
|
3648
|
+
.bp-doc .github-alert-content > :last-child {
|
|
3649
|
+
margin-bottom: 0;
|
|
3650
|
+
}
|
|
3651
|
+
|
|
3121
3652
|
/* Note Alert */
|
|
3122
3653
|
.github-alert-note {
|
|
3123
3654
|
border-color: var(--bp-custom-block-note-border);
|
|
@@ -3191,8 +3722,8 @@ ${`/**
|
|
|
3191
3722
|
|
|
3192
3723
|
.github-alert-caution .github-alert-icon {
|
|
3193
3724
|
fill: var(--bp-c-caution-1);
|
|
3194
|
-
}
|
|
3195
|
-
|
|
3725
|
+
}`}
|
|
3726
|
+
${`/**
|
|
3196
3727
|
* VitePress Theme for BunPress - Code Groups
|
|
3197
3728
|
* -------------------------------------------------------------------------- */
|
|
3198
3729
|
|
|
@@ -3293,11 +3824,24 @@ ${`/**
|
|
|
3293
3824
|
display: block;
|
|
3294
3825
|
}
|
|
3295
3826
|
|
|
3296
|
-
.bp-block
|
|
3297
|
-
.code-group-panel {
|
|
3827
|
+
.bp-block {
|
|
3298
3828
|
padding: 20px 24px;
|
|
3299
3829
|
}
|
|
3300
3830
|
|
|
3831
|
+
/* The panel is a frame, not a padded box \u2014 the code block inside brings its
|
|
3832
|
+
* own padding, background and radius, and stacking the panel's on top of it
|
|
3833
|
+
* rendered a card inside a card with a gap under the tab bar. */
|
|
3834
|
+
.code-group-panel {
|
|
3835
|
+
padding: 0;
|
|
3836
|
+
}
|
|
3837
|
+
|
|
3838
|
+
.bp-doc .code-group-panel > pre,
|
|
3839
|
+
.bp-doc .code-group-panel > div[class*='language-'] {
|
|
3840
|
+
margin: 0;
|
|
3841
|
+
border: none;
|
|
3842
|
+
border-radius: 0;
|
|
3843
|
+
}
|
|
3844
|
+
|
|
3301
3845
|
/* Code group container */
|
|
3302
3846
|
.code-group {
|
|
3303
3847
|
margin: 16px 0;
|
|
@@ -3320,8 +3864,8 @@ ${`/**
|
|
|
3320
3864
|
margin: 0;
|
|
3321
3865
|
border-radius: 0;
|
|
3322
3866
|
border: none;
|
|
3323
|
-
}
|
|
3324
|
-
`}function
|
|
3867
|
+
}`}
|
|
3868
|
+
`}function WZ(){return`/**
|
|
3325
3869
|
* VitePress Theme for BunPress
|
|
3326
3870
|
* Colors: Solid
|
|
3327
3871
|
* -------------------------------------------------------------------------- */
|
|
@@ -3550,6 +4094,9 @@ ${`/**
|
|
|
3550
4094
|
--bp-z-index-layout-top: 40;
|
|
3551
4095
|
--bp-z-index-backdrop: 50;
|
|
3552
4096
|
--bp-z-index-sidebar: 60;
|
|
4097
|
+
/* Above the sidebar drawer: search opens over everything, including a
|
|
4098
|
+
* drawer left open behind it. */
|
|
4099
|
+
--bp-z-index-search: 200;
|
|
3553
4100
|
}
|
|
3554
4101
|
|
|
3555
4102
|
@media (min-width: 960px) {
|
|
@@ -3663,37 +4210,43 @@ ${`/**
|
|
|
3663
4210
|
--bp-custom-block-font-size: 14px;
|
|
3664
4211
|
--bp-custom-block-code-font-size: 13px;
|
|
3665
4212
|
|
|
3666
|
-
|
|
4213
|
+
/* The *-border colour is drawn only on the leading edge (see .custom-block),
|
|
4214
|
+
* so it carries the block's identity \u2014 hence a solid accent, not transparent.
|
|
4215
|
+
* Info/note are neutral, so they take a mid-grey: --bp-c-default-1 is a
|
|
4216
|
+
* near-white tint that vanishes against the block's own soft background. */
|
|
4217
|
+
--bp-custom-block-info-border: var(--bp-c-text-3);
|
|
3667
4218
|
--bp-custom-block-info-text: var(--bp-c-text-1);
|
|
3668
4219
|
--bp-custom-block-info-bg: var(--bp-c-default-soft);
|
|
3669
4220
|
--bp-custom-block-info-code-bg: var(--bp-c-default-soft);
|
|
3670
4221
|
|
|
3671
|
-
|
|
4222
|
+
/* note carries a brand-coloured title and icon, so its rail matches those
|
|
4223
|
+
* rather than the neutral background it shares with info. */
|
|
4224
|
+
--bp-custom-block-note-border: var(--bp-c-note-1);
|
|
3672
4225
|
--bp-custom-block-note-text: var(--bp-c-text-1);
|
|
3673
4226
|
--bp-custom-block-note-bg: var(--bp-c-default-soft);
|
|
3674
4227
|
--bp-custom-block-note-code-bg: var(--bp-c-default-soft);
|
|
3675
4228
|
|
|
3676
|
-
--bp-custom-block-tip-border:
|
|
4229
|
+
--bp-custom-block-tip-border: var(--bp-c-tip-1);
|
|
3677
4230
|
--bp-custom-block-tip-text: var(--bp-c-text-1);
|
|
3678
4231
|
--bp-custom-block-tip-bg: var(--bp-c-tip-soft);
|
|
3679
4232
|
--bp-custom-block-tip-code-bg: var(--bp-c-tip-soft);
|
|
3680
4233
|
|
|
3681
|
-
--bp-custom-block-important-border:
|
|
4234
|
+
--bp-custom-block-important-border: var(--bp-c-important-1);
|
|
3682
4235
|
--bp-custom-block-important-text: var(--bp-c-text-1);
|
|
3683
4236
|
--bp-custom-block-important-bg: var(--bp-c-important-soft);
|
|
3684
4237
|
--bp-custom-block-important-code-bg: var(--bp-c-important-soft);
|
|
3685
4238
|
|
|
3686
|
-
--bp-custom-block-warning-border:
|
|
4239
|
+
--bp-custom-block-warning-border: var(--bp-c-warning-1);
|
|
3687
4240
|
--bp-custom-block-warning-text: var(--bp-c-text-1);
|
|
3688
4241
|
--bp-custom-block-warning-bg: var(--bp-c-warning-soft);
|
|
3689
4242
|
--bp-custom-block-warning-code-bg: var(--bp-c-warning-soft);
|
|
3690
4243
|
|
|
3691
|
-
--bp-custom-block-danger-border:
|
|
4244
|
+
--bp-custom-block-danger-border: var(--bp-c-danger-1);
|
|
3692
4245
|
--bp-custom-block-danger-text: var(--bp-c-text-1);
|
|
3693
4246
|
--bp-custom-block-danger-bg: var(--bp-c-danger-soft);
|
|
3694
4247
|
--bp-custom-block-danger-code-bg: var(--bp-c-danger-soft);
|
|
3695
4248
|
|
|
3696
|
-
--bp-custom-block-caution-border:
|
|
4249
|
+
--bp-custom-block-caution-border: var(--bp-c-caution-1);
|
|
3697
4250
|
--bp-custom-block-caution-text: var(--bp-c-text-1);
|
|
3698
4251
|
--bp-custom-block-caution-bg: var(--bp-c-caution-soft);
|
|
3699
4252
|
--bp-custom-block-caution-code-bg: var(--bp-c-caution-soft);
|
|
@@ -4149,6 +4702,10 @@ mjx-container > svg {
|
|
|
4149
4702
|
position: relative;
|
|
4150
4703
|
font-weight: 600;
|
|
4151
4704
|
outline: none;
|
|
4705
|
+
/* Anchor jumps \u2014 from the outline, the sidebar or an external deep link \u2014
|
|
4706
|
+
* otherwise land the heading flush against the top edge of the scroll
|
|
4707
|
+
* container, with no separation from the chrome above it. */
|
|
4708
|
+
scroll-margin-top: 24px;
|
|
4152
4709
|
}
|
|
4153
4710
|
|
|
4154
4711
|
.bp-doc h1 {
|
|
@@ -4260,6 +4817,12 @@ mjx-container > svg {
|
|
|
4260
4817
|
transition: color 0.5s;
|
|
4261
4818
|
}
|
|
4262
4819
|
|
|
4820
|
+
/* Zeroing every paragraph margin ran a multi-paragraph quote together as if
|
|
4821
|
+
* it were one block of prose. */
|
|
4822
|
+
.bp-doc blockquote > p + p {
|
|
4823
|
+
margin-top: 16px;
|
|
4824
|
+
}
|
|
4825
|
+
|
|
4263
4826
|
.bp-doc a {
|
|
4264
4827
|
font-weight: 500;
|
|
4265
4828
|
color: var(--bp-c-brand-1);
|
|
@@ -4280,27 +4843,72 @@ mjx-container > svg {
|
|
|
4280
4843
|
* Lists
|
|
4281
4844
|
* -------------------------------------------------------------------------- */
|
|
4282
4845
|
|
|
4846
|
+
/* Markers hang in the gutter (\`outside\`) so wrapped lines stay flush with the
|
|
4847
|
+
* first line \u2014 the single biggest readability win for multi-line bullets. The
|
|
4848
|
+
* indent is wide enough for two-digit ordered markers without clipping. */
|
|
4283
4849
|
.bp-doc ul,
|
|
4284
4850
|
.bp-doc ol {
|
|
4285
|
-
padding-left: 1.
|
|
4851
|
+
padding-left: 1.5rem;
|
|
4286
4852
|
margin: 16px 0;
|
|
4853
|
+
list-style-position: outside;
|
|
4287
4854
|
}
|
|
4288
4855
|
|
|
4289
4856
|
.bp-doc ul {
|
|
4290
|
-
list-style: disc;
|
|
4857
|
+
list-style-type: disc;
|
|
4291
4858
|
}
|
|
4292
4859
|
|
|
4293
4860
|
.bp-doc ol {
|
|
4294
|
-
list-style: decimal;
|
|
4861
|
+
list-style-type: decimal;
|
|
4295
4862
|
}
|
|
4296
4863
|
|
|
4297
|
-
.bp-doc li
|
|
4298
|
-
margin
|
|
4864
|
+
.bp-doc li {
|
|
4865
|
+
margin: 6px 0;
|
|
4866
|
+
line-height: 1.75;
|
|
4867
|
+
}
|
|
4868
|
+
|
|
4869
|
+
.bp-doc li::marker {
|
|
4870
|
+
color: var(--bp-c-text-3);
|
|
4871
|
+
}
|
|
4872
|
+
|
|
4873
|
+
.bp-doc ol > li::marker {
|
|
4874
|
+
font-variant-numeric: tabular-nums;
|
|
4299
4875
|
}
|
|
4300
4876
|
|
|
4877
|
+
/* A nested list belongs to its parent item, so it hugs it rather than
|
|
4878
|
+
* inheriting the full inter-item gap. */
|
|
4301
4879
|
.bp-doc li > ol,
|
|
4302
4880
|
.bp-doc li > ul {
|
|
4303
|
-
margin:
|
|
4881
|
+
margin: 6px 0 0;
|
|
4882
|
+
padding-left: 1.5rem;
|
|
4883
|
+
}
|
|
4884
|
+
|
|
4885
|
+
.bp-doc ul ul {
|
|
4886
|
+
list-style-type: circle;
|
|
4887
|
+
}
|
|
4888
|
+
|
|
4889
|
+
.bp-doc ul ul ul {
|
|
4890
|
+
list-style-type: square;
|
|
4891
|
+
}
|
|
4892
|
+
|
|
4893
|
+
/* Loose lists (blank lines between items) wrap each item's text in a <p>.
|
|
4894
|
+
* Without this the paragraph's 16px margins double the list's spacing. */
|
|
4895
|
+
.bp-doc li > p {
|
|
4896
|
+
margin: 0;
|
|
4897
|
+
}
|
|
4898
|
+
|
|
4899
|
+
.bp-doc li > p + p {
|
|
4900
|
+
margin-top: 12px;
|
|
4901
|
+
}
|
|
4902
|
+
|
|
4903
|
+
/* Block content inside an item stays indented with the item, and never
|
|
4904
|
+
* bleeds full-width the way a top-level code block does. */
|
|
4905
|
+
.bp-doc li > pre,
|
|
4906
|
+
.bp-doc li > div[class*='language-'],
|
|
4907
|
+
.bp-doc li > pre[data-lang],
|
|
4908
|
+
.bp-doc li > blockquote,
|
|
4909
|
+
.bp-doc li > .table-responsive,
|
|
4910
|
+
.bp-doc li > .custom-block {
|
|
4911
|
+
margin: 12px 0;
|
|
4304
4912
|
}
|
|
4305
4913
|
|
|
4306
4914
|
/* Task list styles */
|
|
@@ -4309,16 +4917,29 @@ mjx-container > svg {
|
|
|
4309
4917
|
padding-left: 0;
|
|
4310
4918
|
}
|
|
4311
4919
|
|
|
4920
|
+
/* A list of task items has checkboxes where the markers would be, so the
|
|
4921
|
+
* marker gutter is dead space. Scoped with :has() so a list that merely
|
|
4922
|
+
* contains one task item keeps its indent for the plain items. */
|
|
4923
|
+
.bp-doc ul:has(> .task-list-item) {
|
|
4924
|
+
padding-left: 0;
|
|
4925
|
+
list-style: none;
|
|
4926
|
+
}
|
|
4927
|
+
|
|
4312
4928
|
.bp-doc .task-list-item {
|
|
4313
4929
|
display: flex;
|
|
4314
4930
|
align-items: flex-start;
|
|
4315
4931
|
gap: 0.5rem;
|
|
4316
4932
|
}
|
|
4317
4933
|
|
|
4934
|
+
/* .task-list-item-checkbox is what Bun.markdown emits; .task-list-checkbox is
|
|
4935
|
+
* kept for content that ships its own task-list markup. */
|
|
4936
|
+
.bp-doc .task-list-item-checkbox,
|
|
4318
4937
|
.bp-doc .task-list-checkbox {
|
|
4319
|
-
|
|
4938
|
+
/* Nudged down to sit on the first line's cap height rather than its top. */
|
|
4939
|
+
margin: 0.3em 0 0;
|
|
4320
4940
|
width: 1rem;
|
|
4321
4941
|
height: 1rem;
|
|
4942
|
+
flex-shrink: 0;
|
|
4322
4943
|
accent-color: var(--bp-c-brand-1);
|
|
4323
4944
|
cursor: default;
|
|
4324
4945
|
}
|
|
@@ -4332,39 +4953,115 @@ mjx-container > svg {
|
|
|
4332
4953
|
* Table
|
|
4333
4954
|
* -------------------------------------------------------------------------- */
|
|
4334
4955
|
|
|
4956
|
+
/* The scroll container owns overflow, so the table itself stays a real table.
|
|
4957
|
+
* (\`display: block\` on <table> collapses column sizing \u2014 the table shrinks to
|
|
4958
|
+
* its content instead of filling the row, and cell widths stop balancing.) */
|
|
4959
|
+
.bp-doc .table-responsive {
|
|
4960
|
+
margin: 20px 0;
|
|
4961
|
+
overflow-x: auto;
|
|
4962
|
+
overscroll-behavior-x: contain;
|
|
4963
|
+
border: 1px solid var(--bp-c-divider);
|
|
4964
|
+
border-radius: 8px;
|
|
4965
|
+
/* Clip the corner radius against the header's background fill. */
|
|
4966
|
+
background-color: var(--bp-c-bg);
|
|
4967
|
+
}
|
|
4968
|
+
|
|
4335
4969
|
.bp-doc table {
|
|
4336
|
-
display:
|
|
4970
|
+
display: table;
|
|
4971
|
+
width: 100%;
|
|
4337
4972
|
border-collapse: collapse;
|
|
4338
4973
|
margin: 20px 0;
|
|
4339
|
-
|
|
4974
|
+
font-size: 14px;
|
|
4975
|
+
line-height: 1.6;
|
|
4976
|
+
}
|
|
4977
|
+
|
|
4978
|
+
/* Inside a scroll wrapper the wrapper supplies the outer spacing and frame. */
|
|
4979
|
+
.bp-doc .table-responsive > table {
|
|
4980
|
+
margin: 0;
|
|
4981
|
+
border: none;
|
|
4340
4982
|
}
|
|
4341
4983
|
|
|
4342
4984
|
.bp-doc tr {
|
|
4343
|
-
background-color:
|
|
4344
|
-
|
|
4345
|
-
transition: background-color 0.5s;
|
|
4985
|
+
background-color: transparent;
|
|
4986
|
+
transition: background-color 0.25s;
|
|
4346
4987
|
}
|
|
4347
4988
|
|
|
4348
|
-
.bp-doc tr:nth-child(2n) {
|
|
4989
|
+
.bp-doc tbody tr:nth-child(2n) {
|
|
4349
4990
|
background-color: var(--bp-c-bg-soft);
|
|
4350
4991
|
}
|
|
4351
4992
|
|
|
4352
4993
|
.bp-doc th,
|
|
4353
4994
|
.bp-doc td {
|
|
4354
|
-
|
|
4355
|
-
|
|
4995
|
+
/* Row rules only \u2014 a full grid double-draws against the wrapper border and
|
|
4996
|
+
* makes dense config tables read as noise. */
|
|
4997
|
+
border-bottom: 1px solid var(--bp-c-divider);
|
|
4998
|
+
padding: 10px 16px;
|
|
4999
|
+
text-align: left;
|
|
5000
|
+
vertical-align: top;
|
|
4356
5001
|
}
|
|
4357
5002
|
|
|
4358
|
-
.bp-doc th {
|
|
4359
|
-
|
|
4360
|
-
font-size: 14px;
|
|
5003
|
+
.bp-doc thead th {
|
|
5004
|
+
font-size: 13px;
|
|
4361
5005
|
font-weight: 600;
|
|
5006
|
+
letter-spacing: 0.01em;
|
|
4362
5007
|
color: var(--bp-c-text-2);
|
|
4363
5008
|
background-color: var(--bp-c-bg-soft);
|
|
5009
|
+
border-bottom: 1px solid var(--bp-c-divider);
|
|
5010
|
+
white-space: nowrap;
|
|
5011
|
+
}
|
|
5012
|
+
|
|
5013
|
+
/* Last row sits flush against the wrapper's own bottom border. */
|
|
5014
|
+
.bp-doc tbody tr:last-child > th,
|
|
5015
|
+
.bp-doc tbody tr:last-child > td {
|
|
5016
|
+
border-bottom: none;
|
|
5017
|
+
}
|
|
5018
|
+
|
|
5019
|
+
.bp-doc td {
|
|
5020
|
+
font-size: 14px;
|
|
5021
|
+
color: var(--bp-c-text-1);
|
|
5022
|
+
}
|
|
5023
|
+
|
|
5024
|
+
/* Long identifiers (\`preserveDirectoryStructure\`, \`Record<string, string>\`)
|
|
5025
|
+
* must not dictate column widths. \`anywhere\` \u2014 unlike \`break-word\` \u2014 also
|
|
5026
|
+
* lowers the cell's intrinsic minimum, which is what lets the auto table
|
|
5027
|
+
* algorithm hand the spare width to the prose column instead. */
|
|
5028
|
+
.bp-doc td > code,
|
|
5029
|
+
.bp-doc th > code {
|
|
5030
|
+
white-space: normal;
|
|
5031
|
+
overflow-wrap: anywhere;
|
|
5032
|
+
}
|
|
5033
|
+
|
|
5034
|
+
/* Narrow screens: a multi-column table squeezed into a phone width degenerates
|
|
5035
|
+
* into one word per line. Give it a readable floor and let the wrapper scroll
|
|
5036
|
+
* horizontally instead \u2014 scrolling a table beats shredding it. */
|
|
5037
|
+
@media (max-width: 767px) {
|
|
5038
|
+
.bp-doc .table-responsive > table {
|
|
5039
|
+
min-width: 38rem;
|
|
5040
|
+
}
|
|
5041
|
+
|
|
5042
|
+
.bp-doc thead th {
|
|
5043
|
+
white-space: normal;
|
|
5044
|
+
}
|
|
5045
|
+
|
|
5046
|
+
.bp-doc th,
|
|
5047
|
+
.bp-doc td {
|
|
5048
|
+
padding: 10px 12px;
|
|
5049
|
+
}
|
|
4364
5050
|
}
|
|
4365
5051
|
|
|
4366
|
-
.
|
|
4367
|
-
|
|
5052
|
+
/* Alignment from GFM's \`:---:\` / \`---:\` syntax must win over the default. */
|
|
5053
|
+
.bp-doc th[align='center'],
|
|
5054
|
+
.bp-doc td[align='center'],
|
|
5055
|
+
.bp-doc th[style*='center'],
|
|
5056
|
+
.bp-doc td[style*='center'] {
|
|
5057
|
+
text-align: center;
|
|
5058
|
+
}
|
|
5059
|
+
|
|
5060
|
+
.bp-doc th[align='right'],
|
|
5061
|
+
.bp-doc td[align='right'],
|
|
5062
|
+
.bp-doc th[style*='right'],
|
|
5063
|
+
.bp-doc td[style*='right'] {
|
|
5064
|
+
text-align: right;
|
|
4368
5065
|
}
|
|
4369
5066
|
|
|
4370
5067
|
/**
|
|
@@ -4391,6 +5088,19 @@ mjx-container > svg {
|
|
|
4391
5088
|
padding: 3px 6px;
|
|
4392
5089
|
background-color: var(--bp-code-bg);
|
|
4393
5090
|
transition: color 0.25s, background-color 0.5s;
|
|
5091
|
+
/* Without clone, a code span that wraps loses its padding and rounding on
|
|
5092
|
+
* the broken edges, so a wrapped identifier reads as ragged half-boxes. */
|
|
5093
|
+
-webkit-box-decoration-break: clone;
|
|
5094
|
+
box-decoration-break: clone;
|
|
5095
|
+
}
|
|
5096
|
+
|
|
5097
|
+
/* Inline code sits on a text baseline, so it must not add leading of its own
|
|
5098
|
+
* \u2014 otherwise a paragraph containing code is spaced wider than its neighbours. */
|
|
5099
|
+
.bp-doc p > code,
|
|
5100
|
+
.bp-doc li > code,
|
|
5101
|
+
.bp-doc td > code,
|
|
5102
|
+
.bp-doc th > code {
|
|
5103
|
+
line-height: 1.4;
|
|
4394
5104
|
}
|
|
4395
5105
|
|
|
4396
5106
|
.bp-doc a > code {
|
|
@@ -4412,36 +5122,28 @@ mjx-container > svg {
|
|
|
4412
5122
|
* Code blocks
|
|
4413
5123
|
* -------------------------------------------------------------------------- */
|
|
4414
5124
|
|
|
5125
|
+
/* Inset, not full-bleed. The old \`margin: 16px -24px\` hard-coded the content
|
|
5126
|
+
* container's padding: once that padding changed on small screens the bleed
|
|
5127
|
+
* overshot it, hanging the block 8px off each edge and leaving the content
|
|
5128
|
+
* pane with a phantom horizontal scroll. Inset also matches how every other
|
|
5129
|
+
* block element here behaves (containers, tables, alerts). */
|
|
4415
5130
|
.bp-doc div[class*='language-'],
|
|
4416
5131
|
.bp-doc pre[data-lang],
|
|
4417
5132
|
.bp-block {
|
|
4418
5133
|
position: relative;
|
|
4419
|
-
margin: 16px
|
|
5134
|
+
margin: 16px 0;
|
|
5135
|
+
border-radius: 8px;
|
|
4420
5136
|
background-color: var(--bp-code-block-bg);
|
|
4421
5137
|
overflow-x: auto;
|
|
4422
5138
|
transition: background-color 0.5s;
|
|
4423
5139
|
}
|
|
4424
5140
|
|
|
4425
|
-
|
|
4426
|
-
|
|
4427
|
-
|
|
4428
|
-
.bp-block {
|
|
4429
|
-
border-radius: 8px;
|
|
4430
|
-
margin: 16px 0;
|
|
4431
|
-
}
|
|
4432
|
-
}
|
|
4433
|
-
|
|
4434
|
-
@media (max-width: 639px) {
|
|
4435
|
-
.bp-doc li div[class*='language-'],
|
|
4436
|
-
.bp-doc li pre[data-lang] {
|
|
4437
|
-
border-radius: 8px 0 0 8px;
|
|
4438
|
-
}
|
|
4439
|
-
}
|
|
4440
|
-
|
|
5141
|
+
/* Wrapper divs that belong to one code group are pulled together. Bare
|
|
5142
|
+
* \`pre[data-lang]\` siblings are NOT a group \u2014 they are independent examples,
|
|
5143
|
+
* and the negative margin made consecutive blocks overlap into one slab. */
|
|
4441
5144
|
.bp-doc div[class*='language-'] + div[class*='language-'],
|
|
4442
5145
|
.bp-doc div[class$='-api'] + div[class*='language-'],
|
|
4443
|
-
.bp-doc div[class*='language-'] + div[class$='-api'] > div[class*='language-']
|
|
4444
|
-
.bp-doc pre[data-lang] + pre[data-lang] {
|
|
5146
|
+
.bp-doc div[class*='language-'] + div[class$='-api'] > div[class*='language-'] {
|
|
4445
5147
|
margin-top: -8px;
|
|
4446
5148
|
}
|
|
4447
5149
|
|
|
@@ -4458,13 +5160,20 @@ mjx-container > svg {
|
|
|
4458
5160
|
.bp-doc pre[data-lang] {
|
|
4459
5161
|
position: relative;
|
|
4460
5162
|
z-index: 1;
|
|
4461
|
-
margin: 0;
|
|
4462
5163
|
padding: 20px 0;
|
|
4463
|
-
background: transparent;
|
|
4464
5164
|
overflow-x: auto;
|
|
4465
5165
|
text-align: left;
|
|
4466
5166
|
}
|
|
4467
5167
|
|
|
5168
|
+
/* A pre nested in a language wrapper is not the block \u2014 the wrapper is \u2014 so it
|
|
5169
|
+
* contributes neither margin nor background of its own. A bare pre[data-lang]
|
|
5170
|
+
* IS the block and must keep the margin set above; zeroing it here (the rule
|
|
5171
|
+
* this splits out of) is what let consecutive blocks run together. */
|
|
5172
|
+
.bp-doc [class*='language-'] pre {
|
|
5173
|
+
margin: 0;
|
|
5174
|
+
background: transparent;
|
|
5175
|
+
}
|
|
5176
|
+
|
|
4468
5177
|
.bp-doc [class*='language-'] code,
|
|
4469
5178
|
.bp-doc pre[data-lang] code {
|
|
4470
5179
|
display: block;
|
|
@@ -4477,14 +5186,21 @@ mjx-container > svg {
|
|
|
4477
5186
|
transition: color 0.5s;
|
|
4478
5187
|
}
|
|
4479
5188
|
|
|
5189
|
+
/* Marked rows bleed through the code element's 24px gutters so the band spans
|
|
5190
|
+
* the full block, not just the text column. min-width (rather than width) keeps
|
|
5191
|
+
* a line longer than the block from being clipped mid-band when it scrolls. */
|
|
5192
|
+
.bp-doc [class*='language-'] code :is(.highlighted, .diff, .diff-add, .diff-remove, .has-error, .has-warning),
|
|
5193
|
+
.bp-doc pre[data-lang] code :is(.highlighted, .diff, .diff-add, .diff-remove, .has-error, .has-warning) {
|
|
5194
|
+
display: inline-block;
|
|
5195
|
+
margin: 0 -24px;
|
|
5196
|
+
padding: 0 24px;
|
|
5197
|
+
min-width: calc(100% + 2 * 24px);
|
|
5198
|
+
transition: background-color 0.5s;
|
|
5199
|
+
}
|
|
5200
|
+
|
|
4480
5201
|
.bp-doc [class*='language-'] code .highlighted,
|
|
4481
5202
|
.bp-doc pre[data-lang] code .highlighted {
|
|
4482
5203
|
background-color: var(--bp-code-line-highlight-color);
|
|
4483
|
-
transition: background-color 0.5s;
|
|
4484
|
-
margin: 0 -24px;
|
|
4485
|
-
padding: 0 24px;
|
|
4486
|
-
width: calc(100% + 2 * 24px);
|
|
4487
|
-
display: inline-block;
|
|
4488
5204
|
}
|
|
4489
5205
|
|
|
4490
5206
|
.bp-doc [class*='language-'] code .highlighted.error,
|
|
@@ -4497,65 +5213,63 @@ mjx-container > svg {
|
|
|
4497
5213
|
background-color: var(--bp-code-line-warning-color);
|
|
4498
5214
|
}
|
|
4499
5215
|
|
|
4500
|
-
|
|
4501
|
-
|
|
4502
|
-
|
|
4503
|
-
|
|
4504
|
-
|
|
4505
|
-
width: calc(100% + 2 * 24px);
|
|
4506
|
-
display: inline-block;
|
|
4507
|
-
}
|
|
4508
|
-
|
|
4509
|
-
.bp-doc [class*='language-'] code .diff::before,
|
|
4510
|
-
.bp-doc pre[data-lang] code .diff::before {
|
|
4511
|
-
position: absolute;
|
|
4512
|
-
left: 10px;
|
|
4513
|
-
}
|
|
4514
|
-
|
|
4515
|
-
/* Focus lines with blur effect - matches VitePress exactly */
|
|
4516
|
-
.bp-doc [class*='language-'] .has-focused-lines .line:not(.has-focus),
|
|
4517
|
-
.bp-doc pre[data-lang] .has-focused-lines .line:not(.has-focus) {
|
|
5216
|
+
/* Focus lines: unfocused rows blur back until the block is hovered.
|
|
5217
|
+
* The renderer marks them \`.dimmed\` (see processCodeBlock) \u2014 the upstream
|
|
5218
|
+
* \`:not(.has-focus)\` form never matched this markup. */
|
|
5219
|
+
.bp-doc [class*='language-'] .line.dimmed,
|
|
5220
|
+
.bp-doc pre[data-lang] .line.dimmed {
|
|
4518
5221
|
filter: blur(0.095rem);
|
|
4519
|
-
opacity: 0.4;
|
|
4520
|
-
transition: filter 0.35s, opacity 0.35s;
|
|
4521
|
-
}
|
|
4522
|
-
|
|
4523
|
-
/* VitePress has a second rule that overrides the opacity to 0.7 */
|
|
4524
|
-
.bp-doc [class*='language-'] .has-focused-lines .line:not(.has-focus),
|
|
4525
|
-
.bp-doc pre[data-lang] .has-focused-lines .line:not(.has-focus) {
|
|
4526
5222
|
opacity: 0.7;
|
|
4527
5223
|
transition: filter 0.35s, opacity 0.35s;
|
|
4528
5224
|
}
|
|
4529
5225
|
|
|
4530
|
-
.bp-doc [class*='language-']:hover .
|
|
4531
|
-
.bp-doc pre[data-lang]:hover .
|
|
5226
|
+
.bp-doc [class*='language-']:hover .line.dimmed,
|
|
5227
|
+
.bp-doc pre[data-lang]:hover .line.dimmed {
|
|
4532
5228
|
filter: blur(0);
|
|
4533
5229
|
opacity: 1;
|
|
4534
5230
|
}
|
|
4535
5231
|
|
|
4536
|
-
|
|
4537
|
-
|
|
5232
|
+
/* Both class spellings: \`.diff.remove\` is the upstream form, \`.diff-remove\`
|
|
5233
|
+
* is what processCodeBlock emits. */
|
|
5234
|
+
.bp-doc [class*='language-'] code :is(.diff.remove, .diff-remove),
|
|
5235
|
+
.bp-doc pre[data-lang] code :is(.diff.remove, .diff-remove) {
|
|
4538
5236
|
background-color: var(--bp-code-line-diff-remove-color);
|
|
4539
|
-
opacity: 0.7;
|
|
4540
5237
|
}
|
|
4541
5238
|
|
|
4542
|
-
.bp-doc [class*='language-'] code .diff.remove::before,
|
|
4543
|
-
.bp-doc pre[data-lang] code .diff.remove::before {
|
|
5239
|
+
.bp-doc [class*='language-'] code :is(.diff.remove, .diff-remove)::before,
|
|
5240
|
+
.bp-doc pre[data-lang] code :is(.diff.remove, .diff-remove)::before {
|
|
4544
5241
|
content: '-';
|
|
4545
5242
|
color: var(--bp-code-line-diff-remove-symbol-color);
|
|
4546
5243
|
}
|
|
4547
5244
|
|
|
4548
|
-
.bp-doc [class*='language-'] code .diff.add,
|
|
4549
|
-
.bp-doc pre[data-lang] code .diff.add {
|
|
5245
|
+
.bp-doc [class*='language-'] code :is(.diff.add, .diff-add),
|
|
5246
|
+
.bp-doc pre[data-lang] code :is(.diff.add, .diff-add) {
|
|
4550
5247
|
background-color: var(--bp-code-line-diff-add-color);
|
|
4551
5248
|
}
|
|
4552
5249
|
|
|
4553
|
-
.bp-doc [class*='language-'] code .diff.add::before,
|
|
4554
|
-
.bp-doc pre[data-lang] code .diff.add::before {
|
|
5250
|
+
.bp-doc [class*='language-'] code :is(.diff.add, .diff-add)::before,
|
|
5251
|
+
.bp-doc pre[data-lang] code :is(.diff.add, .diff-add)::before {
|
|
4555
5252
|
content: '+';
|
|
4556
5253
|
color: var(--bp-code-line-diff-add-symbol-color);
|
|
4557
5254
|
}
|
|
4558
5255
|
|
|
5256
|
+
/* The +/- glyph lives in the 24px gutter the row bleeds into. */
|
|
5257
|
+
.bp-doc [class*='language-'] code :is(.diff, .diff-add, .diff-remove)::before,
|
|
5258
|
+
.bp-doc pre[data-lang] code :is(.diff, .diff-add, .diff-remove)::before {
|
|
5259
|
+
position: absolute;
|
|
5260
|
+
left: 8px;
|
|
5261
|
+
}
|
|
5262
|
+
|
|
5263
|
+
.bp-doc [class*='language-'] code :is(.has-error, .highlighted.error),
|
|
5264
|
+
.bp-doc pre[data-lang] code :is(.has-error, .highlighted.error) {
|
|
5265
|
+
background-color: var(--bp-code-line-error-color);
|
|
5266
|
+
}
|
|
5267
|
+
|
|
5268
|
+
.bp-doc [class*='language-'] code :is(.has-warning, .highlighted.warning),
|
|
5269
|
+
.bp-doc pre[data-lang] code :is(.has-warning, .highlighted.warning) {
|
|
5270
|
+
background-color: var(--bp-code-line-warning-color);
|
|
5271
|
+
}
|
|
5272
|
+
|
|
4559
5273
|
/* Line numbers */
|
|
4560
5274
|
.bp-doc div[class*='language-'].line-numbers-mode,
|
|
4561
5275
|
.bp-doc pre[data-lang].line-numbers-mode {
|
|
@@ -4730,9 +5444,13 @@ mjx-container > svg {
|
|
|
4730
5444
|
* -------------------------------------------------------------------------- */
|
|
4731
5445
|
|
|
4732
5446
|
.custom-block {
|
|
4733
|
-
|
|
5447
|
+
/* Accent lives on the leading edge only \u2014 the other sides stay zero-width so
|
|
5448
|
+
* a variant's \`border-color\` can't paint a full outline. The tint alone is
|
|
5449
|
+
* easy to miss when scanning; a 4px rail reads at any zoom level. */
|
|
5450
|
+
border: 0 solid transparent;
|
|
5451
|
+
border-left-width: 4px;
|
|
4734
5452
|
border-radius: 8px;
|
|
4735
|
-
padding:
|
|
5453
|
+
padding: 14px 16px;
|
|
4736
5454
|
line-height: 24px;
|
|
4737
5455
|
font-size: var(--bp-custom-block-font-size);
|
|
4738
5456
|
color: var(--bp-c-text-2);
|
|
@@ -4898,18 +5616,75 @@ mjx-container > svg {
|
|
|
4898
5616
|
}
|
|
4899
5617
|
|
|
4900
5618
|
.custom-block-title {
|
|
4901
|
-
|
|
5619
|
+
margin-bottom: 6px;
|
|
5620
|
+
font-weight: 700;
|
|
5621
|
+
font-size: 13px;
|
|
5622
|
+
letter-spacing: 0.03em;
|
|
5623
|
+
text-transform: uppercase;
|
|
5624
|
+
}
|
|
5625
|
+
|
|
5626
|
+
/* The title supplies the block's leading margin, so the first body paragraph
|
|
5627
|
+
* must not add one on top of it. */
|
|
5628
|
+
.custom-block-title + * {
|
|
5629
|
+
margin-top: 0;
|
|
4902
5630
|
}
|
|
4903
5631
|
|
|
4904
5632
|
.custom-block p + p {
|
|
4905
5633
|
margin: 8px 0;
|
|
4906
5634
|
}
|
|
4907
5635
|
|
|
4908
|
-
|
|
4909
|
-
|
|
5636
|
+
/* The native disclosure triangle is unstyleable and sits at a different size
|
|
5637
|
+
* and colour in every engine, so it is replaced with a chevron that matches
|
|
5638
|
+
* the rest of the chrome. */
|
|
5639
|
+
.custom-block.details summary,
|
|
5640
|
+
.bp-doc .custom-block.details summary {
|
|
5641
|
+
display: flex;
|
|
5642
|
+
align-items: center;
|
|
5643
|
+
gap: 8px;
|
|
5644
|
+
margin: 0;
|
|
4910
5645
|
font-weight: 700;
|
|
4911
5646
|
cursor: pointer;
|
|
4912
5647
|
user-select: none;
|
|
5648
|
+
list-style: none;
|
|
5649
|
+
}
|
|
5650
|
+
|
|
5651
|
+
.custom-block.details summary::-webkit-details-marker {
|
|
5652
|
+
display: none;
|
|
5653
|
+
}
|
|
5654
|
+
|
|
5655
|
+
.custom-block.details summary::marker {
|
|
5656
|
+
content: '';
|
|
5657
|
+
}
|
|
5658
|
+
|
|
5659
|
+
.custom-block.details summary::before {
|
|
5660
|
+
content: '';
|
|
5661
|
+
flex-shrink: 0;
|
|
5662
|
+
width: 12px;
|
|
5663
|
+
height: 12px;
|
|
5664
|
+
background-color: currentColor;
|
|
5665
|
+
transition: transform 0.2s ease;
|
|
5666
|
+
--icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 18l6-6-6-6'/%3E%3C/svg%3E");
|
|
5667
|
+
-webkit-mask-image: var(--icon);
|
|
5668
|
+
mask-image: var(--icon);
|
|
5669
|
+
-webkit-mask-size: contain;
|
|
5670
|
+
mask-size: contain;
|
|
5671
|
+
-webkit-mask-repeat: no-repeat;
|
|
5672
|
+
mask-repeat: no-repeat;
|
|
5673
|
+
}
|
|
5674
|
+
|
|
5675
|
+
.custom-block.details[open] summary::before {
|
|
5676
|
+
transform: rotate(90deg);
|
|
5677
|
+
}
|
|
5678
|
+
|
|
5679
|
+
.custom-block.details summary:focus-visible {
|
|
5680
|
+
outline: 2px solid var(--bp-c-brand-1);
|
|
5681
|
+
outline-offset: 2px;
|
|
5682
|
+
border-radius: 3px;
|
|
5683
|
+
}
|
|
5684
|
+
|
|
5685
|
+
/* Body content only gains its top margin once the block is open. */
|
|
5686
|
+
.bp-doc .custom-block.details[open] summary {
|
|
5687
|
+
margin-bottom: 8px;
|
|
4913
5688
|
}
|
|
4914
5689
|
|
|
4915
5690
|
.custom-block.details summary + p {
|
|
@@ -4968,21 +5743,27 @@ mjx-container > svg {
|
|
|
4968
5743
|
* GitHub-Flavored Alerts (VitePress style)
|
|
4969
5744
|
* -------------------------------------------------------------------------- */
|
|
4970
5745
|
|
|
5746
|
+
/* Same box treatment as .custom-block \u2014 alerts and containers say the same
|
|
5747
|
+
* kind of thing, so they must not look like two unrelated systems. */
|
|
4971
5748
|
.github-alert {
|
|
4972
|
-
border:
|
|
5749
|
+
border: 0 solid transparent;
|
|
5750
|
+
border-left-width: 4px;
|
|
4973
5751
|
border-radius: 8px;
|
|
4974
|
-
padding:
|
|
5752
|
+
padding: 14px 16px;
|
|
4975
5753
|
line-height: 24px;
|
|
4976
5754
|
font-size: var(--bp-custom-block-font-size);
|
|
4977
5755
|
margin: 16px 0;
|
|
4978
5756
|
}
|
|
4979
5757
|
|
|
4980
|
-
.
|
|
5758
|
+
/* The title is a <p>, so .bp-doc's 16px paragraph margins have to be beaten
|
|
5759
|
+
* on specificity \u2014 otherwise the label floats half a line above its body. */
|
|
5760
|
+
.github-alert-title,
|
|
5761
|
+
.bp-doc .github-alert-title {
|
|
4981
5762
|
display: flex;
|
|
4982
5763
|
align-items: center;
|
|
4983
5764
|
gap: 8px;
|
|
5765
|
+
margin: 0 0 6px;
|
|
4984
5766
|
font-weight: 600;
|
|
4985
|
-
margin-bottom: 8px;
|
|
4986
5767
|
}
|
|
4987
5768
|
|
|
4988
5769
|
.github-alert-icon {
|
|
@@ -4995,14 +5776,24 @@ mjx-container > svg {
|
|
|
4995
5776
|
line-height: 24px;
|
|
4996
5777
|
}
|
|
4997
5778
|
|
|
4998
|
-
.github-alert-content p
|
|
4999
|
-
|
|
5779
|
+
.github-alert-content p,
|
|
5780
|
+
.bp-doc .github-alert-content p {
|
|
5781
|
+
margin: 0;
|
|
5000
5782
|
}
|
|
5001
5783
|
|
|
5002
|
-
.github-alert-content p
|
|
5784
|
+
.github-alert-content p + p,
|
|
5785
|
+
.bp-doc .github-alert-content p + p {
|
|
5786
|
+
margin-top: 12px;
|
|
5787
|
+
}
|
|
5788
|
+
|
|
5789
|
+
.bp-doc .github-alert-content > :first-child {
|
|
5003
5790
|
margin-top: 0;
|
|
5004
5791
|
}
|
|
5005
5792
|
|
|
5793
|
+
.bp-doc .github-alert-content > :last-child {
|
|
5794
|
+
margin-bottom: 0;
|
|
5795
|
+
}
|
|
5796
|
+
|
|
5006
5797
|
/* Note Alert */
|
|
5007
5798
|
.github-alert-note {
|
|
5008
5799
|
border-color: var(--bp-custom-block-note-border);
|
|
@@ -5076,7 +5867,7 @@ mjx-container > svg {
|
|
|
5076
5867
|
|
|
5077
5868
|
.github-alert-caution .github-alert-icon {
|
|
5078
5869
|
fill: var(--bp-c-caution-1);
|
|
5079
|
-
}`}function
|
|
5870
|
+
}`}function KZ(){return`/**
|
|
5080
5871
|
* VitePress Theme for BunPress - Code Groups
|
|
5081
5872
|
* -------------------------------------------------------------------------- */
|
|
5082
5873
|
|
|
@@ -5177,11 +5968,24 @@ mjx-container > svg {
|
|
|
5177
5968
|
display: block;
|
|
5178
5969
|
}
|
|
5179
5970
|
|
|
5180
|
-
.bp-block
|
|
5181
|
-
.code-group-panel {
|
|
5971
|
+
.bp-block {
|
|
5182
5972
|
padding: 20px 24px;
|
|
5183
5973
|
}
|
|
5184
5974
|
|
|
5975
|
+
/* The panel is a frame, not a padded box \u2014 the code block inside brings its
|
|
5976
|
+
* own padding, background and radius, and stacking the panel's on top of it
|
|
5977
|
+
* rendered a card inside a card with a gap under the tab bar. */
|
|
5978
|
+
.code-group-panel {
|
|
5979
|
+
padding: 0;
|
|
5980
|
+
}
|
|
5981
|
+
|
|
5982
|
+
.bp-doc .code-group-panel > pre,
|
|
5983
|
+
.bp-doc .code-group-panel > div[class*='language-'] {
|
|
5984
|
+
margin: 0;
|
|
5985
|
+
border: none;
|
|
5986
|
+
border-radius: 0;
|
|
5987
|
+
}
|
|
5988
|
+
|
|
5185
5989
|
/* Code group container */
|
|
5186
5990
|
.code-group {
|
|
5187
5991
|
margin: 16px 0;
|
|
@@ -5204,7 +6008,7 @@ mjx-container > svg {
|
|
|
5204
6008
|
margin: 0;
|
|
5205
6009
|
border-radius: 0;
|
|
5206
6010
|
border: none;
|
|
5207
|
-
}`}var
|
|
6011
|
+
}`}var _Z={name:"vitepress",getCSS:AJ,getVars:WZ,getBase:zZ,getCustomBlocks:VZ,getCodeGroups:KZ},$Q=_Z;var YQ=`/**
|
|
5208
6012
|
* Bun Theme for BunPress
|
|
5209
6013
|
* Colors extracted from bun.sh
|
|
5210
6014
|
* -------------------------------------------------------------------------- */
|
|
@@ -5758,7 +6562,7 @@ mjx-container > svg {
|
|
|
5758
6562
|
|
|
5759
6563
|
.bpi-search {
|
|
5760
6564
|
--icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cg fill='none' stroke='black' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.6'%3E%3Cpath d='m21 21l-4.34-4.34'/%3E%3Ccircle cx='11' cy='11' r='8' stroke-width='1.4'/%3E%3C/g%3E%3C/svg%3E");
|
|
5761
|
-
}`,
|
|
6565
|
+
}`,XQ=`/**
|
|
5762
6566
|
* Bun Theme for BunPress - Base Styles
|
|
5763
6567
|
* -------------------------------------------------------------------------- */
|
|
5764
6568
|
|
|
@@ -6557,7 +7361,7 @@ p {
|
|
|
6557
7361
|
.bp-doc .custom-block .bp-code-group .tabs {
|
|
6558
7362
|
margin: 0;
|
|
6559
7363
|
border-radius: 5px 5px 0 0;
|
|
6560
|
-
}`,
|
|
7364
|
+
}`,qQ=`/**
|
|
6561
7365
|
* Bun Theme for BunPress - Custom Blocks
|
|
6562
7366
|
* -------------------------------------------------------------------------- */
|
|
6563
7367
|
|
|
@@ -6921,7 +7725,7 @@ p {
|
|
|
6921
7725
|
|
|
6922
7726
|
.github-alert-caution .github-alert-icon {
|
|
6923
7727
|
fill: var(--bp-c-caution-1);
|
|
6924
|
-
}`,
|
|
7728
|
+
}`,WQ=`/**
|
|
6925
7729
|
* Bun Theme for BunPress - Code Groups
|
|
6926
7730
|
* -------------------------------------------------------------------------- */
|
|
6927
7731
|
|
|
@@ -7051,7 +7855,7 @@ p {
|
|
|
7051
7855
|
margin: 0;
|
|
7052
7856
|
border-radius: 0;
|
|
7053
7857
|
border: none;
|
|
7054
|
-
}`,
|
|
7858
|
+
}`,zQ=`/**
|
|
7055
7859
|
* Bun Theme for BunPress - Extra Bun-specific styles
|
|
7056
7860
|
* -------------------------------------------------------------------------- */
|
|
7057
7861
|
|
|
@@ -7205,255 +8009,28 @@ p {
|
|
|
7205
8009
|
|
|
7206
8010
|
.interactive-hover:hover {
|
|
7207
8011
|
transform: scale(1.06);
|
|
7208
|
-
}`;function
|
|
8012
|
+
}`;function VQ(){return`
|
|
7209
8013
|
/* Bun Theme for BunPress */
|
|
7210
8014
|
/* Colors extracted from bun.sh */
|
|
7211
|
-
${
|
|
7212
|
-
${
|
|
7213
|
-
${
|
|
7214
|
-
${
|
|
7215
|
-
${
|
|
7216
|
-
${
|
|
7217
|
-
`}function
|
|
7218
|
-
|
|
7219
|
-
<
|
|
7220
|
-
|
|
7221
|
-
</
|
|
7222
|
-
|
|
7223
|
-
|
|
7224
|
-
|
|
7225
|
-
|
|
7226
|
-
|
|
7227
|
-
|
|
7228
|
-
|
|
7229
|
-
|
|
7230
|
-
overflow-y: auto;
|
|
7231
|
-
padding: 1rem;
|
|
7232
|
-
}
|
|
7233
|
-
|
|
7234
|
-
.toc-container {
|
|
7235
|
-
padding: 0;
|
|
7236
|
-
}
|
|
7237
|
-
|
|
7238
|
-
.toc-title {
|
|
7239
|
-
margin: 0 0 1rem 0;
|
|
7240
|
-
font-size: 1.2rem;
|
|
7241
|
-
font-weight: 600;
|
|
7242
|
-
}
|
|
7243
|
-
|
|
7244
|
-
.toc-list,
|
|
7245
|
-
.toc-sublist {
|
|
7246
|
-
list-style: none;
|
|
7247
|
-
padding: 0;
|
|
7248
|
-
margin: 0;
|
|
7249
|
-
}
|
|
7250
|
-
|
|
7251
|
-
.toc-list {
|
|
7252
|
-
padding-left: 0;
|
|
7253
|
-
}
|
|
7254
|
-
|
|
7255
|
-
.toc-sublist {
|
|
7256
|
-
padding-left: 1rem;
|
|
7257
|
-
margin-top: 0.5rem;
|
|
7258
|
-
}
|
|
7259
|
-
|
|
7260
|
-
.toc-item,
|
|
7261
|
-
.toc-subitem {
|
|
7262
|
-
margin-bottom: 0.5rem;
|
|
7263
|
-
}
|
|
7264
|
-
|
|
7265
|
-
.toc-link {
|
|
7266
|
-
color: inherit;
|
|
7267
|
-
text-decoration: none;
|
|
7268
|
-
display: block;
|
|
7269
|
-
padding: 0.25rem 0;
|
|
7270
|
-
border-radius: 0.25rem;
|
|
7271
|
-
transition: background-color 0.2s;
|
|
7272
|
-
}
|
|
7273
|
-
|
|
7274
|
-
.toc-link:hover {
|
|
7275
|
-
background-color: rgba(0, 0, 0, 0.05);
|
|
7276
|
-
}
|
|
7277
|
-
|
|
7278
|
-
.toc-active .toc-link,
|
|
7279
|
-
.active-toc-item .toc-link {
|
|
7280
|
-
background-color: rgba(0, 123, 255, 0.1);
|
|
7281
|
-
font-weight: 500;
|
|
7282
|
-
}
|
|
7283
|
-
|
|
7284
|
-
.toc-truncate {
|
|
7285
|
-
/* Styles for truncated TOC items */
|
|
7286
|
-
}
|
|
7287
|
-
|
|
7288
|
-
.toc-truncate .toc-link {
|
|
7289
|
-
white-space: nowrap;
|
|
7290
|
-
overflow: hidden;
|
|
7291
|
-
text-overflow: ellipsis;
|
|
7292
|
-
}
|
|
7293
|
-
|
|
7294
|
-
.toc-collapse .toc-link::before {
|
|
7295
|
-
content: '\u25B6';
|
|
7296
|
-
margin-right: 0.5rem;
|
|
7297
|
-
transition: transform 0.2s;
|
|
7298
|
-
}
|
|
7299
|
-
|
|
7300
|
-
.toc-collapse.collapsed .toc-link::before {
|
|
7301
|
-
transform: rotate(90deg);
|
|
7302
|
-
}
|
|
7303
|
-
|
|
7304
|
-
.toc-expand .toc-link::before {
|
|
7305
|
-
content: '\u25BC';
|
|
7306
|
-
margin-right: 0.5rem;
|
|
7307
|
-
}
|
|
7308
|
-
|
|
7309
|
-
.heading-anchor {
|
|
7310
|
-
color: inherit;
|
|
7311
|
-
text-decoration: none;
|
|
7312
|
-
opacity: 0;
|
|
7313
|
-
margin-left: -1rem;
|
|
7314
|
-
padding-right: 0.5rem;
|
|
7315
|
-
transition: opacity 0.2s;
|
|
7316
|
-
}
|
|
7317
|
-
|
|
7318
|
-
h1:hover .heading-anchor,
|
|
7319
|
-
h2:hover .heading-anchor,
|
|
7320
|
-
h3:hover .heading-anchor,
|
|
7321
|
-
h4:hover .heading-anchor,
|
|
7322
|
-
h5:hover .heading-anchor,
|
|
7323
|
-
h6:hover .heading-anchor {
|
|
7324
|
-
opacity: 0.7;
|
|
7325
|
-
}
|
|
7326
|
-
|
|
7327
|
-
.heading-anchor:hover {
|
|
7328
|
-
opacity: 1;
|
|
7329
|
-
}
|
|
7330
|
-
|
|
7331
|
-
/* Smooth scrolling */
|
|
7332
|
-
html {
|
|
7333
|
-
scroll-behavior: smooth;
|
|
7334
|
-
}
|
|
7335
|
-
|
|
7336
|
-
/* Responsive adjustments */
|
|
7337
|
-
@media (max-width: 768px) {
|
|
7338
|
-
.toc-sidebar {
|
|
7339
|
-
display: none;
|
|
7340
|
-
}
|
|
7341
|
-
|
|
7342
|
-
.toc-floating {
|
|
7343
|
-
position: fixed;
|
|
7344
|
-
bottom: 1rem;
|
|
7345
|
-
right: 1rem;
|
|
7346
|
-
background: white;
|
|
7347
|
-
border: 1px solid #ddd;
|
|
7348
|
-
border-radius: 0.5rem;
|
|
7349
|
-
padding: 1rem;
|
|
7350
|
-
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
|
|
7351
|
-
max-width: 250px;
|
|
7352
|
-
}
|
|
7353
|
-
}
|
|
7354
|
-
`}function k0(){return`
|
|
7355
|
-
function initToc() {
|
|
7356
|
-
const tocLinks = document.querySelectorAll('.toc-link')
|
|
7357
|
-
|
|
7358
|
-
// Smooth scrolling for TOC links
|
|
7359
|
-
tocLinks.forEach(link => {
|
|
7360
|
-
link.addEventListener('click', function(e) {
|
|
7361
|
-
e.preventDefault()
|
|
7362
|
-
const targetId = this.getAttribute('href')?.substring(1)
|
|
7363
|
-
const targetElement = document.getElementById(targetId)
|
|
7364
|
-
|
|
7365
|
-
if (targetElement) {
|
|
7366
|
-
targetElement.scrollIntoView({
|
|
7367
|
-
behavior: 'smooth',
|
|
7368
|
-
block: 'start'
|
|
7369
|
-
})
|
|
7370
|
-
|
|
7371
|
-
// Update URL without page reload
|
|
7372
|
-
history.pushState(null, '', '#' + targetId)
|
|
7373
|
-
}
|
|
7374
|
-
})
|
|
7375
|
-
})
|
|
7376
|
-
|
|
7377
|
-
// Active TOC item highlighting on scroll
|
|
7378
|
-
function updateActiveTocItem() {
|
|
7379
|
-
const headings = document.querySelectorAll('h1, h2, h3, h4, h5, h6')
|
|
7380
|
-
const tocLinks = document.querySelectorAll('.toc-link')
|
|
7381
|
-
|
|
7382
|
-
let currentActive = null
|
|
7383
|
-
let currentDistance = Infinity
|
|
7384
|
-
|
|
7385
|
-
headings.forEach((heading, index) => {
|
|
7386
|
-
const rect = heading.getBoundingClientRect()
|
|
7387
|
-
const distance = Math.abs(rect.top)
|
|
7388
|
-
|
|
7389
|
-
if (distance < currentDistance && rect.top <= 100) {
|
|
7390
|
-
currentActive = heading.id
|
|
7391
|
-
currentDistance = distance
|
|
7392
|
-
}
|
|
7393
|
-
})
|
|
7394
|
-
|
|
7395
|
-
tocLinks.forEach(link => {
|
|
7396
|
-
const parent = link.parentElement
|
|
7397
|
-
if (parent) {
|
|
7398
|
-
parent.classList.remove('toc-active', 'active-toc-item')
|
|
7399
|
-
const href = link.getAttribute('href')?.substring(1)
|
|
7400
|
-
if (href === currentActive) {
|
|
7401
|
-
parent.classList.add('toc-active', 'active-toc-item')
|
|
7402
|
-
}
|
|
7403
|
-
}
|
|
7404
|
-
})
|
|
7405
|
-
}
|
|
7406
|
-
|
|
7407
|
-
// Throttle scroll events
|
|
7408
|
-
let scrollTimeout
|
|
7409
|
-
function throttledUpdate() {
|
|
7410
|
-
if (!scrollTimeout) {
|
|
7411
|
-
scrollTimeout = setTimeout(() => {
|
|
7412
|
-
updateActiveTocItem()
|
|
7413
|
-
scrollTimeout = null
|
|
7414
|
-
}, 100)
|
|
7415
|
-
}
|
|
7416
|
-
}
|
|
7417
|
-
|
|
7418
|
-
window.addEventListener('scroll', throttledUpdate)
|
|
7419
|
-
updateActiveTocItem()
|
|
7420
|
-
|
|
7421
|
-
// TOC collapse/expand functionality
|
|
7422
|
-
const expandableItems = document.querySelectorAll('.toc-expand')
|
|
7423
|
-
|
|
7424
|
-
expandableItems.forEach(item => {
|
|
7425
|
-
item.addEventListener('click', function(e) {
|
|
7426
|
-
if (e.target === this || e.target.closest('.toc-link')) {
|
|
7427
|
-
this.classList.toggle('collapsed')
|
|
7428
|
-
}
|
|
7429
|
-
})
|
|
7430
|
-
})
|
|
7431
|
-
|
|
7432
|
-
// Handle URL hash on page load
|
|
7433
|
-
if (window.location.hash) {
|
|
7434
|
-
const targetId = window.location.hash.substring(1)
|
|
7435
|
-
const targetElement = document.getElementById(targetId)
|
|
7436
|
-
|
|
7437
|
-
if (targetElement) {
|
|
7438
|
-
setTimeout(() => {
|
|
7439
|
-
targetElement.scrollIntoView({
|
|
7440
|
-
behavior: 'smooth',
|
|
7441
|
-
block: 'start'
|
|
7442
|
-
})
|
|
7443
|
-
}, 100)
|
|
7444
|
-
}
|
|
7445
|
-
}
|
|
7446
|
-
}
|
|
7447
|
-
|
|
7448
|
-
// Initialize TOC when DOM is ready
|
|
7449
|
-
if (document.readyState === 'loading') {
|
|
7450
|
-
document.addEventListener('DOMContentLoaded', initToc)
|
|
7451
|
-
}
|
|
7452
|
-
else {
|
|
7453
|
-
initToc()
|
|
7454
|
-
}
|
|
7455
|
-
`}async function wZ(Q,Z){let $=Q.themeConfig?.sidebar||Q.markdown?.sidebar;if(!$)return"";let Y=[];if(Array.isArray($))Y=$;else if(typeof $==="object"){let q=Object.keys($).sort((K,X)=>X.length-K.length).find((K)=>Z.startsWith(K))||"/";Y=$[q]||[]}let J=await Promise.all(Y.map(async(O)=>{let q=O.items?O.items.map((K)=>{let X=K.link||"/",z=WQ(Q,X);return`<li><a class="${X===Z||K.link===Z?"BPSidebarItem-link is-active":"BPSidebarItem-link"}" href="${z}">${K.text}</a></li>`}).join(""):"";return await v("sidebar-section",{title:O.text,items:q,collapsedClass:O.collapsed?" collapsed":""})}));return await v("sidebar",{sections:J.join("")})}async function DZ(Q){let Z=/<h([2-6])([^>]*)>(.*?)<\/h\1>/g,$=[],Y;while((Y=Z.exec(Q))!==null){let O=Number.parseInt(Y[1]),q=Y[2],K=Y[3];K=K.replace(/<[^>]*>/g,"");let X=q.match(/id="([^"]*)"/),z=X?X[1]:K.toLowerCase().replace(/\s+/g,"-").replace(/[^\w-]/g,"");$.push({level:O,text:K,id:z})}if($.length===0)return"";let J=$.map((O)=>{let q=O.level>2?`level-${O.level}`:"";return`<a href="#${O.id}" class="${q}">${O.text}</a>`}).join(`
|
|
7456
|
-
`);return await v("page-toc",{items:J})}function TZ(Q){return Q.replace(/<h([1-6])([^>]*)>(.*?)<\/h\1>/g,(Z,$,Y,J)=>{if(Y.includes("id="))return Z;let O=J.match(/\s*\{#([\w-]+)\}\s*$/),q,K=J;if(O)q=O[1],K=J.replace(/\s*\{#[\w-]+\}\s*$/,"");else q=J.replace(/<[^>]*>/g,"").toLowerCase().replace(/\//g,"-").replace(/\s+/g,"-").replace(/[^\w-]/g,"").replace(/-+/g,"-").replace(/^-+|-+$/g,"");return`<h${$}${Y} id="${q}">${K}</h${$}>`})}function qQ(Q){let Z=LZ(),$=Q.lastIndexOf("</body>");if($===-1)return Q+Z;return Q.slice(0,$)+Z+Q.slice($)}function KQ(Q,Z){if(!Z)return Q;let $=Q.lastIndexOf("</body>");if($===-1)return Q+Z;return Q.slice(0,$)+Z+Q.slice($)}function LZ(){return`<script data-bp-router="1">
|
|
8015
|
+
${YQ}
|
|
8016
|
+
${XQ}
|
|
8017
|
+
${ZQ}
|
|
8018
|
+
${qQ}
|
|
8019
|
+
${WQ}
|
|
8020
|
+
${zQ}
|
|
8021
|
+
`}function GZ(){return YQ}function jZ(){return XQ}function OZ(){return qQ}function UZ(){return WQ}function NZ(){return zQ}var BZ={name:"bun",getCSS:VQ,getVars:GZ,getBase:jZ,getCustomBlocks:OZ,getCodeGroups:UZ,getExtras:NZ},KQ=BZ;var EZ={vitepress:$Q,bun:KQ};function _Q(J="vitepress"){let Z=EZ[J];if(!Z)return console.warn(`[BunPress] Unknown theme: ${J}, falling back to vitepress`),AJ();return Z.getCSS()}async function RZ(J,Z){let Q=J.themeConfig?.sidebar||J.markdown?.sidebar;if(!Q)return"";let Y=[];if(Array.isArray(Q))Y=Q;else if(typeof Q==="object"){let q=Object.keys(Q).sort((W,z)=>z.length-W.length).find((W)=>Z.startsWith(W))||"/";Y=Q[q]||[]}let $=await Promise.all(Y.map(async(X)=>{let q=X.items?X.items.map((W)=>{let z=W.link||"/",K=qJ(J,z);return`<li><a class="${z===Z||W.link===Z?"BPSidebarItem-link is-active":"BPSidebarItem-link"}" href="${K}">${W.text}</a></li>`}).join(""):"";return await T("sidebar-section",{title:X.text,items:q,collapsedClass:X.collapsed?" collapsed":""})}));return await T("sidebar",{sections:$.join("")})}var AZ=`<button class="BPNavBarHamburger" type="button" aria-label="Toggle navigation" onclick="toggleSidebar()">
|
|
8022
|
+
<svg fill="none" stroke="currentColor" viewBox="0 0 24 24" aria-hidden="true">
|
|
8023
|
+
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 6h16M4 12h16M4 18h16"></path>
|
|
8024
|
+
</svg>
|
|
8025
|
+
</button>`;function MZ(J){if(!J.keyboard||!J.keys.length)return{hint:"",aria:""};let Z=(Q,Y)=>{let $=[];if(Q.ctrl)$.push(Y?"Ctrl":"Control");if(Q.meta)$.push(Y?"\u2318":"Meta");if(Q.alt)$.push(Y?"\u2325":"Alt");if(Q.shift)$.push("Shift");return $.push(Q.key.length===1?Q.key.toUpperCase():Q.key),Y?$.join(""):$.join("+")};return{hint:Z(J.keys[0],!0),aria:J.keys.map((Q)=>Z(Q,!1)).join(" ")}}function FZ(J,Z){let{hint:Q,aria:Y}=MZ(Z),$=w(J);return`<button class="BPNavBarSearch" type="button" aria-label="${$}"${Y?` aria-keyshortcuts="${w(Y)}"`:""}>
|
|
8026
|
+
<svg class="BPNavBarSearch-icon" fill="none" stroke="currentColor" viewBox="0 0 24 24" aria-hidden="true">
|
|
8027
|
+
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"></path>
|
|
8028
|
+
</svg>
|
|
8029
|
+
<span class="BPNavBarSearch-label">${$}</span>
|
|
8030
|
+
${Q?`<kbd class="BPNavBarSearch-kbd">${w(Q)}</kbd>`:""}
|
|
8031
|
+
</button>`}var wZ={github:'<path d="M12 0c-6.626 0-12 5.373-12 12 0 5.302 3.438 9.8 8.207 11.387.599.111.793-.261.793-.577v-2.234c-3.338.726-4.033-1.416-4.033-1.416-.546-1.387-1.333-1.756-1.333-1.756-1.089-.745.083-.729.083-.729 1.205.084 1.839 1.237 1.839 1.237 1.07 1.834 2.807 1.304 3.492.997.107-.775.418-1.305.762-1.604-2.665-.305-5.467-1.334-5.467-5.931 0-1.311.469-2.381 1.236-3.221-.124-.303-.535-1.524.117-3.176 0 0 1.008-.322 3.301 1.23.957-.266 1.983-.399 3.003-.404 1.02.005 2.047.138 3.006.404 2.291-1.552 3.297-1.23 3.297-1.23.653 1.653.242 2.874.118 3.176.77.84 1.235 1.911 1.235 3.221 0 4.609-2.807 5.624-5.479 5.921.43.372.823 1.102.823 2.222v3.293c0 .319.192.694.801.576 4.765-1.589 8.199-6.086 8.199-11.386 0-6.627-5.373-12-12-12z"/>',twitter:'<path d="M18.244 2.25h3.308l-7.227 8.26 8.502 11.24H16.17l-5.214-6.817L4.99 21.75H1.68l7.73-8.835L1.254 2.25H8.08l4.713 6.231zm-1.161 17.52h1.833L7.084 4.126H5.117z"/>',discord:'<path d="M20.317 4.37a19.79 19.79 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.6 12.6 0 0 0-.617-1.25.077.077 0 0 0-.079-.037A19.74 19.74 0 0 0 3.677 4.37a.07.07 0 0 0-.032.027C.533 9.046-.32 13.58.099 18.057a.082.082 0 0 0 .031.057 19.9 19.9 0 0 0 5.993 3.03.078.078 0 0 0 .084-.028c.462-.63.874-1.295 1.226-1.994a.076.076 0 0 0-.041-.106 13.1 13.1 0 0 1-1.872-.892.077.077 0 0 1-.008-.128c.126-.094.252-.192.372-.291a.074.074 0 0 1 .077-.01c3.928 1.793 8.18 1.793 12.062 0a.074.074 0 0 1 .078.009c.12.099.246.198.373.292a.077.077 0 0 1-.006.127 12.3 12.3 0 0 1-1.873.891.077.077 0 0 0-.041.107c.36.698.772 1.362 1.225 1.993a.076.076 0 0 0 .084.028 19.84 19.84 0 0 0 6.002-3.03.077.077 0 0 0 .032-.056c.5-5.177-.838-9.674-3.549-13.66a.06.06 0 0 0-.031-.028M8.02 15.331c-1.183 0-2.157-1.085-2.157-2.419 0-1.333.955-2.419 2.157-2.419 1.21 0 2.176 1.096 2.157 2.42 0 1.333-.956 2.418-2.157 2.418m7.975 0c-1.183 0-2.157-1.085-2.157-2.419 0-1.333.955-2.419 2.157-2.419 1.21 0 2.176 1.096 2.157 2.42 0 1.333-.946 2.418-2.157 2.418"/>',x:'<path d="M18.244 2.25h3.308l-7.227 8.26 8.502 11.24H16.17l-5.214-6.817L4.99 21.75H1.68l7.73-8.835L1.254 2.25H8.08l4.713 6.231zm-1.161 17.52h1.833L7.084 4.126H5.117z"/>'};function IZ(J){return(J.themeConfig?.socialLinks??[]).map(({icon:Q,link:Y})=>{let $=wZ[Q?.toLowerCase()],X=Q?Q.charAt(0).toUpperCase()+Q.slice(1):"Link",q=$?`<svg fill="currentColor" viewBox="0 0 24 24" aria-hidden="true">${$}</svg>`:`<span class="BPSocialLinks-text">${w(X)}</span>`;return`<a href="${w(Y)}" target="_blank" rel="noopener external" aria-label="${w(X)}">${q}</a>`}).join(`
|
|
8032
|
+
`)}function w(J){return String(J??"").replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""")}async function TZ(J,Z="On this page"){let Q=J.replace(/<nav class="table-of-contents[\s\S]*?<\/nav>/g,""),Y=/<h([2-6])([^>]*)>(.*?)<\/h\1>/g,$=[],X;while((X=Y.exec(Q))!==null){let W=Number.parseInt(X[1]),z=X[2],K=X[3];K=K.replace(/<[^>]*>/g,"");let V=z.match(/id="([^"]*)"/),_=V?V[1]:K.toLowerCase().replace(/\s+/g,"-").replace(/[^\w-]/g,"");$.push({level:W,text:K,id:_})}if($.length===0)return{aside:"",inline:""};let q=$.map((W)=>{let z=W.level>2?`level-${W.level}`:"";return`<a href="#${W.id}" class="${z}">${W.text}</a>`}).join(`
|
|
8033
|
+
`);return{aside:await T("page-toc",{items:q,title:Z}),inline:await T("page-outline",{items:q,count:String($.length),title:Z})}}function DZ(J){let Z=new Set;return J.replace(/<h([1-6])([^>]*)>(.*?)<\/h\1>/g,(Q,Y,$,X)=>{if($.includes("id=")){let K=$.match(/\bid=["']([^"']+)["']/)?.[1];if(K)Z.add(K);return Q}let q=X.match(/\s*\{#([\w-]+)\}\s*$/),W,z=X;if(q)W=q[1],z=X.replace(/\s*\{#[\w-]+\}\s*$/,"");else{let K=X.replace(/<[^>]*>/g,"");W=PJ(K)}return W=yJ(W,Z),`<h${Y}${$} id="${W}">${z}</h${Y}>`})}function LZ(J,Z,Q=""){if(!Z&&!Q)return J;let Y=!1,$=J.replace(/<h1(?:\s[^>]*)?>[\s\S]*?<\/h1>/,(X)=>{return Y=!0,`<div class="bp-page-header">${X}${Z}</div>${Q}`});return Y?$:`${Q}${J}`}function MJ(J){let Z=HZ(),Q=J.lastIndexOf("</body>");if(Q===-1)return J+Z;return J.slice(0,Q)+Z+J.slice(Q)}function FJ(J,Z){if(!Z)return J;let Q=J.lastIndexOf("</body>");if(Q===-1)return J+Z;return J.slice(0,Q)+Z+J.slice(Q)}function HZ(){return`<script data-bp-router="1">
|
|
7457
8034
|
(function(){
|
|
7458
8035
|
if (history.scrollRestoration) history.scrollRestoration = 'manual';
|
|
7459
8036
|
|
|
@@ -7671,6 +8248,11 @@ else {
|
|
|
7671
8248
|
lastSearch = target.search;
|
|
7672
8249
|
updateActiveLinks();
|
|
7673
8250
|
|
|
8251
|
+
// Swapping .BPDoc's innerHTML discards every element a DOMContentLoaded
|
|
8252
|
+
// handler had added to it (code copy buttons, for one). Announce the swap
|
|
8253
|
+
// so those enhancements can re-apply \u2014 DOMContentLoaded fires only once.
|
|
8254
|
+
document.dispatchEvent(new CustomEvent('bp:navigated', { detail: { path: target.pathname } }));
|
|
8255
|
+
|
|
7674
8256
|
if (typeof opts.restoreScroll === 'number') {
|
|
7675
8257
|
applyScroll(opts.restoreScroll);
|
|
7676
8258
|
} else if (target.hash) {
|
|
@@ -7749,55 +8331,73 @@ else {
|
|
|
7749
8331
|
|
|
7750
8332
|
updateActiveLinks();
|
|
7751
8333
|
})();
|
|
7752
|
-
<`+"/script>"}function
|
|
8334
|
+
<`+"/script>"}function PZ(J,Z=""){let Q=J.themeConfig?.nav||J.markdown?.nav||J.nav;if(!Q||Q.length===0)return"";let Y=(q)=>{return qJ(J,q||"/")},$=(q)=>{if(q.activeMatch)try{return new RegExp(q.activeMatch).test(Z)}catch{return!1}if(!q.link)return!1;let W=q.link.split("#")[0].replace(/\/$/,"");return W!==""&&W!=="/"&&(Z===W||Z.startsWith(`${W}/`))};return Q.map((q)=>{if(q.items&&q.items.length>0)return`<div class="BPNavBarMenu-group${$(q)||q.items.some((K)=>$(K))?" is-active":""}">
|
|
7753
8335
|
<button class="BPNavBarMenu-group-button" type="button">
|
|
7754
|
-
<span>${
|
|
8336
|
+
<span>${q.text}</span>
|
|
7755
8337
|
<svg class="chevron" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
|
7756
8338
|
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 9l-7 7-7-7"></path>
|
|
7757
8339
|
</svg>
|
|
7758
8340
|
</button>
|
|
7759
8341
|
<div class="BPNavBarMenu-group-items">
|
|
7760
|
-
${
|
|
8342
|
+
${q.items.map((K)=>`<a href="${Y(K.link)}">${K.text}</a>`).join("")}
|
|
7761
8343
|
</div>
|
|
7762
|
-
</div>`;return`<a class="BPNavBarMenu-link" href="${
|
|
7763
|
-
`)}function
|
|
7764
|
-
`)}function
|
|
8344
|
+
</div>`;return`<a class="BPNavBarMenu-link${$(q)?" is-active":""}" href="${Y(q.link)}">${q.text}</a>`}).join("")}function vQ(J){if(J.basePath){let Q=J.basePath.trim().replace(/\/+$/,"");if(!Q||Q==="/")return"";return Q.startsWith("/")?Q:`/${Q}`}let Z=J.sitemap?.baseUrl;if(!Z)return"";try{let Q=new URL(Z).pathname.replace(/\/+$/,"");return Q==="/"?"":Q}catch{return""}}function yZ(J,Z){let Q=vQ(J);if(!Q)return Z;if(Z===Q||Z.startsWith(`${Q}/`))return Z.slice(Q.length)||"/";return Z}function qJ(J,Z){let Q=vQ(J);if(!Q||!Z.startsWith("/")||Z.startsWith("//"))return Z;if(Z===Q||Z.startsWith(`${Q}/`))return Z;return Z==="/"?`${Q}/`:`${Q}${Z}`}function wJ(J,Z){return J.replace(/\b(href|src|action)="(\/[^"]*)"/g,(Q,Y,$)=>{let X=qJ(Z,$);return X===$?Q:`${Y}="${X}"`})}function SZ(J,Z,Q){if(Q)return`<link rel="canonical" href="${w(Q)}">`;let Y=J.sitemap?.baseUrl;if(!Y)return"";return`<link rel="canonical" href="${Y.replace(/\/$/,"")}${Z==="/index"?"/":Z}">`}function kZ(J,Z,Q,Y,$){let X=Q.sitemap?.baseUrl;if(!X)return"";let z=`${X.replace(/\/$/,"")}${Y==="/index"?"/":Y}`,K=Q.title||Q.markdown?.title||J,V=$||Q.markdown?.meta?.["og:image"]||Q.markdown?.meta?.ogImage,_=['<meta property="og:type" content="website">',`<meta property="og:url" content="${z}">`,`<meta property="og:title" content="${J}">`,`<meta property="og:description" content="${Z}">`,`<meta property="og:site_name" content="${K}">`];if(V)_.push(`<meta property="og:image" content="${V}">`);return _.join(`
|
|
8345
|
+
`)}function vZ(J,Z,Q,Y){let $=Q.markdown?.meta?.["twitter:card"]||Q.markdown?.meta?.twitterCard||"summary",X=Q.markdown?.meta?.["twitter:site"]||Q.markdown?.meta?.twitterSite,q=Y||Q.markdown?.meta?.["twitter:image"]||Q.markdown?.meta?.twitterImage,W=[`<meta name="twitter:card" content="${$}">`,`<meta name="twitter:title" content="${J}">`,`<meta name="twitter:description" content="${Z}">`];if(X)W.push(`<meta name="twitter:site" content="${X}">`);if(q)W.push(`<meta name="twitter:image" content="${q}">`);return W.join(`
|
|
8346
|
+
`)}function xZ(J,Z,Q,Y){let $=Q.sitemap?.baseUrl;if(!$)return"";let X=$.replace(/\/$/,""),q=Y==="/index"?"/":Y,W=`${X}${q}`;if(q==="/"){let _={"@context":"https://schema.org","@type":"WebSite",name:Q.title||Q.markdown?.title||J,description:Z,url:X};return`<script type="application/ld+json">
|
|
7765
8347
|
${JSON.stringify(_,null,2)}
|
|
7766
|
-
</script>`}let
|
|
7767
|
-
${JSON.stringify(
|
|
8348
|
+
</script>`}let z={"@context":"https://schema.org","@type":"TechArticle",headline:J,description:Z,url:W},K=q.split("/").filter(Boolean),V=K.map((_,G)=>{let E=G+1,B=`${X}/${K.slice(0,E).join("/")}`;return{"@type":"ListItem",position:E,name:_.replace(/-/g," ").replace(/\b\w/g,(j)=>j.toUpperCase()),item:B}});if(V.length>0){let _={"@context":"https://schema.org","@type":"BreadcrumbList",itemListElement:V};return`<script type="application/ld+json">
|
|
8349
|
+
${JSON.stringify(z,null,2)}
|
|
7768
8350
|
</script>
|
|
7769
8351
|
<script type="application/ld+json">
|
|
7770
8352
|
${JSON.stringify(_,null,2)}
|
|
7771
8353
|
</script>`}return`<script type="application/ld+json">
|
|
7772
|
-
${JSON.stringify(
|
|
7773
|
-
</script>`}function
|
|
7774
|
-
`);return{fontLinks
|
|
7775
|
-
`),fontFaceCss
|
|
7776
|
-
|
|
7777
|
-
|
|
7778
|
-
`)
|
|
7779
|
-
|
|
7780
|
-
|
|
7781
|
-
|
|
7782
|
-
|
|
7783
|
-
|
|
7784
|
-
|
|
7785
|
-
|
|
7786
|
-
|
|
7787
|
-
|
|
7788
|
-
|
|
7789
|
-
${
|
|
7790
|
-
|
|
7791
|
-
|
|
7792
|
-
|
|
7793
|
-
|
|
7794
|
-
${
|
|
7795
|
-
${
|
|
7796
|
-
${
|
|
7797
|
-
${
|
|
7798
|
-
${
|
|
7799
|
-
|
|
7800
|
-
|
|
8354
|
+
${JSON.stringify(z,null,2)}
|
|
8355
|
+
</script>`}function CZ(J){let Z=J.fonts;if(!Z)return{fontLinks:"",fontFaceCss:""};let Q=[],Y=Z.google?.filter(Boolean)??[];if(Y.length>0){if(Z.preconnect!==!1)Q.push('<link rel="preconnect" href="https://fonts.googleapis.com">'),Q.push('<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>');let X=Y.map((W)=>`family=${W.trim().replace(/\s+/g,"+")}`).join("&"),q=Z.display??"swap";Q.push(`<link href="https://fonts.googleapis.com/css2?${X}&display=${q}" rel="stylesheet">`)}let $=(Z.faces??[]).map((X)=>X.trim()).filter(Boolean).join(`
|
|
8356
|
+
`);return{fontLinks:Q.join(`
|
|
8357
|
+
`),fontFaceCss:$}}function bZ(J){let Z=J.themeConfig;if(!Z)return"";let Q=[],Y=(W,z)=>{if(z)Q.push(` ${W}: ${z};`)},$=Z.colors??{};Y("--bp-c-brand-1",$.primary),Y("--bp-c-brand-2",$.secondary||$.primary),Y("--bp-c-brand-3",$.accent||$.secondary||$.primary),Y("--bp-c-bg",$.background),Y("--bp-c-bg-alt",$.surface),Y("--bp-c-bg-soft",$.surface),Y("--bp-c-text-1",$.text),Y("--bp-c-text-2",$.muted);let X=Z.fonts??{};Y("--bp-font-family-base",X.body),Y("--bp-font-family-mono",X.mono);for(let[W,z]of Object.entries(Z.cssVars??{}))Y(W.startsWith("--")?W:`--${W}`,z);let q=[];if(Q.length)q.push(`:root {
|
|
8358
|
+
${Q.join(`
|
|
8359
|
+
`)}
|
|
8360
|
+
}`);if(X.heading)q.push(`.bp-doc h1,
|
|
8361
|
+
.bp-doc h2,
|
|
8362
|
+
.bp-doc h3,
|
|
8363
|
+
.bp-doc h4,
|
|
8364
|
+
.bp-doc h5,
|
|
8365
|
+
.bp-doc h6,
|
|
8366
|
+
.BPHero-text {
|
|
8367
|
+
font-family: ${X.heading};
|
|
8368
|
+
}`);if(Z.css)q.push(Z.css);return q.join(`
|
|
8369
|
+
|
|
8370
|
+
`)}function pZ(J,Z,Q,Y){let $=Z.match(/<h1(?:\s[^>]*)?>([\s\S]*?)<\/h1>/),X=$?$[1].replace(/<[^>]+>/g,"").trim():"",q=typeof J.title==="string"&&J.title.trim()||X||Q,W=q&&q!==Q?`${q} | ${Q}`:Q,z=typeof J.description==="string"&&J.description.trim()||Y.description||Y.markdown?.meta?.description||"Documentation built with BunPress",K=[],V=(B)=>{K.push(B)},_=J.keywords;if(_){let B=Array.isArray(_)?_.join(", "):String(_);if(B.trim())V(`<meta name="keywords" content="${w(B)}">`)}if(typeof J.author==="string"&&J.author.trim())V(`<meta name="author" content="${w(J.author)}">`);if(typeof J.robots==="string"&&J.robots.trim())V(`<meta name="robots" content="${w(J.robots)}">`);if(J.meta&&typeof J.meta==="object")for(let[B,j]of Object.entries(J.meta)){if(j===void 0||j===null)continue;let U=B.startsWith("og:")?"property":"name";V(`<meta ${U}="${w(B)}" content="${w(String(j))}">`)}if(Array.isArray(J.head))for(let B of J.head){if(!Array.isArray(B)||typeof B[0]!=="string")continue;let[j,U]=B;if(!["meta","link","base"].includes(j.toLowerCase()))continue;let O=Object.entries(U??{}).map(([N,M])=>`${w(N)}="${w(String(M))}"`).join(" ");V(`<${j.toLowerCase()}${O?` ${O}`:""}>`)}let G=typeof J.image==="string"?J.image:void 0,E=typeof J.canonical==="string"?J.canonical:void 0;return{documentTitle:W,pageTitle:q,description:z,image:G,canonical:E,extraTags:K.join(`
|
|
8371
|
+
`)}}async function fZ(J,Z,Q,Y,$){let X=J.themeConfig,q="",W="",z=X?.editLink?.pattern;if(z&&$&&Z.editLink!==!1){let E=iJ(z,Y,$),B=X?.editLink?.text??"Edit this page";q=`<a class="BPDocFooter-edit" href="${w(E)}" target="_blank" rel="noopener"><svg fill="none" stroke="currentColor" viewBox="0 0 24 24" aria-hidden="true"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M11 5H6a2 2 0 00-2 2v11a2 2 0 002 2h11a2 2 0 002-2v-5m-1.414-9.414a2 2 0 112.828 2.828L11.828 15H9v-2.828l8.586-8.586z"></path></svg>${w(B)}</a>`}let K=X?.lastUpdated,V=Z.lastUpdated!==!1,_=K!==void 0&&K!==!1,G=typeof Z.lastUpdated==="string"?Z.lastUpdated:void 0;if(V&&(_||Z.lastUpdated===!0||G)){let E=G??($?await sJ(Y,$):null);if(E){let B=typeof K==="object"?K:{},j=rJ(E,Q,B.formatOptions);if(j){let U=B.text??"Last updated";W=`<p class="BPDocFooter-updated">${w(U)}: <time datetime="${w(E)}">${w(j)}</time></p>`}}}if(!q&&!W)return"";return T("doc-footer",{editLink:q,lastUpdated:W})}async function UQ(J,Z,Q,Y="doc",$={},X={}){let{i18n:q,locale:W,sourceFile:z,docsDir:K=Z.docsDir||"./docs"}=X,V=q??await HJ(LJ(Z),Z),_=W||V.defaultLocale,G=FQ(Z,V,_),E=(F)=>V.translate(F,_),B=G.title||G.themeConfig?.siteTitle||G.markdown?.title||"BunPress Documentation",j=pZ($,J,B,G),U=j.documentTitle,O=j.description,N=G.theme||"vitepress",M=_Q(N),R=cJ(),A=EQ.markdown?.css||"",D=G.markdown?.css||"",P=D&&D!==A?D:"",C=bZ(G),WJ=SZ(G,Q,j.canonical),b=kZ(j.pageTitle,O,G,Q,j.image),zJ=vZ(j.pageTitle,O,G,j.image),VJ=xZ(j.pageTitle,O,G,Q),SJ=Object.entries(G.markdown?.meta||{}).filter(([F])=>!F.startsWith("og:")&&!F.startsWith("twitter:")&&F!=="description"&&F!=="ogImage"&&F!=="twitterCard"&&F!=="twitterSite"&&F!=="twitterImage").map(([F,x])=>`<meta name="${F}" content="${x}">`).join(`
|
|
8372
|
+
`),{fontLinks:S,fontFaceCss:L}=CZ(G),I=wQ(V,G,Q),u=[SJ,WJ,I,b,zJ,j.extraTags,S].filter(Boolean).join(`
|
|
8373
|
+
`),i=gZ(G),KJ=hZ(G),_J=G.markdown?.scripts?.map((F)=>`<script>${F}</script>`).join(`
|
|
8374
|
+
`)||"",r=IQ(V),g=[VJ,i,KJ,_J,r?`<script>${r}</script>`:""].filter(Boolean).join(`
|
|
8375
|
+
`),H=PZ(G,Q),p=G.search??G.markdown?.search,o=p?.enabled!==!1,k=p?.algolia,kJ=p?.provider==="algolia"&&!!k?.appId&&!!k?.apiKey&&!!k?.indexName,v=SQ(G,qJ(G,YJ));if(!G.search?.placeholder&&!G.markdown?.search?.placeholder)v.placeholder=E("search.placeholder");v.locale=V.enabled?_:null;let GJ=o?await T(kJ?"search-algolia":"search",{placeholder:v.placeholder,runtimeConfig:JSON.stringify(kJ?{...v,algolia:k}:v).replace(/</g,"\\u003c")}):"",f=G.themeConfig?.footer,jJ=f?.message||f?.copyright?await T("footer",{message:f.message?`<p class="BPFooter-message">${f.message}</p>`:"",copyright:f.copyright?`<p class="BPFooter-copyright">${f.copyright}</p>`:""}):"",bQ=V.enabled?await T("locale-switcher",{label:E("nav.menu"),current:DJ(V,_),options:V.locales.map((F)=>{let x=AQ(V,F,Q==="/index"?"/":Q),h=F===_?' aria-current="true"':"";return`<li><a href="${w(x)}" data-locale="${w(F)}"${h}>${w(DJ(V,F))}</a></li>`}).join(`
|
|
8376
|
+
`)}):"",pQ=G.themeConfig?.logo?`<img class="BPNavBarTitle-logo" src="${w(G.themeConfig.logo)}" alt="">`:"",OJ=async(F)=>$.navbar===!1?"":T("navbar",{title:B,logo:pQ,localeSwitcher:bQ,nav:H,searchTrigger:o?FZ(v.placeholder,v.shortcuts):"",hamburger:F==="doc"?AZ:"",socialLinks:IZ(G)}),a=G.darkMode??G.themeConfig?.darkMode??"auto",n=a===!0||a==="dark"?"dark":a===!1||a==="light"?"light":"auto",UJ=n==="dark"?"dark":"";if(Y==="home"){let F=await IJ(`${J}
|
|
8377
|
+
${H}`),x=`${L}
|
|
8378
|
+
${M}
|
|
8379
|
+
${R}
|
|
8380
|
+
${F}
|
|
8381
|
+
${A}
|
|
8382
|
+
${P}
|
|
8383
|
+
${C}`,h=await T("layout-home",{htmlClass:UJ,themeMode:n,lang:_,title:B,documentTitle:U,description:O,meta:u,customCSS:x,navbar:await OJ("plain"),search:GJ,footer:jJ,content:J});return wJ(MJ(FJ(h,g)),G)}if(Y==="page"){let F=await IJ(`${J}
|
|
8384
|
+
${H}`),x=`${L}
|
|
8385
|
+
${M}
|
|
8386
|
+
${R}
|
|
8387
|
+
${F}
|
|
8388
|
+
${A}
|
|
8389
|
+
${P}
|
|
8390
|
+
${C}`,h=await T("layout-page",{htmlClass:UJ,themeMode:n,lang:_,title:B,documentTitle:U,description:O,meta:u,customCSS:x,navbar:await OJ("plain"),search:GJ,footer:jJ,content:J});return wJ(MJ(FJ(h,g)),G)}let vJ=DZ(J),xJ=await TZ(vJ,E("toc.title")),CJ=await RZ(G,Q),bJ=LZ(vJ,await T("copy-page",{}),xJ.inline),fQ=xJ.aside,uQ=await IJ(`${bJ}
|
|
8391
|
+
${H}
|
|
8392
|
+
${CJ}`),gQ=`${L}
|
|
8393
|
+
${M}
|
|
8394
|
+
${R}
|
|
8395
|
+
${uQ}
|
|
8396
|
+
${A}
|
|
8397
|
+
${P}
|
|
8398
|
+
${C}`,hQ=await fZ(G,$,_,K,z),mQ=await T("layout-doc",{htmlClass:UJ,themeMode:n,lang:_,title:B,documentTitle:U,description:O,meta:u,customCSS:gQ,navbar:await OJ("doc"),search:GJ,docFooter:hQ,footer:jJ,sidebar:$.sidebar===!1?"":CJ,content:bJ,pageTOC:fQ});return wJ(MJ(FJ(mQ,g)),G)}var ZJ=null,NQ=!1;async function uZ(){if(NQ)return ZJ;NQ=!0;try{ZJ=await import("@cwcss/crosswind")}catch{ZJ=null}return ZJ}async function IJ(J){let Z=await uZ();if(!Z)return"";let Y=new Z.Scanner([]).scanContent(J);if(Y.size===0)return"";let $=new Z.CSSGenerator(Z.defaultConfig);for(let X of Y)$.generate(X);return $.toCSS(!1,!1)}function gZ(J){if(!J.fathom?.enabled||!J.fathom?.siteId)return"";let Z=J.fathom.scriptUrl||"https://cdn.usefathom.com/script.js",Q=J.fathom.defer!==!1,Y=J.fathom.honorDNT||!1,$=J.fathom.auto!==!1,X=J.fathom.canonical,q=J.fathom.spa||!1,W=[`data-site="${J.fathom.siteId}"`,Y?'data-honor-dnt="true"':"",!$?'data-auto="false"':"",X?`data-canonical="${X}"`:"",q?'data-spa="auto"':""].filter(Boolean).join(" ");return`<script src="${Z}" ${W}${Q?" defer":""}></script>`}function hZ(J){let Z=J.analytics||J.selfHostedAnalytics;if(!Z?.enabled||!Z?.siteId)return"";let Q=TJ(Z.siteId);if(Z.scriptSrc)return`<script defer src="${TJ(Z.scriptSrc)}" data-site="${Q}"></script>`;let Y=Z.apiEndpoint?TJ(Z.apiEndpoint):"",$=Z.honorDNT?`var dnt=n.doNotTrack||w.doNotTrack||n.msDoNotTrack;if(dnt==="1"||dnt==="yes"||dnt===true){l('DNT enabled, skipping');return;}`:"",X=Z.trackHashChanges?"w.addEventListener('hashchange',function(){pv();});":"",q=Z.trackOutboundLinks?`d.addEventListener('click',function(e){try{var a=e.target.closest('a');if(a&&a.hostname&&a.hostname!==location.hostname){t('outbound',{url:a.href,text:(a.textContent||'').slice(0,100)});}}
|
|
8399
|
+
catch (err){l('Outbound error',err);}});`:"",W=Y?` data-api="${Y}"`:"";return`<!-- ts-analytics: privacy-first analytics -->
|
|
8400
|
+
<script data-site="${Q}"${W} defer>
|
|
7801
8401
|
(function(){
|
|
7802
8402
|
'use strict';
|
|
7803
8403
|
var d=document,w=window,n=navigator,ss=w.sessionStorage,s=d.currentScript;
|
|
@@ -7805,7 +8405,7 @@ var site=s.dataset.site,api=s.dataset.api||w.ANALYTICS_API_ENDPOINT||'/api/analy
|
|
|
7805
8405
|
var debug=w.ANALYTICS_DEBUG||false;
|
|
7806
8406
|
function l(){if(debug&&w.console)console.log.apply(console,['[Analytics]'].concat([].slice.call(arguments)));}
|
|
7807
8407
|
try{
|
|
7808
|
-
${
|
|
8408
|
+
${$}
|
|
7809
8409
|
var SK='_tsa_sid',VK='_tsa_vid';
|
|
7810
8410
|
var sid=ss.getItem(SK);
|
|
7811
8411
|
if(!sid){sid=Math.random().toString(36).slice(2)+Date.now().toString(36);ss.setItem(SK,sid);l('New session',sid);}
|
|
@@ -7843,7 +8443,7 @@ send(api+'/collect',data);
|
|
|
7843
8443
|
catch(err){l('Track error',err);}
|
|
7844
8444
|
}
|
|
7845
8445
|
var pvSent={};function pv(){var p=location.pathname;if(pvSent[p]&&Date.now()-pvSent[p]<1000)return;pvSent[p]=Date.now();l('Pageview',p);t('pageview',{path:p});}
|
|
7846
|
-
${
|
|
8446
|
+
${X}
|
|
7847
8447
|
${q}
|
|
7848
8448
|
var hp=history.pushState;if(hp){history.pushState=function(){hp.apply(history,arguments);pv();};}
|
|
7849
8449
|
var hr=history.replaceState;if(hr){history.replaceState=function(){hr.apply(history,arguments);};}
|
|
@@ -7858,38 +8458,50 @@ l('Initialized',site);
|
|
|
7858
8458
|
}
|
|
7859
8459
|
catch(err){if(w.console)console.error('[Analytics] Init error:',err);}
|
|
7860
8460
|
})();
|
|
7861
|
-
</script>`}function
|
|
7862
|
-
`)
|
|
7863
|
-
`)}</div>`;let
|
|
7864
|
-
<${q} class="BPFeature"${
|
|
7865
|
-
${
|
|
7866
|
-
<h3 class="BPFeature-title">${
|
|
7867
|
-
<p class="BPFeature-details">${
|
|
7868
|
-
</${q}>`}).join("");return await
|
|
7869
|
-
`).
|
|
7870
|
-
`)
|
|
7871
|
-
|
|
7872
|
-
|
|
7873
|
-
|
|
7874
|
-
|
|
7875
|
-
`)
|
|
7876
|
-
`),
|
|
7877
|
-
|
|
7878
|
-
|
|
8461
|
+
</script>`}function TJ(J){return J.replace(/&/g,"&").replace(/"/g,""").replace(/'/g,"'").replace(/</g,"<").replace(/>/g,">")}function mZ(J){let Z=J.replace(/\r\n/g,`
|
|
8462
|
+
`),Q=/^---\n([\s\S]*?)\n---\n?/,Y=Z.match(Q);if(!Y)return{frontmatter:{},content:Z};let $=Y[1],X=Z.slice(Y[0].length);try{return{frontmatter:jQ.parse($),content:X}}catch{try{let q=$.replace(/^(\s*\w+:\s*)"(.+)",\s*(.+)$/gm,`$1'"$2," $3'`);return{frontmatter:jQ.parse(q),content:X}}catch(q){return console.error("Failed to parse frontmatter YAML:",q),{frontmatter:{},content:J}}}}async function dZ(J){if(!J)return"";let Z=J.name?`<p class="BPHero-name">${J.name}</p>`:"",Q=J.text?`<h1 class="BPHero-text">${J.text}</h1>`:"",Y=J.tagline?`<p class="BPHero-tagline">${J.tagline}</p>`:"",$="";if(J.actions)$=`<div class="BPHero-actions">${J.actions.map((W)=>{return`<a class="${W.theme==="brand"?"BPButton BPButton-brand":"BPButton BPButton-alt"}" href="${W.link}">${W.text}</a>`}).join(`
|
|
8463
|
+
`)}</div>`;let X=J.image?`<div class="hero-image"><img src="${J.image}" alt="${J.name||""}" /></div>`:"";return await T("hero",{name:Z,text:Q,tagline:Y,actions:$,image:X})}var cZ={Fast:'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5"><path d="M13 2L3 14h9l-1 8 10-12h-9l1-8z"/></svg>',Shield:'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5"><path d="M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z"/></svg>',Blade:'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5"><path d="M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z"/></svg>',Tools:'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5"><path d="M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z"/></svg>',Components:'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5"><rect x="3" y="3" width="7" height="7" rx="1"/><rect x="14" y="3" width="7" height="7" rx="1"/><rect x="3" y="14" width="7" height="7" rx="1"/><rect x="14" y="14" width="7" height="7" rx="1"/></svg>',Stream:'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5"><path d="M2 12h6l3-9 3 18 3-9h5"/></svg>',Desktop:'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5"><rect x="2" y="3" width="20" height="14" rx="2"/><path d="M8 21h8m-4-4v4"/></svg>',Parser:'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5"><path d="M16 18l6-6-6-6M8 6l-6 6 6 6"/></svg>',Icons:'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5"><circle cx="12" cy="12" r="4"/><path d="M12 2v2m0 16v2M4.93 4.93l1.41 1.41m11.32 11.32l1.41 1.41M2 12h2m16 0h2M6.34 17.66l-1.41 1.41M19.07 4.93l-1.41 1.41"/></svg>'};function lZ(J){if(J.startsWith("<")||/\p{Emoji}/u.test(J))return J;return cZ[J]||`<span class="BPFeature-icon-text">${J.charAt(0)}</span>`}async function sZ(J){if(!J||J.length===0)return"";let Z=J.map((Q)=>{let Y=Q.icon?lZ(Q.icon):"",$=Y?`<div class="BPFeature-icon">${Y}</div>`:"",X=Q.link,q=X?"a":"div",W=X?` href="${X}"`:"";return`
|
|
8464
|
+
<${q} class="BPFeature"${W}>
|
|
8465
|
+
${$}
|
|
8466
|
+
<h3 class="BPFeature-title">${Q.title||""}</h3>
|
|
8467
|
+
<p class="BPFeature-details">${Q.details||""}</p>
|
|
8468
|
+
</${q}>`}).join("");return await T("features",{items:Z})}function iZ(J){let Z={smile:"\uD83D\uDE04",laughing:"\uD83D\uDE06",blush:"\uD83D\uDE0A",heart_eyes:"\uD83D\uDE0D",kissing_heart:"\uD83D\uDE18",relaxed:"\u263A\uFE0F",wink:"\uD83D\uDE09",grin:"\uD83D\uDE01",joy:"\uD83D\uDE02",sweat_smile:"\uD83D\uDE05",rofl:"\uD83E\uDD23",thinking:"\uD83E\uDD14",zipper_mouth:"\uD83E\uDD10",neutral_face:"\uD83D\uDE10",expressionless:"\uD83D\uDE11",confused:"\uD83D\uDE15",worried:"\uD83D\uDE1F",slightly_frowning_face:"\uD83D\uDE41",frowning_face:"\u2639\uFE0F",persevere:"\uD83D\uDE23",disappointed:"\uD83D\uDE1E",sweat:"\uD83D\uDE13",tired_face:"\uD83D\uDE2B",cry:"\uD83D\uDE22",sob:"\uD83D\uDE2D",triumph:"\uD83D\uDE24",angry:"\uD83D\uDE20",rage:"\uD83D\uDE21",no_mouth:"\uD83D\uDE36",sleeping:"\uD83D\uDE34","+1":"\uD83D\uDC4D",thumbsup:"\uD83D\uDC4D","-1":"\uD83D\uDC4E",thumbsdown:"\uD83D\uDC4E",clap:"\uD83D\uDC4F",raised_hands:"\uD83D\uDE4C",pray:"\uD83D\uDE4F",wave:"\uD83D\uDC4B",ok_hand:"\uD83D\uDC4C",point_up:"\u261D\uFE0F",point_down:"\uD83D\uDC47",point_left:"\uD83D\uDC48",point_right:"\uD83D\uDC49",muscle:"\uD83D\uDCAA",heart:"\u2764\uFE0F",blue_heart:"\uD83D\uDC99",green_heart:"\uD83D\uDC9A",yellow_heart:"\uD83D\uDC9B",purple_heart:"\uD83D\uDC9C",broken_heart:"\uD83D\uDC94",sparkling_heart:"\uD83D\uDC96",star:"\u2B50",star2:"\uD83C\uDF1F",sparkles:"\u2728",boom:"\uD83D\uDCA5",fire:"\uD83D\uDD25",tada:"\uD83C\uDF89",confetti_ball:"\uD83C\uDF8A",rocket:"\uD83D\uDE80",zap:"\u26A1",bulb:"\uD83D\uDCA1",bell:"\uD83D\uDD14",mega:"\uD83D\uDCE3",loudspeaker:"\uD83D\uDCE2",warning:"\u26A0\uFE0F",white_check_mark:"\u2705",check:"\u2705",x:"\u274C",heavy_check_mark:"\u2714\uFE0F",heavy_multiplication_x:"\u2716\uFE0F",question:"\u2753",grey_question:"\u2754",exclamation:"\u2757",grey_exclamation:"\u2755",heavy_plus_sign:"\u2795",heavy_minus_sign:"\u2796",pencil2:"\u270F\uFE0F",memo:"\uD83D\uDCDD",book:"\uD83D\uDCD6",books:"\uD83D\uDCDA",bookmark:"\uD83D\uDD16",mag:"\uD83D\uDD0D",mag_right:"\uD83D\uDD0E",lock:"\uD83D\uDD12",unlock:"\uD83D\uDD13",key:"\uD83D\uDD11",link:"\uD83D\uDD17",computer:"\uD83D\uDCBB",email:"\uD83D\uDCE7",inbox_tray:"\uD83D\uDCE5",outbox_tray:"\uD83D\uDCE4",package:"\uD83D\uDCE6",file_folder:"\uD83D\uDCC1",open_file_folder:"\uD83D\uDCC2",page_facing_up:"\uD83D\uDCC4",calendar:"\uD83D\uDCC5",chart_with_upwards_trend:"\uD83D\uDCC8",chart_with_downwards_trend:"\uD83D\uDCC9",bar_chart:"\uD83D\uDCCA",clipboard:"\uD83D\uDCCB",pushpin:"\uD83D\uDCCC",round_pushpin:"\uD83D\uDCCD",paperclip:"\uD83D\uDCCE",straight_ruler:"\uD83D\uDCCF",wrench:"\uD83D\uDD27",hammer:"\uD83D\uDD28",gear:"\u2699\uFE0F",nut_and_bolt:"\uD83D\uDD29",seedling:"\uD83C\uDF31",evergreen_tree:"\uD83C\uDF32",deciduous_tree:"\uD83C\uDF33",palm_tree:"\uD83C\uDF34",cactus:"\uD83C\uDF35",herb:"\uD83C\uDF3F",shamrock:"\u2618\uFE0F",four_leaf_clover:"\uD83C\uDF40",bug:"\uD83D\uDC1B",bee:"\uD83D\uDC1D",bird:"\uD83D\uDC26",dog:"\uD83D\uDC36",cat:"\uD83D\uDC31",penguin:"\uD83D\uDC27",turtle:"\uD83D\uDC22",fish:"\uD83D\uDC1F",coffee:"\u2615",tea:"\uD83C\uDF75",beer:"\uD83C\uDF7A",beers:"\uD83C\uDF7B",wine_glass:"\uD83C\uDF77",pizza:"\uD83C\uDF55",hamburger:"\uD83C\uDF54",fries:"\uD83C\uDF5F",cake:"\uD83C\uDF70",birthday:"\uD83C\uDF82",cookie:"\uD83C\uDF6A",doughnut:"\uD83C\uDF69",apple:"\uD83C\uDF4E",green_apple:"\uD83C\uDF4F",banana:"\uD83C\uDF4C",strawberry:"\uD83C\uDF53",house:"\uD83C\uDFE0",office:"\uD83C\uDFE2",hospital:"\uD83C\uDFE5",school:"\uD83C\uDFEB",car:"\uD83D\uDE97",taxi:"\uD83D\uDE95",bus:"\uD83D\uDE8C",train:"\uD83D\uDE82",airplane:"\u2708\uFE0F",ship:"\uD83D\uDEA2",bike:"\uD83D\uDEB2",soccer:"\u26BD",basketball:"\uD83C\uDFC0",football:"\uD83C\uDFC8",baseball:"\u26BE",tennis:"\uD83C\uDFBE",trophy:"\uD83C\uDFC6",medal:"\uD83C\uDFC5",dart:"\uD83C\uDFAF",game_die:"\uD83C\uDFB2",musical_note:"\uD83C\uDFB5",notes:"\uD83C\uDFB6",art:"\uD83C\uDFA8",camera:"\uD83D\uDCF7",movie_camera:"\uD83C\uDFA5",checkered_flag:"\uD83C\uDFC1",triangular_flag_on_post:"\uD83D\uDEA9",flag_us:"\uD83C\uDDFA\uD83C\uDDF8",flag_gb:"\uD83C\uDDEC\uD83C\uDDE7",flag_fr:"\uD83C\uDDEB\uD83C\uDDF7",flag_de:"\uD83C\uDDE9\uD83C\uDDEA",flag_jp:"\uD83C\uDDEF\uD83C\uDDF5",flag_cn:"\uD83C\uDDE8\uD83C\uDDF3"};return J.replace(/:(\w+):/g,(Q,Y)=>{return Z[Y]||Q})}function rZ(J){let Z=/<Badge([^/>]+)\/>/gi;return J.replace(Z,(Q,Y)=>{let $=Y.match(/type="(info|tip|warning|danger)"/i),X=Y.match(/text="([^"]+)"/),q=$?$[1].toLowerCase():"info",W=X?X[1]:"";return`<span class="badge badge-${q}">${W}</span>`})}function oZ(J,Z=!0,Q=!0){return J.replace(/<a\s+href="([^"]+)"([^>]*)>/g,(Y,$,X)=>{if(X.includes("target="))return Y;if($.startsWith("http://")||$.startsWith("https://"))return`<a href="${$}"${Z?' target="_blank"':""}${Q?' rel="noreferrer noopener"':""}${X}>`;return Y})}function aZ(J){return J.replace(/<a\s+href="([^"]+)"\s+target="_blank"[^>]*>[\s\S]+?<\/a>/g,(Z,Q)=>{if(Z.includes("external-link-icon"))return Z;let Y='<svg class="external-link-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"></path><polyline points="15 3 21 3 21 9"></polyline><line x1="10" y1="14" x2="21" y2="3"></line></svg>';return Z.replace("</a>",`${Y}</a>`)})}function nZ(J){return J.replace(/<img([^>]+)>/g,(Z,Q)=>{if(Q.includes("loading="))return Z;return`<img ${Q} loading="lazy" decoding="async">`})}function tZ(J,Z){if(!J.includes("[[toc]]"))return{content:J,tocHtml:null};let Q=LQ(J),Y={...TQ,...Z},$=PQ(Q,Y),q={items:HQ($),title:Y.title||"Table of Contents",config:Y},W=yQ(q),z="<!--INLINE_TOC_PLACEHOLDER-->";return{content:J.replace(/\[\[toc\]\]/g,z),tocHtml:W}}function eZ(J,Z){return J.replace(/<!--INLINE_TOC_PLACEHOLDER-->/g,Z)}function xQ(J){let Z=J.replace(/\s+$/,"").split(`
|
|
8469
|
+
`),Q=Z.filter((X)=>X.trim()).map((X)=>X.match(/^[ \t]*/)[0].length),Y=Q.length>0?Math.min(...Q):0,$=Z.map((X)=>X.slice(Y)).join(`
|
|
8470
|
+
`).trim();return $?`
|
|
8471
|
+
|
|
8472
|
+
${$}
|
|
8473
|
+
|
|
8474
|
+
`:""}async function J0(J){let Z=/^>\s*\[!(NOTE|TIP|IMPORTANT|WARNING|CAUTION)\]\s*\n((?:>\s*.*\n?)*)/gm,Q=Array.from(J.matchAll(Z)),Y=J;for(let $ of Q.reverse()){let[X,q,W]=$,z=W.split(`
|
|
8475
|
+
`).map((_)=>_.replace(/^>\s?/,"")).join(`
|
|
8476
|
+
`),K=q.toLowerCase(),V=await T(`blocks/alerts/${K}`,{content:xQ(z)});Y=`${Y.slice(0,$.index)}
|
|
8477
|
+
|
|
8478
|
+
${V}
|
|
8479
|
+
|
|
8480
|
+
${Y.slice($.index+X.length)}`}return Y}async function Q0(J,Z){let Q=/^<<<\s+@\/([^\s[{#]+)(?:\{(\d+)-(\d+)\}|#(\w+))?\s*(?:\[[^\]]+\]\s*)?$/gm,Y=Array.from(J.matchAll(Q)),$=J;for(let X of Y.reverse()){let[q,W,z,K,V]=X;try{let{join:_}=await import("path"),G=_(Z,W),E=Bun.file(G);if(!await E.exists()){console.warn(`Code import: File not found: ${G}`);continue}let j=(await E.text()).split(`
|
|
8481
|
+
`),U=W.split(".").pop()||"",N={js:"javascript",ts:"typescript",jsx:"jsx",tsx:"tsx",py:"python",rb:"ruby",go:"go",rs:"rust",java:"java",cpp:"cpp",c:"c",cs:"csharp",php:"php",sh:"bash",bash:"bash",yaml:"yaml",yml:"yaml",json:"json",md:"markdown",html:"html",css:"css",scss:"scss",vue:"vue"}[U]||U;if(z&&K){let A=Number.parseInt(z)-1,D=Number.parseInt(K);j=j.slice(A,D)}else if(V){let A=j.findIndex((P)=>P.includes(`#region ${V}`)||P.includes(`// region ${V}`)||P.includes(`# region ${V}`)),D=j.findIndex((P,C)=>C>A&&(P.includes("#endregion")||P.includes("// endregion")||P.includes("# endregion")));if(A!==-1&&D!==-1)j=j.slice(A+1,D);else console.warn(`Code import: Region '${V}' not found in ${W}`)}let M=j.join(`
|
|
8482
|
+
`),R=`\`\`\`${N}
|
|
8483
|
+
${M}
|
|
8484
|
+
\`\`\``;$=$.slice(0,X.index)+R+$.slice(X.index+q.length)}catch(_){console.error(`Error importing code from ${W}:`,_)}}return $}async function CQ(J,Z,Q=new Set){let Y=/<!--@include:\s*([^\s{]+)(?:\{(\d+)-(\d+)\}|\{#([\w-]+)\})?\s*-->/g,$=Array.from(J.matchAll(Y)),X=J;for(let q of $.reverse()){let[W,z,K,V,_]=q;try{let{join:G,resolve:E}=await import("path"),B=E(G(Z,z));if(Q.has(B)){console.warn(`Markdown include: Circular reference detected for ${z}`);continue}let j=Bun.file(B);if(!await j.exists()){console.warn(`Markdown include: File not found: ${B}`);continue}let O=(await j.text()).split(`
|
|
8485
|
+
`);if(K&&V){let R=Number.parseInt(K)-1,A=Number.parseInt(V);O=O.slice(R,A)}else if(_){let R=O.findIndex((D)=>D.includes(`<!-- #region ${_} -->`)||D.includes(`<!-- region ${_} -->`)),A=O.findIndex((D,P)=>P>R&&(D.includes("<!-- #endregion -->")||D.includes("<!-- endregion -->")));if(R!==-1&&A!==-1)O=O.slice(R+1,A);else{console.warn(`Markdown include: Region '${_}' not found in ${z}`);continue}}let N=O.join(`
|
|
8486
|
+
`),M=new Set(Q);M.add(B),N=await CQ(N,Z,M),X=X.slice(0,q.index)+N+X.slice(q.index+W.length)}catch(G){console.error(`Error including markdown from ${z}:`,G)}}return X}async function Z0(J){let Z=/^:::\s+code-group[ \t]*\n((?:(?!^:::)[\s\S])*)^:::$/gm,Q=Array.from(J.matchAll(Z)),Y=J;for(let $ of Q.reverse()){let[X,q]=$,W=/^```(\w+)[ \t]+\[([^\]]+)\][ \t]*\n((?:(?!^```)[\s\S])*)^```$/gm,z=Array.from(q.matchAll(W));if(z.length===0)continue;let K=new Bun.CryptoHasher("sha256");K.update(`${$.index}\x00${X}`);let V=`code-group-${K.digest("hex").slice(0,12)}`,_=z.map((B,j)=>{let U=B[2];return`<button class="code-group-tab${j===0?" active":""}" onclick="switchCodeTab('${V}', ${j})">${U}</button>`}).join(""),G=await Promise.all(z.map(async(B,j)=>{let U=B[1],O=B[3],N=j===0,M=y.markdown?.syntaxHighlightTheme||"github-light",R=await BJ(O,U,M),A=`<pre data-lang="${U}"><code class="language-${U}">${R}</code></pre>`;return`<div class="code-group-panel${N?" active":""}" data-panel="${j}">
|
|
8487
|
+
${A}
|
|
8488
|
+
</div>`})),E=[`<div class="code-group" id="${V}">`,' <div class="code-group-tabs">',` ${_}`," </div>",' <div class="code-group-panels">',` ${G.join(`
|
|
7879
8489
|
`)}`," </div>","</div>"].join(`
|
|
7880
|
-
`);Y=Y.slice(0
|
|
7881
|
-
|
|
7882
|
-
|
|
7883
|
-
|
|
7884
|
-
`).
|
|
7885
|
-
`),
|
|
7886
|
-
`),
|
|
7887
|
-
`)
|
|
7888
|
-
<
|
|
7889
|
-
|
|
7890
|
-
|
|
7891
|
-
|
|
7892
|
-
|
|
7893
|
-
|
|
7894
|
-
|
|
7895
|
-
|
|
8490
|
+
`);Y=Y.slice(0,$.index)+E+Y.slice($.index+X.length)}return Y}async function $0(J){let Z=/^:::\s+(info|tip|warning|danger|details|raw)(?: +([^\n\t ][^\n]*))?\n((?:(?!^:::)[\s\S])*)^:::$/gm,Q=Array.from(J.matchAll(Z)),Y=J;for(let $ of Q.reverse()){let[X,q,W,z]=$,K={info:"INFO",tip:"TIP",warning:"WARNING",danger:"DANGER",details:"Details",raw:""},V=W&&W.trim()||K[q],_=await T(`blocks/containers/${q}`,{title:V,content:xQ(z)});Y=`${Y.slice(0,$.index)}
|
|
8491
|
+
|
|
8492
|
+
${_}
|
|
8493
|
+
|
|
8494
|
+
${Y.slice($.index+X.length)}`}return Y}function Y0(J){let Z=J.match(/^(\w+)/),Q=Z?Z[1]:"",Y=J.match(/\{([^}]+)\}/),$=[];if(Y){let q=Y[1].split(",");for(let W of q){let z=W.trim();if(z.includes("-")){let[K,V]=z.split("-").map(Number);for(let _=K;_<=V;_++)$.push(_)}else $.push(Number(z))}}let X=J.includes(":line-numbers");return{lang:Q,highlights:$,showLineNumbers:X}}async function X0(J,Z,Q){let Y=J[Z],$=Y.match(/^(`{3,})/),X=$?$[1].length:3,q="`".repeat(X),W=Y.substring(X).trim(),z=Y0(W),K=z.lang,V=Q.lineHighlighting?z.highlights:[],_=Q.lineNumbers?z.showLineNumbers:!1,G=[],E=Z+1;while(E<J.length){let S=J[E];if(S.match(new RegExp(`^\`{${X},}\\s*$`)))break;G.push(S),E++}let B=new Set,j=new Set,U=new Set,O=new Set,N=new Set,M=G.map((S,L)=>{let I=S;if(I.includes("// [!code focus]"))B.add(L),I=I.replace(/\/\/ \[!code focus\]/,"").trimEnd();if(I.includes("// [!code ++]"))j.add(L),I=I.replace(/\/\/ \[!code \+\+\]/,"").trimEnd();if(I.includes("// [!code --]"))U.add(L),I=I.replace(/\/\/ \[!code --\]/,"").trimEnd();if(I.includes("// [!code error]"))O.add(L),I=I.replace(/\/\/ \[!code error\]/,"").trimEnd();if(I.includes("// [!code warning]"))N.add(L),I=I.replace(/\/\/ \[!code warning\]/,"").trimEnd();return I}),R=B.size>0,A=M.join(`
|
|
8495
|
+
`),D=y.markdown?.syntaxHighlightTheme||"github-light",WJ=(await BJ(A,K,D)).split(`
|
|
8496
|
+
`).map((S,L)=>{let I=L+1,u=V.includes(I),i=B.has(L),KJ=Q.diffs&&j.has(L),_J=Q.diffs&&U.has(L),r=Q.errorWarningMarkers&&O.has(L),g=Q.errorWarningMarkers&&N.has(L),H=["line"];if(u)H.push("highlighted");if(i)H.push("focused");if(R&&!i)H.push("dimmed");if(KJ)H.push("diff-add");if(_J)H.push("diff-remove");if(r)H.push("has-error");if(g)H.push("has-warning");if(S.startsWith('<span class="line">')){let o=H.join(" "),k=S.replace('<span class="line">',`<span class="${o}">`);if(_)return`<span class="${H.join(" ")}"><span class="line-number">${I}</span>${k.replace(/^<span class="[^"]*">/,"").replace(/<\/span>$/,"")}</span>`;return k}let p=H.length>0?` class="${H.join(" ")}"`:"";if(_)return`<span${p}><span class="line-number">${I}</span>${S}</span>`;return`<span${p}>${S}</span>`}).join(`
|
|
8497
|
+
`),b=[];if(_)b.push("line-numbers-mode");if(R)b.push("has-focused-lines");let zJ=b.length>0?` class="${b.join(" ")}"`:"",VJ=K?` data-lang="${K}"`:"";return{html:`<pre${zJ}${VJ}><code class="language-${K}">${WJ}</code></pre>`,endIndex:E}}function q0(J){let Z=new Map;return{content:J.replace(/^(#{1,6})\s+(.*?)\s*\{#([\w-]+)\}\s*$/gm,(Y,$,X,q)=>{let W=DQ(X),z=Z.get(W)??[];return z.push(q),Z.set(W,z),`${$} ${X.trim()}`}),customAnchors:Z}}async function W0(J,Z,Q){let Y=J.split(`
|
|
8498
|
+
`),$=[],X=0,q=0;while(X<Y.length){let W=Y[X];if(W.match(/^`{3,}/)){let{html:z,endIndex:K}=await X0(Y,X,Q),V=`<!--BUNPRESS_CODE_${q++}-->`;Z.set(V,z),$.push(""),$.push(V),$.push(""),X=K+1}else $.push(W),X++}return $.join(`
|
|
8499
|
+
`)}function z0(J){return J=J.replace(/==(.+?)==/g,"<mark>$1</mark>"),J=J.replace(/\^(.+?)\^/g,"<sup>$1</sup>"),J=J.replace(/(?<!~)~(?!~)(.+?)(?<!~)~(?!~)/g,"<sub>$1</sub>"),J}function V0(J,Z=!0,Q=!0,Y=!0){if(Q||Z){let $=`${Q?`<div class="table-responsive">
|
|
8500
|
+
`:""}<table${Z?' class="enhanced-table"':""}>`;J=J.replace(/<table>/g,$),J=J.replace(/<\/table>/g,Q?`</table>
|
|
8501
|
+
</div>`:"</table>")}if(Y)J=J.replace(/<(th|td) align="(left|center|right)">/g,($,X,q)=>{return`<${X} style="text-align: ${q}">`}),J=J.replace(/<(th|td)>/g,($,X)=>{return`<${X} style="text-align: left">`});return J}function K0(J,Z){let Q=new Set;return J.replace(/<h([1-6])([^>]*)>([\s\S]*?)<\/h\1>/g,(Y,$,X,q)=>{if(X.includes(" id="))return Y;let W=q.replace(/<[^>]+>/g,"").trim(),K=Z.get(W)?.shift();if(!K)K=PJ(W);return K=yJ(K,Q),`<h${$} id="${K}"${X}>${q}</h${$}>`})}async function _0(J,Z="./docs"){let{frontmatter:Q,content:Y}=mZ(J);if(Q.layout==="home"){let X=await dZ(Q.hero),q=await sZ(Q.features),W=Y.trim()?await BQ(Y,Q,Z):"",z=W?`<div class="BPHome-content"><div class="container bp-doc vp-doc">${W}</div></div>`:"";return{html:X+q+z,frontmatter:Q}}return{html:await BQ(Y,Q,Z),frontmatter:Q}}async function BQ(J,Z,Q){let Y=y.markdown?.features,$=(O)=>{if(!Y)return!0;let N=Y[O];return N===void 0||N===!0||typeof N==="object"&&N!==null},X=(O,N)=>{if(!$(O))return!1;let M=Y?.[O];if(typeof M!=="object"||M===null)return!0;return M[N]!==!1},q=$("includes")?await $J(J,(O)=>CQ(O,Q)):J,W={...Z,data:await fJ(Q,y.dataDir),site:{title:y.title||y.markdown?.title||"",description:y.description||y.markdown?.meta?.description||"",themeConfig:y.themeConfig}},z=y.componentsDir?XJ(s.cwd(),y.componentsDir):XJ(Q,".components");q=await RJ(q,z,W);let K=q.replace(/```[\s\S]*?```/g,"");if(K.includes("@if")||K.includes("@foreach")||K.includes("@for (")||K.includes("<script server")||K.includes("@include")||/\{\{(?!\{)\s*\w/.test(K))try{let O=await import("@stacksjs/stx/render"),N=[],M=q.replace(/```[\s\S]*?```/g,(R)=>{return N.push(R),`\x00BPSTXCODE${N.length-1}\x00`}).replace(/`[^`\n]*`/g,(R)=>{return N.push(R),`\x00BPSTXCODE${N.length-1}\x00`});q=await O.renderString(M,W,{injectCSS:!1,templateOnly:!0}),q=q.replace(/\u0000BPSTXCODE(\d+)\u0000/g,(R,A)=>N[Number(A)]??"")}catch(O){let N=O instanceof Error?O.message:String(O);throw Error(`Failed to render BunPress stx syntax: ${N}`,{cause:O})}let{content:_,tocHtml:G}=$("inlineToc")?tZ(q,Z.toc):{content:q,tocHtml:""};q=$("codeImports")?await $J(_,(O)=>Q0(O,Q)):_,q=$("codeGroups")?await Z0(q):q,q=await $J(q,async(O)=>{let N=$("githubAlerts")?await J0(O):O;return N=$("containers")?await $0(N):N,N=$("emoji")?iZ(N):N,N=$("badges")?rZ(N):N,N});let{content:E,customAnchors:B}=$("customAnchors")?q0(q):{content:q,customAnchors:new Map};q=E;let j=new Map;q=$("codeBlocks")?await W0(q,j,{lineHighlighting:X("codeBlocks","lineHighlighting"),lineNumbers:X("codeBlocks","lineNumbers"),diffs:X("codeBlocks","diffs"),errorWarningMarkers:X("codeBlocks","errorWarningMarkers")}):q;let U=Bun.markdown.html(q,{tables:!0,strikethrough:!0,tasklists:!0,autolinks:!0,...y.markdown?.parserOptions??{}});for(let[O,N]of j)U=U.replace(`<p>${O}</p>`,N),U=U.replace(O,N);if($("inlineFormatting"))U=z0(U);if($("tables"))U=V0(U,X("tables","enhancedStyling"),X("tables","responsive"),X("tables","alignment"));if(U=K0(U,B),G)U=eZ(U,G);if($("externalLinks")){if(X("externalLinks","autoTarget")||X("externalLinks","autoRel"))U=oZ(U,X("externalLinks","autoTarget"),X("externalLinks","autoRel"));if(X("externalLinks","showIcon"))U=aZ(U)}if($("imageLazyLoading"))U=nZ(U);return U}async function G0(J={}){let Z=J.config||y,Q=J.port??3000,Y=J.root||"./docs",$=await HJ(LJ(Z),Z),X=Bun.serve({port:Q,async fetch(z){let K=new URL(z.url),V=yZ(Z,K.pathname);if(V==="/")V="/index";else if(V.length>1&&V.endsWith("/"))V=V.replace(/\/+$/,"");if(V===YJ.replace(/\.json$/,"")||K.pathname.endsWith(YJ)){let j=await kQ(Y,Z);return new Response(JSON.stringify(j),{headers:{"Content-Type":"application/json","Cache-Control":"no-store"}})}if([".png",".jpg",".jpeg",".gif",".svg",".css",".js",".ico",".woff",".woff2",".ttf"].some((j)=>V.endsWith(j)))try{let j=`${Y}/public${V}`,U=Bun.file(j);if(await U.exists())return new Response(U);let O=`${Y}${V}`,N=Bun.file(O);if(await N.exists())return new Response(N)}catch{}let{locale:G,path:E}=RQ($,V),B=MQ($,Y,G,E);for(let j of B)try{let U=Bun.file(j);if(await U.exists()){let O=await U.text(),{html:N,frontmatter:M}=await _0(O,Y),R=M.layout||"doc",A=await UQ(N,Z,E,R,M,{i18n:$,locale:G,sourceFile:j,docsDir:Y});return new Response(A,{headers:{"Content-Type":"text/html; charset=utf-8"}})}}catch{}return new Response(await UQ("<h1>404 - Page Not Found</h1><p>The page you are looking for does not exist.</p>",Z,V),{status:404,headers:{"Content-Type":"text/html; charset=utf-8"}})}}),q=`http://localhost:${X.port}`,W=()=>X.stop();if(!J.quiet)console.log(`
|
|
8502
|
+
\uD83D\uDCDA BunPress documentation server running at ${q}`),console.log(`Press Ctrl+C to stop
|
|
8503
|
+
`);return{server:X,url:q,stop:W}}async function t0(J={}){let{stop:Z}=await G0(J),Q=J.watch!==void 0?J.watch:!0,Y=J.root||"./docs";if(Q){console.log(`Watching for changes in ${Y} directory...
|
|
8504
|
+
`);try{let $=new Map,X=new GQ("**/*.{md,stx,ts,js,css,html}");for await(let z of X.scan(Y))try{let K=XJ(Y,z),V=await OQ(K);$.set(z,V.mtimeMs)}catch{}let q=null,W=()=>{if(q)clearTimeout(q);q=setTimeout(async()=>{console.log("File changed detected, reloading..."),QQ(),nJ(),uJ(),console.log("Ready for requests")},100)};setInterval(async()=>{try{let z=!1,K=new Set,V=new GQ("**/*.{md,stx,ts,js,css,html}");for await(let _ of V.scan(Y)){K.add(_);try{let G=XJ(Y,_),E=await OQ(G),B=$.get(_);if(B===void 0||E.mtimeMs>B)z=!0,$.set(_,E.mtimeMs)}catch{}}for(let _ of $.keys())if(!K.has(_))z=!0,$.delete(_);if(z)W()}catch{}},1000)}catch($){console.error("Error setting up file watcher:",$)}}s.on("SIGINT",()=>{console.log(`
|
|
8505
|
+
Shutting down server...`),Z(),s.exit(0)}),s.on("SIGTERM",()=>{console.log(`
|
|
8506
|
+
Shutting down server...`),Z(),s.exit(0)}),await new Promise(()=>{})}
|
|
8507
|
+
export{E0 as a,mJ as b,dJ as c,BJ as d,R0 as e,cJ as f,A0 as g,M0 as h,vQ as i,yZ as j,UQ as k,_0 as l,G0 as m,t0 as n};
|