@blaaiz/docs-core 0.1.0
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/LICENSE +21 -0
- package/README.md +103 -0
- package/dist/chunk-3ZX4WIE3.js +2984 -0
- package/dist/chunk-3ZX4WIE3.js.map +1 -0
- package/dist/chunk-JCYR6RPE.js +31 -0
- package/dist/chunk-JCYR6RPE.js.map +1 -0
- package/dist/chunk-ZKOOKLZ3.js +124 -0
- package/dist/chunk-ZKOOKLZ3.js.map +1 -0
- package/dist/cli.js +534 -0
- package/dist/cli.js.map +1 -0
- package/dist/generator.cjs +508 -0
- package/dist/generator.cjs.map +1 -0
- package/dist/generator.d.cts +122 -0
- package/dist/generator.d.ts +122 -0
- package/dist/generator.js +177 -0
- package/dist/generator.js.map +1 -0
- package/dist/index.cjs +3024 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +1182 -0
- package/dist/index.d.ts +1182 -0
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -0
- package/dist/navigation-CGqFIPlP.d.cts +498 -0
- package/dist/navigation-CGqFIPlP.d.ts +498 -0
- package/dist/openapi-types-CJ6p5Cux.d.cts +78 -0
- package/dist/openapi-types-CJ6p5Cux.d.ts +78 -0
- package/dist/ui/api-try-it.cjs +654 -0
- package/dist/ui/api-try-it.cjs.map +1 -0
- package/dist/ui/api-try-it.d.cts +78 -0
- package/dist/ui/api-try-it.d.ts +78 -0
- package/dist/ui/api-try-it.js +509 -0
- package/dist/ui/api-try-it.js.map +1 -0
- package/dist/ui/ask-ai.cjs +810 -0
- package/dist/ui/ask-ai.cjs.map +1 -0
- package/dist/ui/ask-ai.d.cts +57 -0
- package/dist/ui/ask-ai.d.ts +57 -0
- package/dist/ui/ask-ai.js +808 -0
- package/dist/ui/ask-ai.js.map +1 -0
- package/dist/ui/copy-page.cjs +312 -0
- package/dist/ui/copy-page.cjs.map +1 -0
- package/dist/ui/copy-page.d.cts +33 -0
- package/dist/ui/copy-page.d.ts +33 -0
- package/dist/ui/copy-page.js +183 -0
- package/dist/ui/copy-page.js.map +1 -0
- package/dist/ui/mermaid.cjs +363 -0
- package/dist/ui/mermaid.cjs.map +1 -0
- package/dist/ui/mermaid.d.cts +13 -0
- package/dist/ui/mermaid.d.ts +13 -0
- package/dist/ui/mermaid.js +361 -0
- package/dist/ui/mermaid.js.map +1 -0
- package/dist/ui.cjs +661 -0
- package/dist/ui.cjs.map +1 -0
- package/dist/ui.d.cts +428 -0
- package/dist/ui.d.ts +428 -0
- package/dist/ui.js +537 -0
- package/dist/ui.js.map +1 -0
- package/package.json +145 -0
- package/patches/fumadocs-openapi.patch +173 -0
- package/skills/AGENTS-section.md +36 -0
- package/skills/SKILL.md +363 -0
- package/styles/api-reference.css +1417 -0
- package/styles/ask-ai.css +563 -0
- package/styles/auth.css +462 -0
- package/styles/docs.css +247 -0
- package/styles/home.css +376 -0
- package/templates/init/content/docs/index.mdx.tmpl +52 -0
- package/templates/init/content/docs/meta.json.tmpl +3 -0
- package/templates/init/content/docs.json.tmpl +12 -0
- package/templates/init/content/nav.json.tmpl +7 -0
- package/templates/init/docs.config.ts.tmpl +36 -0
- package/templates/init/env.example.tmpl +15 -0
package/dist/ui.js
ADDED
|
@@ -0,0 +1,537 @@
|
|
|
1
|
+
import { strokeIcon } from './chunk-ZKOOKLZ3.js';
|
|
2
|
+
import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
|
|
3
|
+
import { isValidElement, cloneElement } from 'react';
|
|
4
|
+
|
|
5
|
+
function Accordion({ title, children }) {
|
|
6
|
+
return /* @__PURE__ */ jsxs(
|
|
7
|
+
"details",
|
|
8
|
+
{
|
|
9
|
+
style: {
|
|
10
|
+
border: "1px solid var(--color-fd-border)",
|
|
11
|
+
borderRadius: 8,
|
|
12
|
+
padding: "10px 14px",
|
|
13
|
+
margin: "8px 0"
|
|
14
|
+
},
|
|
15
|
+
children: [
|
|
16
|
+
/* @__PURE__ */ jsx("summary", { style: { cursor: "pointer", fontWeight: 600 }, children: title }),
|
|
17
|
+
/* @__PURE__ */ jsx("div", { style: { marginTop: 8 }, children })
|
|
18
|
+
]
|
|
19
|
+
}
|
|
20
|
+
);
|
|
21
|
+
}
|
|
22
|
+
function AccordionGroup({ children }) {
|
|
23
|
+
return /* @__PURE__ */ jsx("div", { style: { margin: "16px 0" }, children });
|
|
24
|
+
}
|
|
25
|
+
function apiOperationLayout(slots) {
|
|
26
|
+
let playground = slots.apiPlayground;
|
|
27
|
+
if (isValidElement(playground) && playground.type.acceptsExample === true) {
|
|
28
|
+
playground = cloneElement(playground, {
|
|
29
|
+
example: slots.apiExample
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
return /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-x-6 gap-y-4 @4xl:flex-row @4xl:items-start", children: [
|
|
33
|
+
/* @__PURE__ */ jsxs("div", { className: "min-w-0 flex-1", children: [
|
|
34
|
+
slots.header,
|
|
35
|
+
slots.description,
|
|
36
|
+
playground,
|
|
37
|
+
slots.authSchemes,
|
|
38
|
+
slots.parameters,
|
|
39
|
+
slots.body,
|
|
40
|
+
slots.responses,
|
|
41
|
+
slots.callbacks
|
|
42
|
+
] }),
|
|
43
|
+
/* @__PURE__ */ jsx("div", { className: "@4xl:sticky @4xl:top-[calc(var(--fd-docs-row-1,2rem)+1rem)] @4xl:w-[400px]", children: slots.apiExample })
|
|
44
|
+
] });
|
|
45
|
+
}
|
|
46
|
+
function MethodBadge({ method }) {
|
|
47
|
+
const upper = method.toUpperCase();
|
|
48
|
+
return /* @__PURE__ */ jsx("span", { className: "api-method-badge", "data-method": method.toLowerCase(), children: upper });
|
|
49
|
+
}
|
|
50
|
+
function apiMethodBadges(methods) {
|
|
51
|
+
return {
|
|
52
|
+
file(node) {
|
|
53
|
+
const method = node.url ? methods[node.url] : void 0;
|
|
54
|
+
if (!method) {
|
|
55
|
+
return node;
|
|
56
|
+
}
|
|
57
|
+
return {
|
|
58
|
+
...node,
|
|
59
|
+
name: /* @__PURE__ */ jsxs("span", { className: "api-nav-item", children: [
|
|
60
|
+
/* @__PURE__ */ jsx(MethodBadge, { method }),
|
|
61
|
+
/* @__PURE__ */ jsx("span", { className: "api-nav-text", children: node.name })
|
|
62
|
+
] })
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
function authErrorMessage(code, domains) {
|
|
68
|
+
if (!code) {
|
|
69
|
+
return null;
|
|
70
|
+
}
|
|
71
|
+
const list = domains.join(", ");
|
|
72
|
+
switch (code) {
|
|
73
|
+
case "forbidden":
|
|
74
|
+
case "domain":
|
|
75
|
+
return list ? `That email isn't on an allowed domain. Sign in with your ${list} account.` : `That account isn't allowed to access these docs.`;
|
|
76
|
+
case "oauth":
|
|
77
|
+
case "state":
|
|
78
|
+
return `Google sign-in didn't complete. Please try again.`;
|
|
79
|
+
case "badsecret":
|
|
80
|
+
return `That secret is incorrect. Please try again.`;
|
|
81
|
+
case "expired":
|
|
82
|
+
return `Your session expired. Sign in again to continue.`;
|
|
83
|
+
case "config":
|
|
84
|
+
return `Sign-in isn't configured for this site. Contact the site owner.`;
|
|
85
|
+
default:
|
|
86
|
+
return `Something went wrong signing in. Please try again.`;
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
function mailIcon() {
|
|
90
|
+
return strokeIcon("mail");
|
|
91
|
+
}
|
|
92
|
+
function lockIcon() {
|
|
93
|
+
return strokeIcon("lock");
|
|
94
|
+
}
|
|
95
|
+
function alertIcon() {
|
|
96
|
+
return strokeIcon("info");
|
|
97
|
+
}
|
|
98
|
+
function keyIcon() {
|
|
99
|
+
return strokeIcon("key");
|
|
100
|
+
}
|
|
101
|
+
function userIcon() {
|
|
102
|
+
return strokeIcon("user");
|
|
103
|
+
}
|
|
104
|
+
function googleIcon() {
|
|
105
|
+
return /* @__PURE__ */ jsxs("svg", { viewBox: "0 0 24 24", "aria-hidden": "true", children: [
|
|
106
|
+
/* @__PURE__ */ jsx(
|
|
107
|
+
"path",
|
|
108
|
+
{
|
|
109
|
+
fill: "#4285F4",
|
|
110
|
+
d: "M23.52 12.27c0-.82-.07-1.6-.2-2.36H12v4.46h6.47a5.53 5.53 0 0 1-2.4 3.63v3.02h3.88c2.27-2.09 3.57-5.17 3.57-8.75z"
|
|
111
|
+
}
|
|
112
|
+
),
|
|
113
|
+
/* @__PURE__ */ jsx(
|
|
114
|
+
"path",
|
|
115
|
+
{
|
|
116
|
+
fill: "#34A853",
|
|
117
|
+
d: "M12 24c3.24 0 5.96-1.08 7.95-2.91l-3.88-3.02c-1.08.72-2.45 1.16-4.07 1.16-3.13 0-5.78-2.11-6.73-4.96H1.29v3.12A12 12 0 0 0 12 24z"
|
|
118
|
+
}
|
|
119
|
+
),
|
|
120
|
+
/* @__PURE__ */ jsx(
|
|
121
|
+
"path",
|
|
122
|
+
{
|
|
123
|
+
fill: "#FBBC05",
|
|
124
|
+
d: "M5.27 14.27a7.2 7.2 0 0 1 0-4.54V6.61H1.29a12 12 0 0 0 0 10.78l3.98-3.12z"
|
|
125
|
+
}
|
|
126
|
+
),
|
|
127
|
+
/* @__PURE__ */ jsx(
|
|
128
|
+
"path",
|
|
129
|
+
{
|
|
130
|
+
fill: "#EA4335",
|
|
131
|
+
d: "M12 4.75c1.77 0 3.35.61 4.6 1.8l3.44-3.44A11.5 11.5 0 0 0 12 0 12 12 0 0 0 1.29 6.61l3.98 3.12C6.22 6.86 8.87 4.75 12 4.75z"
|
|
132
|
+
}
|
|
133
|
+
)
|
|
134
|
+
] });
|
|
135
|
+
}
|
|
136
|
+
function AuthScreen(props) {
|
|
137
|
+
const { config, from, error } = props;
|
|
138
|
+
const auth = config.auth;
|
|
139
|
+
const workspace = auth === "public" ? null : auth;
|
|
140
|
+
const domains = workspace?.allowedDomains ?? [];
|
|
141
|
+
const target = from ?? "/";
|
|
142
|
+
const emailAction = props.emailAction ?? "/api/auth/email";
|
|
143
|
+
const secretAction = props.secretAction ?? "/api/auth/secret";
|
|
144
|
+
const googleStartPath = props.googleStartPath ?? "/api/auth/google/start";
|
|
145
|
+
const signInPath = props.signInPath ?? "/signin";
|
|
146
|
+
const secretEnabled = props.secretEnabled ?? Boolean(workspace?.providers.secret);
|
|
147
|
+
const emailProvider = workspace?.providers.email ?? false;
|
|
148
|
+
const hasEmailFlow = secretEnabled || emailProvider;
|
|
149
|
+
const showGoogle = props.googleEnabled ?? Boolean(workspace?.providers.google);
|
|
150
|
+
const message = authErrorMessage(error, domains);
|
|
151
|
+
const logo = config.theme.logo;
|
|
152
|
+
const onSecretStep = props.step === "secret" && secretEnabled && Boolean(props.email);
|
|
153
|
+
const brand = /* @__PURE__ */ jsx("div", { className: "auth-brand", children: logo ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
154
|
+
/* @__PURE__ */ jsx("img", { className: "auth-logo-light", src: logo.light, alt: config.theme.name }),
|
|
155
|
+
/* @__PURE__ */ jsx("img", { className: "auth-logo-dark", src: logo.dark, alt: config.theme.name })
|
|
156
|
+
] }) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
157
|
+
/* @__PURE__ */ jsx("span", { className: "auth-dot", "aria-hidden": "true" }),
|
|
158
|
+
config.theme.name
|
|
159
|
+
] }) });
|
|
160
|
+
const errorBanner = message ? /* @__PURE__ */ jsxs("div", { className: "auth-error", role: "alert", children: [
|
|
161
|
+
alertIcon(),
|
|
162
|
+
/* @__PURE__ */ jsx("span", { children: message })
|
|
163
|
+
] }) : null;
|
|
164
|
+
if (onSecretStep) {
|
|
165
|
+
return /* @__PURE__ */ jsxs("div", { className: "auth-screen", children: [
|
|
166
|
+
/* @__PURE__ */ jsx("div", { className: "auth-ambient", "aria-hidden": "true" }),
|
|
167
|
+
/* @__PURE__ */ jsxs("main", { className: "auth-card", children: [
|
|
168
|
+
brand,
|
|
169
|
+
/* @__PURE__ */ jsx("h1", { className: "auth-title", children: "Enter access secret" }),
|
|
170
|
+
/* @__PURE__ */ jsx("p", { className: "auth-sub", children: "One more step \u2014 enter the shared secret to continue." }),
|
|
171
|
+
/* @__PURE__ */ jsxs("div", { className: "auth-identity", children: [
|
|
172
|
+
userIcon(),
|
|
173
|
+
/* @__PURE__ */ jsx("span", { className: "auth-identity-email", children: props.email }),
|
|
174
|
+
/* @__PURE__ */ jsx("a", { className: "auth-change", href: signInPath, children: "Change" })
|
|
175
|
+
] }),
|
|
176
|
+
errorBanner,
|
|
177
|
+
/* @__PURE__ */ jsxs("form", { className: "auth-form", action: secretAction, method: "post", children: [
|
|
178
|
+
/* @__PURE__ */ jsx("input", { type: "hidden", name: "from", value: target }),
|
|
179
|
+
/* @__PURE__ */ jsx("label", { className: "auth-label", htmlFor: "auth-secret", children: "Access secret" }),
|
|
180
|
+
/* @__PURE__ */ jsxs("div", { className: "auth-field", children: [
|
|
181
|
+
keyIcon(),
|
|
182
|
+
/* @__PURE__ */ jsx(
|
|
183
|
+
"input",
|
|
184
|
+
{
|
|
185
|
+
id: "auth-secret",
|
|
186
|
+
name: "secret",
|
|
187
|
+
type: "password",
|
|
188
|
+
required: true,
|
|
189
|
+
autoFocus: true,
|
|
190
|
+
autoComplete: "off",
|
|
191
|
+
placeholder: "Enter the access secret",
|
|
192
|
+
className: "auth-input"
|
|
193
|
+
}
|
|
194
|
+
)
|
|
195
|
+
] }),
|
|
196
|
+
/* @__PURE__ */ jsx("button", { type: "submit", className: "auth-submit", children: "Sign in" })
|
|
197
|
+
] }),
|
|
198
|
+
/* @__PURE__ */ jsxs("p", { className: "auth-foot", children: [
|
|
199
|
+
lockIcon(),
|
|
200
|
+
"Access is limited to your workspace."
|
|
201
|
+
] })
|
|
202
|
+
] })
|
|
203
|
+
] });
|
|
204
|
+
}
|
|
205
|
+
return /* @__PURE__ */ jsxs("div", { className: "auth-screen", children: [
|
|
206
|
+
/* @__PURE__ */ jsx("div", { className: "auth-ambient", "aria-hidden": "true" }),
|
|
207
|
+
/* @__PURE__ */ jsxs("main", { className: "auth-card", children: [
|
|
208
|
+
brand,
|
|
209
|
+
/* @__PURE__ */ jsx("h1", { className: "auth-title", children: "Sign in" }),
|
|
210
|
+
/* @__PURE__ */ jsx("p", { className: "auth-sub", children: domains.length ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
211
|
+
"These docs are restricted to ",
|
|
212
|
+
/* @__PURE__ */ jsx("b", { children: domains.join(", ") }),
|
|
213
|
+
" accounts."
|
|
214
|
+
] }) : "These docs are restricted to your workspace." }),
|
|
215
|
+
errorBanner,
|
|
216
|
+
hasEmailFlow ? /* @__PURE__ */ jsxs(
|
|
217
|
+
"form",
|
|
218
|
+
{
|
|
219
|
+
className: "auth-form",
|
|
220
|
+
action: secretEnabled ? secretAction : emailAction,
|
|
221
|
+
method: "post",
|
|
222
|
+
children: [
|
|
223
|
+
/* @__PURE__ */ jsx("input", { type: "hidden", name: "from", value: target }),
|
|
224
|
+
/* @__PURE__ */ jsx("label", { className: "auth-label", htmlFor: "auth-email", children: "Work email" }),
|
|
225
|
+
/* @__PURE__ */ jsxs("div", { className: "auth-field", children: [
|
|
226
|
+
mailIcon(),
|
|
227
|
+
/* @__PURE__ */ jsx(
|
|
228
|
+
"input",
|
|
229
|
+
{
|
|
230
|
+
id: "auth-email",
|
|
231
|
+
name: "email",
|
|
232
|
+
type: "email",
|
|
233
|
+
required: true,
|
|
234
|
+
autoComplete: "email",
|
|
235
|
+
autoFocus: true,
|
|
236
|
+
placeholder: `you@${domains[0] ?? "company.com"}`,
|
|
237
|
+
className: "auth-input"
|
|
238
|
+
}
|
|
239
|
+
)
|
|
240
|
+
] }),
|
|
241
|
+
/* @__PURE__ */ jsx("button", { type: "submit", className: "auth-submit", children: secretEnabled ? "Continue" : "Continue with email" })
|
|
242
|
+
]
|
|
243
|
+
}
|
|
244
|
+
) : null,
|
|
245
|
+
hasEmailFlow && showGoogle ? /* @__PURE__ */ jsx("div", { className: "auth-divider", children: "or" }) : null,
|
|
246
|
+
showGoogle ? /* @__PURE__ */ jsxs("a", { className: "auth-google", href: `${googleStartPath}?from=${encodeURIComponent(target)}`, children: [
|
|
247
|
+
googleIcon(),
|
|
248
|
+
"Continue with Google"
|
|
249
|
+
] }) : null,
|
|
250
|
+
/* @__PURE__ */ jsxs("p", { className: "auth-foot", children: [
|
|
251
|
+
lockIcon(),
|
|
252
|
+
"Access is limited to your workspace."
|
|
253
|
+
] })
|
|
254
|
+
] })
|
|
255
|
+
] });
|
|
256
|
+
}
|
|
257
|
+
var TONE_GLYPHS = {
|
|
258
|
+
note: "info",
|
|
259
|
+
info: "info",
|
|
260
|
+
tip: "bulb",
|
|
261
|
+
warning: "alert"
|
|
262
|
+
};
|
|
263
|
+
function Callout({ tone = "note", children }) {
|
|
264
|
+
return /* @__PURE__ */ jsxs("div", { className: `cl cl-${tone}`, children: [
|
|
265
|
+
/* @__PURE__ */ jsx("span", { className: "cl-icon", children: strokeIcon(TONE_GLYPHS[tone], { size: 18, rounded: true }) }),
|
|
266
|
+
/* @__PURE__ */ jsx("div", { className: "cl-body", children })
|
|
267
|
+
] });
|
|
268
|
+
}
|
|
269
|
+
function Note({ children }) {
|
|
270
|
+
return /* @__PURE__ */ jsx(Callout, { tone: "note", children });
|
|
271
|
+
}
|
|
272
|
+
function Warning({ children }) {
|
|
273
|
+
return /* @__PURE__ */ jsx(Callout, { tone: "warning", children });
|
|
274
|
+
}
|
|
275
|
+
function Info({ children }) {
|
|
276
|
+
return /* @__PURE__ */ jsx(Callout, { tone: "info", children });
|
|
277
|
+
}
|
|
278
|
+
function Tip({ children }) {
|
|
279
|
+
return /* @__PURE__ */ jsx(Callout, { tone: "tip", children });
|
|
280
|
+
}
|
|
281
|
+
function Card({
|
|
282
|
+
title,
|
|
283
|
+
href,
|
|
284
|
+
children
|
|
285
|
+
}) {
|
|
286
|
+
const style = {
|
|
287
|
+
display: "block",
|
|
288
|
+
border: "1px solid var(--color-fd-border)",
|
|
289
|
+
borderRadius: 12,
|
|
290
|
+
padding: "16px 18px",
|
|
291
|
+
textDecoration: "none",
|
|
292
|
+
color: "inherit",
|
|
293
|
+
background: "var(--color-fd-card)"
|
|
294
|
+
};
|
|
295
|
+
const body = /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
296
|
+
title !== void 0 && /* @__PURE__ */ jsx("div", { style: { fontWeight: 700, fontSize: 15, marginBottom: 4 }, children: title }),
|
|
297
|
+
/* @__PURE__ */ jsx("div", { style: { color: "var(--color-fd-muted-foreground)", fontSize: 14 }, children })
|
|
298
|
+
] });
|
|
299
|
+
if (href !== void 0) {
|
|
300
|
+
return /* @__PURE__ */ jsx("a", { href, style, children: body });
|
|
301
|
+
}
|
|
302
|
+
return /* @__PURE__ */ jsx("div", { style, children: body });
|
|
303
|
+
}
|
|
304
|
+
function CardGroup({ cols = 2, children }) {
|
|
305
|
+
const style = {
|
|
306
|
+
display: "grid",
|
|
307
|
+
gridTemplateColumns: `repeat(${String(cols)}, minmax(0, 1fr))`,
|
|
308
|
+
gap: 12,
|
|
309
|
+
margin: "16px 0"
|
|
310
|
+
};
|
|
311
|
+
return /* @__PURE__ */ jsx("div", { style, children });
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
// src/ui/docs-icons.tsx
|
|
315
|
+
var ICONS = {
|
|
316
|
+
house: "house",
|
|
317
|
+
book: "book",
|
|
318
|
+
code: "code",
|
|
319
|
+
rocket: "rocket",
|
|
320
|
+
terminal: "terminal",
|
|
321
|
+
wallet: "wallet",
|
|
322
|
+
key: "key",
|
|
323
|
+
webhook: "webhook",
|
|
324
|
+
globe: "globe"
|
|
325
|
+
};
|
|
326
|
+
var ALIASES = {
|
|
327
|
+
home: "house",
|
|
328
|
+
"book-open": "book",
|
|
329
|
+
api: "code",
|
|
330
|
+
reference: "code",
|
|
331
|
+
terminal: "terminal",
|
|
332
|
+
bank: "wallet",
|
|
333
|
+
"credit-card": "wallet",
|
|
334
|
+
auth: "key",
|
|
335
|
+
lock: "key",
|
|
336
|
+
world: "globe"
|
|
337
|
+
};
|
|
338
|
+
function docsIcon(name) {
|
|
339
|
+
if (!name) {
|
|
340
|
+
return void 0;
|
|
341
|
+
}
|
|
342
|
+
const key = name.toLowerCase();
|
|
343
|
+
const glyph = ICONS[key] ?? ICONS[ALIASES[key] ?? ""];
|
|
344
|
+
return glyph === void 0 ? void 0 : strokeIcon(glyph, { size: 16, rounded: true, key: `docs-icon-${glyph}` });
|
|
345
|
+
}
|
|
346
|
+
function icon(name) {
|
|
347
|
+
return strokeIcon(name, { strokeWidth: 1.75 });
|
|
348
|
+
}
|
|
349
|
+
var PRESETS = {
|
|
350
|
+
"not-found": {
|
|
351
|
+
code: "404",
|
|
352
|
+
title: "Page not found",
|
|
353
|
+
description: "The page you're looking for doesn't exist or may have moved.",
|
|
354
|
+
icon: icon("crossCircle")
|
|
355
|
+
},
|
|
356
|
+
forbidden: {
|
|
357
|
+
code: "403",
|
|
358
|
+
title: "Access restricted",
|
|
359
|
+
description: "Your account is not allowed to view this page. Sign in with an allowed account.",
|
|
360
|
+
icon: icon("lock")
|
|
361
|
+
},
|
|
362
|
+
server: {
|
|
363
|
+
code: "500",
|
|
364
|
+
title: "Something went wrong",
|
|
365
|
+
description: "An unexpected error occurred on our side. Please try again in a moment.",
|
|
366
|
+
icon: icon("alert")
|
|
367
|
+
},
|
|
368
|
+
offline: {
|
|
369
|
+
code: "Offline",
|
|
370
|
+
title: "You're offline",
|
|
371
|
+
description: "Check your connection and try again.",
|
|
372
|
+
icon: icon("offline")
|
|
373
|
+
},
|
|
374
|
+
unknown: {
|
|
375
|
+
code: "Error",
|
|
376
|
+
title: "Something went wrong",
|
|
377
|
+
description: "An unexpected error occurred. Please try again.",
|
|
378
|
+
icon: icon("info")
|
|
379
|
+
}
|
|
380
|
+
};
|
|
381
|
+
function errorPreset(kind) {
|
|
382
|
+
return PRESETS[kind];
|
|
383
|
+
}
|
|
384
|
+
function homeIcon() {
|
|
385
|
+
return strokeIcon("house");
|
|
386
|
+
}
|
|
387
|
+
function ErrorScreen(props) {
|
|
388
|
+
const kind = props.kind ?? "unknown";
|
|
389
|
+
const preset = PRESETS[kind];
|
|
390
|
+
const code = props.code ?? preset.code;
|
|
391
|
+
const title = props.title ?? preset.title;
|
|
392
|
+
const description = props.description ?? preset.description;
|
|
393
|
+
return /* @__PURE__ */ jsxs("div", { className: "error-screen", children: [
|
|
394
|
+
/* @__PURE__ */ jsx("div", { className: "auth-ambient", "aria-hidden": "true" }),
|
|
395
|
+
/* @__PURE__ */ jsxs("main", { className: "error-card", children: [
|
|
396
|
+
/* @__PURE__ */ jsx("div", { className: "error-glyph", "data-kind": kind, children: preset.icon }),
|
|
397
|
+
/* @__PURE__ */ jsx("p", { className: "error-code", children: code }),
|
|
398
|
+
/* @__PURE__ */ jsx("h1", { className: "error-title", children: title }),
|
|
399
|
+
/* @__PURE__ */ jsx("p", { className: "error-desc", children: description }),
|
|
400
|
+
props.homeHref || props.action ? /* @__PURE__ */ jsxs("div", { className: "error-actions", children: [
|
|
401
|
+
props.homeHref ? /* @__PURE__ */ jsxs("a", { className: "error-btn error-btn-primary", href: props.homeHref, children: [
|
|
402
|
+
homeIcon(),
|
|
403
|
+
props.homeLabel ?? "Back to docs"
|
|
404
|
+
] }) : null,
|
|
405
|
+
props.action
|
|
406
|
+
] }) : null
|
|
407
|
+
] })
|
|
408
|
+
] });
|
|
409
|
+
}
|
|
410
|
+
function Steps({ children }) {
|
|
411
|
+
return /* @__PURE__ */ jsx(
|
|
412
|
+
"div",
|
|
413
|
+
{
|
|
414
|
+
style: {
|
|
415
|
+
borderLeft: "2px solid var(--color-fd-border)",
|
|
416
|
+
paddingLeft: 20,
|
|
417
|
+
margin: "16px 0",
|
|
418
|
+
display: "flex",
|
|
419
|
+
flexDirection: "column",
|
|
420
|
+
gap: 16
|
|
421
|
+
},
|
|
422
|
+
children
|
|
423
|
+
}
|
|
424
|
+
);
|
|
425
|
+
}
|
|
426
|
+
function Step({ title, children }) {
|
|
427
|
+
return /* @__PURE__ */ jsxs("div", { children: [
|
|
428
|
+
title !== void 0 && /* @__PURE__ */ jsx("div", { style: { fontWeight: 700, fontSize: 15, marginBottom: 4 }, children: title }),
|
|
429
|
+
/* @__PURE__ */ jsx("div", { children })
|
|
430
|
+
] });
|
|
431
|
+
}
|
|
432
|
+
|
|
433
|
+
// src/ui/mdx.tsx
|
|
434
|
+
var mdxComponents = {
|
|
435
|
+
Note,
|
|
436
|
+
Warning,
|
|
437
|
+
Info,
|
|
438
|
+
Tip,
|
|
439
|
+
Card,
|
|
440
|
+
CardGroup,
|
|
441
|
+
Accordion,
|
|
442
|
+
AccordionGroup,
|
|
443
|
+
Steps,
|
|
444
|
+
Step
|
|
445
|
+
};
|
|
446
|
+
var defaultResolveHref = (page) => {
|
|
447
|
+
if (page.kind === "openapi") {
|
|
448
|
+
return "/reference";
|
|
449
|
+
}
|
|
450
|
+
if (page.file === "introduction") {
|
|
451
|
+
return "/";
|
|
452
|
+
}
|
|
453
|
+
return `/${page.file}`;
|
|
454
|
+
};
|
|
455
|
+
var METHOD_COLORS = {
|
|
456
|
+
GET: "#16a34a",
|
|
457
|
+
POST: "var(--color-fd-primary)",
|
|
458
|
+
PUT: "#d97706",
|
|
459
|
+
PATCH: "#d97706",
|
|
460
|
+
DELETE: "#dc2626"
|
|
461
|
+
};
|
|
462
|
+
function labelForDoc(file) {
|
|
463
|
+
const last = file.split("/").pop() ?? file;
|
|
464
|
+
return last.replace(/-/g, " ").replace(/\b\w/g, (c) => c.toUpperCase());
|
|
465
|
+
}
|
|
466
|
+
function Items({
|
|
467
|
+
items,
|
|
468
|
+
depth,
|
|
469
|
+
resolveHref
|
|
470
|
+
}) {
|
|
471
|
+
const list = { listStyle: "none", margin: 0, paddingLeft: depth === 0 ? 0 : 12 };
|
|
472
|
+
const groupLabel = {
|
|
473
|
+
fontSize: 11,
|
|
474
|
+
fontWeight: 700,
|
|
475
|
+
textTransform: "uppercase",
|
|
476
|
+
letterSpacing: "0.04em",
|
|
477
|
+
color: "var(--color-fd-muted-foreground)",
|
|
478
|
+
margin: "6px 0"
|
|
479
|
+
};
|
|
480
|
+
const link = {
|
|
481
|
+
display: "flex",
|
|
482
|
+
alignItems: "center",
|
|
483
|
+
gap: 8,
|
|
484
|
+
padding: "5px 8px",
|
|
485
|
+
borderRadius: 6,
|
|
486
|
+
color: "var(--color-fd-foreground)",
|
|
487
|
+
textDecoration: "none",
|
|
488
|
+
fontSize: 14
|
|
489
|
+
};
|
|
490
|
+
return /* @__PURE__ */ jsx("ul", { style: list, children: items.map((item, index) => {
|
|
491
|
+
if (item.kind === "group") {
|
|
492
|
+
return /* @__PURE__ */ jsxs("li", { style: { marginTop: 10 }, children: [
|
|
493
|
+
/* @__PURE__ */ jsx("div", { style: groupLabel, children: item.title }),
|
|
494
|
+
/* @__PURE__ */ jsx(Items, { items: item.items, depth: depth + 1, resolveHref })
|
|
495
|
+
] }, `g-${String(index)}`);
|
|
496
|
+
}
|
|
497
|
+
return /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsxs("a", { href: resolveHref(item), style: link, children: [
|
|
498
|
+
item.kind === "openapi" && /* @__PURE__ */ jsx(
|
|
499
|
+
"span",
|
|
500
|
+
{
|
|
501
|
+
style: {
|
|
502
|
+
fontSize: 9,
|
|
503
|
+
fontWeight: 700,
|
|
504
|
+
color: METHOD_COLORS[item.method] ?? "var(--color-fd-muted-foreground)",
|
|
505
|
+
minWidth: 34
|
|
506
|
+
},
|
|
507
|
+
children: item.method
|
|
508
|
+
}
|
|
509
|
+
),
|
|
510
|
+
/* @__PURE__ */ jsx("span", { children: item.kind === "openapi" ? item.apiPath.replace(/^\/api\//, "") : labelForDoc(item.file) })
|
|
511
|
+
] }) }, `p-${String(index)}`);
|
|
512
|
+
}) });
|
|
513
|
+
}
|
|
514
|
+
function DocsSidebar({
|
|
515
|
+
nav,
|
|
516
|
+
resolveHref = defaultResolveHref
|
|
517
|
+
}) {
|
|
518
|
+
return /* @__PURE__ */ jsx("nav", { style: { padding: "20px 16px" }, children: nav.map((tab, index) => /* @__PURE__ */ jsxs("div", { style: { marginBottom: 18 }, children: [
|
|
519
|
+
/* @__PURE__ */ jsx(
|
|
520
|
+
"div",
|
|
521
|
+
{
|
|
522
|
+
style: {
|
|
523
|
+
fontSize: 13,
|
|
524
|
+
fontWeight: 800,
|
|
525
|
+
color: "var(--color-fd-foreground)",
|
|
526
|
+
marginBottom: 4
|
|
527
|
+
},
|
|
528
|
+
children: tab.title
|
|
529
|
+
}
|
|
530
|
+
),
|
|
531
|
+
/* @__PURE__ */ jsx(Items, { items: tab.items, depth: 0, resolveHref })
|
|
532
|
+
] }, `t-${String(index)}`)) });
|
|
533
|
+
}
|
|
534
|
+
|
|
535
|
+
export { Accordion, AccordionGroup, AuthScreen, Callout, Card, CardGroup, DocsSidebar, ErrorScreen, Info, MethodBadge, Note, Step, Steps, Tip, Warning, apiMethodBadges, apiOperationLayout, authErrorMessage, docsIcon, errorPreset, mdxComponents };
|
|
536
|
+
//# sourceMappingURL=ui.js.map
|
|
537
|
+
//# sourceMappingURL=ui.js.map
|
package/dist/ui.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/ui/accordion.tsx","../src/ui/api-layout.tsx","../src/ui/api-sidebar.tsx","../src/ui/auth-screen.tsx","../src/ui/callout.tsx","../src/ui/card.tsx","../src/ui/docs-icons.tsx","../src/ui/error-screen.tsx","../src/ui/steps.tsx","../src/ui/mdx.tsx","../src/ui/sidebar.tsx"],"names":["jsxs","jsx","Fragment"],"mappings":";;;;AAgBO,SAAS,SAAA,CAAU,EAAE,KAAA,EAAO,QAAA,EAAS,EAA4C;AACtF,EAAA,uBACE,IAAA;AAAA,IAAC,SAAA;AAAA,IAAA;AAAA,MACC,KAAA,EAAO;AAAA,QACL,MAAA,EAAQ,kCAAA;AAAA,QACR,YAAA,EAAc,CAAA;AAAA,QACd,OAAA,EAAS,WAAA;AAAA,QACT,MAAA,EAAQ;AAAA,OACV;AAAA,MAEA,QAAA,EAAA;AAAA,wBAAA,GAAA,CAAC,SAAA,EAAA,EAAQ,O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CAAA,EAAA,EAnBO,CAAA,EAAA,EAAK,MAAA,CAAO,KAAK,CAAC,CAAA,CAoB3B,CAAA;AAAA,EAEJ,CAAC,CAAA,EACH,CAAA;AAEJ;AAeO,SAAS,WAAA,CAAY;AAAA,EAC1B,GAAA;AAAA,EACA,WAAA,GAAc;AAChB,CAAA,EAGG;AACD,EAAA,uBACEA,IAAC,KAAA,EAAA,EAAI,KAAA,EAAO,EAAE,OAAA,EAAS,WAAA,IACpB,QAAA,EAAA,GAAA,CAAI,GAAA,CAAI,CAAC,GAAA,EAAK,KAAA,qBACbD,IAAAA,CAAC,KAAA,EAAA,EAA+B,OAAO,EAAE,YAAA,EAAc,IAAG,EACxD,QAAA,EAAA;AAAA,oBAAAC,GAAAA;AAAA,MAAC,KAAA;AAAA,MAAA;AAAA,QACC,KAAA,EAAO;AAAA,UACL,QAAA,EAAU,EAAA;AAAA,UACV,UAAA,EAAY,GAAA;AAAA,UACZ,KAAA,EAAO,4BAAA;AAAA,UACP,YAAA,EAAc;AAAA,SAChB;AAAA,QAEC,QAAA,EAAA,GAAA,CAAI;AAAA;AAAA,KACP;AAAA,oBACAA,IAAC,KAAA,EAAA,EAAM,KAAA,EAAO,IAAI,KAAA,EAAO,KAAA,EAAO,GAAG,WAAA,EAA0B;AAAA,GAAA,EAAA,EAXrD,KAAK,MAAA,CAAO,KAAK,CAAC,CAAA,CAY5B,CACD,CAAA,EACH,CAAA;AAEJ","file":"ui.js","sourcesContent":["import type { ReactNode } from 'react';\n\n/**\n * Accordion components — the Mintlify `<Accordion>` and `<AccordionGroup>`.\n * Built on the native `<details>` element, so they are interactive with zero\n * client JavaScript and render in a Server Component. The hairline uses the\n * framework's border token, so it follows the site's palette and the dark theme.\n *\n * @packageDocumentation\n */\n\n/**\n * A single collapsible section.\n *\n * @public\n */\nexport function Accordion({ title, children }: { title: string; children?: ReactNode }) {\n return (\n <details\n style={{\n border: '1px solid var(--color-fd-border)',\n borderRadius: 8,\n padding: '10px 14px',\n margin: '8px 0',\n }}\n >\n <summary style={{ cursor: 'pointer', fontWeight: 600 }}>{title}</summary>\n <div style={{ marginTop: 8 }}>{children}</div>\n </details>\n );\n}\n\n/**\n * A group of accordions.\n *\n * @public\n */\nexport function AccordionGroup({ children }: { children?: ReactNode }) {\n return <div style={{ margin: '16px 0' }}>{children}</div>;\n}\n","import { cloneElement, isValidElement, type ReactElement, type ReactNode } from 'react';\n\n/**\n * The Mintlify-style API operation layout: one two-column row for the whole\n * operation, so the code rail starts level with the endpoint title. Pass it to\n * fumadocs-openapi — the slots type is structural, so this module needs no\n * fumadocs dependency and the site keeps ownership of that package.\n *\n * @example\n * ```tsx\n * export const APIPage = createOpenAPIPage({\n * content: { renderOperationLayout: apiOperationLayout },\n * });\n * ```\n *\n * @packageDocumentation\n */\n\n/**\n * The slots fumadocs-openapi hands to `renderOperationLayout`.\n *\n * @public\n */\nexport interface ApiOperationSlots {\n readonly header: ReactNode;\n readonly description: ReactNode;\n readonly apiPlayground: ReactNode;\n readonly authSchemes: ReactNode;\n readonly parameters: ReactNode;\n readonly body: ReactNode;\n readonly responses: ReactNode;\n readonly callbacks: ReactNode;\n readonly apiExample: ReactNode;\n}\n\n/**\n * Render an API operation as title → description → playground → request details\n * on the left, with the code/response rail as the right column. Pair with\n * `@blaaiz/docs-core/styles/api-reference.css`, which anchors the rail to the\n * viewport.\n *\n * @param slots - the operation slots from fumadocs-openapi\n * @returns the two-column operation layout\n * @public\n */\nexport function apiOperationLayout(slots: ApiOperationSlots): ReactNode {\n // When the playground is our ApiTryIt (it declares `acceptsExample`), hand it\n // the code/response column so its modal can show form and sample side by side.\n let playground = slots.apiPlayground;\n if (\n isValidElement(playground) &&\n (playground.type as { acceptsExample?: boolean }).acceptsExample === true\n ) {\n playground = cloneElement(playground as ReactElement<{ example?: ReactNode }>, {\n example: slots.apiExample,\n });\n }\n\n return (\n <div className=\"flex flex-col gap-x-6 gap-y-4 @4xl:flex-row @4xl:items-start\">\n <div className=\"min-w-0 flex-1\">\n {slots.header}\n {slots.description}\n {playground}\n {slots.authSchemes}\n {slots.parameters}\n {slots.body}\n {slots.responses}\n {slots.callbacks}\n </div>\n <div className=\"@4xl:sticky @4xl:top-[calc(var(--fd-docs-row-1,2rem)+1rem)] @4xl:w-[400px]\">\n {slots.apiExample}\n </div>\n </div>\n );\n}\n","import type { ReactNode } from 'react';\n\n/**\n * Sidebar helpers for the API reference: a coloured HTTP-method badge and a\n * page-tree transformer that prefixes each API page's sidebar entry with it —\n * the Mintlify look (POST · GET · … next to the endpoint name). Server-\n * compatible; styled by `styles/api-reference.css`.\n *\n * @packageDocumentation\n */\n\n/**\n * A coloured HTTP-method pill (GET, POST, …).\n *\n * @param props - the HTTP method\n * @public\n */\nexport function MethodBadge({ method }: { method: string }) {\n const upper = method.toUpperCase();\n return (\n <span className=\"api-method-badge\" data-method={method.toLowerCase()}>\n {upper}\n </span>\n );\n}\n\n/**\n * The minimal page-tree item this transformer touches. Structural, so the\n * framework needs no fumadocs types; a site passes the result straight into\n * `loader({ pageTree: { transformers } })`.\n *\n * @public\n */\nexport interface SidebarItem {\n readonly type?: string;\n readonly url?: string;\n name?: ReactNode;\n}\n\n/**\n * A page-tree transformer with a `file` hook, generic over the tree's own item\n * type so it slots into fumadocs' `loader({ pageTree: { transformers } })`\n * without a cast: `file` returns exactly the item type it was given.\n *\n * @public\n */\nexport interface SidebarBadgeTransformer {\n file<T extends SidebarItem>(node: T): T;\n}\n\n/**\n * A page-tree transformer that prefixes every API page's sidebar entry with its\n * HTTP-method badge, matching endpoint URLs against the `methods` map the\n * generator emits (`content/api-methods.json`).\n *\n * @example\n * ```ts\n * import methods from '@/content/api-methods.json';\n * loader({ pageTree: { transformers: [apiMethodBadges(methods)] } });\n * ```\n *\n * @param methods - map of page URL to HTTP method\n * @returns a transformer with a `file` hook\n * @public\n */\nexport function apiMethodBadges(\n methods: Readonly<Record<string, string>>,\n): SidebarBadgeTransformer {\n return {\n file<T extends SidebarItem>(node: T): T {\n const method = node.url ? methods[node.url] : undefined;\n if (!method) {\n return node;\n }\n // Only `name` is rewritten; every other field is carried through, so the\n // item keeps its original type.\n return {\n ...node,\n name: (\n <span className=\"api-nav-item\">\n <MethodBadge method={method} />\n <span className=\"api-nav-text\">{node.name}</span>\n </span>\n ),\n };\n },\n };\n}\n","/**\n * The sign-in screen for a workspace-gated docs site.\n *\n * A site renders one element — `<AuthScreen config={config} .../>` — and gets\n * the whole gate: brand, the allowed-domain note, the providers its config\n * declares (email, shared secret, Google), and an inline error banner. The\n * shared-secret provider is a two-step flow — email, then secret — rendered by\n * the `step` prop. The framework owns the layout and copy; the site owns only\n * its config. Server-rendered: every form is a native POST, no client JS.\n *\n * @packageDocumentation\n */\n\nimport type { ReactNode } from 'react';\n\nimport type { DocsConfig } from '../core/config.js';\n\nimport { strokeIcon } from './icons.js';\n\n/**\n * Map a sign-in error code (carried on `?error=` after a failed attempt) to a\n * human sentence. Unknown codes get a safe generic message.\n *\n * @param code - the error code, or undefined\n * @param domains - the allowed email domains, for the domain-mismatch message\n * @returns the message to show, or null when there is no error\n * @public\n */\nexport function authErrorMessage(\n code: string | undefined,\n domains: readonly string[],\n): string | null {\n if (!code) {\n return null;\n }\n const list = domains.join(', ');\n switch (code) {\n case 'forbidden':\n case 'domain':\n return list\n ? `That email isn't on an allowed domain. Sign in with your ${list} account.`\n : `That account isn't allowed to access these docs.`;\n case 'oauth':\n case 'state':\n return `Google sign-in didn't complete. Please try again.`;\n case 'badsecret':\n return `That secret is incorrect. Please try again.`;\n case 'expired':\n return `Your session expired. Sign in again to continue.`;\n case 'config':\n return `Sign-in isn't configured for this site. Contact the site owner.`;\n default:\n return `Something went wrong signing in. Please try again.`;\n }\n}\n\n/**\n * Props for {@link AuthScreen}.\n *\n * @public\n */\nexport interface AuthScreenProps {\n /** The site configuration; drives brand, providers, and allowed domains. */\n readonly config: DocsConfig;\n /** The path to return to after sign-in (from the gate's `?from=`). */\n readonly from?: string;\n /** A sign-in error code to surface inline (from `?error=`). */\n readonly error?: string;\n /**\n * Which step of the shared-secret flow to render. `'email'` (default) shows\n * the email field; `'secret'` shows the secret field for the already-validated\n * {@link AuthScreenProps.email}. Ignored unless the secret provider is enabled.\n */\n readonly step?: 'email' | 'secret';\n /** The domain-checked email to show on the secret step (from the site's cookie). */\n readonly email?: string;\n /**\n * Whether to offer the shared-secret flow. Defaults to whether config declares\n * the secret provider; pass `false` when its env secret is absent. When on, it\n * supersedes plain email sign-in.\n */\n readonly secretEnabled?: boolean;\n /**\n * Whether to offer the Google button. Defaults to whether config declares the\n * Google provider; pass `false` to hide it when its env vars are absent.\n */\n readonly googleEnabled?: boolean;\n /** The email sign-in endpoint. Default `/api/auth/email`. */\n readonly emailAction?: string;\n /** The shared-secret sign-in endpoint (both steps post here). Default `/api/auth/secret`. */\n readonly secretAction?: string;\n /** The Google sign-in start path. Default `/api/auth/google/start`. */\n readonly googleStartPath?: string;\n /** The sign-in page path, for the \"use a different email\" link. Default `/signin`. */\n readonly signInPath?: string;\n}\n\nfunction mailIcon(): ReactNode {\n return strokeIcon('mail');\n}\n\nfunction lockIcon(): ReactNode {\n return strokeIcon('lock');\n}\n\nfunction alertIcon(): ReactNode {\n return strokeIcon('info');\n}\n\nfunction keyIcon(): ReactNode {\n return strokeIcon('key');\n}\n\nfunction userIcon(): ReactNode {\n return strokeIcon('user');\n}\n\n/** Google's multicolour \"G\" mark. */\nfunction googleIcon(): ReactNode {\n return (\n <svg viewBox=\"0 0 24 24\" aria-hidden=\"true\">\n <path\n fill=\"#4285F4\"\n d=\"M23.52 12.27c0-.82-.07-1.6-.2-2.36H12v4.46h6.47a5.53 5.53 0 0 1-2.4 3.63v3.02h3.88c2.27-2.09 3.57-5.17 3.57-8.75z\"\n />\n <path\n fill=\"#34A853\"\n d=\"M12 24c3.24 0 5.96-1.08 7.95-2.91l-3.88-3.02c-1.08.72-2.45 1.16-4.07 1.16-3.13 0-5.78-2.11-6.73-4.96H1.29v3.12A12 12 0 0 0 12 24z\"\n />\n <path\n fill=\"#FBBC05\"\n d=\"M5.27 14.27a7.2 7.2 0 0 1 0-4.54V6.61H1.29a12 12 0 0 0 0 10.78l3.98-3.12z\"\n />\n <path\n fill=\"#EA4335\"\n d=\"M12 4.75c1.77 0 3.35.61 4.6 1.8l3.44-3.44A11.5 11.5 0 0 0 12 0 12 12 0 0 0 1.29 6.61l3.98 3.12C6.22 6.86 8.87 4.75 12 4.75z\"\n />\n </svg>\n );\n}\n\n/**\n * Render the sign-in screen.\n *\n * @param props - see {@link AuthScreenProps}\n * @public\n */\nexport function AuthScreen(props: AuthScreenProps): ReactNode {\n const { config, from, error } = props;\n const auth = config.auth;\n const workspace = auth === 'public' ? null : auth;\n const domains = workspace?.allowedDomains ?? [];\n const target = from ?? '/';\n const emailAction = props.emailAction ?? '/api/auth/email';\n const secretAction = props.secretAction ?? '/api/auth/secret';\n const googleStartPath = props.googleStartPath ?? '/api/auth/google/start';\n const signInPath = props.signInPath ?? '/signin';\n\n const secretEnabled = props.secretEnabled ?? Boolean(workspace?.providers.secret);\n const emailProvider = workspace?.providers.email ?? false;\n // The secret flow supersedes plain email sign-in: offering email-only too\n // would let a reader skip the secret.\n const hasEmailFlow = secretEnabled || emailProvider;\n const showGoogle = props.googleEnabled ?? Boolean(workspace?.providers.google);\n const message = authErrorMessage(error, domains);\n const logo = config.theme.logo;\n\n // The secret step: only when the flow is enabled and we hold a validated email.\n const onSecretStep = props.step === 'secret' && secretEnabled && Boolean(props.email);\n\n const brand = (\n <div className=\"auth-brand\">\n {logo ? (\n <>\n <img className=\"auth-logo-light\" src={logo.light} alt={config.theme.name} />\n <img className=\"auth-logo-dark\" src={logo.dark} alt={config.theme.name} />\n </>\n ) : (\n <>\n <span className=\"auth-dot\" aria-hidden=\"true\" />\n {config.theme.name}\n </>\n )}\n </div>\n );\n\n const errorBanner = message ? (\n <div className=\"auth-error\" role=\"alert\">\n {alertIcon()}\n <span>{message}</span>\n </div>\n ) : null;\n\n if (onSecretStep) {\n return (\n <div className=\"auth-screen\">\n <div className=\"auth-ambient\" aria-hidden=\"true\" />\n <main className=\"auth-card\">\n {brand}\n <h1 className=\"auth-title\">Enter access secret</h1>\n <p className=\"auth-sub\">One more step — enter the shared secret to continue.</p>\n\n <div className=\"auth-identity\">\n {userIcon()}\n <span className=\"auth-identity-email\">{props.email}</span>\n <a className=\"auth-change\" href={signInPath}>\n Change\n </a>\n </div>\n\n {errorBanner}\n\n <form className=\"auth-form\" action={secretAction} method=\"post\">\n <input type=\"hidden\" name=\"from\" value={target} />\n <label className=\"auth-label\" htmlFor=\"auth-secret\">\n Access secret\n </label>\n <div className=\"auth-field\">\n {keyIcon()}\n <input\n id=\"auth-secret\"\n name=\"secret\"\n type=\"password\"\n required\n autoFocus\n autoComplete=\"off\"\n placeholder=\"Enter the access secret\"\n className=\"auth-input\"\n />\n </div>\n <button type=\"submit\" className=\"auth-submit\">\n Sign in\n </button>\n </form>\n\n <p className=\"auth-foot\">\n {lockIcon()}\n Access is limited to your workspace.\n </p>\n </main>\n </div>\n );\n }\n\n return (\n <div className=\"auth-screen\">\n <div className=\"auth-ambient\" aria-hidden=\"true\" />\n <main className=\"auth-card\">\n {brand}\n <h1 className=\"auth-title\">Sign in</h1>\n <p className=\"auth-sub\">\n {domains.length ? (\n <>\n These docs are restricted to <b>{domains.join(', ')}</b> accounts.\n </>\n ) : (\n 'These docs are restricted to your workspace.'\n )}\n </p>\n\n {errorBanner}\n\n {hasEmailFlow ? (\n <form\n className=\"auth-form\"\n action={secretEnabled ? secretAction : emailAction}\n method=\"post\"\n >\n <input type=\"hidden\" name=\"from\" value={target} />\n <label className=\"auth-label\" htmlFor=\"auth-email\">\n Work email\n </label>\n <div className=\"auth-field\">\n {mailIcon()}\n <input\n id=\"auth-email\"\n name=\"email\"\n type=\"email\"\n required\n autoComplete=\"email\"\n autoFocus\n placeholder={`you@${domains[0] ?? 'company.com'}`}\n className=\"auth-input\"\n />\n </div>\n <button type=\"submit\" className=\"auth-submit\">\n {secretEnabled ? 'Continue' : 'Continue with email'}\n </button>\n </form>\n ) : null}\n\n {hasEmailFlow && showGoogle ? <div className=\"auth-divider\">or</div> : null}\n\n {showGoogle ? (\n <a className=\"auth-google\" href={`${googleStartPath}?from=${encodeURIComponent(target)}`}>\n {googleIcon()}\n Continue with Google\n </a>\n ) : null}\n\n <p className=\"auth-foot\">\n {lockIcon()}\n Access is limited to your workspace.\n </p>\n </main>\n </div>\n );\n}\n","import type { ReactNode } from 'react';\n\nimport { type GlyphName, strokeIcon } from './icons.js';\n\n/**\n * Callout components — the Mintlify `<Note>`, `<Warning>`, `<Info>`, and `<Tip>`\n * blocks. Server-compatible: no client state, so they render in a React Server\n * Component without a `'use client'` boundary.\n *\n * The box is styled by the `.cl` classes in `@blaaiz/docs-core/styles/docs.css`,\n * which a site already imports. That is what makes a callout follow the dark\n * theme: the class set carries a light and a dark palette per tone, where the\n * inline colours these components used before could only ever be light.\n *\n * @packageDocumentation\n */\n\ntype Tone = 'note' | 'warning' | 'info' | 'tip';\n\n/** The glyph each tone shows: a circled `i`, a bulb for a tip, a triangle to warn. */\nconst TONE_GLYPHS: Record<Tone, GlyphName> = {\n note: 'info',\n info: 'info',\n tip: 'bulb',\n warning: 'alert',\n};\n\n/**\n * A tinted callout box with the tone's icon.\n *\n * @public\n */\nexport function Callout({ tone = 'note', children }: { tone?: Tone; children?: ReactNode }) {\n return (\n <div className={`cl cl-${tone}`}>\n <span className=\"cl-icon\">{strokeIcon(TONE_GLYPHS[tone], { size: 18, rounded: true })}</span>\n <div className=\"cl-body\">{children}</div>\n </div>\n );\n}\n\n/** Mintlify `<Note>`. @public */\nexport function Note({ children }: { children?: ReactNode }) {\n return <Callout tone=\"note\">{children}</Callout>;\n}\n\n/** Mintlify `<Warning>`. @public */\nexport function Warning({ children }: { children?: ReactNode }) {\n return <Callout tone=\"warning\">{children}</Callout>;\n}\n\n/** Mintlify `<Info>`. @public */\nexport function Info({ children }: { children?: ReactNode }) {\n return <Callout tone=\"info\">{children}</Callout>;\n}\n\n/** Mintlify `<Tip>`. @public */\nexport function Tip({ children }: { children?: ReactNode }) {\n return <Callout tone=\"tip\">{children}</Callout>;\n}\n","import type { CSSProperties, ReactNode } from 'react';\n\n/**\n * Card components — the Mintlify `<Card>` and `<CardGroup>`. Server-compatible.\n *\n * Colours come from the framework's `--color-fd-*` theme variables, so a card\n * follows the site's palette and the dark theme. Nothing here is a fixed hue.\n *\n * @packageDocumentation\n */\n\n/**\n * A card. When `href` is set it renders as a link.\n *\n * @public\n */\nexport function Card({\n title,\n href,\n children,\n}: {\n title?: string;\n href?: string;\n children?: ReactNode;\n}) {\n const style: CSSProperties = {\n display: 'block',\n border: '1px solid var(--color-fd-border)',\n borderRadius: 12,\n padding: '16px 18px',\n textDecoration: 'none',\n color: 'inherit',\n background: 'var(--color-fd-card)',\n };\n const body = (\n <>\n {title !== undefined && (\n <div style={{ fontWeight: 700, fontSize: 15, marginBottom: 4 }}>{title}</div>\n )}\n <div style={{ color: 'var(--color-fd-muted-foreground)', fontSize: 14 }}>{children}</div>\n </>\n );\n if (href !== undefined) {\n return (\n <a href={href} style={style}>\n {body}\n </a>\n );\n }\n return <div style={style}>{body}</div>;\n}\n\n/**\n * A responsive grid of cards. `cols` sets the column count (default 2).\n *\n * @public\n */\nexport function CardGroup({ cols = 2, children }: { cols?: number; children?: ReactNode }) {\n const style: CSSProperties = {\n display: 'grid',\n gridTemplateColumns: `repeat(${String(cols)}, minmax(0, 1fr))`,\n gap: 12,\n margin: '16px 0',\n };\n return <div style={style}>{children}</div>;\n}\n","import type { ReactNode } from 'react';\n\n/**\n * Inline-SVG icon resolver for navigation icons named in `docs.json` (Mintlify\n * uses icon names like `house`, `book`, `code`). Zero dependency: a curated set\n * of common docs-nav icons plus a graceful no-icon fallback. Pass it to\n * `loader({ icon: docsIcon })`.\n *\n * @packageDocumentation\n */\n\nimport { type GlyphName, strokeIcon } from './icons.js';\n\n/** The glyphs a docs navigation reaches for, keyed by the names authors write. */\nconst ICONS: Record<string, GlyphName> = {\n house: 'house',\n book: 'book',\n code: 'code',\n rocket: 'rocket',\n terminal: 'terminal',\n wallet: 'wallet',\n key: 'key',\n webhook: 'webhook',\n globe: 'globe',\n};\n\n// Aliases point several common spellings at one glyph.\nconst ALIASES: Record<string, string> = {\n home: 'house',\n 'book-open': 'book',\n api: 'code',\n reference: 'code',\n terminal: 'terminal',\n bank: 'wallet',\n 'credit-card': 'wallet',\n auth: 'key',\n lock: 'key',\n world: 'globe',\n};\n\n/**\n * Resolve a `docs.json` icon name to an inline SVG. Unknown names resolve to\n * nothing, so the sidebar simply shows no icon rather than a broken one.\n *\n * @param name - the icon name from `docs.json`, or undefined\n * @returns the icon element, or undefined\n * @public\n */\nexport function docsIcon(name: string | undefined): ReactNode {\n if (!name) {\n return undefined;\n }\n const key = name.toLowerCase();\n const glyph = ICONS[key] ?? ICONS[ALIASES[key] ?? ''];\n // The key matters: fumadocs renders a nav link as the array [icon, text], and\n // an unkeyed element in that array raises React's \"unique key\" warning in the\n // consuming site's console.\n return glyph === undefined\n ? undefined\n : strokeIcon(glyph, { size: 16, rounded: true, key: `docs-icon-${glyph}` });\n}\n","/**\n * A general error screen with per-kind states.\n *\n * One component covers every full-page error a docs site shows — a missing page\n * (404), a forbidden account (403), a runtime failure (500), an offline state —\n * each with its own icon, eyebrow, and default copy. A site picks the `kind`\n * and, for runtime errors, passes a retry action; the framework owns the rest.\n * Server-compatible: the site's `error.tsx` wrapper carries the `'use client'`\n * boundary and hands in the retry button.\n *\n * @packageDocumentation\n */\n\nimport type { ReactNode } from 'react';\n\nimport { type GlyphName, strokeIcon } from './icons.js';\n\n/**\n * The error states the screen renders.\n *\n * @public\n */\nexport type ErrorKind = 'not-found' | 'forbidden' | 'server' | 'offline' | 'unknown';\n\n/**\n * The default eyebrow, title, description, and icon for a {@link ErrorKind}.\n *\n * @public\n */\nexport interface ErrorPreset {\n readonly code: string;\n readonly title: string;\n readonly description: string;\n readonly icon: ReactNode;\n}\n\n/** The screens' icons are drawn a hair lighter than the rest of the UI. */\nfunction icon(name: GlyphName): ReactNode {\n return strokeIcon(name, { strokeWidth: 1.75 });\n}\n\nconst PRESETS: Record<ErrorKind, ErrorPreset> = {\n 'not-found': {\n code: '404',\n title: 'Page not found',\n description: \"The page you're looking for doesn't exist or may have moved.\",\n icon: icon('crossCircle'),\n },\n forbidden: {\n code: '403',\n title: 'Access restricted',\n description: 'Your account is not allowed to view this page. Sign in with an allowed account.',\n icon: icon('lock'),\n },\n server: {\n code: '500',\n title: 'Something went wrong',\n description: 'An unexpected error occurred on our side. Please try again in a moment.',\n icon: icon('alert'),\n },\n offline: {\n code: 'Offline',\n title: \"You're offline\",\n description: 'Check your connection and try again.',\n icon: icon('offline'),\n },\n unknown: {\n code: 'Error',\n title: 'Something went wrong',\n description: 'An unexpected error occurred. Please try again.',\n icon: icon('info'),\n },\n};\n\n/**\n * The default preset for an error kind — its icon, eyebrow, and copy.\n *\n * @param kind - the error state\n * @returns the preset a site can render or override\n * @public\n */\nexport function errorPreset(kind: ErrorKind): ErrorPreset {\n return PRESETS[kind];\n}\n\n/**\n * Props for {@link ErrorScreen}. Everything but `kind` is optional: the kind's\n * preset fills the eyebrow, title, description, and icon unless overridden.\n *\n * @public\n */\nexport interface ErrorScreenProps {\n /** Which error state to render. Default `unknown`. */\n readonly kind?: ErrorKind;\n /** Override the eyebrow code (e.g. a specific status). */\n readonly code?: string;\n /** Override the title. */\n readonly title?: string;\n /** Override the description. */\n readonly description?: string;\n /** When set, render a primary button linking here (e.g. `/docs`). */\n readonly homeHref?: string;\n /** Label for the home button. Default \"Back to docs\". */\n readonly homeLabel?: string;\n /** An extra action rendered beside the home button (e.g. a retry button). */\n readonly action?: ReactNode;\n}\n\nfunction homeIcon(): ReactNode {\n return strokeIcon('house');\n}\n\n/**\n * Render the error screen.\n *\n * @param props - see {@link ErrorScreenProps}\n * @public\n */\nexport function ErrorScreen(props: ErrorScreenProps): ReactNode {\n const kind = props.kind ?? 'unknown';\n const preset = PRESETS[kind];\n const code = props.code ?? preset.code;\n const title = props.title ?? preset.title;\n const description = props.description ?? preset.description;\n\n return (\n <div className=\"error-screen\">\n <div className=\"auth-ambient\" aria-hidden=\"true\" />\n <main className=\"error-card\">\n <div className=\"error-glyph\" data-kind={kind}>\n {preset.icon}\n </div>\n <p className=\"error-code\">{code}</p>\n <h1 className=\"error-title\">{title}</h1>\n <p className=\"error-desc\">{description}</p>\n {props.homeHref || props.action ? (\n <div className=\"error-actions\">\n {props.homeHref ? (\n <a className=\"error-btn error-btn-primary\" href={props.homeHref}>\n {homeIcon()}\n {props.homeLabel ?? 'Back to docs'}\n </a>\n ) : null}\n {props.action}\n </div>\n ) : null}\n </main>\n </div>\n );\n}\n","import type { ReactNode } from 'react';\n\n/**\n * Steps components — the Mintlify `<Steps>` and `<Step>`. Server-compatible.\n *\n * The spine uses the framework's border token, so it follows the site's palette\n * and the dark theme.\n *\n * @packageDocumentation\n */\n\n/**\n * An ordered list of steps.\n *\n * @public\n */\nexport function Steps({ children }: { children?: ReactNode }) {\n return (\n <div\n style={{\n borderLeft: '2px solid var(--color-fd-border)',\n paddingLeft: 20,\n margin: '16px 0',\n display: 'flex',\n flexDirection: 'column',\n gap: 16,\n }}\n >\n {children}\n </div>\n );\n}\n\n/**\n * A single step with an optional title.\n *\n * @public\n */\nexport function Step({ title, children }: { title?: string; children?: ReactNode }) {\n return (\n <div>\n {title !== undefined && (\n <div style={{ fontWeight: 700, fontSize: 15, marginBottom: 4 }}>{title}</div>\n )}\n <div>{children}</div>\n </div>\n );\n}\n","import { Accordion, AccordionGroup } from './accordion.js';\nimport { Info, Note, Tip, Warning } from './callout.js';\nimport { Card, CardGroup } from './card.js';\nimport { Step, Steps } from './steps.js';\n\n/**\n * The Mintlify-compatible MDX component map.\n *\n * Pass this to an MDX renderer (for example `next-mdx-remote`'s `compileMDX`)\n * so real Mintlify guides render unchanged. A site no longer needs to shim\n * these itself.\n *\n * @public\n */\nexport const mdxComponents = {\n Note,\n Warning,\n Info,\n Tip,\n Card,\n CardGroup,\n Accordion,\n AccordionGroup,\n Steps,\n Step,\n};\n","import type { CSSProperties } from 'react';\n\nimport type { NavItem, NavPage, Navigation } from '../core/index.js';\n\n/**\n * The navigation sidebar. Renders a {@link Navigation} tree (produced by\n * `parseNavigation`) as tabs, groups, and page links. Framework-agnostic: it\n * emits plain anchors and takes an optional `resolveHref` so a site controls\n * its own routing. Server-compatible.\n *\n * @packageDocumentation\n */\n\n/**\n * Map a navigation page to a URL. Override to control routing — the default\n * assumes one specific site shape, which is why {@link DocsSidebar} is\n * deprecated.\n *\n * @public\n */\nexport type ResolveHref = (page: NavPage) => string;\n\nconst defaultResolveHref: ResolveHref = (page) => {\n if (page.kind === 'openapi') {\n return '/reference';\n }\n if (page.file === 'introduction') {\n return '/';\n }\n return `/${page.file}`;\n};\n\n/**\n * The method palette. The three status hues are the ones\n * `styles/api-reference.css` uses for its badges, so a method reads the same\n * colour everywhere; `POST` follows the site's own accent.\n */\nconst METHOD_COLORS: Record<string, string> = {\n GET: '#16a34a',\n POST: 'var(--color-fd-primary)',\n PUT: '#d97706',\n PATCH: '#d97706',\n DELETE: '#dc2626',\n};\n\nfunction labelForDoc(file: string): string {\n const last = file.split('/').pop() ?? file;\n return last.replace(/-/g, ' ').replace(/\\b\\w/g, (c) => c.toUpperCase());\n}\n\nfunction Items({\n items,\n depth,\n resolveHref,\n}: {\n items: readonly NavItem[];\n depth: number;\n resolveHref: ResolveHref;\n}) {\n const list: CSSProperties = { listStyle: 'none', margin: 0, paddingLeft: depth === 0 ? 0 : 12 };\n const groupLabel: CSSProperties = {\n fontSize: 11,\n fontWeight: 700,\n textTransform: 'uppercase',\n letterSpacing: '0.04em',\n color: 'var(--color-fd-muted-foreground)',\n margin: '6px 0',\n };\n const link: CSSProperties = {\n display: 'flex',\n alignItems: 'center',\n gap: 8,\n padding: '5px 8px',\n borderRadius: 6,\n color: 'var(--color-fd-foreground)',\n textDecoration: 'none',\n fontSize: 14,\n };\n return (\n <ul style={list}>\n {items.map((item, index) => {\n if (item.kind === 'group') {\n return (\n <li key={`g-${String(index)}`} style={{ marginTop: 10 }}>\n <div style={groupLabel}>{item.title}</div>\n <Items items={item.items} depth={depth + 1} resolveHref={resolveHref} />\n </li>\n );\n }\n return (\n <li key={`p-${String(index)}`}>\n <a href={resolveHref(item)} style={link}>\n {item.kind === 'openapi' && (\n <span\n style={{\n fontSize: 9,\n fontWeight: 700,\n color: METHOD_COLORS[item.method] ?? 'var(--color-fd-muted-foreground)',\n minWidth: 34,\n }}\n >\n {item.method}\n </span>\n )}\n <span>\n {item.kind === 'openapi'\n ? item.apiPath.replace(/^\\/api\\//, '')\n : labelForDoc(item.file)}\n </span>\n </a>\n </li>\n );\n })}\n </ul>\n );\n}\n\n/**\n * Render the documentation sidebar.\n *\n * @deprecated Use fumadocs' `DocsLayout` with `loader({ icon: docsIcon })`,\n * which both shipped sites use. This component predates that wiring: it renders\n * plain anchors with no active state, no collapsible groups, and no search, and\n * its default `resolveHref` assumes a routing shape (`/reference`, and\n * `introduction` at the root) that no site now uses. Pass your own\n * {@link ResolveHref} if you keep it. It stays exported, and behaves exactly as\n * before, until the next major version.\n *\n * @public\n */\nexport function DocsSidebar({\n nav,\n resolveHref = defaultResolveHref,\n}: {\n nav: Navigation;\n resolveHref?: ResolveHref;\n}) {\n return (\n <nav style={{ padding: '20px 16px' }}>\n {nav.map((tab, index) => (\n <div key={`t-${String(index)}`} style={{ marginBottom: 18 }}>\n <div\n style={{\n fontSize: 13,\n fontWeight: 800,\n color: 'var(--color-fd-foreground)',\n marginBottom: 4,\n }}\n >\n {tab.title}\n </div>\n <Items items={tab.items} depth={0} resolveHref={resolveHref} />\n </div>\n ))}\n </nav>\n );\n}\n"]}
|