boltdocs 3.0.2 → 3.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -18
- package/dist/{adapters-DEXNIv3x.mjs → adapters-ByYY44Zy.mjs} +1 -1
- package/dist/{adapters-C5AWWGfb.cjs → adapters-DvmtpdSF.cjs} +1 -1
- package/dist/{banner-CfdalYLL.d.ts → banner-BMop1KLF.d.ts} +2 -2
- package/dist/{banner-DNSkgUsO.d.cts → banner-CVD0GugR.d.cts} +2 -2
- package/dist/cache-CO4Dy2uQ.cjs +6 -0
- package/dist/cache-Dk53iOo6.mjs +6 -0
- package/dist/chunk-BFSpntXv.mjs +6 -0
- package/dist/{chunk-Ds5LZdWN.cjs → chunk-D1Md3oWO.cjs} +1 -1
- package/dist/client/index.cjs +433 -272
- package/dist/client/index.d.cts +129 -18
- package/dist/client/index.d.ts +129 -18
- package/dist/client/index.js +337 -178
- package/dist/client/mdx.cjs +1 -1
- package/dist/client/mdx.d.cts +1 -1
- package/dist/client/mdx.d.ts +1 -1
- package/dist/client/mdx.js +1 -1
- package/dist/client/primitives.cjs +7 -7
- package/dist/client/primitives.d.cts +5 -22
- package/dist/client/primitives.d.ts +5 -22
- package/dist/client/primitives.js +4 -4
- package/dist/client/theme/neutral.css +1 -3
- package/dist/client/theme/reset.css +31 -4
- package/dist/config-BpzaPsJj.d.cts +781 -0
- package/dist/config-CCXp3aXO.mjs +7 -0
- package/dist/{config-JGkMJoJQ.cjs → config-CMd4XoFq.cjs} +1 -1
- package/dist/config-DlGoEM9D.cjs +7 -0
- package/dist/config-xtS0ZkMm.d.mts +781 -0
- package/dist/{csp-CBysWlAf.cjs → csp-CRp_3U7a.cjs} +1 -1
- package/dist/csp-oTC2ygvF.mjs +6 -0
- package/dist/{docs-layout-6FQ8__ok.js → docs-layout-BdtZ9z6s.js} +9 -28
- package/dist/{docs-layout-3TpAt6MB.cjs → docs-layout-CFWI15Id.cjs} +69 -88
- package/dist/{doctor-BR1B2Mkz.cjs → doctor-BBtmNJE0.cjs} +1 -1
- package/dist/doctor-Bv16QSrI.cjs +7 -0
- package/dist/doctor-DOAbSaiL.mjs +7 -0
- package/dist/{generator-DtUU3Cfk.cjs → generator-COepVWGi.cjs} +1 -1
- package/dist/{handler-Btd4t_67.mjs → handler-DzQae4eA.mjs} +1 -1
- package/dist/{handler-Dzf4dSnV.cjs → handler-XX7cLTqe.cjs} +1 -1
- package/dist/headers-Ddwek8K7.mjs +6 -0
- package/dist/{headers-BXKxiPUv.cjs → headers-dg4SDrjY.cjs} +1 -1
- package/dist/{image-C9md50h2.js → image-Bz87fCla.js} +2 -2
- package/dist/{image-CR6UlaI5.cjs → image-C4TlpMHn.cjs} +18 -18
- package/dist/link-2PzgTnaP.js +673 -0
- package/dist/{icons-dev-BryEFkJu.cjs → link-D1Gjkb-2.cjs} +8 -353
- package/dist/{mdx-DhyMkc35.js → mdx-BuO6a1f7.js} +199 -40
- package/dist/{mdx-DJBg5DuL.cjs → mdx-CD-tSjRG.cjs} +237 -72
- package/dist/{meta-loader-C9MKjAs0.cjs → meta-loader-Dq1zcFnh.cjs} +1 -1
- package/dist/node/cache.cjs +6 -0
- package/dist/node/cache.d.cts +84 -0
- package/dist/node/cache.d.mts +84 -0
- package/dist/node/cache.mjs +6 -0
- package/dist/node/cli-entry.cjs +6 -6
- package/dist/node/cli-entry.mjs +9 -9
- package/dist/node/index.cjs +1 -1
- package/dist/node/index.d.cts +27 -638
- package/dist/node/index.d.mts +27 -640
- package/dist/node/index.mjs +1 -1
- package/dist/node/mdx/shiki-adapter.cjs +6 -0
- package/dist/node/mdx/shiki-adapter.d.cts +51 -0
- package/dist/node/mdx/shiki-adapter.d.mts +51 -0
- package/dist/node/mdx/shiki-adapter.mjs +6 -0
- package/dist/node-BXtqM1uH.mjs +6 -0
- package/dist/node-BlVk4EVg.cjs +104 -0
- package/dist/node-DOf4zhWc.mjs +104 -0
- package/dist/node-aD1eisrR.cjs +6 -0
- package/dist/{package-CEDhVAfO.cjs → package-BcISI5-P.cjs} +1 -1
- package/dist/{package-_dCCKVvG.mjs → package-CCYEAYeA.mjs} +1 -1
- package/dist/{pages-external-CX2uyW95.cjs → pages-external-XkYIs-d5.cjs} +1 -1
- package/dist/parser-DCiEWkSk.cjs +8 -0
- package/dist/parser-qk9FIHJ7.mjs +8 -0
- package/dist/plugin-C95kvu6h.mjs +73 -0
- package/dist/plugin-DM3u2bVj.cjs +73 -0
- package/dist/routes-BW6zsk7Z.mjs +6 -0
- package/dist/routes-BgoIB5wb.cjs +6 -0
- package/dist/{routes-BajCwrvX.cjs → routes-CORVxc02.cjs} +1 -1
- package/dist/{search-dialog-D4rplZMv.cjs → search-dialog-B1NERUNx.cjs} +101 -55
- package/dist/{search-dialog-Cx7aGW3U.cjs → search-dialog-BRFno7HD.cjs} +8 -8
- package/dist/{search-dialog-DDopgbKM.js → search-dialog-BmxHiKwt.js} +2 -2
- package/dist/{search-dialog-BNdRV60O.js → search-dialog-D6TvjcuV.js} +1 -1
- package/dist/{search-dialog-DaeSPvEo.js → search-dialog-DFnlx8LO.js} +44 -4
- package/dist/{search-dialog-CW1f6dn6.cjs → search-dialog-DHqwjJuG.cjs} +1 -1
- package/dist/server/index.cjs +1 -1
- package/dist/server/index.d.mts +1 -1
- package/dist/server/index.mjs +1 -1
- package/dist/shiki-adapter-CoQ6jyJ4.cjs +6 -0
- package/dist/shiki-adapter-D-aKw7PP.mjs +6 -0
- package/dist/sidebar-COTaMHR-.d.ts +1100 -0
- package/dist/sidebar-CrEdJuHX.d.cts +1100 -0
- package/dist/{types-generator-CYcHkDzZ.cjs → types-generator-BXhv7Ill.cjs} +1 -1
- package/dist/types-generator-bDPvUztF.mjs +26 -0
- package/dist/utils-Crm9oPcV.mjs +7 -0
- package/dist/utils-D6Xtj0FZ.cjs +7 -0
- package/package.json +26 -12
- package/src/shared/types.ts +532 -23
- package/dist/cache-DETwlACe.cjs +0 -6
- package/dist/cache-SF59enb3.mjs +0 -6
- package/dist/config-B5uVv5q4.cjs +0 -7
- package/dist/config-D3_zDkHh.mjs +0 -7
- package/dist/csp-gaZ51xzq.mjs +0 -6
- package/dist/doctor-3MheVMwd.mjs +0 -7
- package/dist/doctor-DQxLM202.cjs +0 -7
- package/dist/headers-CXyf0auY.mjs +0 -6
- package/dist/icons-dev-kJyGWNeg.js +0 -916
- package/dist/node-B9JSyEIU.mjs +0 -105
- package/dist/node-Cedquois.cjs +0 -105
- package/dist/parser-CNIPHx4s.cjs +0 -8
- package/dist/parser-D0QHIQsi.mjs +0 -8
- package/dist/plugin-WYNORxp1.cjs +0 -68
- package/dist/plugin-YWNVRpws.mjs +0 -68
- package/dist/rolldown-runtime-fkIsjY3S.mjs +0 -6
- package/dist/routes-CyrnmVuG.mjs +0 -6
- package/dist/routes-D6Tuu7Fs.cjs +0 -6
- package/dist/shiki-adapter-CGTmrR6S.cjs +0 -6
- package/dist/shiki-adapter-CXEGRnjr.mjs +0 -6
- package/dist/shiki-adapter-Mr8_oT_9.cjs +0 -6
- package/dist/sidebar-7gIifpBX.d.cts +0 -615
- package/dist/sidebar-BAKgJ-Er.d.ts +0 -615
- package/dist/types-generator-DVOnRVKU.mjs +0 -26
- package/dist/utils-B3xYMrpK.mjs +0 -7
- package/dist/utils-Bz1tG9Dg.cjs +0 -7
- /package/dist/{errors-C0Hx15Ag.mjs → errors-0zGHRLue.mjs} +0 -0
- /package/dist/{errors-Dx6JHoKE.cjs → errors-vKw8CkiX.cjs} +0 -0
- /package/dist/{index-CdJv4ocW.d.mts → index-1KsTDq4o.d.mts} +0 -0
|
@@ -1,615 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
import * as React$2 from "react";
|
|
3
|
-
import { ComponentType, ReactNode } from "react";
|
|
4
|
-
import * as _$react_jsx_runtime0 from "react/jsx-runtime";
|
|
5
|
-
import { Plugin } from "vite";
|
|
6
|
-
|
|
7
|
-
//#region src/shared/types.d.ts
|
|
8
|
-
/**
|
|
9
|
-
* Represents a single social link in the configuration.
|
|
10
|
-
*/
|
|
11
|
-
interface BoltdocsSocialLink {
|
|
12
|
-
icon: 'discord' | 'x' | 'github' | 'bluesky' | string;
|
|
13
|
-
link: string;
|
|
14
|
-
}
|
|
15
|
-
/**
|
|
16
|
-
* Configuration for the site footer.
|
|
17
|
-
*/
|
|
18
|
-
interface BoltdocsFooterConfig {
|
|
19
|
-
text?: string;
|
|
20
|
-
}
|
|
21
|
-
/**
|
|
22
|
-
* Theme-specific configuration options.
|
|
23
|
-
*/
|
|
24
|
-
interface BoltdocsThemeConfig {
|
|
25
|
-
title?: string | Record<string, string>;
|
|
26
|
-
description?: string | Record<string, string>;
|
|
27
|
-
logo?: string | {
|
|
28
|
-
dark: string;
|
|
29
|
-
light: string;
|
|
30
|
-
alt?: string;
|
|
31
|
-
width?: number;
|
|
32
|
-
height?: number;
|
|
33
|
-
};
|
|
34
|
-
navbar?: Array<{
|
|
35
|
-
label: string | Record<string, string>;
|
|
36
|
-
href: BoltdocsRoutePathWithFallback$1;
|
|
37
|
-
items?: Array<{
|
|
38
|
-
label: string | Record<string, string>;
|
|
39
|
-
href: BoltdocsRoutePathWithFallback$1;
|
|
40
|
-
}>;
|
|
41
|
-
}>;
|
|
42
|
-
sidebar?: Record<string, Array<{
|
|
43
|
-
text: string;
|
|
44
|
-
link: BoltdocsRoutePathWithFallback$1;
|
|
45
|
-
}>>;
|
|
46
|
-
sidebarGroups?: Record<string, {
|
|
47
|
-
title?: string | Record<string, string>;
|
|
48
|
-
icon?: string;
|
|
49
|
-
}>;
|
|
50
|
-
socialLinks?: BoltdocsSocialLink[];
|
|
51
|
-
footer?: BoltdocsFooterConfig;
|
|
52
|
-
editLink?: string;
|
|
53
|
-
communityHelp?: string;
|
|
54
|
-
version?: string;
|
|
55
|
-
githubRepo?: string;
|
|
56
|
-
favicon?: string;
|
|
57
|
-
tabs?: Array<{
|
|
58
|
-
id: string;
|
|
59
|
-
text: string | Record<string, string>;
|
|
60
|
-
icon?: string;
|
|
61
|
-
}>;
|
|
62
|
-
codeTheme?: ShikiTheme | {
|
|
63
|
-
light: ShikiTheme;
|
|
64
|
-
dark: ShikiTheme;
|
|
65
|
-
};
|
|
66
|
-
}
|
|
67
|
-
/**
|
|
68
|
-
* List of supported syntax highlighting themes.
|
|
69
|
-
*/
|
|
70
|
-
type ShikiTheme = 'github-dark' | 'github-light' | 'tokyo-night' | 'dracula' | 'nord' | 'one-dark-pro' | 'one-light';
|
|
71
|
-
/**
|
|
72
|
-
* Configuration for the robots.txt file.
|
|
73
|
-
*/
|
|
74
|
-
type BoltdocsRobotsConfig = string | {
|
|
75
|
-
rules?: Array<{
|
|
76
|
-
userAgent: string;
|
|
77
|
-
allow?: string | string[];
|
|
78
|
-
disallow?: string | string[];
|
|
79
|
-
}>;
|
|
80
|
-
sitemaps?: string[];
|
|
81
|
-
};
|
|
82
|
-
/**
|
|
83
|
-
* Configuration for a specific locale.
|
|
84
|
-
*/
|
|
85
|
-
interface BoltdocsLocaleConfig {
|
|
86
|
-
label?: string;
|
|
87
|
-
direction?: 'ltr' | 'rtl';
|
|
88
|
-
htmlLang?: string;
|
|
89
|
-
calendar?: string;
|
|
90
|
-
}
|
|
91
|
-
/**
|
|
92
|
-
* Configuration for internationalization (i18n).
|
|
93
|
-
*/
|
|
94
|
-
interface BoltdocsI18nConfig {
|
|
95
|
-
defaultLocale: string;
|
|
96
|
-
locales: string[] | Record<string, string>;
|
|
97
|
-
localeConfigs?: Record<string, BoltdocsLocaleConfig>;
|
|
98
|
-
}
|
|
99
|
-
/**
|
|
100
|
-
* Configuration for a specific documentation version.
|
|
101
|
-
*/
|
|
102
|
-
interface BoltdocsVersionConfig {
|
|
103
|
-
label: string;
|
|
104
|
-
path: string;
|
|
105
|
-
}
|
|
106
|
-
/**
|
|
107
|
-
* Configuration for documentation versioning.
|
|
108
|
-
*/
|
|
109
|
-
interface BoltdocsVersionsConfig {
|
|
110
|
-
defaultVersion: string;
|
|
111
|
-
prefix?: string;
|
|
112
|
-
versions: BoltdocsVersionConfig[];
|
|
113
|
-
}
|
|
114
|
-
/**
|
|
115
|
-
* Shared badge value type used in frontmatter, RouteMeta, and ComponentRoute.
|
|
116
|
-
*/
|
|
117
|
-
type BadgeValue = string | {
|
|
118
|
-
text: string;
|
|
119
|
-
expires?: string;
|
|
120
|
-
};
|
|
121
|
-
/**
|
|
122
|
-
* Defines a Boltdocs plugin.
|
|
123
|
-
*
|
|
124
|
-
* Use the `createPlugin()` helper from the node API for full type safety and
|
|
125
|
-
* access to lifecycle hooks.
|
|
126
|
-
*/
|
|
127
|
-
interface BoltdocsPlugin {
|
|
128
|
-
name: string;
|
|
129
|
-
enforce?: 'pre' | 'post';
|
|
130
|
-
version?: string;
|
|
131
|
-
boltdocsVersion?: string;
|
|
132
|
-
remarkPlugins?: unknown[];
|
|
133
|
-
rehypePlugins?: unknown[];
|
|
134
|
-
vitePlugins?: Plugin[];
|
|
135
|
-
components?: Record<string, string>;
|
|
136
|
-
/** Lifecycle hooks — use the `PluginLifecycleHooks` type from the node API. */
|
|
137
|
-
hooks?: Record<string, (ctx: unknown) => Promise<void> | void>;
|
|
138
|
-
}
|
|
139
|
-
/**
|
|
140
|
-
* Configuration for the collections (blog) feature.
|
|
141
|
-
*/
|
|
142
|
-
interface BoltdocsCollectionsConfig {
|
|
143
|
-
/** Number of posts per page in collection listing pages. Defaults to 10. */
|
|
144
|
-
postsPerPage?: number;
|
|
145
|
-
/** The name of the default collection used by BlogList when none is specified. */
|
|
146
|
-
defaultCollection?: string;
|
|
147
|
-
/** Date format string for rendering post dates (e.g., 'MMMM dd, yyyy'). */
|
|
148
|
-
dateFormat?: string;
|
|
149
|
-
/** Field to sort posts by. Defaults to 'date'. */
|
|
150
|
-
sortBy?: 'date' | 'title' | 'sidebarPosition';
|
|
151
|
-
}
|
|
152
|
-
interface BoltdocsSecurityConfig {
|
|
153
|
-
headers?: Record<string, string>;
|
|
154
|
-
enableCSP?: boolean;
|
|
155
|
-
customHeaders?: Record<string, string>;
|
|
156
|
-
}
|
|
157
|
-
interface BoltdocsVerificationConfig {
|
|
158
|
-
google?: string;
|
|
159
|
-
bing?: string;
|
|
160
|
-
yandex?: string;
|
|
161
|
-
pinterest?: string;
|
|
162
|
-
facebook?: string;
|
|
163
|
-
}
|
|
164
|
-
/**
|
|
165
|
-
* Configuration for SEO.
|
|
166
|
-
*/
|
|
167
|
-
interface BoltdocsSeoConfig {
|
|
168
|
-
metatags?: Record<string, string>;
|
|
169
|
-
indexing?: 'all' | 'public';
|
|
170
|
-
thumbnails?: {
|
|
171
|
-
background?: string;
|
|
172
|
-
};
|
|
173
|
-
verification?: BoltdocsVerificationConfig;
|
|
174
|
-
}
|
|
175
|
-
/**
|
|
176
|
-
* Configuration for Google Analytics 4 (GA4).
|
|
177
|
-
*/
|
|
178
|
-
interface BoltdocsGA4Config {
|
|
179
|
-
measurementId: string;
|
|
180
|
-
debug?: boolean;
|
|
181
|
-
anonymizeIp?: boolean;
|
|
182
|
-
sendPageView?: boolean;
|
|
183
|
-
cookieFlags?: string;
|
|
184
|
-
autoTrack?: {
|
|
185
|
-
pageViews?: boolean;
|
|
186
|
-
downloads?: boolean;
|
|
187
|
-
externalLinks?: boolean;
|
|
188
|
-
search?: boolean;
|
|
189
|
-
};
|
|
190
|
-
}
|
|
191
|
-
/**
|
|
192
|
-
* Configuration for Google Tag Manager (GTM).
|
|
193
|
-
*/
|
|
194
|
-
interface BoltdocsGTMConfig {
|
|
195
|
-
tagId: string;
|
|
196
|
-
dataLayerName?: string;
|
|
197
|
-
preview?: string;
|
|
198
|
-
}
|
|
199
|
-
/**
|
|
200
|
-
* Configuration for Algolia DocSearch.
|
|
201
|
-
*/
|
|
202
|
-
interface BoltdocsAlgoliaConfig {
|
|
203
|
-
appId: string;
|
|
204
|
-
apiKey: string;
|
|
205
|
-
indexName: string;
|
|
206
|
-
}
|
|
207
|
-
/**
|
|
208
|
-
* Configuration for Giscus comments.
|
|
209
|
-
*/
|
|
210
|
-
interface BoltdocsGiscusConfig {
|
|
211
|
-
repo: string;
|
|
212
|
-
repoId: string;
|
|
213
|
-
category?: string;
|
|
214
|
-
categoryId?: string;
|
|
215
|
-
mapping?: 'pathname' | 'url' | 'title' | 'og:title' | 'specific' | 'number';
|
|
216
|
-
strict?: '0' | '1' | boolean;
|
|
217
|
-
reactionsEnabled?: '0' | '1' | boolean;
|
|
218
|
-
emitMetadata?: '0' | '1' | boolean;
|
|
219
|
-
inputPosition?: 'top' | 'bottom';
|
|
220
|
-
theme?: string;
|
|
221
|
-
darkTheme?: string;
|
|
222
|
-
lang?: string;
|
|
223
|
-
loading?: 'lazy' | 'eager';
|
|
224
|
-
}
|
|
225
|
-
/**
|
|
226
|
-
* Configuration for custom feedback system using GitHub Discussions API.
|
|
227
|
-
*/
|
|
228
|
-
interface BoltdocsCustomFeedbackConfig {
|
|
229
|
-
enabled: boolean;
|
|
230
|
-
owner: string;
|
|
231
|
-
repo: string;
|
|
232
|
-
categorySlug?: string;
|
|
233
|
-
endpoint?: string;
|
|
234
|
-
}
|
|
235
|
-
interface BoltdocsVercelConfig {
|
|
236
|
-
analytics?: boolean;
|
|
237
|
-
speedInsights?: boolean;
|
|
238
|
-
}
|
|
239
|
-
interface BoltdocsIntegrationsConfig {
|
|
240
|
-
analytics?: {
|
|
241
|
-
ga4?: BoltdocsGA4Config;
|
|
242
|
-
vercel?: BoltdocsVercelConfig;
|
|
243
|
-
gtm?: BoltdocsGTMConfig;
|
|
244
|
-
};
|
|
245
|
-
search?: {
|
|
246
|
-
algolia?: BoltdocsAlgoliaConfig;
|
|
247
|
-
};
|
|
248
|
-
feedback?: {
|
|
249
|
-
giscus?: BoltdocsGiscusConfig;
|
|
250
|
-
custom?: BoltdocsCustomFeedbackConfig;
|
|
251
|
-
};
|
|
252
|
-
}
|
|
253
|
-
/**
|
|
254
|
-
* The root configuration object for Boltdocs.
|
|
255
|
-
*/
|
|
256
|
-
interface BoltdocsConfig$1 {
|
|
257
|
-
siteUrl?: string;
|
|
258
|
-
docsDir?: string;
|
|
259
|
-
base?: string;
|
|
260
|
-
theme?: BoltdocsThemeConfig;
|
|
261
|
-
i18n?: BoltdocsI18nConfig;
|
|
262
|
-
versions?: BoltdocsVersionsConfig;
|
|
263
|
-
plugins?: BoltdocsPlugin[];
|
|
264
|
-
collections?: BoltdocsCollectionsConfig;
|
|
265
|
-
robots?: BoltdocsRobotsConfig;
|
|
266
|
-
security?: BoltdocsSecurityConfig;
|
|
267
|
-
seo?: BoltdocsSeoConfig;
|
|
268
|
-
integrations?: BoltdocsIntegrationsConfig;
|
|
269
|
-
directoryMeta?: Record<string, unknown>;
|
|
270
|
-
vite?: unknown;
|
|
271
|
-
}
|
|
272
|
-
/**
|
|
273
|
-
* Global namespace for Boltdocs types that can be augmented by generated code.
|
|
274
|
-
* This allows for strictly typed locales and versions based on the project configuration.
|
|
275
|
-
*/
|
|
276
|
-
declare global {
|
|
277
|
-
namespace Boltdocs {
|
|
278
|
-
interface Types {}
|
|
279
|
-
/**
|
|
280
|
-
* Marker interface augmented by generated code to provide strict route path typing.
|
|
281
|
-
* When no types have been generated (e.g., before first dev server start),
|
|
282
|
-
* keyof is never, and BoltdocsRoutePath falls back to string.
|
|
283
|
-
*/
|
|
284
|
-
interface RoutePaths {}
|
|
285
|
-
}
|
|
286
|
-
}
|
|
287
|
-
type BoltdocsTypes = Boltdocs.Types;
|
|
288
|
-
type BoltdocsRoutePath = keyof Boltdocs.RoutePaths;
|
|
289
|
-
type BoltdocsRoutePathWithFallback$1 = BoltdocsRoutePath extends never ? string : BoltdocsRoutePath;
|
|
290
|
-
type BoltdocsLocale = Boltdocs.Types extends {
|
|
291
|
-
Locale: infer L;
|
|
292
|
-
} ? L : string;
|
|
293
|
-
type BoltdocsVersion = Boltdocs.Types extends {
|
|
294
|
-
Version: infer V;
|
|
295
|
-
} ? V : string;
|
|
296
|
-
type UnpackMdxComponents<T> = T extends {
|
|
297
|
-
default: infer D;
|
|
298
|
-
} ? D : T;
|
|
299
|
-
type TransformMdxComponents<T> = { [K in keyof T as K extends `Frontmatter_${string}` ? never : K]: T[K] } & {
|
|
300
|
-
Frontmatter: { [K in keyof T as K extends `Frontmatter_${infer Name}` ? Name : never]: T[K] };
|
|
301
|
-
};
|
|
302
|
-
type BoltdocsMdxComponents = Boltdocs.Types extends {
|
|
303
|
-
MdxComponents: infer M;
|
|
304
|
-
} ? TransformMdxComponents<UnpackMdxComponents<M>> : {
|
|
305
|
-
[key: string]: ComponentType<any>;
|
|
306
|
-
Frontmatter: Record<string, ComponentType<any>>;
|
|
307
|
-
};
|
|
308
|
-
//#endregion
|
|
309
|
-
//#region src/client/types.d.ts
|
|
310
|
-
/**
|
|
311
|
-
* Metadata provided by the server for a specific route.
|
|
312
|
-
* Maps closely to the `RouteMeta` type in the Node environment.
|
|
313
|
-
*/
|
|
314
|
-
interface ComponentRoute {
|
|
315
|
-
/** The final URL path */
|
|
316
|
-
path: string;
|
|
317
|
-
/** The absolute filesystem path of the source file */
|
|
318
|
-
componentPath: string;
|
|
319
|
-
/** The page title */
|
|
320
|
-
title: string;
|
|
321
|
-
/** Explicit order in the sidebar */
|
|
322
|
-
sidebarPosition?: number;
|
|
323
|
-
/** The relative path from the docs directory */
|
|
324
|
-
filePath: string;
|
|
325
|
-
/** The group directory name */
|
|
326
|
-
group?: string;
|
|
327
|
-
/** The display title of the group */
|
|
328
|
-
groupTitle?: string;
|
|
329
|
-
/** Explicit order of the group in the sidebar */
|
|
330
|
-
groupPosition?: number;
|
|
331
|
-
/** Extracted markdown headings for search indexing */
|
|
332
|
-
headings?: {
|
|
333
|
-
level: number;
|
|
334
|
-
text: string;
|
|
335
|
-
id: string;
|
|
336
|
-
}[];
|
|
337
|
-
/** The page summary or description */
|
|
338
|
-
description?: string;
|
|
339
|
-
/** The locale this route belongs to, if i18n is configured */
|
|
340
|
-
locale?: string;
|
|
341
|
-
/** The version this route belongs to, if versioning is configured */
|
|
342
|
-
version?: string;
|
|
343
|
-
/** Optional icon to display (Lucide icon name or raw SVG) */
|
|
344
|
-
icon?: string;
|
|
345
|
-
/** The tab this route belongs to, if tabs are configured */
|
|
346
|
-
tab?: string;
|
|
347
|
-
/** Optional badge to display next to the sidebar item */
|
|
348
|
-
badge?: BadgeValue;
|
|
349
|
-
/** Optional icon for the route's group */
|
|
350
|
-
groupIcon?: string;
|
|
351
|
-
/** The sub-route group this route belongs to (from folders starting with _) */
|
|
352
|
-
subRouteGroup?: string;
|
|
353
|
-
/** The nested sub-routes if this route acts as the parent of a subRouteGroup */
|
|
354
|
-
subRoutes?: ComponentRoute[];
|
|
355
|
-
/** Internal helper map for nesting routes during sidebar construction */
|
|
356
|
-
_subMap?: Map<string, ComponentRoute>;
|
|
357
|
-
/** The extracted plain-text content of the page for search indexing */
|
|
358
|
-
_content?: string;
|
|
359
|
-
/** The raw markdown content of the page */
|
|
360
|
-
_rawContent?: string;
|
|
361
|
-
/** The publication date */
|
|
362
|
-
date?: string | Date;
|
|
363
|
-
/** The last updated timestamp or date */
|
|
364
|
-
lastUpdated?: string | number | Date;
|
|
365
|
-
/** The collection this route belongs to (from [name] directories) */
|
|
366
|
-
collection?: string;
|
|
367
|
-
/** Tags for blog posts */
|
|
368
|
-
tags?: string[];
|
|
369
|
-
/** Author identifier for blog posts */
|
|
370
|
-
author?: string | {
|
|
371
|
-
name: string;
|
|
372
|
-
avatar?: string;
|
|
373
|
-
url?: string;
|
|
374
|
-
image?: string;
|
|
375
|
-
};
|
|
376
|
-
/** Draft flag */
|
|
377
|
-
draft?: boolean;
|
|
378
|
-
/** Short excerpt for list displays */
|
|
379
|
-
excerpt?: string;
|
|
380
|
-
/** Cover image for blog posts */
|
|
381
|
-
coverImage?: string;
|
|
382
|
-
/** Raw extensible frontmatter data for custom components and formatters */
|
|
383
|
-
frontmatter?: Record<string, any>;
|
|
384
|
-
/** Clean URL segments stripped of locale/version prefixes */
|
|
385
|
-
slugParts?: string[];
|
|
386
|
-
/** SEO metadata for page headers */
|
|
387
|
-
seo?: Record<string, any>;
|
|
388
|
-
/** Flag to indicate if this is a fallback redirect route */
|
|
389
|
-
fallback?: boolean;
|
|
390
|
-
}
|
|
391
|
-
/**
|
|
392
|
-
* Site configuration provided by the server.
|
|
393
|
-
*/
|
|
394
|
-
type SiteConfig = BoltdocsConfig;
|
|
395
|
-
/**
|
|
396
|
-
* Tab configuration for the documentation site.
|
|
397
|
-
*/
|
|
398
|
-
interface BoltdocsTab {
|
|
399
|
-
id: string;
|
|
400
|
-
/** Text to display (can be a string or a map of translations) */
|
|
401
|
-
text: string | Record<string, string>;
|
|
402
|
-
icon?: string;
|
|
403
|
-
}
|
|
404
|
-
/**
|
|
405
|
-
* Props for the Sidebar component.
|
|
406
|
-
*/
|
|
407
|
-
interface SidebarProps {
|
|
408
|
-
routes: ComponentRoute[];
|
|
409
|
-
config: BoltdocsConfig;
|
|
410
|
-
}
|
|
411
|
-
/**
|
|
412
|
-
* Props for the OnThisPage (TOC) component.
|
|
413
|
-
*/
|
|
414
|
-
interface OnThisPageProps {
|
|
415
|
-
headings?: {
|
|
416
|
-
level: number;
|
|
417
|
-
text: string;
|
|
418
|
-
id: string;
|
|
419
|
-
}[];
|
|
420
|
-
editLink?: string;
|
|
421
|
-
communityHelp?: string;
|
|
422
|
-
filePath?: string;
|
|
423
|
-
}
|
|
424
|
-
/**
|
|
425
|
-
* Props for the Tabs component.
|
|
426
|
-
*/
|
|
427
|
-
interface TabsProps {
|
|
428
|
-
tabs: BoltdocsTab[];
|
|
429
|
-
routes: ComponentRoute[];
|
|
430
|
-
}
|
|
431
|
-
/**
|
|
432
|
-
* Props for user-defined layout components (layout.tsx).
|
|
433
|
-
*/
|
|
434
|
-
interface LayoutProps {
|
|
435
|
-
children: React$2.ReactNode;
|
|
436
|
-
}
|
|
437
|
-
/**
|
|
438
|
-
* Unified type for navbar links.
|
|
439
|
-
*/
|
|
440
|
-
interface NavbarLink {
|
|
441
|
-
label: string | Record<string, string>;
|
|
442
|
-
href: BoltdocsRoutePathWithFallback;
|
|
443
|
-
active: boolean;
|
|
444
|
-
to?: string;
|
|
445
|
-
items?: NavbarLink[];
|
|
446
|
-
}
|
|
447
|
-
/**
|
|
448
|
-
* Shape of the data returned by a collection post route loader.
|
|
449
|
-
* Consumed by `BlogPost` via `useLoaderData<CollectionPostLoaderData>()`.
|
|
450
|
-
*/
|
|
451
|
-
interface CollectionPostLoaderData {
|
|
452
|
-
/** Full route metadata for this post (title, date, author, tags, etc.) */
|
|
453
|
-
route: ComponentRoute;
|
|
454
|
-
/** The name of the collection this post belongs to (e.g. 'blog') */
|
|
455
|
-
collection: string;
|
|
456
|
-
/** Extracted page headings for the Table of Contents */
|
|
457
|
-
headings: {
|
|
458
|
-
level: number;
|
|
459
|
-
text: string;
|
|
460
|
-
id: string;
|
|
461
|
-
}[];
|
|
462
|
-
}
|
|
463
|
-
/**
|
|
464
|
-
* Shape of the data returned by a collection listing route loader.
|
|
465
|
-
* Consumed by `BlogList` via `useLoaderData<CollectionListLoaderData>()`.
|
|
466
|
-
*/
|
|
467
|
-
interface CollectionListLoaderData {
|
|
468
|
-
/** Paginated subset of posts to display on this page */
|
|
469
|
-
posts: Array<{
|
|
470
|
-
path: string;
|
|
471
|
-
title: string;
|
|
472
|
-
date?: string | Date;
|
|
473
|
-
excerpt?: string;
|
|
474
|
-
tags?: string[];
|
|
475
|
-
author?: string;
|
|
476
|
-
coverImage?: string;
|
|
477
|
-
filePath: string;
|
|
478
|
-
}>;
|
|
479
|
-
/** Total number of pages available */
|
|
480
|
-
totalPages: number;
|
|
481
|
-
/** Current page index (1-based) */
|
|
482
|
-
currentPage: number;
|
|
483
|
-
/** Collection name used to build pagination URLs (e.g. 'blog' → '/blog/page/2') */
|
|
484
|
-
collection: string;
|
|
485
|
-
}
|
|
486
|
-
//#endregion
|
|
487
|
-
//#region src/client/components/primitives/types.d.ts
|
|
488
|
-
type ComponentBase = {
|
|
489
|
-
className?: string;
|
|
490
|
-
children?: ReactNode;
|
|
491
|
-
};
|
|
492
|
-
//#endregion
|
|
493
|
-
//#region src/client/components/primitives/sidebar.d.ts
|
|
494
|
-
/**
|
|
495
|
-
* Desktop Sidebar Container
|
|
496
|
-
*/
|
|
497
|
-
declare function SidebarRoot({
|
|
498
|
-
children,
|
|
499
|
-
className
|
|
500
|
-
}: ComponentBase): _$react_jsx_runtime0.JSX.Element;
|
|
501
|
-
/**
|
|
502
|
-
* Mobile Sidebar Modal
|
|
503
|
-
*/
|
|
504
|
-
declare function SidebarMobile({
|
|
505
|
-
children,
|
|
506
|
-
className
|
|
507
|
-
}: ComponentBase): _$react_jsx_runtime0.JSX.Element;
|
|
508
|
-
/**
|
|
509
|
-
* Shared Header for Sidebar
|
|
510
|
-
*/
|
|
511
|
-
declare function SidebarHeader({
|
|
512
|
-
children,
|
|
513
|
-
className
|
|
514
|
-
}: ComponentBase): _$react_jsx_runtime0.JSX.Element;
|
|
515
|
-
/**
|
|
516
|
-
* Scrollable Content Wrapper
|
|
517
|
-
*/
|
|
518
|
-
declare function SidebarContent({
|
|
519
|
-
children,
|
|
520
|
-
className
|
|
521
|
-
}: ComponentBase): _$react_jsx_runtime0.JSX.Element;
|
|
522
|
-
/**
|
|
523
|
-
* Navigation Group
|
|
524
|
-
*/
|
|
525
|
-
declare function SidebarGroup({
|
|
526
|
-
title,
|
|
527
|
-
icon: Icon,
|
|
528
|
-
children,
|
|
529
|
-
className,
|
|
530
|
-
collapsible,
|
|
531
|
-
collapsed,
|
|
532
|
-
active
|
|
533
|
-
}: {
|
|
534
|
-
title?: string;
|
|
535
|
-
icon?: React.ElementType;
|
|
536
|
-
collapsible?: boolean;
|
|
537
|
-
collapsed?: boolean;
|
|
538
|
-
active?: boolean;
|
|
539
|
-
} & ComponentBase): _$react_jsx_runtime0.JSX.Element;
|
|
540
|
-
/**
|
|
541
|
-
* Sidebar Link
|
|
542
|
-
*/
|
|
543
|
-
interface SidebarLinkProps extends ComponentBase {
|
|
544
|
-
label: string;
|
|
545
|
-
href: BoltdocsRoutePathWithFallback$1;
|
|
546
|
-
active?: boolean;
|
|
547
|
-
icon?: React.ElementType;
|
|
548
|
-
badge?: ComponentRoute['badge'];
|
|
549
|
-
}
|
|
550
|
-
declare function SidebarLink({
|
|
551
|
-
label,
|
|
552
|
-
href,
|
|
553
|
-
active,
|
|
554
|
-
icon: Icon,
|
|
555
|
-
badge,
|
|
556
|
-
className
|
|
557
|
-
}: SidebarLinkProps): _$react_jsx_runtime0.JSX.Element;
|
|
558
|
-
/**
|
|
559
|
-
* Nested SubGroup
|
|
560
|
-
*/
|
|
561
|
-
declare function SidebarSubGroup({
|
|
562
|
-
label,
|
|
563
|
-
href,
|
|
564
|
-
active,
|
|
565
|
-
icon: Icon,
|
|
566
|
-
badge,
|
|
567
|
-
isOpen,
|
|
568
|
-
onToggle,
|
|
569
|
-
children,
|
|
570
|
-
className
|
|
571
|
-
}: SidebarLinkProps & {
|
|
572
|
-
isOpen: boolean;
|
|
573
|
-
onToggle: () => void;
|
|
574
|
-
children: ReactNode;
|
|
575
|
-
}): _$react_jsx_runtime0.JSX.Element;
|
|
576
|
-
/**
|
|
577
|
-
* Automated single-route rendering primitive
|
|
578
|
-
*/
|
|
579
|
-
interface SidebarItemProps extends ComponentBase {
|
|
580
|
-
route: ComponentRoute;
|
|
581
|
-
activePath: string;
|
|
582
|
-
activeRoute?: ComponentRoute;
|
|
583
|
-
}
|
|
584
|
-
declare function SidebarItem({
|
|
585
|
-
route,
|
|
586
|
-
activePath,
|
|
587
|
-
activeRoute,
|
|
588
|
-
className
|
|
589
|
-
}: SidebarItemProps): _$react_jsx_runtime0.JSX.Element;
|
|
590
|
-
/**
|
|
591
|
-
* High-level automated routes data rendering primitive
|
|
592
|
-
*/
|
|
593
|
-
interface SidebarItemsProps extends ComponentBase {
|
|
594
|
-
routes: ComponentRoute[];
|
|
595
|
-
}
|
|
596
|
-
declare function SidebarItems({
|
|
597
|
-
routes,
|
|
598
|
-
className
|
|
599
|
-
}: SidebarItemsProps): _$react_jsx_runtime0.JSX.Element;
|
|
600
|
-
/**
|
|
601
|
-
* Main Sidebar Export
|
|
602
|
-
*/
|
|
603
|
-
declare const Sidebar: typeof SidebarRoot & {
|
|
604
|
-
Root: typeof SidebarRoot;
|
|
605
|
-
Mobile: typeof SidebarMobile;
|
|
606
|
-
Header: typeof SidebarHeader;
|
|
607
|
-
Content: typeof SidebarContent;
|
|
608
|
-
Group: typeof SidebarGroup;
|
|
609
|
-
Link: typeof SidebarLink;
|
|
610
|
-
SubGroup: typeof SidebarSubGroup;
|
|
611
|
-
Item: typeof SidebarItem;
|
|
612
|
-
Items: typeof SidebarItems;
|
|
613
|
-
};
|
|
614
|
-
//#endregion
|
|
615
|
-
export { BoltdocsRoutePathWithFallback$1 as A, SiteConfig as C, BoltdocsLocale as D, BoltdocsIntegrationsConfig as E, BoltdocsTypes as M, BoltdocsVersion as N, BoltdocsMdxComponents as O, SidebarProps as S, BoltdocsConfig$1 as T, CollectionPostLoaderData as _, SidebarItem as a, NavbarLink as b, SidebarItemsProps as c, SidebarMobile as d, SidebarRoot as f, CollectionListLoaderData as g, BoltdocsTab as h, SidebarHeader as i, BoltdocsSocialLink as j, BoltdocsRoutePath as k, SidebarLink as l, ComponentBase as m, SidebarContent as n, SidebarItemProps as o, SidebarSubGroup as p, SidebarGroup as r, SidebarItems as s, Sidebar as t, SidebarLinkProps as u, ComponentRoute as v, TabsProps as w, OnThisPageProps as x, LayoutProps as y };
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Boltdocs - https://boltdocs.vercel.app
|
|
3
|
-
* Copyright (c) 2026 Jesus Alcala
|
|
4
|
-
* Licensed under the MIT License.
|
|
5
|
-
*/
|
|
6
|
-
import{t as e}from"./rolldown-runtime-fkIsjY3S.mjs";import t from"node:path";import n from"node:fs";var r=e({generateProjectTypes:()=>i,writeLinkTree:()=>a});function i(e,r,i=process.cwd(),a){let o=t.resolve(i,`.boltdocs`,`generated`);n.existsSync(o)||n.mkdirSync(o,{recursive:!0});let s=e.i18n?Object.keys(e.i18n.locales):[],c=e.versions?e.versions.versions.map(e=>e.path):[],l=s.length>0?s.map(e=>`'${e}'`).join(` | `):`string`,u=c.length>0?c.map(e=>`'${e}'`).join(` | `):`string`,d=[`tsx`,`ts`,`jsx`,`js`],f=``,p=``;for(let e of d){let a=t.resolve(i,r,`mdx-components.${e}`);if(n.existsSync(a)){let e=t.join(i,r,`mdx-components`),n=t.relative(o,e).replace(/\\/g,`/`);f=`import type * as MdxComponentsModule from '${n.startsWith(`.`)?n:`./${n}`}'\n`,p=` MdxComponents: typeof MdxComponentsModule`;break}}let m=a&&a.length>0?`\ndeclare global {
|
|
7
|
-
namespace Boltdocs {
|
|
8
|
-
interface RoutePaths {
|
|
9
|
-
${a.map(e=>` '${e}': void`).join(`
|
|
10
|
-
`)}
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
}`:``,h=`// This file is automatically generated by Boltdocs.
|
|
14
|
-
// Do not edit this file manually.
|
|
15
|
-
|
|
16
|
-
${f}declare global {
|
|
17
|
-
namespace Boltdocs {
|
|
18
|
-
interface Types {
|
|
19
|
-
Locale: ${l}
|
|
20
|
-
Version: ${u}${p?`\n${p}`:``}
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
}${m}
|
|
24
|
-
|
|
25
|
-
export {}
|
|
26
|
-
`;n.writeFileSync(t.resolve(o,`types.d.ts`),h)}function a(e,r=process.cwd()){let i=t.resolve(r,`.boltdocs`,`generated`);n.existsSync(i)||n.mkdirSync(i,{recursive:!0});let a={routes:Array.from(new Set(e)).sort(),timestamp:Date.now()};n.writeFileSync(t.resolve(i,`link-tree.json`),JSON.stringify(a,null,2))}export{r as n,a as r,i as t};
|
package/dist/utils-B3xYMrpK.mjs
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Boltdocs - https://boltdocs.vercel.app
|
|
3
|
-
* Copyright (c) 2026 Jesus Alcala
|
|
4
|
-
* Licensed under the MIT License.
|
|
5
|
-
*/
|
|
6
|
-
import{r as e}from"./errors-C0Hx15Ag.mjs";import t from"node:fs";import n from"isomorphic-dompurify";import{z as r}from"zod";import{error as i}from"@bdocs/dui";const a=/^[a-zA-Z0-9\-_/.()[\]]+$/,o=r.looseObject({title:r.string().max(200).optional(),description:r.string().max(500).optional(),permalink:r.string().optional(),sidebarPosition:r.number().optional(),sidebarLabel:r.string().max(100).optional(),sidebarHidden:r.boolean().optional(),hidden:r.boolean().optional(),category:r.string().max(50).optional(),order:r.number().optional(),badge:r.union([r.string().max(50),r.object({text:r.string().max(50),expires:r.string().optional()})]).optional(),icon:r.string().max(50).optional(),date:r.union([r.string(),r.date()]).optional(),lastUpdated:r.union([r.string(),r.date()]).optional(),groupTitle:r.string().max(100).optional(),groupPosition:r.number().optional(),seo:r.record(r.string(),r.any()).optional(),tags:r.array(r.string().max(50)).optional(),author:r.union([r.string().max(100),r.object({name:r.string().max(100),avatar:r.string().optional(),url:r.string().optional(),image:r.string().optional()})]).optional(),draft:r.boolean().optional(),excerpt:r.string().max(500).optional(),coverImage:r.string().nullable().optional()});function s(e){let t=e.trim();if(!t.startsWith(`---`))return{data:{},content:e,rawMatter:``};let n=t.indexOf(`---`,3);if(n===-1||n===3)return{data:{},content:e,rawMatter:``};let r=t.slice(3,n).trim(),i=t.slice(n+3).trim();return c(r)?{data:{},content:i,rawMatter:r}:{data:l(r),content:i,rawMatter:r}}function c(e){let t=!1,n=!1;for(let r=0;r<e.length;r++){let i=e[r],a=r>0?e[r-1]:``;i===`'`&&!n&&a!==`\\`?t=!t:i===`"`&&!t&&a!==`\\`&&(n=!n)}return t||n}function l(e){let t=e.split(`
|
|
7
|
-
`),n={},r=0;for(;r<t.length;){let e=t[r],i=e.trim();if(!i||i.startsWith(`#`)){r++;continue}let a=i.indexOf(`:`);if(a!==-1){let o=i.slice(0,a).trim(),s=i.slice(a+1).trim();if(s===``){let i=u(t.slice(r+1),e.search(/\S|$/));i.value===void 0?r++:(n[o]=i.value,r+=i.linesConsumed+1)}else n[o]=d(s),r++}else r++}return n}function u(e,t){if(e.length===0)return{value:void 0,linesConsumed:0};if(e[0].trim().startsWith(`-`)){let n=[],r=0;for(;r<e.length;){let i=e[r],a=i.search(/\S|$/),o=i.trim();if(!o||o.startsWith(`#`)){r++;continue}if(o.startsWith(`-`)){let e=o.slice(1).trim();if(e.includes(`:`)){let t={},r=e.split(/,\s*/);for(let e of r){let n=e.indexOf(`:`);if(n!==-1){let r=e.slice(0,n).trim();t[r]=d(e.slice(n+1).trim())}}n.push(t)}else n.push(e)}else if(a>t&&n.length>0){let e=n[n.length-1];if(typeof e==`object`&&e){let t=e,n=o.indexOf(`:`);if(n!==-1){let e=o.slice(0,n).trim();t[e]=d(o.slice(n+1).trim())}}}else break;r++}return{value:n.length>0?n:void 0,linesConsumed:r}}let n={},r=0;for(;r<e.length;){let i=e[r],a=i.search(/\S|$/),o=i.trim();if(!o||o.startsWith(`#`)){r++;continue}if(a<=t)break;let s=o.indexOf(`:`);if(s!==-1){let e=o.slice(0,s).trim();n[e]=d(o.slice(s+1).trim())}r++}return{value:Object.keys(n).length>0?n:void 0,linesConsumed:r}}function d(e){let t=e.trim();if(t===`true`)return!0;if(t===`false`)return!1;if(t===`null`||t===`~`)return null;if(/^-?\d+(\.\d+)?$/.test(t))return Number(t);if(t.startsWith(`"`)&&t.endsWith(`"`)||t.startsWith(`'`)&&t.endsWith(`'`))return t.slice(1,-1);if(t.startsWith(`[`)&&t.endsWith(`]`)){let e=t.slice(1,-1).trim();return e?e.split(/,\s*/).map(e=>d(e.trim())):[]}if(t.startsWith(`{`)&&t.endsWith(`}`)){let e=t.slice(1,-1).trim(),n={},r=e.split(/,\s*/);for(let e of r){let t=e.indexOf(`:`);if(t!==-1){let r=e.slice(0,t).trim();n[r]=d(e.slice(t+1).trim())}}return n}return t}function f(e){return e.replace(/\\/g,`/`)}function p(e){return e.replace(/^\d+\./,``)}function m(e){let t=e.match(/^(\d+)\./);return t?parseInt(t[1],10):void 0}function h(e){return/\.mdx?$/.test(e)}function g(e){try{return t.statSync(e).mtimeMs}catch{return 0}}function _(t,n,r){let{data:i,content:a,rawMatter:c}=s(n);if(c&&c.length>10240)throw E(`FRONTMATTER_TOO_LARGE`,`Frontmatter block exceeds size limit`,{size:c.length,file:t}),new e(`Security breach: Frontmatter size exceeds limit of 10240 bytes`);if(!r)return{data:i,content:a};let l=o.safeParse(i),u={...l.success?l.data:{}};return u.title&&=C(u.title).trim(),u.description&&=C(u.description).trim(),{data:u,content:a}}async function v(n,r=!0){let i=``;try{i=await t.promises.readFile(n,`utf-8`);let{data:e,content:a}=_(n,i,r);if(r&&!e.lastUpdated)try{e.lastUpdated=(await t.promises.stat(n)).mtimeMs}catch{e.lastUpdated=0}return{data:e,content:a,raw:i}}catch(t){if(t instanceof e)throw t;return{data:{},content:i,raw:i}}}function y(e){return e.replace(/&/g,`&`).replace(/"/g,`"`).replace(/'/g,`'`).replace(/</g,`<`).replace(/>/g,`>`)}function b(e){return y(e)}function x(e){let t=f(e).split(`/`).map(e=>T(p(e))).join(`/`).replace(/\/$/,``);return t=t.replace(/\.mdx?$/,``),(t===`index`||t.endsWith(`/index`))&&(t=t.replace(/index$/,``)),t.startsWith(`/`)||(t=`/`+t),t.length>1&&t.endsWith(`/`)&&(t=t.slice(0,-1)),t}function S(e){return n.sanitize(e,{ALLOWED_TAGS:`b.i.em.strong.a.p.br.code.pre.span.div.h1.h2.h3.h4.h5.h6.ul.ol.li.table.thead.tbody.tr.th.td.blockquote.hr`.split(`.`),ALLOWED_ATTR:[`href`,`title`,`target`,`class`,`id`,`src`,`alt`,`width`,`height`],FORCE_BODY:!0})}n.addHook(`afterSanitizeAttributes`,e=>{if(e.hasAttribute(`href`)){let t=e.getAttribute(`href`)?.toLowerCase()||``;(t.startsWith(`javascript:`)||t.startsWith(`data:`)||t.startsWith(`vbscript:`))&&e.removeAttribute(`href`)}if(e.hasAttribute(`src`)){let t=e.getAttribute(`src`)?.toLowerCase()||``;(t.startsWith(`javascript:`)||t.startsWith(`data:`)||t.startsWith(`vbscript:`))&&e.removeAttribute(`src`)}});function C(e){return e?n.sanitize(e,{ALLOWED_TAGS:[]}).replace(/\s+/g,` `).trim():``}function w(e){return e.charAt(0).toUpperCase()+e.slice(1)}function T(e){return e.replace(/[^a-zA-Z0-9\-_/.]/g,``).split(`/`).filter(e=>e!==`..`&&e!==`.`).map(e=>e.replace(/\.\.+/g,`.`)).join(`/`)}function E(e,t,n={}){let r=new Date().toISOString(),a={...n};for(let e in a)typeof a[e]==`string`&&a[e].includes(`:`)&&(a[e]=a[e].split(/[\\/]/).pop()||a[e]);i(`[SECURITY][${r}] TYPE: ${e} | MESSAGE: ${t} | DETAILS: ${JSON.stringify(a)}`)}function D(){return{dir:process.env.BOLTDOCS_CACHE_DIR||`.boltdocs/cache`,noCache:process.env.BOLTDOCS_NO_CACHE===`1`,lruLimit:parseInt(process.env.BOLTDOCS_CACHE_LRU_LIMIT||`2000`,10),lruTTL:parseInt(process.env.BOLTDOCS_CACHE_LRU_TTL||`14400000`,10),compress:process.env.BOLTDOCS_CACHE_COMPRESS!==`0`}}export{o as _,x as a,h as c,v as d,T as f,s as g,p as h,m as i,E as l,C as m,y as n,D as o,S as p,b as r,g as s,w as t,f as u,a as v};
|
package/dist/utils-Bz1tG9Dg.cjs
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Boltdocs - https://boltdocs.vercel.app
|
|
3
|
-
* Copyright (c) 2026 Jesus Alcala
|
|
4
|
-
* Licensed under the MIT License.
|
|
5
|
-
*/
|
|
6
|
-
const e=require(`./chunk-Ds5LZdWN.cjs`),t=require(`./errors-Dx6JHoKE.cjs`);let n=require(`node:fs`);n=e.n(n);let r=require(`isomorphic-dompurify`);r=e.n(r);let i=require(`zod`),a=require(`@bdocs/dui`);const o=/^[a-zA-Z0-9\-_/.()[\]]+$/,s=i.z.looseObject({title:i.z.string().max(200).optional(),description:i.z.string().max(500).optional(),permalink:i.z.string().optional(),sidebarPosition:i.z.number().optional(),sidebarLabel:i.z.string().max(100).optional(),sidebarHidden:i.z.boolean().optional(),hidden:i.z.boolean().optional(),category:i.z.string().max(50).optional(),order:i.z.number().optional(),badge:i.z.union([i.z.string().max(50),i.z.object({text:i.z.string().max(50),expires:i.z.string().optional()})]).optional(),icon:i.z.string().max(50).optional(),date:i.z.union([i.z.string(),i.z.date()]).optional(),lastUpdated:i.z.union([i.z.string(),i.z.date()]).optional(),groupTitle:i.z.string().max(100).optional(),groupPosition:i.z.number().optional(),seo:i.z.record(i.z.string(),i.z.any()).optional(),tags:i.z.array(i.z.string().max(50)).optional(),author:i.z.union([i.z.string().max(100),i.z.object({name:i.z.string().max(100),avatar:i.z.string().optional(),url:i.z.string().optional(),image:i.z.string().optional()})]).optional(),draft:i.z.boolean().optional(),excerpt:i.z.string().max(500).optional(),coverImage:i.z.string().nullable().optional()});function c(e){let t=e.trim();if(!t.startsWith(`---`))return{data:{},content:e,rawMatter:``};let n=t.indexOf(`---`,3);if(n===-1||n===3)return{data:{},content:e,rawMatter:``};let r=t.slice(3,n).trim(),i=t.slice(n+3).trim();return l(r)?{data:{},content:i,rawMatter:r}:{data:u(r),content:i,rawMatter:r}}function l(e){let t=!1,n=!1;for(let r=0;r<e.length;r++){let i=e[r],a=r>0?e[r-1]:``;i===`'`&&!n&&a!==`\\`?t=!t:i===`"`&&!t&&a!==`\\`&&(n=!n)}return t||n}function u(e){let t=e.split(`
|
|
7
|
-
`),n={},r=0;for(;r<t.length;){let e=t[r],i=e.trim();if(!i||i.startsWith(`#`)){r++;continue}let a=i.indexOf(`:`);if(a!==-1){let o=i.slice(0,a).trim(),s=i.slice(a+1).trim();if(s===``){let i=d(t.slice(r+1),e.search(/\S|$/));i.value===void 0?r++:(n[o]=i.value,r+=i.linesConsumed+1)}else n[o]=f(s),r++}else r++}return n}function d(e,t){if(e.length===0)return{value:void 0,linesConsumed:0};if(e[0].trim().startsWith(`-`)){let n=[],r=0;for(;r<e.length;){let i=e[r],a=i.search(/\S|$/),o=i.trim();if(!o||o.startsWith(`#`)){r++;continue}if(o.startsWith(`-`)){let e=o.slice(1).trim();if(e.includes(`:`)){let t={},r=e.split(/,\s*/);for(let e of r){let n=e.indexOf(`:`);if(n!==-1){let r=e.slice(0,n).trim();t[r]=f(e.slice(n+1).trim())}}n.push(t)}else n.push(e)}else if(a>t&&n.length>0){let e=n[n.length-1];if(typeof e==`object`&&e){let t=e,n=o.indexOf(`:`);if(n!==-1){let e=o.slice(0,n).trim();t[e]=f(o.slice(n+1).trim())}}}else break;r++}return{value:n.length>0?n:void 0,linesConsumed:r}}let n={},r=0;for(;r<e.length;){let i=e[r],a=i.search(/\S|$/),o=i.trim();if(!o||o.startsWith(`#`)){r++;continue}if(a<=t)break;let s=o.indexOf(`:`);if(s!==-1){let e=o.slice(0,s).trim();n[e]=f(o.slice(s+1).trim())}r++}return{value:Object.keys(n).length>0?n:void 0,linesConsumed:r}}function f(e){let t=e.trim();if(t===`true`)return!0;if(t===`false`)return!1;if(t===`null`||t===`~`)return null;if(/^-?\d+(\.\d+)?$/.test(t))return Number(t);if(t.startsWith(`"`)&&t.endsWith(`"`)||t.startsWith(`'`)&&t.endsWith(`'`))return t.slice(1,-1);if(t.startsWith(`[`)&&t.endsWith(`]`)){let e=t.slice(1,-1).trim();return e?e.split(/,\s*/).map(e=>f(e.trim())):[]}if(t.startsWith(`{`)&&t.endsWith(`}`)){let e=t.slice(1,-1).trim(),n={},r=e.split(/,\s*/);for(let e of r){let t=e.indexOf(`:`);if(t!==-1){let r=e.slice(0,t).trim();n[r]=f(e.slice(t+1).trim())}}return n}return t}function p(e){return e.replace(/\\/g,`/`)}function m(e){return e.replace(/^\d+\./,``)}function h(e){let t=e.match(/^(\d+)\./);return t?parseInt(t[1],10):void 0}function g(e){return/\.mdx?$/.test(e)}function _(e){try{return n.default.statSync(e).mtimeMs}catch{return 0}}function v(e,n,r){let{data:i,content:a,rawMatter:o}=c(n);if(o&&o.length>10240)throw D(`FRONTMATTER_TOO_LARGE`,`Frontmatter block exceeds size limit`,{size:o.length,file:e}),new t.r(`Security breach: Frontmatter size exceeds limit of 10240 bytes`);if(!r)return{data:i,content:a};let l=s.safeParse(i),u={...l.success?l.data:{}};return u.title&&=w(u.title).trim(),u.description&&=w(u.description).trim(),{data:u,content:a}}async function y(e,r=!0){let i=``;try{i=await n.default.promises.readFile(e,`utf-8`);let{data:t,content:a}=v(e,i,r);if(r&&!t.lastUpdated)try{t.lastUpdated=(await n.default.promises.stat(e)).mtimeMs}catch{t.lastUpdated=0}return{data:t,content:a,raw:i}}catch(e){if(e instanceof t.r)throw e;return{data:{},content:i,raw:i}}}function b(e){return e.replace(/&/g,`&`).replace(/"/g,`"`).replace(/'/g,`'`).replace(/</g,`<`).replace(/>/g,`>`)}function x(e){return b(e)}function S(e){let t=p(e).split(`/`).map(e=>E(m(e))).join(`/`).replace(/\/$/,``);return t=t.replace(/\.mdx?$/,``),(t===`index`||t.endsWith(`/index`))&&(t=t.replace(/index$/,``)),t.startsWith(`/`)||(t=`/`+t),t.length>1&&t.endsWith(`/`)&&(t=t.slice(0,-1)),t}function C(e){return r.default.sanitize(e,{ALLOWED_TAGS:`b.i.em.strong.a.p.br.code.pre.span.div.h1.h2.h3.h4.h5.h6.ul.ol.li.table.thead.tbody.tr.th.td.blockquote.hr`.split(`.`),ALLOWED_ATTR:[`href`,`title`,`target`,`class`,`id`,`src`,`alt`,`width`,`height`],FORCE_BODY:!0})}r.default.addHook(`afterSanitizeAttributes`,e=>{if(e.hasAttribute(`href`)){let t=e.getAttribute(`href`)?.toLowerCase()||``;(t.startsWith(`javascript:`)||t.startsWith(`data:`)||t.startsWith(`vbscript:`))&&e.removeAttribute(`href`)}if(e.hasAttribute(`src`)){let t=e.getAttribute(`src`)?.toLowerCase()||``;(t.startsWith(`javascript:`)||t.startsWith(`data:`)||t.startsWith(`vbscript:`))&&e.removeAttribute(`src`)}});function w(e){return e?r.default.sanitize(e,{ALLOWED_TAGS:[]}).replace(/\s+/g,` `).trim():``}function T(e){return e.charAt(0).toUpperCase()+e.slice(1)}function E(e){return e.replace(/[^a-zA-Z0-9\-_/.]/g,``).split(`/`).filter(e=>e!==`..`&&e!==`.`).map(e=>e.replace(/\.\.+/g,`.`)).join(`/`)}function D(e,t,n={}){let r=new Date().toISOString(),i={...n};for(let e in i)typeof i[e]==`string`&&i[e].includes(`:`)&&(i[e]=i[e].split(/[\\/]/).pop()||i[e]);(0,a.error)(`[SECURITY][${r}] TYPE: ${e} | MESSAGE: ${t} | DETAILS: ${JSON.stringify(i)}`)}function O(){return{dir:process.env.BOLTDOCS_CACHE_DIR||`.boltdocs/cache`,noCache:process.env.BOLTDOCS_NO_CACHE===`1`,lruLimit:parseInt(process.env.BOLTDOCS_CACHE_LRU_LIMIT||`2000`,10),lruTTL:parseInt(process.env.BOLTDOCS_CACHE_LRU_TTL||`14400000`,10),compress:process.env.BOLTDOCS_CACHE_COMPRESS!==`0`}}Object.defineProperty(exports,`_`,{enumerable:!0,get:function(){return s}}),Object.defineProperty(exports,`a`,{enumerable:!0,get:function(){return S}}),Object.defineProperty(exports,`c`,{enumerable:!0,get:function(){return g}}),Object.defineProperty(exports,`d`,{enumerable:!0,get:function(){return y}}),Object.defineProperty(exports,`f`,{enumerable:!0,get:function(){return E}}),Object.defineProperty(exports,`g`,{enumerable:!0,get:function(){return c}}),Object.defineProperty(exports,`h`,{enumerable:!0,get:function(){return m}}),Object.defineProperty(exports,`i`,{enumerable:!0,get:function(){return h}}),Object.defineProperty(exports,`l`,{enumerable:!0,get:function(){return D}}),Object.defineProperty(exports,`m`,{enumerable:!0,get:function(){return w}}),Object.defineProperty(exports,`n`,{enumerable:!0,get:function(){return b}}),Object.defineProperty(exports,`o`,{enumerable:!0,get:function(){return O}}),Object.defineProperty(exports,`p`,{enumerable:!0,get:function(){return C}}),Object.defineProperty(exports,`r`,{enumerable:!0,get:function(){return x}}),Object.defineProperty(exports,`s`,{enumerable:!0,get:function(){return _}}),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return T}}),Object.defineProperty(exports,`u`,{enumerable:!0,get:function(){return p}}),Object.defineProperty(exports,`v`,{enumerable:!0,get:function(){return o}});
|
|
File without changes
|
|
File without changes
|
|
File without changes
|