@stacksjs/bunpress 0.1.9 → 0.1.11
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.js +1 -1
- package/dist/chunk-0sfpwr5e.js +2 -0
- package/dist/chunk-e5q66hsy.js +1189 -0
- package/dist/{chunk-7z3sysbz.js → chunk-rfaz4x5j.js} +1 -1
- package/dist/{chunk-wagjntqk.js → chunk-semwkmam.js} +1 -1
- package/dist/chunk-sregzvcv.js +466 -0
- package/dist/chunk-ss6yzy9f.js +33 -0
- package/dist/{chunk-43fsk0jg.js → chunk-w6byd4st.js} +1 -1
- package/dist/{chunk-dc9wxnsp.js → chunk-zdvnysqn.js} +140 -1260
- package/dist/index.d.ts +5 -0
- package/dist/rss.d.ts +11 -1
- package/dist/sitemap.d.ts +11 -1
- package/dist/src/index.js +1 -1
- package/dist/template-loader.d.ts +2 -3
- package/dist/templates/hero.stx +5 -5
- package/dist/templates/layout-doc.stx +1 -1
- package/dist/templates/layout-home.stx +9 -2
- package/dist/templates/layout-page.stx +1 -1
- package/dist/themes/vitepress/index.d.ts +6 -463
- package/dist/themes/vitepress/index.ts +30 -7
- package/dist/types.d.ts +1 -0
- package/package.json +4 -4
- package/dist/chunk-jmv68grk.js +0 -2
- package/dist/chunk-tpk7xkfy.js +0 -496
|
@@ -1,1177 +1,11 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{
|
|
3
|
-
|
|
4
|
-
/* Note: Base styles are provided by the VitePress theme */
|
|
5
|
-
|
|
6
|
-
/* Copy button for code blocks */
|
|
7
|
-
.copy-code-button {
|
|
8
|
-
position: absolute;
|
|
9
|
-
top: 12px;
|
|
10
|
-
right: 12px;
|
|
11
|
-
padding: 6px 8px;
|
|
12
|
-
background-color: var(--bp-code-copy-code-bg, var(--bp-c-bg-soft, #f6f6f7));
|
|
13
|
-
border: 1px solid var(--bp-code-copy-code-border-color, var(--bp-c-divider, #e2e2e3));
|
|
14
|
-
border-radius: 4px;
|
|
15
|
-
cursor: pointer;
|
|
16
|
-
opacity: 0;
|
|
17
|
-
transition: opacity 0.2s ease, background-color 0.2s ease;
|
|
18
|
-
z-index: 3;
|
|
19
|
-
display: flex;
|
|
20
|
-
align-items: center;
|
|
21
|
-
justify-content: center;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
pre:hover .copy-code-button {
|
|
25
|
-
opacity: 1;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
.copy-code-button:hover {
|
|
29
|
-
background-color: var(--bp-code-copy-code-hover-bg, var(--bp-c-bg, #ffffff));
|
|
30
|
-
border-color: var(--bp-code-copy-code-hover-border-color, var(--bp-c-divider, #e2e2e3));
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
.copy-code-button.copied {
|
|
34
|
-
opacity: 1;
|
|
35
|
-
background-color: var(--bp-c-success-soft, rgba(16, 185, 129, 0.14));
|
|
36
|
-
border-color: var(--bp-c-success-1, #18794e);
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
.copy-code-button svg {
|
|
40
|
-
width: 16px;
|
|
41
|
-
height: 16px;
|
|
42
|
-
color: var(--bp-c-text-2, #67676c);
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
.copy-code-button.copied svg {
|
|
46
|
-
color: var(--bp-c-success-1, #18794e);
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
/* Code block backgrounds fix - using !important to override any inline styles */
|
|
50
|
-
pre,
|
|
51
|
-
pre[data-lang],
|
|
52
|
-
article pre,
|
|
53
|
-
.bp-doc pre {
|
|
54
|
-
position: relative;
|
|
55
|
-
background-color: #f6f6f7 !important;
|
|
56
|
-
border-radius: 8px;
|
|
57
|
-
margin: 16px 0;
|
|
58
|
-
overflow-x: auto;
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
pre code,
|
|
62
|
-
pre[data-lang] code,
|
|
63
|
-
article pre code,
|
|
64
|
-
.bp-doc pre code {
|
|
65
|
-
display: block;
|
|
66
|
-
padding: 20px 24px;
|
|
67
|
-
background-color: transparent !important;
|
|
68
|
-
background: transparent !important;
|
|
69
|
-
font-size: 14px;
|
|
70
|
-
line-height: 1.7;
|
|
71
|
-
color: #24292f;
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
/* Dark mode code blocks */
|
|
75
|
-
html.dark pre,
|
|
76
|
-
html.dark pre[data-lang],
|
|
77
|
-
html.dark article pre,
|
|
78
|
-
html.dark .bp-doc pre {
|
|
79
|
-
background-color: #161618 !important;
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
html.dark pre code,
|
|
83
|
-
html.dark pre[data-lang] code {
|
|
84
|
-
color: #e6edf3;
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
/* Code groups - tabbed code blocks */
|
|
88
|
-
.code-group {
|
|
89
|
-
margin: 16px 0;
|
|
90
|
-
border-radius: 8px;
|
|
91
|
-
overflow: hidden;
|
|
92
|
-
border: 1px solid #e2e2e3;
|
|
93
|
-
background-color: #f6f6f7 !important;
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
html.dark .code-group {
|
|
97
|
-
border-color: #3c3f44;
|
|
98
|
-
background-color: #161618 !important;
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
.code-group-tabs {
|
|
102
|
-
display: flex;
|
|
103
|
-
background-color: #f6f6f7 !important;
|
|
104
|
-
border-bottom: 1px solid #e2e2e3;
|
|
105
|
-
overflow-x: auto;
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
html.dark .code-group-tabs {
|
|
109
|
-
background-color: #161618 !important;
|
|
110
|
-
border-bottom-color: #3c3f44;
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
.code-group-tab {
|
|
114
|
-
padding: 12px 16px;
|
|
115
|
-
font-size: 14px;
|
|
116
|
-
font-weight: 500;
|
|
117
|
-
color: #67676c;
|
|
118
|
-
background: transparent;
|
|
119
|
-
border: none;
|
|
120
|
-
border-bottom: 2px solid transparent;
|
|
121
|
-
cursor: pointer;
|
|
122
|
-
white-space: nowrap;
|
|
123
|
-
transition: color 0.2s, border-color 0.2s;
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
.code-group-tab:hover {
|
|
127
|
-
color: #3c3c43;
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
.code-group-tab.active {
|
|
131
|
-
color: #3451b2;
|
|
132
|
-
border-bottom-color: #3451b2;
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
html.dark .code-group-tab {
|
|
136
|
-
color: #9ca3af;
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
html.dark .code-group-tab:hover {
|
|
140
|
-
color: #e6edf3;
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
html.dark .code-group-tab.active {
|
|
144
|
-
color: #a8b1ff;
|
|
145
|
-
border-bottom-color: #a8b1ff;
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
.code-group-panels {
|
|
149
|
-
background-color: #f6f6f7 !important;
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
html.dark .code-group-panels {
|
|
153
|
-
background-color: #161618 !important;
|
|
154
|
-
}
|
|
155
|
-
|
|
156
|
-
.code-group-panel {
|
|
157
|
-
display: none;
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
.code-group-panel.active {
|
|
161
|
-
display: block;
|
|
162
|
-
}
|
|
163
|
-
|
|
164
|
-
.code-group-panel pre,
|
|
165
|
-
.code-group pre {
|
|
166
|
-
margin: 0 !important;
|
|
167
|
-
border-radius: 0 !important;
|
|
168
|
-
border: none !important;
|
|
169
|
-
background-color: #f6f6f7 !important;
|
|
170
|
-
}
|
|
171
|
-
|
|
172
|
-
html.dark .code-group-panel pre,
|
|
173
|
-
html.dark .code-group pre {
|
|
174
|
-
background-color: #161618 !important;
|
|
175
|
-
}
|
|
176
|
-
|
|
177
|
-
/* Language label positioning */
|
|
178
|
-
pre[data-lang]::before {
|
|
179
|
-
content: attr(data-lang);
|
|
180
|
-
position: absolute;
|
|
181
|
-
top: 8px;
|
|
182
|
-
right: 48px;
|
|
183
|
-
font-size: 12px;
|
|
184
|
-
font-weight: 500;
|
|
185
|
-
color: #9ca3af;
|
|
186
|
-
text-transform: lowercase;
|
|
187
|
-
pointer-events: none;
|
|
188
|
-
z-index: 2;
|
|
189
|
-
}
|
|
190
|
-
|
|
191
|
-
/* Adjust copy button position to not overlap language label */
|
|
192
|
-
pre .copy-code-button {
|
|
193
|
-
top: 8px;
|
|
194
|
-
right: 8px;
|
|
195
|
-
}
|
|
196
|
-
|
|
197
|
-
/* Heading spacing - add margin below headings */
|
|
198
|
-
article h1,
|
|
199
|
-
article h2,
|
|
200
|
-
article h3,
|
|
201
|
-
article h4,
|
|
202
|
-
article h5,
|
|
203
|
-
article h6,
|
|
204
|
-
.bp-doc h1,
|
|
205
|
-
.bp-doc h2,
|
|
206
|
-
.bp-doc h3,
|
|
207
|
-
.bp-doc h4,
|
|
208
|
-
.bp-doc h5,
|
|
209
|
-
.bp-doc h6 {
|
|
210
|
-
margin-bottom: 16px;
|
|
211
|
-
}
|
|
212
|
-
|
|
213
|
-
article h2,
|
|
214
|
-
.bp-doc h2 {
|
|
215
|
-
margin-top: 48px;
|
|
216
|
-
margin-bottom: 24px;
|
|
217
|
-
}
|
|
218
|
-
|
|
219
|
-
article h3,
|
|
220
|
-
.bp-doc h3 {
|
|
221
|
-
margin-top: 32px;
|
|
222
|
-
margin-bottom: 16px;
|
|
223
|
-
}
|
|
224
|
-
|
|
225
|
-
article h4,
|
|
226
|
-
.bp-doc h4 {
|
|
227
|
-
margin-top: 24px;
|
|
228
|
-
margin-bottom: 12px;
|
|
229
|
-
}
|
|
230
|
-
|
|
231
|
-
/* List styling with proper indentation */
|
|
232
|
-
article ul,
|
|
233
|
-
article ol,
|
|
234
|
-
.bp-doc ul,
|
|
235
|
-
.bp-doc ol {
|
|
236
|
-
padding-left: 1.5rem;
|
|
237
|
-
margin: 16px 0;
|
|
238
|
-
}
|
|
239
|
-
|
|
240
|
-
article ul,
|
|
241
|
-
.bp-doc ul {
|
|
242
|
-
list-style-type: disc;
|
|
243
|
-
}
|
|
244
|
-
|
|
245
|
-
article ol,
|
|
246
|
-
.bp-doc ol {
|
|
247
|
-
list-style-type: decimal;
|
|
248
|
-
}
|
|
249
|
-
|
|
250
|
-
article li,
|
|
251
|
-
.bp-doc li {
|
|
252
|
-
margin: 8px 0;
|
|
253
|
-
line-height: 1.7;
|
|
254
|
-
}
|
|
255
|
-
|
|
256
|
-
/* Nested lists */
|
|
257
|
-
article ul ul,
|
|
258
|
-
article ol ul,
|
|
259
|
-
article ul ol,
|
|
260
|
-
article ol ol,
|
|
261
|
-
.bp-doc ul ul,
|
|
262
|
-
.bp-doc ol ul,
|
|
263
|
-
.bp-doc ul ol,
|
|
264
|
-
.bp-doc ol ol {
|
|
265
|
-
margin: 8px 0;
|
|
266
|
-
padding-left: 1.5rem;
|
|
267
|
-
}
|
|
268
|
-
|
|
269
|
-
article ul ul,
|
|
270
|
-
.bp-doc ul ul {
|
|
271
|
-
list-style-type: circle;
|
|
272
|
-
}
|
|
273
|
-
|
|
274
|
-
article ul ul ul,
|
|
275
|
-
.bp-doc ul ul ul {
|
|
276
|
-
list-style-type: square;
|
|
277
|
-
}
|
|
278
|
-
|
|
279
|
-
/* Enhanced Tables */
|
|
280
|
-
.table-responsive {
|
|
281
|
-
overflow-x: auto;
|
|
282
|
-
margin: 16px 0;
|
|
283
|
-
border-radius: 8px;
|
|
284
|
-
border: 1px solid var(--bp-c-divider, #e2e2e3);
|
|
285
|
-
}
|
|
286
|
-
|
|
287
|
-
.enhanced-table {
|
|
288
|
-
width: 100%;
|
|
289
|
-
border-collapse: collapse;
|
|
290
|
-
font-size: 14px;
|
|
291
|
-
background-color: var(--bp-c-bg, #ffffff);
|
|
292
|
-
}
|
|
293
|
-
|
|
294
|
-
.enhanced-table thead {
|
|
295
|
-
background-color: var(--bp-c-bg-soft, #f6f6f7);
|
|
296
|
-
}
|
|
297
|
-
|
|
298
|
-
.enhanced-table th {
|
|
299
|
-
padding: 12px 16px;
|
|
300
|
-
font-weight: 600;
|
|
301
|
-
color: var(--bp-c-text-2, #67676c);
|
|
302
|
-
border-bottom: 2px solid var(--bp-c-divider, #e2e2e3);
|
|
303
|
-
white-space: nowrap;
|
|
304
|
-
}
|
|
305
|
-
|
|
306
|
-
.enhanced-table td {
|
|
307
|
-
padding: 12px 16px;
|
|
308
|
-
color: var(--bp-c-text-1, #3c3c43);
|
|
309
|
-
border-bottom: 1px solid var(--bp-c-divider, #e2e2e3);
|
|
310
|
-
}
|
|
311
|
-
|
|
312
|
-
.enhanced-table tbody tr:nth-child(2n) {
|
|
313
|
-
background-color: var(--bp-c-bg-soft, #f6f6f7);
|
|
314
|
-
}
|
|
315
|
-
|
|
316
|
-
.enhanced-table tbody tr:hover {
|
|
317
|
-
background-color: var(--bp-c-default-soft, rgba(142, 150, 170, 0.14));
|
|
318
|
-
transition: background-color 0.2s ease;
|
|
319
|
-
}
|
|
320
|
-
|
|
321
|
-
/* Image Captions */
|
|
322
|
-
.image-figure {
|
|
323
|
-
margin: 24px 0;
|
|
324
|
-
text-align: center;
|
|
325
|
-
}
|
|
326
|
-
|
|
327
|
-
.image-figure img {
|
|
328
|
-
max-width: 100%;
|
|
329
|
-
height: auto;
|
|
330
|
-
border-radius: 8px;
|
|
331
|
-
border: 1px solid var(--bp-c-divider, #e2e2e3);
|
|
332
|
-
}
|
|
333
|
-
|
|
334
|
-
.image-figure figcaption {
|
|
335
|
-
margin-top: 12px;
|
|
336
|
-
font-size: 14px;
|
|
337
|
-
color: var(--bp-c-text-2, #67676c);
|
|
338
|
-
font-style: italic;
|
|
339
|
-
text-align: center;
|
|
340
|
-
}
|
|
341
|
-
|
|
342
|
-
/* Regular images (without captions) */
|
|
343
|
-
article img:not(.image-figure img) {
|
|
344
|
-
max-width: 100%;
|
|
345
|
-
height: auto;
|
|
346
|
-
border-radius: 8px;
|
|
347
|
-
margin: 16px 0;
|
|
348
|
-
}
|
|
349
|
-
|
|
350
|
-
/* Raw Container - No styling */
|
|
351
|
-
.bp-raw {
|
|
352
|
-
margin: 16px 0;
|
|
353
|
-
}
|
|
354
|
-
|
|
355
|
-
/* Copy Page Dropdown */
|
|
356
|
-
.copy-page-dropdown {
|
|
357
|
-
position: absolute;
|
|
358
|
-
right: 0;
|
|
359
|
-
top: 50%;
|
|
360
|
-
transform: translateY(-50%);
|
|
361
|
-
display: none; /* Hidden until JS positions it */
|
|
362
|
-
z-index: 10;
|
|
363
|
-
}
|
|
364
|
-
|
|
365
|
-
.copy-page-dropdown.positioned {
|
|
366
|
-
display: inline-block;
|
|
367
|
-
}
|
|
368
|
-
|
|
369
|
-
/* Page header row with H1 and Copy button */
|
|
370
|
-
.bp-page-header {
|
|
371
|
-
display: flex;
|
|
372
|
-
align-items: flex-start;
|
|
373
|
-
justify-content: space-between;
|
|
374
|
-
gap: 16px;
|
|
375
|
-
position: relative;
|
|
376
|
-
margin-bottom: 16px;
|
|
377
|
-
}
|
|
378
|
-
|
|
379
|
-
.bp-page-header h1 {
|
|
380
|
-
margin: 0;
|
|
381
|
-
flex: 1;
|
|
382
|
-
min-width: 0;
|
|
383
|
-
}
|
|
384
|
-
|
|
385
|
-
.bp-page-header .copy-page-dropdown {
|
|
386
|
-
position: relative;
|
|
387
|
-
right: auto;
|
|
388
|
-
top: auto;
|
|
389
|
-
transform: none;
|
|
390
|
-
flex-shrink: 0;
|
|
391
|
-
margin-top: 4px;
|
|
392
|
-
display: inline-block;
|
|
393
|
-
}
|
|
394
|
-
|
|
395
|
-
.bp-page-header .copy-page-dropdown.positioned {
|
|
396
|
-
display: inline-block;
|
|
397
|
-
}
|
|
398
|
-
|
|
399
|
-
/* Split button group */
|
|
400
|
-
.copy-page-button-group {
|
|
401
|
-
display: flex;
|
|
402
|
-
align-items: stretch;
|
|
403
|
-
}
|
|
404
|
-
|
|
405
|
-
.copy-page-button {
|
|
406
|
-
display: flex;
|
|
407
|
-
align-items: center;
|
|
408
|
-
gap: 8px;
|
|
409
|
-
padding: 8px 12px;
|
|
410
|
-
background-color: var(--bp-c-bg-soft, #f6f6f7);
|
|
411
|
-
border: 1px solid var(--bp-c-divider, #e2e2e3);
|
|
412
|
-
color: var(--bp-c-text-1, #3c3c43);
|
|
413
|
-
font-size: 14px;
|
|
414
|
-
font-weight: 500;
|
|
415
|
-
cursor: pointer;
|
|
416
|
-
transition: all 0.2s ease;
|
|
417
|
-
}
|
|
418
|
-
|
|
419
|
-
.copy-page-button.copy-page-main {
|
|
420
|
-
border-radius: 8px 0 0 8px;
|
|
421
|
-
border-right: none;
|
|
422
|
-
padding-right: 12px;
|
|
423
|
-
}
|
|
424
|
-
|
|
425
|
-
.copy-page-button.copy-page-toggle {
|
|
426
|
-
border-radius: 0 8px 8px 0;
|
|
427
|
-
padding: 8px 8px;
|
|
428
|
-
border-left: 1px solid var(--bp-c-divider, #e2e2e3);
|
|
429
|
-
}
|
|
430
|
-
|
|
431
|
-
.copy-page-button:hover {
|
|
432
|
-
background-color: var(--bp-c-bg, #ffffff);
|
|
433
|
-
}
|
|
434
|
-
|
|
435
|
-
.copy-page-button-group:hover .copy-page-button {
|
|
436
|
-
border-color: var(--bp-c-brand-1, #5672cd);
|
|
437
|
-
}
|
|
438
|
-
|
|
439
|
-
.copy-page-button-group:hover .copy-page-toggle {
|
|
440
|
-
border-left-color: var(--bp-c-brand-1, #5672cd);
|
|
441
|
-
}
|
|
442
|
-
|
|
443
|
-
.copy-page-button svg {
|
|
444
|
-
width: 16px;
|
|
445
|
-
height: 16px;
|
|
446
|
-
}
|
|
447
|
-
|
|
448
|
-
.copy-page-button .chevron {
|
|
449
|
-
width: 12px;
|
|
450
|
-
height: 12px;
|
|
451
|
-
transition: transform 0.2s ease;
|
|
452
|
-
}
|
|
453
|
-
|
|
454
|
-
.copy-page-dropdown.open .copy-page-button .chevron {
|
|
455
|
-
transform: rotate(180deg);
|
|
456
|
-
}
|
|
457
|
-
|
|
458
|
-
/* Copied state */
|
|
459
|
-
.copy-page-button.copied {
|
|
460
|
-
background-color: var(--bp-c-success-soft, rgba(16, 185, 129, 0.14));
|
|
461
|
-
}
|
|
462
|
-
|
|
463
|
-
.copy-page-button.copied .copy-icon {
|
|
464
|
-
display: none;
|
|
465
|
-
}
|
|
466
|
-
|
|
467
|
-
.copy-page-button.copied .check-icon {
|
|
468
|
-
display: block !important;
|
|
469
|
-
color: var(--bp-c-success-1, #18794e);
|
|
470
|
-
}
|
|
471
|
-
|
|
472
|
-
.copy-page-button.copied .button-text {
|
|
473
|
-
color: var(--bp-c-success-1, #18794e);
|
|
474
|
-
}
|
|
475
|
-
|
|
476
|
-
.copy-page-menu {
|
|
477
|
-
position: absolute;
|
|
478
|
-
top: calc(100% + 8px);
|
|
479
|
-
right: 0;
|
|
480
|
-
min-width: 280px;
|
|
481
|
-
background-color: var(--bp-c-bg, #ffffff);
|
|
482
|
-
border: 1px solid var(--bp-c-divider, #e2e2e3);
|
|
483
|
-
border-radius: 12px;
|
|
484
|
-
box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
|
|
485
|
-
opacity: 0;
|
|
486
|
-
visibility: hidden;
|
|
487
|
-
transform: translateY(-8px);
|
|
488
|
-
transition: all 0.2s ease;
|
|
489
|
-
z-index: 100;
|
|
490
|
-
overflow: hidden;
|
|
491
|
-
}
|
|
492
|
-
|
|
493
|
-
.copy-page-dropdown.open .copy-page-menu {
|
|
494
|
-
opacity: 1;
|
|
495
|
-
visibility: visible;
|
|
496
|
-
transform: translateY(0);
|
|
497
|
-
}
|
|
498
|
-
|
|
499
|
-
.copy-page-menu-item {
|
|
500
|
-
display: flex;
|
|
501
|
-
align-items: center;
|
|
502
|
-
gap: 12px;
|
|
503
|
-
padding: 12px 16px;
|
|
504
|
-
color: var(--bp-c-text-1, #3c3c43);
|
|
505
|
-
text-decoration: none;
|
|
506
|
-
cursor: pointer;
|
|
507
|
-
transition: background-color 0.15s ease;
|
|
508
|
-
}
|
|
509
|
-
|
|
510
|
-
.copy-page-menu-item:hover {
|
|
511
|
-
background-color: var(--bp-c-bg-soft, #f6f6f7);
|
|
512
|
-
}
|
|
513
|
-
|
|
514
|
-
.copy-page-menu-item .icon {
|
|
515
|
-
width: 24px;
|
|
516
|
-
height: 24px;
|
|
517
|
-
display: flex;
|
|
518
|
-
align-items: center;
|
|
519
|
-
justify-content: center;
|
|
520
|
-
flex-shrink: 0;
|
|
521
|
-
}
|
|
522
|
-
|
|
523
|
-
.copy-page-menu-item .icon svg {
|
|
524
|
-
width: 20px;
|
|
525
|
-
height: 20px;
|
|
526
|
-
}
|
|
527
|
-
|
|
528
|
-
.copy-page-menu-item .icon img {
|
|
529
|
-
width: 20px;
|
|
530
|
-
height: 20px;
|
|
531
|
-
border-radius: 4px;
|
|
532
|
-
}
|
|
533
|
-
|
|
534
|
-
.copy-page-menu-item .content {
|
|
535
|
-
flex: 1;
|
|
536
|
-
min-width: 0;
|
|
537
|
-
}
|
|
538
|
-
|
|
539
|
-
.copy-page-menu-item .title {
|
|
540
|
-
font-size: 14px;
|
|
541
|
-
font-weight: 500;
|
|
542
|
-
color: var(--bp-c-text-1, #3c3c43);
|
|
543
|
-
display: flex;
|
|
544
|
-
align-items: center;
|
|
545
|
-
gap: 4px;
|
|
546
|
-
}
|
|
547
|
-
|
|
548
|
-
.copy-page-menu-item .title .external-icon {
|
|
549
|
-
width: 12px;
|
|
550
|
-
height: 12px;
|
|
551
|
-
opacity: 0.6;
|
|
552
|
-
}
|
|
553
|
-
|
|
554
|
-
.copy-page-menu-item .description {
|
|
555
|
-
font-size: 12px;
|
|
556
|
-
color: var(--bp-c-text-2, #67676c);
|
|
557
|
-
margin-top: 2px;
|
|
558
|
-
}
|
|
559
|
-
|
|
560
|
-
.copy-page-menu-divider {
|
|
561
|
-
height: 1px;
|
|
562
|
-
background-color: var(--bp-c-divider, #e2e2e3);
|
|
563
|
-
margin: 4px 0;
|
|
564
|
-
}
|
|
565
|
-
|
|
566
|
-
.copy-page-menu-item.copied .title {
|
|
567
|
-
color: var(--bp-c-success-1, #18794e);
|
|
568
|
-
}
|
|
569
|
-
|
|
570
|
-
/* Dark mode support */
|
|
571
|
-
html.dark .copy-page-menu {
|
|
572
|
-
background-color: var(--bp-c-bg, #1a1a1a);
|
|
573
|
-
box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
|
|
574
|
-
}
|
|
575
|
-
|
|
576
|
-
/* Toast notification */
|
|
577
|
-
.bp-toast {
|
|
578
|
-
position: fixed;
|
|
579
|
-
bottom: 24px;
|
|
580
|
-
left: 50%;
|
|
581
|
-
transform: translateX(-50%) translateY(100px);
|
|
582
|
-
display: flex;
|
|
583
|
-
align-items: center;
|
|
584
|
-
gap: 10px;
|
|
585
|
-
padding: 12px 20px;
|
|
586
|
-
background-color: var(--bp-c-bg, #ffffff);
|
|
587
|
-
border: 1px solid var(--bp-c-divider, #e2e2e3);
|
|
588
|
-
border-radius: 8px;
|
|
589
|
-
box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
|
|
590
|
-
font-size: 14px;
|
|
591
|
-
font-weight: 500;
|
|
592
|
-
color: var(--bp-c-text-1, #3c3c43);
|
|
593
|
-
z-index: 9999;
|
|
594
|
-
opacity: 0;
|
|
595
|
-
transition: transform 0.3s ease, opacity 0.3s ease;
|
|
596
|
-
}
|
|
597
|
-
|
|
598
|
-
.bp-toast.show {
|
|
599
|
-
transform: translateX(-50%) translateY(0);
|
|
600
|
-
opacity: 1;
|
|
601
|
-
}
|
|
602
|
-
|
|
603
|
-
html.dark .bp-toast {
|
|
604
|
-
background-color: var(--bp-c-bg, #1a1a1a);
|
|
605
|
-
box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
|
|
606
|
-
}
|
|
607
|
-
|
|
608
|
-
/* Theme Toggle Button */
|
|
609
|
-
.theme-toggle {
|
|
610
|
-
display: flex;
|
|
611
|
-
align-items: center;
|
|
612
|
-
justify-content: center;
|
|
613
|
-
width: 36px;
|
|
614
|
-
height: 36px;
|
|
615
|
-
padding: 0;
|
|
616
|
-
background: transparent;
|
|
617
|
-
border: 1px solid transparent;
|
|
618
|
-
border-radius: 8px;
|
|
619
|
-
cursor: pointer;
|
|
620
|
-
color: #6b7280;
|
|
621
|
-
transition: color 0.2s, background-color 0.2s, border-color 0.2s;
|
|
622
|
-
}
|
|
623
|
-
|
|
624
|
-
.theme-toggle:hover {
|
|
625
|
-
color: #3c3c43;
|
|
626
|
-
background-color: #f6f6f7;
|
|
627
|
-
border-color: #e2e2e3;
|
|
628
|
-
}
|
|
629
|
-
|
|
630
|
-
html.dark .theme-toggle {
|
|
631
|
-
color: #9ca3af;
|
|
632
|
-
}
|
|
633
|
-
|
|
634
|
-
html.dark .theme-toggle:hover {
|
|
635
|
-
color: #e6edf3;
|
|
636
|
-
background-color: #2e2e32;
|
|
637
|
-
border-color: #3c3f44;
|
|
638
|
-
}
|
|
639
|
-
|
|
640
|
-
.theme-toggle svg {
|
|
641
|
-
width: 20px;
|
|
642
|
-
height: 20px;
|
|
643
|
-
}
|
|
644
|
-
|
|
645
|
-
/* Show sun icon in dark mode, moon icon in light mode */
|
|
646
|
-
.theme-toggle .sun-icon {
|
|
647
|
-
display: none;
|
|
648
|
-
}
|
|
649
|
-
|
|
650
|
-
.theme-toggle .moon-icon {
|
|
651
|
-
display: block;
|
|
652
|
-
}
|
|
653
|
-
|
|
654
|
-
html.dark .theme-toggle .sun-icon {
|
|
655
|
-
display: block;
|
|
656
|
-
}
|
|
657
|
-
|
|
658
|
-
html.dark .theme-toggle .moon-icon {
|
|
659
|
-
display: none;
|
|
660
|
-
}
|
|
661
|
-
`,scripts:[`
|
|
662
|
-
// Theme toggle functionality
|
|
663
|
-
function getPreferredTheme() {
|
|
664
|
-
// Check localStorage first
|
|
665
|
-
const stored = localStorage.getItem('bunpress-theme');
|
|
666
|
-
if (stored) {
|
|
667
|
-
return stored;
|
|
668
|
-
}
|
|
669
|
-
// Fall back to system preference
|
|
670
|
-
return window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light';
|
|
671
|
-
}
|
|
672
|
-
|
|
673
|
-
function setTheme(theme) {
|
|
674
|
-
if (theme === 'dark') {
|
|
675
|
-
document.documentElement.classList.add('dark');
|
|
676
|
-
}
|
|
677
|
-
else {
|
|
678
|
-
document.documentElement.classList.remove('dark');
|
|
679
|
-
}
|
|
680
|
-
localStorage.setItem('bunpress-theme', theme);
|
|
681
|
-
}
|
|
682
|
-
|
|
683
|
-
function toggleTheme() {
|
|
684
|
-
const currentTheme = document.documentElement.classList.contains('dark') ? 'dark' : 'light';
|
|
685
|
-
const newTheme = currentTheme === 'dark' ? 'light' : 'dark';
|
|
686
|
-
setTheme(newTheme);
|
|
687
|
-
}
|
|
688
|
-
|
|
689
|
-
// Initialize theme on page load
|
|
690
|
-
(function() {
|
|
691
|
-
const theme = getPreferredTheme();
|
|
692
|
-
setTheme(theme);
|
|
693
|
-
|
|
694
|
-
// Listen for system theme changes
|
|
695
|
-
window.matchMedia('(prefers-color-scheme: dark)').addEventListener('change', (e) => {
|
|
696
|
-
// Only auto-switch if user hasn't manually set a preference
|
|
697
|
-
if (!localStorage.getItem('bunpress-theme')) {
|
|
698
|
-
setTheme(e.matches ? 'dark' : 'light');
|
|
699
|
-
}
|
|
700
|
-
});
|
|
701
|
-
})();
|
|
702
|
-
|
|
703
|
-
function switchCodeTab(groupId, panelIndex) {
|
|
704
|
-
const group = document.getElementById(groupId);
|
|
705
|
-
if (!group) return;
|
|
706
|
-
|
|
707
|
-
// Update tabs
|
|
708
|
-
const tabs = group.querySelectorAll('.code-group-tab');
|
|
709
|
-
tabs.forEach((tab, index) => {
|
|
710
|
-
if (index === panelIndex) {
|
|
711
|
-
tab.classList.add('active');
|
|
712
|
-
}
|
|
713
|
-
else {
|
|
714
|
-
tab.classList.remove('active');
|
|
715
|
-
}
|
|
716
|
-
});
|
|
717
|
-
|
|
718
|
-
// Update panels
|
|
719
|
-
const panels = group.querySelectorAll('.code-group-panel');
|
|
720
|
-
panels.forEach((panel, index) => {
|
|
721
|
-
if (index === panelIndex) {
|
|
722
|
-
panel.classList.add('active');
|
|
723
|
-
}
|
|
724
|
-
else {
|
|
725
|
-
panel.classList.remove('active');
|
|
726
|
-
}
|
|
727
|
-
});
|
|
728
|
-
}
|
|
729
|
-
|
|
730
|
-
// Fallback copy function for browsers that don't support clipboard API
|
|
731
|
-
function fallbackCopyToClipboard(text) {
|
|
732
|
-
const textArea = document.createElement('textarea');
|
|
733
|
-
textArea.value = text;
|
|
734
|
-
textArea.style.position = 'fixed';
|
|
735
|
-
textArea.style.left = '-9999px';
|
|
736
|
-
textArea.style.top = '-9999px';
|
|
737
|
-
document.body.appendChild(textArea);
|
|
738
|
-
textArea.focus();
|
|
739
|
-
textArea.select();
|
|
740
|
-
|
|
741
|
-
try {
|
|
742
|
-
document.execCommand('copy');
|
|
743
|
-
document.body.removeChild(textArea);
|
|
744
|
-
return true;
|
|
745
|
-
}
|
|
746
|
-
catch (err) {
|
|
747
|
-
document.body.removeChild(textArea);
|
|
748
|
-
return false;
|
|
749
|
-
}
|
|
750
|
-
}
|
|
751
|
-
|
|
752
|
-
// Copy to clipboard with fallback
|
|
753
|
-
function copyToClipboard(text) {
|
|
754
|
-
return new Promise((resolve, reject) => {
|
|
755
|
-
// Try modern clipboard API first
|
|
756
|
-
if (navigator.clipboard && window.isSecureContext) {
|
|
757
|
-
navigator.clipboard.writeText(text)
|
|
758
|
-
.then(resolve)
|
|
759
|
-
.catch(() => {
|
|
760
|
-
// Fallback to execCommand
|
|
761
|
-
if (fallbackCopyToClipboard(text)) {
|
|
762
|
-
resolve();
|
|
763
|
-
}
|
|
764
|
-
else {
|
|
765
|
-
reject(new Error('Copy failed'));
|
|
766
|
-
}
|
|
767
|
-
});
|
|
768
|
-
}
|
|
769
|
-
else {
|
|
770
|
-
// Use fallback directly
|
|
771
|
-
if (fallbackCopyToClipboard(text)) {
|
|
772
|
-
resolve();
|
|
773
|
-
}
|
|
774
|
-
else {
|
|
775
|
-
reject(new Error('Copy failed'));
|
|
776
|
-
}
|
|
777
|
-
}
|
|
778
|
-
});
|
|
779
|
-
}
|
|
780
|
-
|
|
781
|
-
function copyCode(button) {
|
|
782
|
-
const pre = button.closest('pre');
|
|
783
|
-
if (!pre) return;
|
|
784
|
-
|
|
785
|
-
const code = pre.querySelector('code');
|
|
786
|
-
if (!code) return;
|
|
787
|
-
|
|
788
|
-
// Get text content from code block
|
|
789
|
-
const text = code.textContent || '';
|
|
790
|
-
|
|
791
|
-
// Copy to clipboard using fallback-enabled function
|
|
792
|
-
copyToClipboard(text).then(() => {
|
|
793
|
-
// Show copied state
|
|
794
|
-
button.classList.add('copied');
|
|
795
|
-
|
|
796
|
-
// Change icon to checkmark
|
|
797
|
-
const svg = button.querySelector('svg');
|
|
798
|
-
if (svg) {
|
|
799
|
-
svg.innerHTML = '<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M5 13l4 4L19 7"></path>';
|
|
800
|
-
}
|
|
801
|
-
|
|
802
|
-
// Reset after 2 seconds
|
|
803
|
-
setTimeout(() => {
|
|
804
|
-
button.classList.remove('copied');
|
|
805
|
-
if (svg) {
|
|
806
|
-
svg.innerHTML = '<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z"></path>';
|
|
807
|
-
}
|
|
808
|
-
}, 2000);
|
|
809
|
-
}).catch(err => {
|
|
810
|
-
console.error('Failed to copy code:', err);
|
|
811
|
-
});
|
|
812
|
-
}
|
|
813
|
-
|
|
814
|
-
// Add copy buttons to all code blocks when page loads
|
|
815
|
-
if (typeof document !== 'undefined') {
|
|
816
|
-
document.addEventListener('DOMContentLoaded', () => {
|
|
817
|
-
const codeBlocks = document.querySelectorAll('pre > code');
|
|
818
|
-
codeBlocks.forEach(code => {
|
|
819
|
-
const pre = code.parentElement;
|
|
820
|
-
if (!pre || pre.querySelector('.copy-code-button')) return;
|
|
821
|
-
|
|
822
|
-
const button = document.createElement('button');
|
|
823
|
-
button.className = 'copy-code-button';
|
|
824
|
-
button.setAttribute('onclick', 'copyCode(this)');
|
|
825
|
-
button.setAttribute('aria-label', 'Copy code');
|
|
826
|
-
button.innerHTML = \`<svg fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
|
827
|
-
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z"></path>
|
|
828
|
-
</svg>\`;
|
|
829
|
-
|
|
830
|
-
pre.appendChild(button);
|
|
831
|
-
});
|
|
832
|
-
|
|
833
|
-
// Position Copy Page dropdown next to H1
|
|
834
|
-
const h1 = document.querySelector('article.bp-doc h1');
|
|
835
|
-
const dropdown = document.getElementById('copy-page-dropdown');
|
|
836
|
-
if (h1 && dropdown) {
|
|
837
|
-
// Create wrapper div for H1 and dropdown
|
|
838
|
-
const wrapper = document.createElement('div');
|
|
839
|
-
wrapper.className = 'bp-page-header';
|
|
840
|
-
|
|
841
|
-
// Insert wrapper before H1
|
|
842
|
-
h1.parentNode.insertBefore(wrapper, h1);
|
|
843
|
-
|
|
844
|
-
// Move H1 and dropdown into wrapper
|
|
845
|
-
wrapper.appendChild(h1);
|
|
846
|
-
wrapper.appendChild(dropdown);
|
|
847
|
-
|
|
848
|
-
// Show dropdown now that it's positioned
|
|
849
|
-
dropdown.classList.add('positioned');
|
|
850
|
-
}
|
|
851
|
-
});
|
|
852
|
-
}
|
|
853
|
-
|
|
854
|
-
// Copy Page Dropdown functionality
|
|
855
|
-
function toggleCopyPageDropdown(event) {
|
|
856
|
-
event.stopPropagation();
|
|
857
|
-
const dropdown = document.querySelector('.copy-page-dropdown');
|
|
858
|
-
if (dropdown) {
|
|
859
|
-
dropdown.classList.toggle('open');
|
|
860
|
-
}
|
|
861
|
-
}
|
|
862
|
-
|
|
863
|
-
function closeCopyPageDropdown() {
|
|
864
|
-
const dropdown = document.querySelector('.copy-page-dropdown');
|
|
865
|
-
if (dropdown) {
|
|
866
|
-
dropdown.classList.remove('open');
|
|
867
|
-
}
|
|
868
|
-
}
|
|
869
|
-
|
|
870
|
-
// Direct copy button (left side of split button)
|
|
871
|
-
function copyPageDirect(event) {
|
|
872
|
-
event.preventDefault();
|
|
873
|
-
event.stopPropagation();
|
|
874
|
-
|
|
875
|
-
const markdown = getPageAsMarkdown();
|
|
876
|
-
const button = event.currentTarget;
|
|
877
|
-
const textEl = button.querySelector('.button-text');
|
|
878
|
-
|
|
879
|
-
copyToClipboard(markdown).then(() => {
|
|
880
|
-
// Show copied state
|
|
881
|
-
button.classList.add('copied');
|
|
882
|
-
textEl.textContent = 'Copied!';
|
|
883
|
-
|
|
884
|
-
// Reset after delay
|
|
885
|
-
setTimeout(() => {
|
|
886
|
-
button.classList.remove('copied');
|
|
887
|
-
textEl.textContent = 'Copy page';
|
|
888
|
-
}, 2000);
|
|
889
|
-
}).catch(err => {
|
|
890
|
-
console.error('Failed to copy:', err);
|
|
891
|
-
showToast('Failed to copy. Please try again.');
|
|
892
|
-
});
|
|
893
|
-
}
|
|
894
|
-
|
|
895
|
-
// Get the page content as markdown-formatted text for LLMs
|
|
896
|
-
function getPageAsMarkdown() {
|
|
897
|
-
const article = document.querySelector('article.bp-doc');
|
|
898
|
-
if (!article) return '';
|
|
899
|
-
|
|
900
|
-
const title = document.querySelector('h1')?.textContent || document.title;
|
|
901
|
-
const url = window.location.href;
|
|
902
|
-
|
|
903
|
-
// Clone the article to avoid modifying the original
|
|
904
|
-
const clone = article.cloneNode(true);
|
|
905
|
-
|
|
906
|
-
// Remove copy buttons and other UI elements
|
|
907
|
-
clone.querySelectorAll('.copy-code-button, .copy-page-dropdown').forEach(el => el.remove());
|
|
908
|
-
|
|
909
|
-
// Convert HTML back to a readable markdown-like format
|
|
910
|
-
let content = '';
|
|
911
|
-
|
|
912
|
-
function processNode(node, depth = 0) {
|
|
913
|
-
if (node.nodeType === Node.TEXT_NODE) {
|
|
914
|
-
return node.textContent;
|
|
915
|
-
}
|
|
916
|
-
|
|
917
|
-
if (node.nodeType !== Node.ELEMENT_NODE) return '';
|
|
918
|
-
|
|
919
|
-
const tag = node.tagName.toLowerCase();
|
|
920
|
-
let text = '';
|
|
921
|
-
|
|
922
|
-
switch(tag) {
|
|
923
|
-
case 'h1':
|
|
924
|
-
text = \`# \${node.textContent}\\n\\n\`;
|
|
925
|
-
break;
|
|
926
|
-
case 'h2':
|
|
927
|
-
text = \`## \${node.textContent}\\n\\n\`;
|
|
928
|
-
break;
|
|
929
|
-
case 'h3':
|
|
930
|
-
text = \`### \${node.textContent}\\n\\n\`;
|
|
931
|
-
break;
|
|
932
|
-
case 'h4':
|
|
933
|
-
text = \`#### \${node.textContent}\\n\\n\`;
|
|
934
|
-
break;
|
|
935
|
-
case 'h5':
|
|
936
|
-
text = \`##### \${node.textContent}\\n\\n\`;
|
|
937
|
-
break;
|
|
938
|
-
case 'h6':
|
|
939
|
-
text = \`###### \${node.textContent}\\n\\n\`;
|
|
940
|
-
break;
|
|
941
|
-
case 'p':
|
|
942
|
-
text = Array.from(node.childNodes).map(n => processNode(n, depth)).join('') + '\\n\\n';
|
|
943
|
-
break;
|
|
944
|
-
case 'pre':
|
|
945
|
-
const code = node.querySelector('code');
|
|
946
|
-
const lang = code?.className?.match(/language-(\\w+)/)?.[1] || '';
|
|
947
|
-
text = '\`\`\`' + lang + '\\n' + (code?.textContent || node.textContent) + '\\n\`\`\`\\n\\n';
|
|
948
|
-
break;
|
|
949
|
-
case 'code':
|
|
950
|
-
if (node.parentElement?.tagName.toLowerCase() !== 'pre') {
|
|
951
|
-
text = '\`' + node.textContent + '\`';
|
|
952
|
-
}
|
|
953
|
-
break;
|
|
954
|
-
case 'strong':
|
|
955
|
-
case 'b':
|
|
956
|
-
text = \`**\${node.textContent}**\`;
|
|
957
|
-
break;
|
|
958
|
-
case 'em':
|
|
959
|
-
case 'i':
|
|
960
|
-
text = \`*\${node.textContent}*\`;
|
|
961
|
-
break;
|
|
962
|
-
case 'a':
|
|
963
|
-
const href = node.getAttribute('href');
|
|
964
|
-
text = \`[\${node.textContent}](\${href?.startsWith('/') ? window.location.origin + href : href})\`;
|
|
965
|
-
break;
|
|
966
|
-
case 'ul':
|
|
967
|
-
text = \`\${Array.from(node.children).map(li => \`- \${li.textContent}\`).join('\\n')}\\n\\n\`;
|
|
968
|
-
break;
|
|
969
|
-
case 'ol':
|
|
970
|
-
text = \`\${Array.from(node.children).map((li, i) => \`\${i + 1}. \${li.textContent}\`).join('\\n')}\\n\\n\`;
|
|
971
|
-
break;
|
|
972
|
-
case 'blockquote':
|
|
973
|
-
text = \`\${node.textContent.split('\\n').map(line => \`> \${line}\`).join('\\n')}\\n\\n\`;
|
|
974
|
-
break;
|
|
975
|
-
case 'hr':
|
|
976
|
-
text = '---\\n\\n';
|
|
977
|
-
break;
|
|
978
|
-
case 'br':
|
|
979
|
-
text = '\\n';
|
|
980
|
-
break;
|
|
981
|
-
case 'table':
|
|
982
|
-
// Simple table handling
|
|
983
|
-
const rows = node.querySelectorAll('tr');
|
|
984
|
-
rows.forEach((row, i) => {
|
|
985
|
-
const cells = row.querySelectorAll('th, td');
|
|
986
|
-
text += \`| \${Array.from(cells).map(c => c.textContent.trim()).join(' | ')} |\\n\`;
|
|
987
|
-
if (i === 0) {
|
|
988
|
-
text += \`| \${Array.from(cells).map(() => '---').join(' | ')} |\\n\`;
|
|
989
|
-
}
|
|
990
|
-
});
|
|
991
|
-
text += '\\n';
|
|
992
|
-
break;
|
|
993
|
-
default:
|
|
994
|
-
// For other elements, just process children
|
|
995
|
-
text = Array.from(node.childNodes).map(n => processNode(n, depth)).join('');
|
|
996
|
-
}
|
|
997
|
-
|
|
998
|
-
return text;
|
|
999
|
-
}
|
|
1000
|
-
|
|
1001
|
-
content = Array.from(clone.childNodes).map(n => processNode(n)).join('');
|
|
1002
|
-
|
|
1003
|
-
// Clean up extra newlines
|
|
1004
|
-
content = content.replace(/\\n{3,}/g, '\\n\\n').trim();
|
|
1005
|
-
|
|
1006
|
-
return \`# \${title}\\n\\nSource: \${url}\\n\\n\${content}\`;
|
|
1007
|
-
}
|
|
1008
|
-
|
|
1009
|
-
// Show toast notification
|
|
1010
|
-
function showToast(message, duration = 3000) {
|
|
1011
|
-
// Remove existing toast
|
|
1012
|
-
const existingToast = document.querySelector('.bp-toast');
|
|
1013
|
-
if (existingToast) {
|
|
1014
|
-
existingToast.remove();
|
|
1015
|
-
}
|
|
1016
|
-
|
|
1017
|
-
const toast = document.createElement('div');
|
|
1018
|
-
toast.className = 'bp-toast';
|
|
1019
|
-
toast.innerHTML = \`
|
|
1020
|
-
<svg fill="none" stroke="currentColor" viewBox="0 0 24 24" style="width: 20px; height: 20px; color: #10b981;">
|
|
1021
|
-
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M5 13l4 4L19 7"></path>
|
|
1022
|
-
</svg>
|
|
1023
|
-
<span>\${message}</span>
|
|
1024
|
-
\`;
|
|
1025
|
-
document.body.appendChild(toast);
|
|
1026
|
-
|
|
1027
|
-
// Trigger animation
|
|
1028
|
-
requestAnimationFrame(() => {
|
|
1029
|
-
toast.classList.add('show');
|
|
1030
|
-
});
|
|
1031
|
-
|
|
1032
|
-
setTimeout(() => {
|
|
1033
|
-
toast.classList.remove('show');
|
|
1034
|
-
setTimeout(() => toast.remove(), 300);
|
|
1035
|
-
}, duration);
|
|
1036
|
-
}
|
|
1037
|
-
|
|
1038
|
-
function copyPageAsMarkdown(event) {
|
|
1039
|
-
event.preventDefault();
|
|
1040
|
-
event.stopPropagation();
|
|
1041
|
-
|
|
1042
|
-
const markdown = getPageAsMarkdown();
|
|
1043
|
-
|
|
1044
|
-
copyToClipboard(markdown).then(() => {
|
|
1045
|
-
// Update button to show copied state
|
|
1046
|
-
const menuItem = event.currentTarget;
|
|
1047
|
-
const iconEl = menuItem.querySelector('.icon svg');
|
|
1048
|
-
const titleEl = menuItem.querySelector('.title');
|
|
1049
|
-
const originalIcon = iconEl.outerHTML;
|
|
1050
|
-
const originalTitle = titleEl.textContent;
|
|
1051
|
-
|
|
1052
|
-
// Show checkmark icon
|
|
1053
|
-
iconEl.outerHTML = '<svg fill="none" stroke="currentColor" viewBox="0 0 24 24" style="color: #10b981;"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M5 13l4 4L19 7"></path></svg>';
|
|
1054
|
-
titleEl.textContent = 'Copied to clipboard!';
|
|
1055
|
-
menuItem.classList.add('copied');
|
|
1056
|
-
|
|
1057
|
-
// Show toast
|
|
1058
|
-
showToast('Page copied as Markdown');
|
|
1059
|
-
|
|
1060
|
-
setTimeout(() => {
|
|
1061
|
-
menuItem.querySelector('.icon').innerHTML = originalIcon;
|
|
1062
|
-
titleEl.textContent = originalTitle;
|
|
1063
|
-
menuItem.classList.remove('copied');
|
|
1064
|
-
closeCopyPageDropdown();
|
|
1065
|
-
}, 1500);
|
|
1066
|
-
}).catch(err => {
|
|
1067
|
-
console.error('Failed to copy:', err);
|
|
1068
|
-
showToast('Failed to copy. Please try again.');
|
|
1069
|
-
});
|
|
1070
|
-
}
|
|
1071
|
-
|
|
1072
|
-
function viewAsMarkdown(event) {
|
|
1073
|
-
event.preventDefault();
|
|
1074
|
-
const markdown = getPageAsMarkdown();
|
|
1075
|
-
const blob = new Blob([markdown], { type: 'text/plain' });
|
|
1076
|
-
const url = URL.createObjectURL(blob);
|
|
1077
|
-
window.open(url, '_blank');
|
|
1078
|
-
closeCopyPageDropdown();
|
|
1079
|
-
}
|
|
1080
|
-
|
|
1081
|
-
function openInChatGPT(event) {
|
|
1082
|
-
event.preventDefault();
|
|
1083
|
-
event.stopPropagation();
|
|
1084
|
-
|
|
1085
|
-
const title = document.querySelector('h1')?.textContent || document.title;
|
|
1086
|
-
const pageUrl = window.location.href;
|
|
1087
|
-
const markdown = getPageAsMarkdown();
|
|
1088
|
-
|
|
1089
|
-
const prompt = \`Please help me understand this documentation page:
|
|
1090
|
-
|
|
1091
|
-
Title: \${title}
|
|
1092
|
-
URL: \${pageUrl}
|
|
1093
|
-
|
|
1094
|
-
---
|
|
1095
|
-
|
|
1096
|
-
\${markdown}\`;
|
|
1097
|
-
|
|
1098
|
-
copyToClipboard(prompt).then(() => {
|
|
1099
|
-
showToast('Content copied! Paste it in ChatGPT');
|
|
1100
|
-
closeCopyPageDropdown();
|
|
1101
|
-
setTimeout(() => {
|
|
1102
|
-
window.open('https://chat.openai.com/', '_blank');
|
|
1103
|
-
}, 500);
|
|
1104
|
-
}).catch(err => {
|
|
1105
|
-
console.error('Failed to copy:', err);
|
|
1106
|
-
showToast('Failed to copy. Please try again.');
|
|
1107
|
-
});
|
|
1108
|
-
}
|
|
1109
|
-
|
|
1110
|
-
function openInClaude(event) {
|
|
1111
|
-
event.preventDefault();
|
|
1112
|
-
event.stopPropagation();
|
|
1113
|
-
|
|
1114
|
-
const title = document.querySelector('h1')?.textContent || document.title;
|
|
1115
|
-
const pageUrl = window.location.href;
|
|
1116
|
-
const markdown = getPageAsMarkdown();
|
|
1117
|
-
|
|
1118
|
-
const prompt = \`Please help me understand this documentation page:
|
|
1119
|
-
|
|
1120
|
-
Title: \${title}
|
|
1121
|
-
URL: \${pageUrl}
|
|
1122
|
-
|
|
1123
|
-
---
|
|
1124
|
-
|
|
1125
|
-
\${markdown}\`;
|
|
1126
|
-
|
|
1127
|
-
copyToClipboard(prompt).then(() => {
|
|
1128
|
-
showToast('Content copied! Paste it in Claude');
|
|
1129
|
-
closeCopyPageDropdown();
|
|
1130
|
-
setTimeout(() => {
|
|
1131
|
-
window.open('https://claude.ai/new', '_blank');
|
|
1132
|
-
}, 500);
|
|
1133
|
-
}).catch(err => {
|
|
1134
|
-
console.error('Failed to copy:', err);
|
|
1135
|
-
showToast('Failed to copy. Please try again.');
|
|
1136
|
-
});
|
|
1137
|
-
}
|
|
1138
|
-
|
|
1139
|
-
function openInPerplexity(event) {
|
|
1140
|
-
event.preventDefault();
|
|
1141
|
-
event.stopPropagation();
|
|
1142
|
-
|
|
1143
|
-
const title = document.querySelector('h1')?.textContent || document.title;
|
|
1144
|
-
const pageUrl = window.location.href;
|
|
1145
|
-
|
|
1146
|
-
// Perplexity supports URL-based search
|
|
1147
|
-
const query = encodeURIComponent(\`Explain this documentation: "\${title}" \${pageUrl}\`);
|
|
1148
|
-
closeCopyPageDropdown();
|
|
1149
|
-
window.open(\`https://www.perplexity.ai/search?q=\${query}\`, '_blank');
|
|
1150
|
-
}
|
|
1151
|
-
|
|
1152
|
-
// Close dropdown when clicking outside
|
|
1153
|
-
if (typeof document !== 'undefined') {
|
|
1154
|
-
document.addEventListener('click', (event) => {
|
|
1155
|
-
const dropdown = document.querySelector('.copy-page-dropdown');
|
|
1156
|
-
if (dropdown && !dropdown.contains(event.target)) {
|
|
1157
|
-
closeCopyPageDropdown();
|
|
1158
|
-
}
|
|
1159
|
-
});
|
|
1160
|
-
|
|
1161
|
-
// Close dropdown on escape key
|
|
1162
|
-
document.addEventListener('keydown', (event) => {
|
|
1163
|
-
if (event.key === 'Escape') {
|
|
1164
|
-
closeCopyPageDropdown();
|
|
1165
|
-
}
|
|
1166
|
-
});
|
|
1167
|
-
}
|
|
1168
|
-
`],preserveDirectoryStructure:!0,features:{inlineFormatting:!0,containers:!0,githubAlerts:!0,codeBlocks:{lineHighlighting:!0,lineNumbers:!0,focus:!0,diffs:!0,errorWarningMarkers:!0},codeGroups:!0,codeImports:!0,inlineToc:!0,customAnchors:!0,emoji:!0,badges:!0,includes:!0,externalLinks:{autoTarget:!0,autoRel:!0,showIcon:!0},imageLazyLoading:!0,tables:{alignment:!0,enhancedStyling:!0,responsive:!0}},syntaxHighlightTheme:"github-light"},verbose:!1,sitemap:{enabled:!0,filename:"sitemap.xml",defaultPriority:0.5,defaultChangefreq:"monthly",maxUrlsPerFile:50000,useSitemapIndex:!1},robots:{enabled:!0,filename:"robots.txt"}},y=await aQ({name:"bunpress",alias:"docs",defaultConfig:a});async function V0(){return y}var{Glob:oQ}=globalThis.Bun;import{join as WQ}from"path";var p=new Map;function iQ(Q,Z,$){let O=Z.split("."),J=Q;for(let Y=0;Y<O.length-1;Y++){let q=O[Y];if(typeof J[q]!=="object"||J[q]===null)J[q]={};J=J[q]}J[O[O.length-1]]=$}async function GQ(Q){if(p.has(Q))return p.get(Q);let Z={},$=WQ(Q,".data");try{let O=new oQ("**/*.json");for await(let J of O.scan({cwd:$,absolute:!1}))try{let Y=await Bun.file(WQ($,J)).text(),q=J.replace(/\.json$/,"").replace(/[/\\]/g,".");iQ(Z,q,JSON.parse(Y))}catch{}}catch{}return p.set(Q,Z),Z}function UQ(){p.clear()}import{createHighlighter as nQ,highlight as tQ}from"ts-syntax-highlighter";var x=null;function N0(){x=null}async function jQ(){if(x)return x;return x=await nQ({theme:"github-light",cache:!0}),x}var eQ={js:"javascript",ts:"typescript",jsx:"javascript",tsx:"typescript",htm:"html",sh:"bash",shell:"bash",zsh:"bash"};function o(Q){let Z=Q.toLowerCase().trim();return eQ[Z]||Z}function NQ(Q){let Z=o(Q);return["javascript","typescript","html","css","json","stx","bash"].includes(Z)}function f(Q){return Q.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function QZ(Q,Z){let $=/<span[^>]*class="token[^"]*"[^>]*>([^<]*)<\/span>/g,O=[],J;while((J=$.exec(Z))!==null){let X=J[1].replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,'"').replace(/�*39;/g,"'");if(X)O.push({text:X,span:J[0]})}if(O.length===0)return Z;let Y="",q=0,K=Q.match(/^(\s*)/);if(K&&K[1])Y+=K[1],q=K[1].length;for(let X=0;X<O.length;X++){let{text:V,span:z}=O[X],_=Q.indexOf(V,q);if(_===-1){Y+=z;continue}if(_>q){let G=Q.substring(q,_);if(/^\s+$/.test(G))Y+=G}Y+=z,q=_+V.length}return Y}async function i(Q,Z,$="github-light"){let O=o(Z);if(!NQ(O))return Q.split(`
|
|
1169
|
-
`).map((Y)=>`<span class="line">${f(Y)}</span>`).join(`
|
|
2
|
+
import{P as lQ,Q as P}from"./chunk-e5q66hsy.js";import{S as x}from"./chunk-w6byd4st.js";var{Glob:fQ,YAML:pQ}=globalThis.Bun;import{stat as mQ}from"fs/promises";import{join as i}from"path";import f from"process";var{Glob:aQ}=globalThis.Bun;import{join as UQ}from"path";var g=new Map;function nQ(Q,Z,$){let Y=Z.split("."),J=Q;for(let O=0;O<Y.length-1;O++){let q=Y[O];if(typeof J[q]!=="object"||J[q]===null)J[q]={};J=J[q]}J[Y[Y.length-1]]=$}async function jQ(Q){if(g.has(Q))return g.get(Q);let Z={},$=UQ(Q,".data");try{let Y=new aQ("**/*.json");for await(let J of Y.scan({cwd:$,absolute:!1}))try{let O=await Bun.file(UQ($,J)).text(),q=J.replace(/\.json$/,"").replace(/[/\\]/g,".");nQ(Z,q,JSON.parse(O))}catch{}}catch{}return g.set(Q,Z),Z}function NQ(){g.clear()}import{createHighlighter as tQ,highlight as eQ}from"ts-syntax-highlighter";var u=null;function G0(){u=null}async function EQ(){if(u)return u;return u=await tQ({theme:"github-light",cache:!0}),u}var QZ={js:"javascript",ts:"typescript",jsx:"javascript",tsx:"typescript",htm:"html",sh:"bash",shell:"bash",zsh:"bash"};function n(Q){let Z=Q.toLowerCase().trim();return QZ[Z]||Z}function RQ(Q){let Z=n(Q);return["javascript","typescript","html","css","json","stx","bash"].includes(Z)}function h(Q){return Q.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function ZZ(Q,Z){let $=/<span[^>]*class="token[^"]*"[^>]*>([^<]*)<\/span>/g,Y=[],J;while((J=$.exec(Z))!==null){let X=J[1].replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,'"').replace(/�*39;/g,"'");if(X)Y.push({text:X,span:J[0]})}if(Y.length===0)return Z;let O="",q=0,K=Q.match(/^(\s*)/);if(K&&K[1])O+=K[1],q=K[1].length;for(let X=0;X<Y.length;X++){let{text:z,span:V}=Y[X],_=Q.indexOf(z,q);if(_===-1){O+=V;continue}if(_>q){let G=Q.substring(q,_);if(/^\s+$/.test(G))O+=G}O+=V,q=_+z.length}return O}async function t(Q,Z,$="github-light"){let Y=n(Z);if(!RQ(Y))return Q.split(`
|
|
3
|
+
`).map((O)=>`<span class="line">${h(O)}</span>`).join(`
|
|
1170
4
|
`);try{let J=Q.split(`
|
|
1171
|
-
`);return(await Promise.all(J.map(async(q)=>{if(!q.trim())return`<span class="line">${q}</span>`;let X=(await
|
|
5
|
+
`);return(await Promise.all(J.map(async(q)=>{if(!q.trim())return`<span class="line">${q}</span>`;let X=(await eQ(q,Y,{theme:$})).html;if(X=X.replace(/<div[^>]*class="syntax-wrapper"[^>]*>/g,""),X=X.replace(/<\/div>\s*$/g,""),X=X.replace(/<pre[^>]*>/g,""),X=X.replace(/<\/pre>/g,""),X=X.replace(/<code[^>]*>/g,""),X=X.replace(/<\/code>/g,""),X=ZZ(q,X.trim()),!X.startsWith('<span class="line">'))X=`<span class="line">${X}</span>`;return X}))).join(`
|
|
1172
6
|
`)}catch(J){return console.warn(`Failed to highlight code for language "${Z}":`,J),Q.split(`
|
|
1173
|
-
`).map((q)=>`<span class="line">${
|
|
1174
|
-
`)}}function
|
|
7
|
+
`).map((q)=>`<span class="line">${h(q)}</span>`).join(`
|
|
8
|
+
`)}}function U0(Q,Z){let $=n(Z);if(!RQ($))return h(Q);return h(Q)}function AQ(){return`
|
|
1175
9
|
/* Basic syntax highlighting styles for ts-syntax-highlighter */
|
|
1176
10
|
/* The actual theme colors are injected by ts-syntax-highlighter */
|
|
1177
11
|
|
|
@@ -1281,7 +115,7 @@ code {
|
|
|
1281
115
|
color: #9ca3af;
|
|
1282
116
|
}
|
|
1283
117
|
}
|
|
1284
|
-
`}async function
|
|
118
|
+
`}async function j0(){await EQ()}async function N0(){return EQ()}import{join as e}from"path";var d=new Map,BQ="\x00BPCODE",FQ="\x00";async function $Z(Q,Z){let $=e(Q,Z);if(d.has($))return d.get($);let Y=[e(Q,`${Z}.stx`),e(Q,Z,"index.stx")],J=null;for(let O of Y){let q=Bun.file(O);if(await q.exists()){J=await q.text();break}}return d.set($,J),J}function MQ(){d.clear()}function JZ(Q,Z){try{let $=Object.keys(Z),Y=$.map((J)=>Z[J]);return Function(...$,`"use strict"; return (${Q});`)(...Y)}catch{return}}function YZ(Q,Z){let $={};if(!Q)return $;let Y=/([:@]?[\w-]+)(?:=(?:"([^"]*)"|'([^']*)'|\{([^}]*)\}))?/g,J;while(J=Y.exec(Q)){let O=J[1];if(!O)continue;let q=O.startsWith(":"),K=O.replace(/^[:@]/,""),X=J[2],z=J[3],V=J[4],_=X??z??V;if(_===void 0)$[K]=!0;else if(q||V!==void 0)$[K]=JZ(_,Z);else $[K]=_}return $}async function QQ(Q,Z,$,Y=0){if(Y>10||!Q.includes("<"))return Q;let J=[],O=Q.replace(/```[\s\S]*?```/g,(_)=>{return J.push(_),`${BQ}${J.length-1}${FQ}`}).replace(/`[^`\n]*`/g,(_)=>{return J.push(_),`${BQ}${J.length-1}${FQ}`}),q=/<([A-Z][A-Za-z0-9]*)((?:\s[^>]*?)?)(\/?)>/g,K="",X=0,z=!1,V;while(V=q.exec(O)){let _=V[0],G=V[1],U=V[2],j=V[3],W=await $Z(Z,G);if(W==null)continue;z=!0,K+=O.slice(X,V.index);let E="",N=V.index+_.length;if(!j){let A=new RegExp(`</${G}>`,"g");A.lastIndex=N;let B=A.exec(O);if(B)E=O.slice(N,B.index).trim(),N=B.index+B[0].length}let F=YZ(U.trim(),$),I="";try{let{renderString:A}=await import("@stacksjs/stx");I=await A(W,{...$,...F,slot:E})}catch{I=""}K+=I,X=N,q.lastIndex=N}if(K+=O.slice(X),K=K.replace(/\u0000BPCODE(\d+)\u0000/g,(_,G)=>J[Number(G)]??""),z)return QQ(K,Z,$,Y+1);return K}import{join as DQ}from"path";var OZ=DQ(import.meta.dir,"templates"),c=new Map;async function XZ(Q){if(c.has(Q))return c.get(Q);let Z=DQ(OZ,`${Q}.stx`),$=Bun.file(Z);if(!await $.exists())throw Error(`Template not found: ${Q}`);let Y=await $.text();return c.set(Q,Y),Y}async function v(Q,Z){let $=await XZ(Q);return qZ($,Z)}function TQ(){c.clear()}function qZ(Q,Z){return Q.replace(/\{!!\s*([\w.]+)\s*!!\}/g,($,Y)=>wQ(IQ(Z,Y))).replace(/\{\{\s*([\w.]+)\s*\}\}/g,($,Y)=>KZ(wQ(IQ(Z,Y))))}function IQ(Q,Z){return Z.split(".").reduce(($,Y)=>{if($==null||typeof $!=="object")return;return $[Y]},Q)}function wQ(Q){if(Q==null)return"";return String(Q)}function KZ(Q){return Q.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}var LQ=`/**
|
|
1285
119
|
* VitePress Theme for BunPress - Layout & Chrome
|
|
1286
120
|
* -------------------------------------------------------------------------- */
|
|
1287
121
|
|
|
@@ -1330,8 +164,10 @@ code {
|
|
|
1330
164
|
}
|
|
1331
165
|
|
|
1332
166
|
.BPNavBarTitle {
|
|
167
|
+
display: inline-flex;
|
|
168
|
+
align-items: center;
|
|
1333
169
|
font-size: 16px;
|
|
1334
|
-
font-weight:
|
|
170
|
+
font-weight: 750;
|
|
1335
171
|
color: var(--bp-c-text-1);
|
|
1336
172
|
white-space: nowrap;
|
|
1337
173
|
text-decoration: none;
|
|
@@ -1351,8 +187,8 @@ code {
|
|
|
1351
187
|
.BPNavBarMenu a,
|
|
1352
188
|
.BPNavBarMenu .BPNavBarMenu-link {
|
|
1353
189
|
font-size: 14px;
|
|
1354
|
-
font-weight:
|
|
1355
|
-
color: var(--bp-c-text-
|
|
190
|
+
font-weight: 600;
|
|
191
|
+
color: var(--bp-c-text-2);
|
|
1356
192
|
text-decoration: none;
|
|
1357
193
|
transition: color 0.25s;
|
|
1358
194
|
cursor: pointer;
|
|
@@ -1582,7 +418,7 @@ code {
|
|
|
1582
418
|
* -------------------------------------------------------------------------- */
|
|
1583
419
|
|
|
1584
420
|
.BPHero-name {
|
|
1585
|
-
font-size:
|
|
421
|
+
font-size: 22px;
|
|
1586
422
|
font-weight: 700;
|
|
1587
423
|
letter-spacing: -0.02em;
|
|
1588
424
|
line-height: 1.2;
|
|
@@ -1594,7 +430,7 @@ code {
|
|
|
1594
430
|
}
|
|
1595
431
|
|
|
1596
432
|
.BPHero-text {
|
|
1597
|
-
font-size:
|
|
433
|
+
font-size: 48px;
|
|
1598
434
|
font-weight: 800;
|
|
1599
435
|
letter-spacing: -0.02em;
|
|
1600
436
|
line-height: 1.1;
|
|
@@ -1603,6 +439,7 @@ code {
|
|
|
1603
439
|
}
|
|
1604
440
|
|
|
1605
441
|
.BPHero-tagline {
|
|
442
|
+
max-width: 720px;
|
|
1606
443
|
font-size: 18px;
|
|
1607
444
|
font-weight: 400;
|
|
1608
445
|
line-height: 1.6;
|
|
@@ -1646,7 +483,7 @@ code {
|
|
|
1646
483
|
}
|
|
1647
484
|
|
|
1648
485
|
.BPButton-brand {
|
|
1649
|
-
color: var(--bp-button-brand-text, #
|
|
486
|
+
color: var(--bp-button-brand-text, #03110b);
|
|
1650
487
|
background-color: var(--bp-c-brand-1);
|
|
1651
488
|
border-color: var(--bp-c-brand-1);
|
|
1652
489
|
}
|
|
@@ -1705,7 +542,7 @@ code {
|
|
|
1705
542
|
|
|
1706
543
|
.BPFeature {
|
|
1707
544
|
display: block;
|
|
1708
|
-
padding:
|
|
545
|
+
padding: 26px;
|
|
1709
546
|
background-color: var(--bp-c-bg-soft, var(--bp-c-bg-alt));
|
|
1710
547
|
border: 1px solid var(--bp-c-divider);
|
|
1711
548
|
border-radius: 12px;
|
|
@@ -1756,6 +593,26 @@ code {
|
|
|
1756
593
|
color: var(--bp-c-text-2);
|
|
1757
594
|
}
|
|
1758
595
|
|
|
596
|
+
/**
|
|
597
|
+
* Home page markdown body \u2014 rendered below the hero + features grid.
|
|
598
|
+
* Wrapped as .BPHome-content > .bp-doc.vp-doc.container by markdownToHtml.
|
|
599
|
+
* -------------------------------------------------------------------------- */
|
|
600
|
+
|
|
601
|
+
.BPHome-content {
|
|
602
|
+
padding: 48px 24px 96px;
|
|
603
|
+
}
|
|
604
|
+
|
|
605
|
+
.BPHome-content .container {
|
|
606
|
+
margin: 0 auto;
|
|
607
|
+
max-width: 1152px;
|
|
608
|
+
}
|
|
609
|
+
|
|
610
|
+
@media (min-width: 960px) {
|
|
611
|
+
.BPHome-content {
|
|
612
|
+
padding: 64px 32px 128px;
|
|
613
|
+
}
|
|
614
|
+
}
|
|
615
|
+
|
|
1759
616
|
/**
|
|
1760
617
|
* Inline content \u2014 badges, external link icons
|
|
1761
618
|
* -------------------------------------------------------------------------- */
|
|
@@ -1916,7 +773,7 @@ code {
|
|
|
1916
773
|
left: 0;
|
|
1917
774
|
}
|
|
1918
775
|
}
|
|
1919
|
-
`;function
|
|
776
|
+
`;function ZQ(){return`
|
|
1920
777
|
/* VitePress Theme for BunPress */
|
|
1921
778
|
/**
|
|
1922
779
|
* VitePress Theme for BunPress
|
|
@@ -3373,8 +2230,10 @@ ${`/**
|
|
|
3373
2230
|
}
|
|
3374
2231
|
|
|
3375
2232
|
.BPNavBarTitle {
|
|
2233
|
+
display: inline-flex;
|
|
2234
|
+
align-items: center;
|
|
3376
2235
|
font-size: 16px;
|
|
3377
|
-
font-weight:
|
|
2236
|
+
font-weight: 750;
|
|
3378
2237
|
color: var(--bp-c-text-1);
|
|
3379
2238
|
white-space: nowrap;
|
|
3380
2239
|
text-decoration: none;
|
|
@@ -3394,8 +2253,8 @@ ${`/**
|
|
|
3394
2253
|
.BPNavBarMenu a,
|
|
3395
2254
|
.BPNavBarMenu .BPNavBarMenu-link {
|
|
3396
2255
|
font-size: 14px;
|
|
3397
|
-
font-weight:
|
|
3398
|
-
color: var(--bp-c-text-
|
|
2256
|
+
font-weight: 600;
|
|
2257
|
+
color: var(--bp-c-text-2);
|
|
3399
2258
|
text-decoration: none;
|
|
3400
2259
|
transition: color 0.25s;
|
|
3401
2260
|
cursor: pointer;
|
|
@@ -3625,7 +2484,7 @@ ${`/**
|
|
|
3625
2484
|
* -------------------------------------------------------------------------- */
|
|
3626
2485
|
|
|
3627
2486
|
.BPHero-name {
|
|
3628
|
-
font-size:
|
|
2487
|
+
font-size: 22px;
|
|
3629
2488
|
font-weight: 700;
|
|
3630
2489
|
letter-spacing: -0.02em;
|
|
3631
2490
|
line-height: 1.2;
|
|
@@ -3637,7 +2496,7 @@ ${`/**
|
|
|
3637
2496
|
}
|
|
3638
2497
|
|
|
3639
2498
|
.BPHero-text {
|
|
3640
|
-
font-size:
|
|
2499
|
+
font-size: 48px;
|
|
3641
2500
|
font-weight: 800;
|
|
3642
2501
|
letter-spacing: -0.02em;
|
|
3643
2502
|
line-height: 1.1;
|
|
@@ -3646,6 +2505,7 @@ ${`/**
|
|
|
3646
2505
|
}
|
|
3647
2506
|
|
|
3648
2507
|
.BPHero-tagline {
|
|
2508
|
+
max-width: 720px;
|
|
3649
2509
|
font-size: 18px;
|
|
3650
2510
|
font-weight: 400;
|
|
3651
2511
|
line-height: 1.6;
|
|
@@ -3689,7 +2549,7 @@ ${`/**
|
|
|
3689
2549
|
}
|
|
3690
2550
|
|
|
3691
2551
|
.BPButton-brand {
|
|
3692
|
-
color: var(--bp-button-brand-text, #
|
|
2552
|
+
color: var(--bp-button-brand-text, #03110b);
|
|
3693
2553
|
background-color: var(--bp-c-brand-1);
|
|
3694
2554
|
border-color: var(--bp-c-brand-1);
|
|
3695
2555
|
}
|
|
@@ -3748,7 +2608,7 @@ ${`/**
|
|
|
3748
2608
|
|
|
3749
2609
|
.BPFeature {
|
|
3750
2610
|
display: block;
|
|
3751
|
-
padding:
|
|
2611
|
+
padding: 26px;
|
|
3752
2612
|
background-color: var(--bp-c-bg-soft, var(--bp-c-bg-alt));
|
|
3753
2613
|
border: 1px solid var(--bp-c-divider);
|
|
3754
2614
|
border-radius: 12px;
|
|
@@ -3799,6 +2659,26 @@ ${`/**
|
|
|
3799
2659
|
color: var(--bp-c-text-2);
|
|
3800
2660
|
}
|
|
3801
2661
|
|
|
2662
|
+
/**
|
|
2663
|
+
* Home page markdown body \u2014 rendered below the hero + features grid.
|
|
2664
|
+
* Wrapped as .BPHome-content > .bp-doc.vp-doc.container by markdownToHtml.
|
|
2665
|
+
* -------------------------------------------------------------------------- */
|
|
2666
|
+
|
|
2667
|
+
.BPHome-content {
|
|
2668
|
+
padding: 48px 24px 96px;
|
|
2669
|
+
}
|
|
2670
|
+
|
|
2671
|
+
.BPHome-content .container {
|
|
2672
|
+
margin: 0 auto;
|
|
2673
|
+
max-width: 1152px;
|
|
2674
|
+
}
|
|
2675
|
+
|
|
2676
|
+
@media (min-width: 960px) {
|
|
2677
|
+
.BPHome-content {
|
|
2678
|
+
padding: 64px 32px 128px;
|
|
2679
|
+
}
|
|
2680
|
+
}
|
|
2681
|
+
|
|
3802
2682
|
/**
|
|
3803
2683
|
* Inline content \u2014 badges, external link icons
|
|
3804
2684
|
* -------------------------------------------------------------------------- */
|
|
@@ -5001,7 +3881,7 @@ ${`/**
|
|
|
5001
3881
|
|
|
5002
3882
|
.bpi-corner-down-left {
|
|
5003
3883
|
--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");
|
|
5004
|
-
}`}function
|
|
3884
|
+
}`}function zZ(){return`/**
|
|
5005
3885
|
* VitePress Theme for BunPress - Base Styles
|
|
5006
3886
|
* -------------------------------------------------------------------------- */
|
|
5007
3887
|
|
|
@@ -5845,7 +4725,7 @@ mjx-container > svg {
|
|
|
5845
4725
|
.bp-doc .custom-block .bp-code-group .tabs {
|
|
5846
4726
|
margin: 0;
|
|
5847
4727
|
border-radius: 8px 8px 0 0;
|
|
5848
|
-
}`}function
|
|
4728
|
+
}`}function VZ(){return`/**
|
|
5849
4729
|
* VitePress Theme for BunPress - Custom Blocks
|
|
5850
4730
|
* -------------------------------------------------------------------------- */
|
|
5851
4731
|
|
|
@@ -6324,7 +5204,7 @@ mjx-container > svg {
|
|
|
6324
5204
|
margin: 0;
|
|
6325
5205
|
border-radius: 0;
|
|
6326
5206
|
border: none;
|
|
6327
|
-
}`}var GZ={name:"vitepress",getCSS:
|
|
5207
|
+
}`}var GZ={name:"vitepress",getCSS:ZQ,getVars:_Z,getBase:zZ,getCustomBlocks:VZ,getCodeGroups:WZ},HQ=GZ;var PQ=`/**
|
|
6328
5208
|
* Bun Theme for BunPress
|
|
6329
5209
|
* Colors extracted from bun.sh
|
|
6330
5210
|
* -------------------------------------------------------------------------- */
|
|
@@ -6878,7 +5758,7 @@ mjx-container > svg {
|
|
|
6878
5758
|
|
|
6879
5759
|
.bpi-search {
|
|
6880
5760
|
--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");
|
|
6881
|
-
}`,
|
|
5761
|
+
}`,yQ=`/**
|
|
6882
5762
|
* Bun Theme for BunPress - Base Styles
|
|
6883
5763
|
* -------------------------------------------------------------------------- */
|
|
6884
5764
|
|
|
@@ -7677,7 +6557,7 @@ p {
|
|
|
7677
6557
|
.bp-doc .custom-block .bp-code-group .tabs {
|
|
7678
6558
|
margin: 0;
|
|
7679
6559
|
border-radius: 5px 5px 0 0;
|
|
7680
|
-
}`,
|
|
6560
|
+
}`,vQ=`/**
|
|
7681
6561
|
* Bun Theme for BunPress - Custom Blocks
|
|
7682
6562
|
* -------------------------------------------------------------------------- */
|
|
7683
6563
|
|
|
@@ -8041,7 +6921,7 @@ p {
|
|
|
8041
6921
|
|
|
8042
6922
|
.github-alert-caution .github-alert-icon {
|
|
8043
6923
|
fill: var(--bp-c-caution-1);
|
|
8044
|
-
}`,
|
|
6924
|
+
}`,kQ=`/**
|
|
8045
6925
|
* Bun Theme for BunPress - Code Groups
|
|
8046
6926
|
* -------------------------------------------------------------------------- */
|
|
8047
6927
|
|
|
@@ -8171,7 +7051,7 @@ p {
|
|
|
8171
7051
|
margin: 0;
|
|
8172
7052
|
border-radius: 0;
|
|
8173
7053
|
border: none;
|
|
8174
|
-
}`,
|
|
7054
|
+
}`,bQ=`/**
|
|
8175
7055
|
* Bun Theme for BunPress - Extra Bun-specific styles
|
|
8176
7056
|
* -------------------------------------------------------------------------- */
|
|
8177
7057
|
|
|
@@ -8325,23 +7205,23 @@ p {
|
|
|
8325
7205
|
|
|
8326
7206
|
.interactive-hover:hover {
|
|
8327
7207
|
transform: scale(1.06);
|
|
8328
|
-
}`;function
|
|
7208
|
+
}`;function SQ(){return`
|
|
8329
7209
|
/* Bun Theme for BunPress */
|
|
8330
7210
|
/* Colors extracted from bun.sh */
|
|
8331
|
-
${
|
|
8332
|
-
${TQ}
|
|
8333
|
-
${wQ}
|
|
8334
|
-
${LQ}
|
|
7211
|
+
${PQ}
|
|
8335
7212
|
${yQ}
|
|
8336
|
-
${
|
|
8337
|
-
|
|
8338
|
-
${
|
|
7213
|
+
${LQ}
|
|
7214
|
+
${vQ}
|
|
7215
|
+
${kQ}
|
|
7216
|
+
${bQ}
|
|
7217
|
+
`}function UZ(){return PQ}function jZ(){return yQ}function NZ(){return vQ}function EZ(){return kQ}function RZ(){return bQ}var AZ={name:"bun",getCSS:SQ,getVars:UZ,getBase:jZ,getCustomBlocks:NZ,getCodeGroups:EZ,getExtras:RZ},xQ=AZ;var BZ={vitepress:HQ,bun:xQ};function CQ(Q="vitepress"){let Z=BZ[Q];if(!Z)return console.warn(`[BunPress] Unknown theme: ${Q}, falling back to vitepress`),ZQ();return Z.getCSS()}var $Q={enabled:!0,position:["sidebar"],title:"Table of Contents",maxDepth:6,minDepth:2,className:"table-of-contents",smoothScroll:!0,activeHighlight:!0,collapsible:!0,exclude:[]};function JQ(Q){return Q.toLowerCase().trim().replace(/<[^>]*>/g,"").replace(/what's new\?\s*\(v2\.0\)/g,"whats-new-v2-0").replace(/features\s*&\s*benefits/g,"features-benefits").replace(/vue\.js\s*\+\s*typescript\s*=\s*\u2764\uFE0F/g,"vue-js-typescript").replace(/\//g,"-").replace(/\./g,"-").replace(/[^\w\s-]/g,"").replace(/[\s_]+/g,"-").replace(/-+/g,"-").replace(/^-+|-+$/g,"")}function uQ(Q,Z){let $=JQ(Q),Y=$,J=1;while(Z.has($))$=`${Y}-${J}`,J++;return Z.add($),$}function YQ(Q){let Z=[],$=new Set,Y=/^(#{1,6})\s+(.+)$/gm,J;while((J=Y.exec(Q))!==null){let O=J[1].length,q=J[2].trim();if(!q)continue;if(q.includes("toc-ignore"))continue;let K=q.replace(/\s*<!-- toc-ignore -->\s*/g,"").trim();K=K.replace(/`([^`]+)`/g,"<code>$1</code>");let X=K.includes("<code>"),z=uQ(K.replace(/<[^>]*>/g,""),$);Z.push({level:O,text:K,id:z,children:[],hasCode:X})}return Z}function OQ(Q){let Z=[],$=[];for(let Y of Q){while($.length>0&&$[$.length-1].level>=Y.level)$.pop();if($.length===0)Z.push(Y);else $[$.length-1].children.push(Y);$.push(Y)}return Z}function XQ(Q,Z){let{minDepth:$=2,maxDepth:Y=6,exclude:J=[]}=Z,O=(q)=>{let K=[];for(let X of q){if(J.some((V)=>{if(V.startsWith("/")&&V.endsWith("/"))return new RegExp(V.slice(1,-1)).test(X.text);else return X.text===V}))continue;if(X.level>Y)continue;let z=O(X.children);if(X.level>=$&&X.level<=Y)K.push({...X,children:z});else K.push(...z)}return K};return O(Q)}function l(Q){let{items:Z,title:$,config:Y}=Q,{className:J,collapsible:O}=Y,q=(K,X=0)=>{if(K.length===0)return"";let z=X===0?"toc-list":"toc-sublist",V=X===0?"toc-item":"toc-subitem";return`<ul class="${z}">
|
|
7218
|
+
${K.map((_)=>{let G=_.children.length>0,U=G&&O?"toc-expand":"",j=G?q(_.children,X+1):"",W=50,E=_.text.length>50?`${_.text.substring(0,50)}...`:_.text,N=_.text.length>50?"toc-truncate":"";return`<li class="${_.hasCode?"toc-code":""} ${U} ${V} ${N}">
|
|
8339
7219
|
<a href="#${_.id}" class="toc-link" title="${_.text.replace(/<[^>]*>/g,"")}">${E}</a>
|
|
8340
7220
|
${j}
|
|
8341
7221
|
</li>`}).join(`
|
|
8342
7222
|
`)}
|
|
8343
7223
|
</ul>`};return[`<nav class="${J}" role="navigation" aria-label="${$}">`,'<div class="toc-container">',` <h2 class="toc-title">${$}</h2>`,` ${q(Z)}`,"</div>","</nav>"].join(`
|
|
8344
|
-
`)}function
|
|
7224
|
+
`)}function r(Q){return l(Q).replace("table-of-contents","table-of-contents toc-inline inline-toc")}function FZ(Q){return l(Q).replace("table-of-contents","table-of-contents toc-sidebar sidebar-toc")}function MZ(Q){return l(Q).replace("table-of-contents","table-of-contents toc-floating floating-toc")}function IZ(Q,Z={}){let $={...Z};if(typeof $.position==="string")$.position=[$.position];let Y={...$Q,...$},J=YQ(Q),O=OQ(J),q=XQ(O,Y);return{title:Y.title,items:q,config:Y}}function H0(Q,Z={}){let $=IZ(Q,Z);return(Array.isArray(Z.position)?Z.position:[Z.position||"sidebar"]).map((J)=>{let O;switch(J){case"inline":O=r($);break;case"sidebar":O=FZ($);break;case"floating":O=MZ($);break;default:O=l($)}return{position:J,data:$,html:O}})}function P0(Q,Z){let $=r(Z);return Q.replace(/\[\[toc\]\]/gi,$)}function y0(Q){let Z=new Set;return Q.replace(/<h([1-6])>(.*?)<\/h[1-6]>/gi,($,Y,J)=>{let O=uQ(J.replace(/<[^>]*>/g,""),Z);return`<h${Y} id="${O}"><a href="#${O}" class="heading-anchor">#</a>${J}</h${Y}>`})}function v0(){return`
|
|
8345
7225
|
.table-of-contents {
|
|
8346
7226
|
position: sticky;
|
|
8347
7227
|
top: 60px; /* Match navbar height */
|
|
@@ -8471,7 +7351,7 @@ html {
|
|
|
8471
7351
|
max-width: 250px;
|
|
8472
7352
|
}
|
|
8473
7353
|
}
|
|
8474
|
-
`}function
|
|
7354
|
+
`}function k0(){return`
|
|
8475
7355
|
function initToc() {
|
|
8476
7356
|
const tocLinks = document.querySelectorAll('.toc-link')
|
|
8477
7357
|
|
|
@@ -8572,8 +7452,8 @@ if (document.readyState === 'loading') {
|
|
|
8572
7452
|
else {
|
|
8573
7453
|
initToc()
|
|
8574
7454
|
}
|
|
8575
|
-
`}async function
|
|
8576
|
-
`);return await v("page-toc",{items:J})}function TZ(Q){return Q.replace(/<h([1-6])([^>]*)>(.*?)<\/h\1>/g,(Z,$,
|
|
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=VQ(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})}));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">
|
|
8577
7457
|
(function(){
|
|
8578
7458
|
if (history.scrollRestoration) history.scrollRestoration = 'manual';
|
|
8579
7459
|
|
|
@@ -8869,7 +7749,7 @@ else {
|
|
|
8869
7749
|
|
|
8870
7750
|
updateActiveLinks();
|
|
8871
7751
|
})();
|
|
8872
|
-
<`+"/script>"}function
|
|
7752
|
+
<`+"/script>"}function HZ(Q){let Z=Q.themeConfig?.nav||Q.markdown?.nav||Q.nav;if(!Z||Z.length===0)return"";let $=(J)=>{return VQ(Q,J||"/")};return Z.map((J)=>{if(J.items&&J.items.length>0)return`<div class="BPNavBarMenu-group">
|
|
8873
7753
|
<button class="BPNavBarMenu-group-button" type="button">
|
|
8874
7754
|
<span>${J.text}</span>
|
|
8875
7755
|
<svg class="chevron" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
|
@@ -8877,46 +7757,46 @@ else {
|
|
|
8877
7757
|
</svg>
|
|
8878
7758
|
</button>
|
|
8879
7759
|
<div class="BPNavBarMenu-group-items">
|
|
8880
|
-
${J.items.map((
|
|
7760
|
+
${J.items.map((O)=>`<a href="${$(O.link)}">${O.text}</a>`).join("")}
|
|
8881
7761
|
</div>
|
|
8882
|
-
</div>`;return`<a class="BPNavBarMenu-link" href="${$(J.link)}">${J.text}</a>`}).join("")}function
|
|
8883
|
-
`)}function kZ(Q,Z,$){let
|
|
8884
|
-
`)}function bZ(Q,Z,$,
|
|
7762
|
+
</div>`;return`<a class="BPNavBarMenu-link" href="${$(J.link)}">${J.text}</a>`}).join("")}function rQ(Q){if(Q.basePath){let $=Q.basePath.trim().replace(/\/+$/,"");if(!$||$==="/")return"";return $.startsWith("/")?$:`/${$}`}let Z=Q.sitemap?.baseUrl;if(!Z)return"";try{let $=new URL(Z).pathname.replace(/\/+$/,"");return $==="/"?"":$}catch{return""}}function PZ(Q,Z){let $=rQ(Q);if(!$)return Z;if(Z===$||Z.startsWith(`${$}/`))return Z.slice($.length)||"/";return Z}function VQ(Q,Z){let $=rQ(Q);if(!$||!Z.startsWith("/")||Z.startsWith("//"))return Z;if(Z===$||Z.startsWith(`${$}/`))return Z;return Z==="/"?`${$}/`:`${$}${Z}`}function _Q(Q,Z){return Q.replace(/\b(href|src|action)="(\/[^"]*)"/g,($,Y,J)=>{let O=VQ(Z,J);return O===J?$:`${Y}="${O}"`})}function yZ(Q,Z){let $=Q.sitemap?.baseUrl;if(!$)return"";return`<link rel="canonical" href="${$.replace(/\/$/,"")}${Z==="/index"?"/":Z}">`}function vZ(Q,Z,$,Y){let J=$.sitemap?.baseUrl;if(!J)return"";let K=`${J.replace(/\/$/,"")}${Y==="/index"?"/":Y}`,X=$.title||$.markdown?.title||Q,z=$.markdown?.meta?.["og:image"]||$.markdown?.meta?.ogImage,V=['<meta property="og:type" content="website">',`<meta property="og:url" content="${K}">`,`<meta property="og:title" content="${Q}">`,`<meta property="og:description" content="${Z}">`,`<meta property="og:site_name" content="${X}">`];if(z)V.push(`<meta property="og:image" content="${z}">`);return V.join(`
|
|
7763
|
+
`)}function kZ(Q,Z,$){let Y=$.markdown?.meta?.["twitter:card"]||$.markdown?.meta?.twitterCard||"summary",J=$.markdown?.meta?.["twitter:site"]||$.markdown?.meta?.twitterSite,O=$.markdown?.meta?.["twitter:image"]||$.markdown?.meta?.twitterImage,q=[`<meta name="twitter:card" content="${Y}">`,`<meta name="twitter:title" content="${Q}">`,`<meta name="twitter:description" content="${Z}">`];if(J)q.push(`<meta name="twitter:site" content="${J}">`);if(O)q.push(`<meta name="twitter:image" content="${O}">`);return q.join(`
|
|
7764
|
+
`)}function bZ(Q,Z,$,Y){let J=$.sitemap?.baseUrl;if(!J)return"";let O=J.replace(/\/$/,""),q=Y==="/index"?"/":Y,K=`${O}${q}`;if(q==="/"){let _={"@context":"https://schema.org","@type":"WebSite",name:$.title||$.markdown?.title||Q,description:Z,url:O};return`<script type="application/ld+json">
|
|
8885
7765
|
${JSON.stringify(_,null,2)}
|
|
8886
|
-
</script>`}let X={"@context":"https://schema.org","@type":"TechArticle",headline:Q,description:Z,url:K},
|
|
7766
|
+
</script>`}let X={"@context":"https://schema.org","@type":"TechArticle",headline:Q,description:Z,url:K},z=q.split("/").filter(Boolean),V=z.map((_,G)=>{let U=G+1,j=`${O}/${z.slice(0,U).join("/")}`;return{"@type":"ListItem",position:U,name:_.replace(/-/g," ").replace(/\b\w/g,(W)=>W.toUpperCase()),item:j}});if(V.length>0){let _={"@context":"https://schema.org","@type":"BreadcrumbList",itemListElement:V};return`<script type="application/ld+json">
|
|
8887
7767
|
${JSON.stringify(X,null,2)}
|
|
8888
7768
|
</script>
|
|
8889
7769
|
<script type="application/ld+json">
|
|
8890
7770
|
${JSON.stringify(_,null,2)}
|
|
8891
7771
|
</script>`}return`<script type="application/ld+json">
|
|
8892
7772
|
${JSON.stringify(X,null,2)}
|
|
8893
|
-
</script>`}function SZ(Q){let Z=Q.fonts;if(!Z)return{fontLinks:"",fontFaceCss:""};let $=[],
|
|
7773
|
+
</script>`}function SZ(Q){let Z=Q.fonts;if(!Z)return{fontLinks:"",fontFaceCss:""};let $=[],Y=Z.google?.filter(Boolean)??[];if(Y.length>0){if(Z.preconnect!==!1)$.push('<link rel="preconnect" href="https://fonts.googleapis.com">'),$.push('<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>');let O=Y.map((K)=>`family=${K.trim().replace(/\s+/g,"+")}`).join("&"),q=Z.display??"swap";$.push(`<link href="https://fonts.googleapis.com/css2?${O}&display=${q}" rel="stylesheet">`)}let J=(Z.faces??[]).map((O)=>O.trim()).filter(Boolean).join(`
|
|
8894
7774
|
`);return{fontLinks:$.join(`
|
|
8895
|
-
`),fontFaceCss:J}}async function
|
|
8896
|
-
`),{fontLinks:N,fontFaceCss:
|
|
8897
|
-
`),
|
|
8898
|
-
`)||"",
|
|
8899
|
-
`),L=
|
|
8900
|
-
${L}`),k=`${
|
|
7775
|
+
`),fontFaceCss:J}}async function gQ(Q,Z,$,Y="doc"){let J=Z.title||Z.themeConfig?.siteTitle||Z.markdown?.title||"BunPress Documentation",O=Z.description||Z.markdown?.meta?.description||"Documentation built with BunPress",q=Z.theme||"vitepress",K=CQ(q),X=AQ(),z=lQ.markdown?.css||"",V=Z.markdown?.css||"",_=V&&V!==z?V:"",G=yZ(Z,$),U=vZ(J,O,Z,$),j=kZ(J,O,Z),W=bZ(J,O,Z,$),E=Object.entries(Z.markdown?.meta||{}).filter(([M])=>!M.startsWith("og:")&&!M.startsWith("twitter:")&&M!=="description"&&M!=="ogImage"&&M!=="twitterCard"&&M!=="twitterSite"&&M!=="twitterImage").map(([M,k])=>`<meta name="${M}" content="${k}">`).join(`
|
|
7776
|
+
`),{fontLinks:N,fontFaceCss:F}=SZ(Z),I=[E,G,U,j,N].filter(Boolean).join(`
|
|
7777
|
+
`),A=CZ(Z),B=uZ(Z),T=Z.markdown?.scripts?.map((M)=>`<script>${M}</script>`).join(`
|
|
7778
|
+
`)||"",w=[W,A,B,T].filter(Boolean).join(`
|
|
7779
|
+
`),L=HZ(Z),b=Z.darkMode??Z.themeConfig?.darkMode??"auto",S=b===!0||b==="dark"?"dark":b===!1||b==="light"?"light":"auto",p=S==="dark"?"dark":"";if(Y==="home"){let M=await zQ(`${Q}
|
|
7780
|
+
${L}`),k=`${F}
|
|
8901
7781
|
${K}
|
|
8902
7782
|
${X}
|
|
8903
|
-
${
|
|
8904
|
-
${
|
|
8905
|
-
${_}`,
|
|
8906
|
-
${L}`),k=`${
|
|
7783
|
+
${M}
|
|
7784
|
+
${z}
|
|
7785
|
+
${_}`,C=await v("layout-home",{htmlClass:p,themeMode:S,title:J,description:O,meta:I,customCSS:k,nav:L,content:Q});return _Q(qQ(KQ(C,w)),Z)}if(Y==="page"){let M=await zQ(`${Q}
|
|
7786
|
+
${L}`),k=`${F}
|
|
8907
7787
|
${K}
|
|
8908
7788
|
${X}
|
|
8909
|
-
${
|
|
8910
|
-
${
|
|
8911
|
-
${_}`,
|
|
7789
|
+
${M}
|
|
7790
|
+
${z}
|
|
7791
|
+
${_}`,C=await v("layout-page",{htmlClass:p,themeMode:S,title:J,description:O,meta:I,customCSS:k,nav:L,content:Q});return _Q(qQ(KQ(C,w)),Z)}let H=TZ(Q),D=await DZ(H),R=await wZ(Z,$),o=await zQ(`${H}
|
|
8912
7792
|
${L}
|
|
8913
|
-
${
|
|
7793
|
+
${R}`),m=`${F}
|
|
8914
7794
|
${K}
|
|
8915
7795
|
${X}
|
|
8916
|
-
${
|
|
8917
|
-
${
|
|
8918
|
-
${_}`,
|
|
8919
|
-
catch (err){l('Outbound error',err);}});`:"",K=
|
|
7796
|
+
${o}
|
|
7797
|
+
${z}
|
|
7798
|
+
${_}`,a=await v("layout-doc",{htmlClass:p,themeMode:S,title:J,description:O,meta:I,customCSS:m,nav:L,sidebar:R,content:H,pageTOC:D});return _Q(qQ(KQ(a,w)),Z)}var s=null,hQ=!1;async function xZ(){if(hQ)return s;hQ=!0;try{s=await import("./chunk-rfaz4x5j.js")}catch{s=null}return s}async function zQ(Q){let Z=await xZ();if(!Z)return"";let Y=new Z.Scanner([]).scanContent(Q);if(Y.size===0)return"";let J=new Z.CSSGenerator(Z.defaultConfig);for(let O of Y)J.generate(O);return J.toCSS(!1,!1)}function CZ(Q){if(!Q.fathom?.enabled||!Q.fathom?.siteId)return"";let Z=Q.fathom.scriptUrl||"https://cdn.usefathom.com/script.js",$=Q.fathom.defer!==!1,Y=Q.fathom.honorDNT||!1,J=Q.fathom.auto!==!1,O=Q.fathom.canonical,q=Q.fathom.spa||!1,K=[`data-site="${Q.fathom.siteId}"`,Y?'data-honor-dnt="true"':"",!J?'data-auto="false"':"",O?`data-canonical="${O}"`:"",q?'data-spa="auto"':""].filter(Boolean).join(" ");return`<script src="${Z}" ${K}${$?" defer":""}></script>`}function uZ(Q){let Z=Q.analytics||Q.selfHostedAnalytics;if(!Z?.enabled||!Z?.siteId)return"";let $=dQ(Z.siteId),Y=Z.apiEndpoint?dQ(Z.apiEndpoint):"",J=Z.honorDNT?`var dnt=n.doNotTrack||w.doNotTrack||n.msDoNotTrack;if(dnt==="1"||dnt==="yes"||dnt===true){l('DNT enabled, skipping');return;}`:"",O=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)});}}
|
|
7799
|
+
catch (err){l('Outbound error',err);}});`:"",K=Y?` data-api="${Y}"`:"";return`<!-- ts-analytics: privacy-first analytics -->
|
|
8920
7800
|
<script data-site="${$}"${K} defer>
|
|
8921
7801
|
(function(){
|
|
8922
7802
|
'use strict';
|
|
@@ -8963,7 +7843,7 @@ send(api+'/collect',data);
|
|
|
8963
7843
|
catch(err){l('Track error',err);}
|
|
8964
7844
|
}
|
|
8965
7845
|
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});}
|
|
8966
|
-
${
|
|
7846
|
+
${O}
|
|
8967
7847
|
${q}
|
|
8968
7848
|
var hp=history.pushState;if(hp){history.pushState=function(){hp.apply(history,arguments);pv();};}
|
|
8969
7849
|
var hr=history.replaceState;if(hr){history.replaceState=function(){hr.apply(history,arguments);};}
|
|
@@ -8978,38 +7858,38 @@ l('Initialized',site);
|
|
|
8978
7858
|
}
|
|
8979
7859
|
catch(err){if(w.console)console.error('[Analytics] Init error:',err);}
|
|
8980
7860
|
})();
|
|
8981
|
-
</script>`}function
|
|
8982
|
-
`),$=/^---\n([\s\S]*?)\n---\n?/,
|
|
8983
|
-
`)}</div>`;let
|
|
7861
|
+
</script>`}function dQ(Q){return Q.replace(/&/g,"&").replace(/"/g,""").replace(/'/g,"'").replace(/</g,"<").replace(/>/g,">")}function fZ(Q){let Z=Q.replace(/\r\n/g,`
|
|
7862
|
+
`),$=/^---\n([\s\S]*?)\n---\n?/,Y=Z.match($);if(!Y)return{frontmatter:{},content:Z};let J=Y[1],O=Z.slice(Y[0].length);try{return{frontmatter:pQ.parse(J),content:O}}catch{try{let q=J.replace(/^(\s*\w+:\s*)"(.+)",\s*(.+)$/gm,`$1'"$2," $3'`);return{frontmatter:pQ.parse(q),content:O}}catch(q){return console.error("Failed to parse frontmatter YAML:",q),{frontmatter:{},content:Q}}}}async function pZ(Q){if(!Q)return"";let Z=Q.name?`<p class="BPHero-name">${Q.name}</p>`:"",$=Q.text?`<h1 class="BPHero-text">${Q.text}</h1>`:"",Y=Q.tagline?`<p class="BPHero-tagline">${Q.tagline}</p>`:"",J="";if(Q.actions)J=`<div class="BPHero-actions">${Q.actions.map((K)=>{return`<a class="${K.theme==="brand"?"BPButton BPButton-brand":"BPButton BPButton-alt"}" href="${K.link}">${K.text}</a>`}).join(`
|
|
7863
|
+
`)}</div>`;let O=Q.image?`<div class="hero-image"><img src="${Q.image}" alt="${Q.name||""}" /></div>`:"";return await v("hero",{name:Z,text:$,tagline:Y,actions:J,image:O})}var mZ={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 gZ(Q){if(Q.startsWith("<")||/\p{Emoji}/u.test(Q))return Q;return mZ[Q]||`<span class="BPFeature-icon-text">${Q.charAt(0)}</span>`}async function hZ(Q){if(!Q||Q.length===0)return"";let Z=Q.map(($)=>{let Y=$.icon?gZ($.icon):"",J=Y?`<div class="BPFeature-icon">${Y}</div>`:"",O=$.link,q=O?"a":"div",K=O?` href="${O}"`:"";return`
|
|
8984
7864
|
<${q} class="BPFeature"${K}>
|
|
8985
7865
|
${J}
|
|
8986
7866
|
<h3 class="BPFeature-title">${$.title||""}</h3>
|
|
8987
7867
|
<p class="BPFeature-details">${$.details||""}</p>
|
|
8988
|
-
</${q}>`}).join("");return await v("features",{items:Z})}function
|
|
8989
|
-
`).map((_)=>_.replace(/^>\s*/,"")).filter((_)=>_.trim()).map((_)=>`<p>${
|
|
8990
|
-
`),
|
|
8991
|
-
`),E=K.split(".").pop()||"",
|
|
8992
|
-
`),
|
|
8993
|
-
${
|
|
8994
|
-
\`\`\``;J=J.slice(0,
|
|
8995
|
-
`);if(V
|
|
8996
|
-
`),
|
|
8997
|
-
${
|
|
8998
|
-
</div>`})),G=[`<div class="code-group" id="${
|
|
7868
|
+
</${q}>`}).join("");return await v("features",{items:Z})}function sQ(Q){return Q.replace(/\*\*(.+?)\*\*/g,"<strong>$1</strong>").replace(/__(.+?)__/g,"<strong>$1</strong>").replace(/~~(.+?)~~/g,"<del>$1</del>").replace(/==(.+?)==/g,"<mark>$1</mark>").replace(/\^(.+?)\^/g,"<sup>$1</sup>").replace(/`(.+?)`/g,"<code>$1</code>").replace(/(?<!\*)\*(?!\*)(.+?)(?<!\*)\*(?!\*)/g,"<em>$1</em>").replace(/(?<!_)_(?!_)(.+?)(?<!_)_(?!_)/g,"<em>$1</em>").replace(/(?<!~)~(?!~)(.+?)(?<!~)~(?!~)/g,"<sub>$1</sub>").replace(/!\[([^\]]*)\]\(\s*([^\s")]+)(?:\s+"([^"]+)")?\)/g,(Z,$,Y,J)=>{if(J)return`<figure class="image-figure"><img src="${Y}" alt="${$}" loading="lazy" decoding="async"><figcaption>${J}</figcaption></figure>`;else return`<img src="${Y}" alt="${$}" loading="lazy" decoding="async">`}).replace(/\[(.+?)\]\((.+?)\)/g,'<a href="$2">$1</a>')}function dZ(Q){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 Q.replace(/:(\w+):/g,($,Y)=>{return Z[Y]||$})}function cZ(Q){let Z=/<Badge([^/>]+)\/>/gi;return Q.replace(Z,($,Y)=>{let J=Y.match(/type="(info|tip|warning|danger)"/i),O=Y.match(/text="([^"]+)"/),q=J?J[1].toLowerCase():"info",K=O?O[1]:"";return`<span class="badge badge-${q}">${K}</span>`})}function lZ(Q){return Q.replace(/<a\s+href="([^"]+)"([^>]*)>/g,(Z,$,Y)=>{if(Y.includes("target="))return Z;if($.startsWith("http://")||$.startsWith("https://"))return`<a href="${$}" target="_blank" rel="noreferrer noopener"${Y}>`;return Z})}function rZ(Q){return Q.replace(/<a\s+href="([^"]+)"\s+target="_blank"[^>]*>[\s\S]+?<\/a>/g,(Z,$)=>{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 sZ(Q){return Q.replace(/<img([^>]+)>/g,(Z,$)=>{if($.includes("loading="))return Z;return`<img ${$} loading="lazy" decoding="async">`})}function iZ(Q,Z){if(!Q.includes("[[toc]]"))return{content:Q,tocHtml:null};let $=YQ(Q),Y={...$Q,...Z},J=XQ($,Y),q={items:OQ(J),title:Y.title||"Table of Contents",config:Y},K=r(q),X="<!--INLINE_TOC_PLACEHOLDER-->";return{content:Q.replace(/\[\[toc\]\]/g,X),tocHtml:K}}function oZ(Q,Z){return Q.replace(/<!--INLINE_TOC_PLACEHOLDER-->/g,Z)}async function aZ(Q){let Z=/^>\s*\[!(NOTE|TIP|IMPORTANT|WARNING|CAUTION)\]\s*\n((?:>\s*.*\n?)*)/gm,$=Array.from(Q.matchAll(Z)),Y=Q;for(let J of $.reverse()){let[O,q,K]=J,X=K.split(`
|
|
7869
|
+
`).map((_)=>_.replace(/^>\s*/,"")).filter((_)=>_.trim()).map((_)=>`<p>${sQ(_)}</p>`).join(`
|
|
7870
|
+
`),z=q.toLowerCase(),V=await v(`blocks/alerts/${z}`,{content:X});Y=Y.slice(0,J.index)+V+Y.slice(J.index+O.length)}return Y}async function nZ(Q,Z){let $=/^<<<\s+@\/([^\s[{#]+)(?:\{(\d+)-(\d+)\}|#(\w+))?\s*(?:\[[^\]]+\]\s*)?$/gm,Y=Array.from(Q.matchAll($)),J=Q;for(let O of Y.reverse()){let[q,K,X,z,V]=O;try{let{join:_}=await import("path"),G=_(Z,K),U=Bun.file(G);if(!await U.exists()){console.warn(`Code import: File not found: ${G}`);continue}let W=(await U.text()).split(`
|
|
7871
|
+
`),E=K.split(".").pop()||"",F={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"}[E]||E;if(X&&z){let B=Number.parseInt(X)-1,T=Number.parseInt(z);W=W.slice(B,T)}else if(V){let B=W.findIndex((w)=>w.includes(`#region ${V}`)||w.includes(`// region ${V}`)||w.includes(`# region ${V}`)),T=W.findIndex((w,L)=>L>B&&(w.includes("#endregion")||w.includes("// endregion")||w.includes("# endregion")));if(B!==-1&&T!==-1)W=W.slice(B+1,T);else console.warn(`Code import: Region '${V}' not found in ${K}`)}let I=W.join(`
|
|
7872
|
+
`),A=`\`\`\`${F}
|
|
7873
|
+
${I}
|
|
7874
|
+
\`\`\``;J=J.slice(0,O.index)+A+J.slice(O.index+q.length)}catch(_){console.error(`Error importing code from ${K}:`,_)}}return J}async function iQ(Q,Z,$=new Set){let Y=/<!--@include:\s*([^\s{]+)(?:\{(\d+)-(\d+)\}|\{#([\w-]+)\})?\s*-->/g,J=Array.from(Q.matchAll(Y)),O=Q;for(let q of J.reverse()){let[K,X,z,V,_]=q;try{let{join:G,resolve:U}=await import("path"),j=U(G(Z,X));if($.has(j)){console.warn(`Markdown include: Circular reference detected for ${X}`);continue}let W=Bun.file(j);if(!await W.exists()){console.warn(`Markdown include: File not found: ${j}`);continue}let N=(await W.text()).split(`
|
|
7875
|
+
`);if(z&&V){let A=Number.parseInt(z)-1,B=Number.parseInt(V);N=N.slice(A,B)}else if(_){let A=N.findIndex((T)=>T.includes(`<!-- #region ${_} -->`)||T.includes(`<!-- region ${_} -->`)),B=N.findIndex((T,w)=>w>A&&(T.includes("<!-- #endregion -->")||T.includes("<!-- endregion -->")));if(A!==-1&&B!==-1)N=N.slice(A+1,B);else{console.warn(`Markdown include: Region '${_}' not found in ${X}`);continue}}let F=N.join(`
|
|
7876
|
+
`),I=new Set($);I.add(j),F=await iQ(F,Z,I),O=O.slice(0,q.index)+F+O.slice(q.index+K.length)}catch(G){console.error(`Error including markdown from ${X}:`,G)}}return O}async function tZ(Q){let Z=/^:::\s+code-group[ \t]*\n((?:(?!^:::)[\s\S])*)^:::$/gm,$=Array.from(Q.matchAll(Z)),Y=Q;for(let J of $.reverse()){let[O,q]=J,K=/^```(\w+)[ \t]+\[([^\]]+)\][ \t]*\n((?:(?!^```)[\s\S])*)^```$/gm,X=Array.from(q.matchAll(K));if(X.length===0)continue;let z=`code-group-${Math.random().toString(36).substr(2,9)}`,V=X.map((U,j)=>{let W=U[2];return`<button class="code-group-tab${j===0?" active":""}" onclick="switchCodeTab('${z}', ${j})">${W}</button>`}).join(""),_=await Promise.all(X.map(async(U,j)=>{let W=U[1],E=U[3],N=j===0,F=P.markdown?.syntaxHighlightTheme||"github-light",I=await t(E,W,F),A=`<pre data-lang="${W}"><code class="language-${W}">${I}</code></pre>`;return`<div class="code-group-panel${N?" active":""}" data-panel="${j}">
|
|
7877
|
+
${A}
|
|
7878
|
+
</div>`})),G=[`<div class="code-group" id="${z}">`,' <div class="code-group-tabs">',` ${V}`," </div>",' <div class="code-group-panels">',` ${_.join(`
|
|
8999
7879
|
`)}`," </div>","</div>"].join(`
|
|
9000
|
-
`);
|
|
9001
|
-
`).filter((U)=>U.trim()).map((U)=>`<p>${
|
|
9002
|
-
`),G=await v(`blocks/containers/${q}`,{title:
|
|
9003
|
-
`),
|
|
9004
|
-
`).map((H,D)=>{let R=D+1,
|
|
9005
|
-
`),L=[];if(
|
|
9006
|
-
`),
|
|
7880
|
+
`);Y=Y.slice(0,J.index)+G+Y.slice(J.index+O.length)}return Y}async function eZ(Q){let Z=/^:::\s+(info|tip|warning|danger|details|raw)(?: +([^\n\t ][^\n]*))?\n((?:(?!^:::)[\s\S])*)^:::$/gm,$=Array.from(Q.matchAll(Z)),Y=Q;for(let J of $.reverse()){let[O,q,K,X]=J,z={info:"INFO",tip:"TIP",warning:"WARNING",danger:"DANGER",details:"Details",raw:""},V=K&&K.trim()||z[q],_=X.trim().split(`
|
|
7881
|
+
`).filter((U)=>U.trim()).map((U)=>`<p>${sQ(U)}</p>`).join(`
|
|
7882
|
+
`),G=await v(`blocks/containers/${q}`,{title:V,content:_});Y=Y.slice(0,J.index)+G+Y.slice(J.index+O.length)}return Y}function Q0(Q){let Z=Q.match(/^(\w+)/),$=Z?Z[1]:"",Y=Q.match(/\{([^}]+)\}/),J=[];if(Y){let q=Y[1].split(",");for(let K of q){let X=K.trim();if(X.includes("-")){let[z,V]=X.split("-").map(Number);for(let _=z;_<=V;_++)J.push(_)}else J.push(Number(X))}}let O=Q.includes(":line-numbers");return{lang:$,highlights:J,showLineNumbers:O}}async function Z0(Q,Z){let $=Q[Z],Y=$.match(/^(`{3,})/),J=Y?Y[1].length:3,O="`".repeat(J),q=$.substring(J).trim(),{lang:K,highlights:X,showLineNumbers:z}=Q0(q),V=[],_=Z+1;while(_<Q.length){let H=Q[_];if(H.match(new RegExp(`^\`{${J},}\\s*$`)))break;V.push(H),_++}let G=new Set,U=new Set,j=new Set,W=new Set,E=new Set,N=V.map((H,D)=>{let R=H;if(R.includes("// [!code focus]"))G.add(D),R=R.replace(/\/\/ \[!code focus\]/,"").trimEnd();if(R.includes("// [!code ++]"))U.add(D),R=R.replace(/\/\/ \[!code \+\+\]/,"").trimEnd();if(R.includes("// [!code --]"))j.add(D),R=R.replace(/\/\/ \[!code --\]/,"").trimEnd();if(R.includes("// [!code error]"))W.add(D),R=R.replace(/\/\/ \[!code error\]/,"").trimEnd();if(R.includes("// [!code warning]"))E.add(D),R=R.replace(/\/\/ \[!code warning\]/,"").trimEnd();return R}),F=G.size>0,I=N.join(`
|
|
7883
|
+
`),A=P.markdown?.syntaxHighlightTheme||"github-light",w=(await t(I,K,A)).split(`
|
|
7884
|
+
`).map((H,D)=>{let R=D+1,o=X.includes(R),m=G.has(D),a=U.has(D),M=j.has(D),k=W.has(D),C=E.has(D),y=["line"];if(o)y.push("highlighted");if(m)y.push("focused");if(F&&!m)y.push("dimmed");if(a)y.push("diff-add");if(M)y.push("diff-remove");if(k)y.push("has-error");if(C)y.push("has-warning");if(H.startsWith('<span class="line">')){let oQ=y.join(" "),GQ=H.replace('<span class="line">',`<span class="${oQ}">`);if(z)return`<span class="${y.join(" ")}"><span class="line-number">${R}</span>${GQ.replace(/^<span class="[^"]*">/,"").replace(/<\/span>$/,"")}</span>`;return GQ}let WQ=y.length>0?` class="${y.join(" ")}"`:"";if(z)return`<span${WQ}><span class="line-number">${R}</span>${H}</span>`;return`<span${WQ}>${H}</span>`}).join(`
|
|
7885
|
+
`),L=[];if(z)L.push("line-numbers-mode");if(F)L.push("has-focused-lines");let b=L.length>0?` class="${L.join(" ")}"`:"",S=K?` data-lang="${K}"`:"";return{html:`<pre${b}${S}><code class="language-${K}">${w}</code></pre>`,endIndex:_}}function $0(Q){let Z=new Map;return{content:Q.replace(/^(#{1,6})\s+(.*?)\s*\{#([\w-]+)\}\s*$/gm,(Y,J,O,q)=>{let K=O.trim().replace(/`([^`]+)`/g,"$1").replace(/\*\*(.+?)\*\*/g,"$1").replace(/__(.+?)__/g,"$1").replace(/\*(.+?)\*/g,"$1").replace(/_(.+?)_/g,"$1").replace(/~~(.+?)~~/g,"$1").trim();return Z.set(K,q),`${J} ${O.trim()}`}),customAnchors:Z}}async function J0(Q,Z){let $=Q.split(`
|
|
7886
|
+
`),Y=[],J=0,O=0;while(J<$.length){let q=$[J];if(q.match(/^`{3,}/)){let{html:K,endIndex:X}=await Z0($,J),z=`<!--BUNPRESS_CODE_${O++}-->`;Z.set(z,K),Y.push(""),Y.push(z),Y.push(""),J=X+1}else Y.push(q),J++}return Y.join(`
|
|
9007
7887
|
`)}function Y0(Q){return Q=Q.replace(/==(.+?)==/g,"<mark>$1</mark>"),Q=Q.replace(/\^(.+?)\^/g,"<sup>$1</sup>"),Q=Q.replace(/(?<!~)~(?!~)(.+?)(?<!~)~(?!~)/g,"<sub>$1</sub>"),Q}function O0(Q){return Q=Q.replace(/<table>/g,`<div class="table-responsive">
|
|
9008
7888
|
<table class="enhanced-table">`),Q=Q.replace(/<\/table>/g,`</table>
|
|
9009
|
-
</div>`),Q=Q.replace(/<(th|td) align="(left|center|right)">/g,(Z,$,
|
|
9010
|
-
\uD83D\uDCDA BunPress documentation server running at ${
|
|
9011
|
-
`);return{server:J,url:
|
|
9012
|
-
`);try{let J=new Map,
|
|
9013
|
-
Shutting down server...`),Z(),
|
|
9014
|
-
Shutting down server...`),Z(),
|
|
9015
|
-
export{
|
|
7889
|
+
</div>`),Q=Q.replace(/<(th|td) align="(left|center|right)">/g,(Z,$,Y)=>{return`<${$} style="text-align: ${Y}">`}),Q=Q.replace(/<(th|td)>/g,(Z,$)=>{return`<${$} style="text-align: left">`}),Q}function X0(Q,Z){let $=new Set;return Q.replace(/<h([1-6])([^>]*)>([\s\S]*?)<\/h\1>/g,(Y,J,O,q)=>{if(O.includes(" id="))return Y;let K=q.replace(/<[^>]+>/g,"").trim(),X=Z.get(K);if(!X)X=JQ(K);if($.has(X)){let z=1;while($.has(`${X}-${z}`))z++;X=`${X}-${z}`}return $.add(X),`<h${J} id="${X}"${O}>${q}</h${J}>`})}async function q0(Q,Z="./docs"){let{frontmatter:$,content:Y}=fZ(Q);if($.layout==="home"){let O=await pZ($.hero),q=await hZ($.features),K=Y.trim()?await cQ(Y,$,Z):"",X=K?`<div class="BPHome-content"><div class="bp-doc vp-doc container">${K}</div></div>`:"";return{html:O+q+X,frontmatter:$}}return{html:await cQ(Y,$,Z),frontmatter:$}}async function cQ(Q,Z,$){let Y=P.markdown?.features,J=(E)=>{if(!Y)return!0;let N=Y[E];return N===void 0||N===!0||typeof N==="object"&&N!==null},O=J("includes")?await iQ(Q,$):Q,q={...Z,data:await jQ($),site:{title:P.title||P.markdown?.title||"",description:P.description||P.markdown?.meta?.description||"",themeConfig:P.themeConfig}},K=P.componentsDir?i(f.cwd(),P.componentsDir):i($,".components");O=await QQ(O,K,q);let X=O.replace(/```[\s\S]*?```/g,"");if(X.includes("@if")||X.includes("@foreach")||X.includes("@for (")||X.includes("<script server")||X.includes("@include")||/\{\{(?!\{)\s*\w/.test(X))try{O=await(await import("@stacksjs/stx")).renderString(O,q)}catch{}let{content:V,tocHtml:_}=J("inlineToc")?iZ(O,Z.toc):{content:O,tocHtml:""};O=J("codeImports")?await nZ(V,$):V,O=J("codeGroups")?await tZ(O):O,O=J("githubAlerts")?await aZ(O):O,O=J("containers")?await eZ(O):O,O=J("emoji")?dZ(O):O,O=J("badges")?cZ(O):O;let{content:G,customAnchors:U}=J("customAnchors")?$0(O):{content:O,customAnchors:new Map};O=G;let j=new Map;O=J("codeBlocks")?await J0(O,j):O;let W=Bun.markdown.html(O,{tables:!0,strikethrough:!0,tasklists:!0,autolinks:!0});for(let[E,N]of j)W=W.replace(`<p>${E}</p>`,N),W=W.replace(E,N);if(J("inlineFormatting"))W=Y0(W);if(J("tables"))W=O0(W);if(W=X0(W,U),_)W=oZ(W,_);if(J("externalLinks"))W=lZ(W),W=rZ(W);if(J("imageLazyLoading"))W=sZ(W);return W}async function K0(Q={}){let Z=Q.config||P,$=Q.port??3000,Y=Q.root||"./docs",J=Bun.serve({port:$,async fetch(K){let X=new URL(K.url),z=PZ(Z,X.pathname);if(z==="/")z="/index";if([".png",".jpg",".jpeg",".gif",".svg",".css",".js",".ico",".woff",".woff2",".ttf"].some((G)=>z.endsWith(G)))try{let G=`${Y}/public${z}`,U=Bun.file(G);if(await U.exists())return new Response(U);let j=`${Y}${z}`,W=Bun.file(j);if(await W.exists())return new Response(W)}catch{}let _=`${Y}${z}.md`;try{let G=Bun.file(_);if(await G.exists()){let U=await G.text(),{html:j,frontmatter:W}=await q0(U,Y),E=W.layout||"doc",N=await gQ(j,Z,z,E);return new Response(N,{headers:{"Content-Type":"text/html; charset=utf-8"}})}}catch{}return new Response(await gQ("<h1>404 - Page Not Found</h1><p>The page you are looking for does not exist.</p>",Z,z),{status:404,headers:{"Content-Type":"text/html; charset=utf-8"}})}}),O=`http://localhost:${J.port}`,q=()=>J.stop();if(!Q.quiet)console.log(`
|
|
7890
|
+
\uD83D\uDCDA BunPress documentation server running at ${O}`),console.log(`Press Ctrl+C to stop
|
|
7891
|
+
`);return{server:J,url:O,stop:q}}async function l0(Q={}){let{stop:Z}=await K0(Q),$=Q.watch!==void 0?Q.watch:!0,Y=Q.root||"./docs";if($){console.log(`Watching for changes in ${Y} directory...
|
|
7892
|
+
`);try{let J=new Map,O=new fQ("**/*.{md,stx,ts,js,css,html}");for await(let X of O.scan(Y))try{let z=i(Y,X),V=await mQ(z);J.set(X,V.mtimeMs)}catch{}let q=null,K=()=>{if(q)clearTimeout(q);q=setTimeout(async()=>{console.log("File changed detected, reloading..."),TQ(),MQ(),NQ(),console.log("Ready for requests")},100)};setInterval(async()=>{try{let X=!1,z=new Set,V=new fQ("**/*.{md,stx,ts,js,css,html}");for await(let _ of V.scan(Y)){z.add(_);try{let G=i(Y,_),U=await mQ(G),j=J.get(_);if(j===void 0||U.mtimeMs>j)X=!0,J.set(_,U.mtimeMs)}catch{}}for(let _ of J.keys())if(!z.has(_))X=!0,J.delete(_);if(X)K()}catch{}},1000)}catch(J){console.error("Error setting up file watcher:",J)}}f.on("SIGINT",()=>{console.log(`
|
|
7893
|
+
Shutting down server...`),Z(),f.exit(0)}),f.on("SIGTERM",()=>{console.log(`
|
|
7894
|
+
Shutting down server...`),Z(),f.exit(0)}),await new Promise(()=>{})}
|
|
7895
|
+
export{G0 as a,n as b,RQ as c,t as d,U0 as e,AQ as f,j0 as g,N0 as h,$Q as i,JQ as j,uQ as k,YQ as l,OQ as m,XQ as n,l as o,r as p,FZ as q,MZ as r,IZ as s,H0 as t,P0 as u,y0 as v,v0 as w,k0 as x,rQ as y,PZ as z,gQ as A,q0 as B,K0 as C,l0 as D};
|