@blaaiz/docs-core 0.4.0 → 0.6.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/dist/{chunk-JHN5XQPU.js → chunk-2GUUVNTP.js} +226 -31
- package/dist/chunk-2GUUVNTP.js.map +1 -0
- package/dist/{chunk-ZKOOKLZ3.js → chunk-6H6OB7YP.js} +17 -2
- package/dist/chunk-6H6OB7YP.js.map +1 -0
- package/dist/generator.cjs +204 -30
- package/dist/generator.cjs.map +1 -1
- package/dist/generator.d.cts +24 -0
- package/dist/generator.d.ts +24 -0
- package/dist/generator.js +179 -22
- package/dist/generator.js.map +1 -1
- package/dist/index.cjs +228 -28
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +267 -8
- package/dist/index.d.ts +267 -8
- package/dist/index.js +1 -1
- package/dist/{navigation-CGqFIPlP.d.cts → navigation-DvgyWSZ4.d.cts} +22 -1
- package/dist/{navigation-CGqFIPlP.d.ts → navigation-DvgyWSZ4.d.ts} +22 -1
- package/dist/ui/api-try-it.cjs +15 -0
- package/dist/ui/api-try-it.cjs.map +1 -1
- package/dist/ui/api-try-it.js +1 -1
- package/dist/ui/ask-ai.cjs +26 -6
- package/dist/ui/ask-ai.cjs.map +1 -1
- package/dist/ui/ask-ai.d.cts +6 -1
- package/dist/ui/ask-ai.d.ts +6 -1
- package/dist/ui/ask-ai.js +26 -6
- package/dist/ui/ask-ai.js.map +1 -1
- package/dist/ui/copy-page.cjs +15 -0
- package/dist/ui/copy-page.cjs.map +1 -1
- package/dist/ui/copy-page.js +1 -1
- package/dist/ui.cjs +77 -6
- package/dist/ui.cjs.map +1 -1
- package/dist/ui.d.cts +99 -8
- package/dist/ui.d.ts +99 -8
- package/dist/ui.js +62 -8
- package/dist/ui.js.map +1 -1
- package/package.json +1 -1
- package/skills/SKILL.md +73 -27
- package/styles/api-reference.css +45 -2
- package/styles/ask-ai.css +28 -0
- package/styles/docs.css +96 -1
- package/styles/home.css +34 -1
- package/dist/chunk-JHN5XQPU.js.map +0 -1
- package/dist/chunk-ZKOOKLZ3.js.map +0 -1
package/dist/ui.d.cts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
2
|
import { ReactNode } from 'react';
|
|
3
|
-
import { D as DocsConfig, N as Navigation, l as NavPage } from './navigation-
|
|
3
|
+
import { D as DocsConfig, t as NavbarConfig, N as Navigation, l as NavPage } from './navigation-DvgyWSZ4.cjs';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* Accordion components — the Mintlify `<Accordion>` and `<AccordionGroup>`.
|
|
@@ -297,6 +297,13 @@ interface NavJsonLink {
|
|
|
297
297
|
readonly text: string;
|
|
298
298
|
readonly url: string;
|
|
299
299
|
readonly icon?: string;
|
|
300
|
+
/**
|
|
301
|
+
* Path prefixes this link is active for, when the generator knows the
|
|
302
|
+
* link's territory better than the URL shows — an API tab whose entry page
|
|
303
|
+
* lives outside its generated folder. Omitted, the section is derived from
|
|
304
|
+
* the URL. Ignored on the exact-match links (Home and the docs root).
|
|
305
|
+
*/
|
|
306
|
+
readonly match?: string | readonly string[];
|
|
300
307
|
}
|
|
301
308
|
/**
|
|
302
309
|
* A rendered top-navigation link, structurally assignable to a fumadocs
|
|
@@ -310,13 +317,14 @@ interface DocsNavLink {
|
|
|
310
317
|
readonly icon: ReactNode;
|
|
311
318
|
readonly active: 'url' | 'nested-url';
|
|
312
319
|
/**
|
|
313
|
-
* The path this link is active for. Equal to `url` for Home and the docs
|
|
314
|
-
* root;
|
|
315
|
-
*
|
|
316
|
-
*
|
|
317
|
-
*
|
|
320
|
+
* The path(s) this link is active for. Equal to `url` for Home and the docs
|
|
321
|
+
* root; for a section link, the section prefixes — `nav.json`'s own `match`
|
|
322
|
+
* when the generator emitted one, the URL-derived section otherwise — so the
|
|
323
|
+
* link stays active on every page of its section, not only under its click
|
|
324
|
+
* target. Plain fumadocs link items cannot express this split; a site
|
|
325
|
+
* component that compares the pathname against `match` can.
|
|
318
326
|
*/
|
|
319
|
-
readonly match: string;
|
|
327
|
+
readonly match: string | readonly string[];
|
|
320
328
|
}
|
|
321
329
|
/**
|
|
322
330
|
* Options for {@link docsNavLinks}.
|
|
@@ -331,6 +339,13 @@ interface DocsNavLinksOptions {
|
|
|
331
339
|
readonly home?: NavJsonLink | false;
|
|
332
340
|
/** The docs base URL, whose link matches exactly rather than nested. */
|
|
333
341
|
readonly baseUrl?: string;
|
|
342
|
+
/**
|
|
343
|
+
* Resolves an icon name from `docs.json` to an element. Defaults to the
|
|
344
|
+
* framework's `docsIcon` set; pass your own to use any icon library the
|
|
345
|
+
* site installs (return `undefined` for a text-only link). The default
|
|
346
|
+
* Home entry resolves the name `house` through it.
|
|
347
|
+
*/
|
|
348
|
+
readonly icon?: (name: string | undefined) => ReactNode;
|
|
334
349
|
}
|
|
335
350
|
/**
|
|
336
351
|
* Map `nav.json` entries to top-navigation links for `HomeLayout` and
|
|
@@ -350,6 +365,82 @@ declare function docsNavLinks(links: readonly NavJsonLink[], options?: DocsNavLi
|
|
|
350
365
|
*/
|
|
351
366
|
declare function isDocsNavLinkActive(link: DocsNavLink, pathname: string): boolean;
|
|
352
367
|
|
|
368
|
+
/**
|
|
369
|
+
* The section links as fumadocs navbar tabs: the docs pages' second header
|
|
370
|
+
* row. The notebook layout's navbar tabs render only `title` — a `LayoutTab`'s
|
|
371
|
+
* `icon` field is silently dropped in that mode — so the icon is folded into
|
|
372
|
+
* the title node here, once, instead of every site rediscovering it.
|
|
373
|
+
*
|
|
374
|
+
* A link whose territory is a page-tree folder binds that folder (`$folder`
|
|
375
|
+
* activates the tab on the whole subtree); the rest match their exact URLs.
|
|
376
|
+
*
|
|
377
|
+
* @packageDocumentation
|
|
378
|
+
*/
|
|
379
|
+
/**
|
|
380
|
+
* One navbar tab, structurally assignable to a fumadocs `LayoutTab`.
|
|
381
|
+
*
|
|
382
|
+
* @public
|
|
383
|
+
*/
|
|
384
|
+
interface DocsLayoutTab<Folder> {
|
|
385
|
+
/** The tab's label: the link's icon and text. */
|
|
386
|
+
readonly title: ReactNode;
|
|
387
|
+
/** The tab's click target. */
|
|
388
|
+
readonly url: string;
|
|
389
|
+
/** The page-tree folder the tab activates on, when its territory is one. */
|
|
390
|
+
readonly $folder?: Folder;
|
|
391
|
+
/** The exact URLs the tab activates on, when it binds no folder. */
|
|
392
|
+
readonly urls?: Set<string>;
|
|
393
|
+
}
|
|
394
|
+
/**
|
|
395
|
+
* Map `nav.json` entries to navbar tabs for `DocsLayout` with
|
|
396
|
+
* `tabMode="navbar"`.
|
|
397
|
+
*
|
|
398
|
+
* @param links - the parsed `content/nav.json`
|
|
399
|
+
* @param tree - the site's page tree (`source.pageTree`)
|
|
400
|
+
* @param options - the Home entry, docs base URL, and icon resolver
|
|
401
|
+
* @returns tabs with icons in their titles and territories bound
|
|
402
|
+
* @public
|
|
403
|
+
*/
|
|
404
|
+
declare function docsLayoutTabs<Node extends {
|
|
405
|
+
readonly type: string;
|
|
406
|
+
}>(links: readonly NavJsonLink[], tree: {
|
|
407
|
+
readonly children: readonly Node[];
|
|
408
|
+
}, options?: DocsNavLinksOptions): DocsLayoutTab<Extract<Node, {
|
|
409
|
+
readonly type: 'folder';
|
|
410
|
+
}>>[];
|
|
411
|
+
|
|
412
|
+
/**
|
|
413
|
+
* The top bar's action cluster: the config's calls to action, and sign-out on
|
|
414
|
+
* a workspace site. Server-compatible; sign-out is a native form post to the
|
|
415
|
+
* site's sign-out route, so no client JavaScript is involved. Styled by
|
|
416
|
+
* `styles/docs.css`.
|
|
417
|
+
*
|
|
418
|
+
* @packageDocumentation
|
|
419
|
+
*/
|
|
420
|
+
/**
|
|
421
|
+
* Props for {@link NavActions}.
|
|
422
|
+
*
|
|
423
|
+
* @public
|
|
424
|
+
*/
|
|
425
|
+
interface NavActionsProps {
|
|
426
|
+
/** The config's `navbar` block: the primary button and the secondary link. */
|
|
427
|
+
readonly navbar?: NavbarConfig;
|
|
428
|
+
/** Whether to offer sign-out (a workspace site). */
|
|
429
|
+
readonly signOut?: boolean;
|
|
430
|
+
/** The sign-out route. Default `/api/auth/signout`. */
|
|
431
|
+
readonly signOutAction?: string;
|
|
432
|
+
/** Leading extras, such as the Ask AI trigger. */
|
|
433
|
+
readonly children?: ReactNode;
|
|
434
|
+
}
|
|
435
|
+
/**
|
|
436
|
+
* The action cluster a site mounts at the end of its top bar: optional extras,
|
|
437
|
+
* the secondary link, sign-out, and the primary button, in that order.
|
|
438
|
+
*
|
|
439
|
+
* @param props - the config's navbar block, the sign-out switch, and extras
|
|
440
|
+
* @public
|
|
441
|
+
*/
|
|
442
|
+
declare function NavActions({ navbar, signOut, signOutAction, children, }: NavActionsProps): react.JSX.Element;
|
|
443
|
+
|
|
353
444
|
/**
|
|
354
445
|
* A general error screen with per-kind states.
|
|
355
446
|
*
|
|
@@ -500,4 +591,4 @@ declare function DocsSidebar({ nav, resolveHref, }: {
|
|
|
500
591
|
resolveHref?: ResolveHref;
|
|
501
592
|
}): react.JSX.Element;
|
|
502
593
|
|
|
503
|
-
export { Accordion, AccordionGroup, type ApiOperationSlots, AuthScreen, type AuthScreenProps, Callout, Card, CardGroup, type DocsNavLink, type DocsNavLinksOptions, DocsSidebar, type ErrorKind, type ErrorPreset, ErrorScreen, type ErrorScreenProps, Info, MethodBadge, type NavJsonLink, Note, type ResolveHref, type SidebarBadgeTransformer, type SidebarItem, Step, Steps, Tip, Warning, apiMethodBadges, apiOperationLayout, authErrorMessage, docsIcon, docsNavLinks, errorPreset, isDocsNavLinkActive, mdxComponents };
|
|
594
|
+
export { Accordion, AccordionGroup, type ApiOperationSlots, AuthScreen, type AuthScreenProps, Callout, Card, CardGroup, type DocsLayoutTab, type DocsNavLink, type DocsNavLinksOptions, DocsSidebar, type ErrorKind, type ErrorPreset, ErrorScreen, type ErrorScreenProps, Info, MethodBadge, NavActions, type NavActionsProps, type NavJsonLink, Note, type ResolveHref, type SidebarBadgeTransformer, type SidebarItem, Step, Steps, Tip, Warning, apiMethodBadges, apiOperationLayout, authErrorMessage, docsIcon, docsLayoutTabs, docsNavLinks, errorPreset, isDocsNavLinkActive, mdxComponents };
|
package/dist/ui.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
2
|
import { ReactNode } from 'react';
|
|
3
|
-
import { D as DocsConfig, N as Navigation, l as NavPage } from './navigation-
|
|
3
|
+
import { D as DocsConfig, t as NavbarConfig, N as Navigation, l as NavPage } from './navigation-DvgyWSZ4.js';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* Accordion components — the Mintlify `<Accordion>` and `<AccordionGroup>`.
|
|
@@ -297,6 +297,13 @@ interface NavJsonLink {
|
|
|
297
297
|
readonly text: string;
|
|
298
298
|
readonly url: string;
|
|
299
299
|
readonly icon?: string;
|
|
300
|
+
/**
|
|
301
|
+
* Path prefixes this link is active for, when the generator knows the
|
|
302
|
+
* link's territory better than the URL shows — an API tab whose entry page
|
|
303
|
+
* lives outside its generated folder. Omitted, the section is derived from
|
|
304
|
+
* the URL. Ignored on the exact-match links (Home and the docs root).
|
|
305
|
+
*/
|
|
306
|
+
readonly match?: string | readonly string[];
|
|
300
307
|
}
|
|
301
308
|
/**
|
|
302
309
|
* A rendered top-navigation link, structurally assignable to a fumadocs
|
|
@@ -310,13 +317,14 @@ interface DocsNavLink {
|
|
|
310
317
|
readonly icon: ReactNode;
|
|
311
318
|
readonly active: 'url' | 'nested-url';
|
|
312
319
|
/**
|
|
313
|
-
* The path this link is active for. Equal to `url` for Home and the docs
|
|
314
|
-
* root;
|
|
315
|
-
*
|
|
316
|
-
*
|
|
317
|
-
*
|
|
320
|
+
* The path(s) this link is active for. Equal to `url` for Home and the docs
|
|
321
|
+
* root; for a section link, the section prefixes — `nav.json`'s own `match`
|
|
322
|
+
* when the generator emitted one, the URL-derived section otherwise — so the
|
|
323
|
+
* link stays active on every page of its section, not only under its click
|
|
324
|
+
* target. Plain fumadocs link items cannot express this split; a site
|
|
325
|
+
* component that compares the pathname against `match` can.
|
|
318
326
|
*/
|
|
319
|
-
readonly match: string;
|
|
327
|
+
readonly match: string | readonly string[];
|
|
320
328
|
}
|
|
321
329
|
/**
|
|
322
330
|
* Options for {@link docsNavLinks}.
|
|
@@ -331,6 +339,13 @@ interface DocsNavLinksOptions {
|
|
|
331
339
|
readonly home?: NavJsonLink | false;
|
|
332
340
|
/** The docs base URL, whose link matches exactly rather than nested. */
|
|
333
341
|
readonly baseUrl?: string;
|
|
342
|
+
/**
|
|
343
|
+
* Resolves an icon name from `docs.json` to an element. Defaults to the
|
|
344
|
+
* framework's `docsIcon` set; pass your own to use any icon library the
|
|
345
|
+
* site installs (return `undefined` for a text-only link). The default
|
|
346
|
+
* Home entry resolves the name `house` through it.
|
|
347
|
+
*/
|
|
348
|
+
readonly icon?: (name: string | undefined) => ReactNode;
|
|
334
349
|
}
|
|
335
350
|
/**
|
|
336
351
|
* Map `nav.json` entries to top-navigation links for `HomeLayout` and
|
|
@@ -350,6 +365,82 @@ declare function docsNavLinks(links: readonly NavJsonLink[], options?: DocsNavLi
|
|
|
350
365
|
*/
|
|
351
366
|
declare function isDocsNavLinkActive(link: DocsNavLink, pathname: string): boolean;
|
|
352
367
|
|
|
368
|
+
/**
|
|
369
|
+
* The section links as fumadocs navbar tabs: the docs pages' second header
|
|
370
|
+
* row. The notebook layout's navbar tabs render only `title` — a `LayoutTab`'s
|
|
371
|
+
* `icon` field is silently dropped in that mode — so the icon is folded into
|
|
372
|
+
* the title node here, once, instead of every site rediscovering it.
|
|
373
|
+
*
|
|
374
|
+
* A link whose territory is a page-tree folder binds that folder (`$folder`
|
|
375
|
+
* activates the tab on the whole subtree); the rest match their exact URLs.
|
|
376
|
+
*
|
|
377
|
+
* @packageDocumentation
|
|
378
|
+
*/
|
|
379
|
+
/**
|
|
380
|
+
* One navbar tab, structurally assignable to a fumadocs `LayoutTab`.
|
|
381
|
+
*
|
|
382
|
+
* @public
|
|
383
|
+
*/
|
|
384
|
+
interface DocsLayoutTab<Folder> {
|
|
385
|
+
/** The tab's label: the link's icon and text. */
|
|
386
|
+
readonly title: ReactNode;
|
|
387
|
+
/** The tab's click target. */
|
|
388
|
+
readonly url: string;
|
|
389
|
+
/** The page-tree folder the tab activates on, when its territory is one. */
|
|
390
|
+
readonly $folder?: Folder;
|
|
391
|
+
/** The exact URLs the tab activates on, when it binds no folder. */
|
|
392
|
+
readonly urls?: Set<string>;
|
|
393
|
+
}
|
|
394
|
+
/**
|
|
395
|
+
* Map `nav.json` entries to navbar tabs for `DocsLayout` with
|
|
396
|
+
* `tabMode="navbar"`.
|
|
397
|
+
*
|
|
398
|
+
* @param links - the parsed `content/nav.json`
|
|
399
|
+
* @param tree - the site's page tree (`source.pageTree`)
|
|
400
|
+
* @param options - the Home entry, docs base URL, and icon resolver
|
|
401
|
+
* @returns tabs with icons in their titles and territories bound
|
|
402
|
+
* @public
|
|
403
|
+
*/
|
|
404
|
+
declare function docsLayoutTabs<Node extends {
|
|
405
|
+
readonly type: string;
|
|
406
|
+
}>(links: readonly NavJsonLink[], tree: {
|
|
407
|
+
readonly children: readonly Node[];
|
|
408
|
+
}, options?: DocsNavLinksOptions): DocsLayoutTab<Extract<Node, {
|
|
409
|
+
readonly type: 'folder';
|
|
410
|
+
}>>[];
|
|
411
|
+
|
|
412
|
+
/**
|
|
413
|
+
* The top bar's action cluster: the config's calls to action, and sign-out on
|
|
414
|
+
* a workspace site. Server-compatible; sign-out is a native form post to the
|
|
415
|
+
* site's sign-out route, so no client JavaScript is involved. Styled by
|
|
416
|
+
* `styles/docs.css`.
|
|
417
|
+
*
|
|
418
|
+
* @packageDocumentation
|
|
419
|
+
*/
|
|
420
|
+
/**
|
|
421
|
+
* Props for {@link NavActions}.
|
|
422
|
+
*
|
|
423
|
+
* @public
|
|
424
|
+
*/
|
|
425
|
+
interface NavActionsProps {
|
|
426
|
+
/** The config's `navbar` block: the primary button and the secondary link. */
|
|
427
|
+
readonly navbar?: NavbarConfig;
|
|
428
|
+
/** Whether to offer sign-out (a workspace site). */
|
|
429
|
+
readonly signOut?: boolean;
|
|
430
|
+
/** The sign-out route. Default `/api/auth/signout`. */
|
|
431
|
+
readonly signOutAction?: string;
|
|
432
|
+
/** Leading extras, such as the Ask AI trigger. */
|
|
433
|
+
readonly children?: ReactNode;
|
|
434
|
+
}
|
|
435
|
+
/**
|
|
436
|
+
* The action cluster a site mounts at the end of its top bar: optional extras,
|
|
437
|
+
* the secondary link, sign-out, and the primary button, in that order.
|
|
438
|
+
*
|
|
439
|
+
* @param props - the config's navbar block, the sign-out switch, and extras
|
|
440
|
+
* @public
|
|
441
|
+
*/
|
|
442
|
+
declare function NavActions({ navbar, signOut, signOutAction, children, }: NavActionsProps): react.JSX.Element;
|
|
443
|
+
|
|
353
444
|
/**
|
|
354
445
|
* A general error screen with per-kind states.
|
|
355
446
|
*
|
|
@@ -500,4 +591,4 @@ declare function DocsSidebar({ nav, resolveHref, }: {
|
|
|
500
591
|
resolveHref?: ResolveHref;
|
|
501
592
|
}): react.JSX.Element;
|
|
502
593
|
|
|
503
|
-
export { Accordion, AccordionGroup, type ApiOperationSlots, AuthScreen, type AuthScreenProps, Callout, Card, CardGroup, type DocsNavLink, type DocsNavLinksOptions, DocsSidebar, type ErrorKind, type ErrorPreset, ErrorScreen, type ErrorScreenProps, Info, MethodBadge, type NavJsonLink, Note, type ResolveHref, type SidebarBadgeTransformer, type SidebarItem, Step, Steps, Tip, Warning, apiMethodBadges, apiOperationLayout, authErrorMessage, docsIcon, docsNavLinks, errorPreset, isDocsNavLinkActive, mdxComponents };
|
|
594
|
+
export { Accordion, AccordionGroup, type ApiOperationSlots, AuthScreen, type AuthScreenProps, Callout, Card, CardGroup, type DocsLayoutTab, type DocsNavLink, type DocsNavLinksOptions, DocsSidebar, type ErrorKind, type ErrorPreset, ErrorScreen, type ErrorScreenProps, Info, MethodBadge, NavActions, type NavActionsProps, type NavJsonLink, Note, type ResolveHref, type SidebarBadgeTransformer, type SidebarItem, Step, Steps, Tip, Warning, apiMethodBadges, apiOperationLayout, authErrorMessage, docsIcon, docsLayoutTabs, docsNavLinks, errorPreset, isDocsNavLinkActive, mdxComponents };
|
package/dist/ui.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { strokeIcon } from './chunk-
|
|
1
|
+
import { strokeIcon } from './chunk-6H6OB7YP.js';
|
|
2
2
|
import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
|
|
3
3
|
import { isValidElement, cloneElement } from 'react';
|
|
4
4
|
|
|
@@ -321,7 +321,11 @@ var ICONS = {
|
|
|
321
321
|
wallet: "wallet",
|
|
322
322
|
key: "key",
|
|
323
323
|
webhook: "webhook",
|
|
324
|
-
globe: "globe"
|
|
324
|
+
globe: "globe",
|
|
325
|
+
user: "user",
|
|
326
|
+
users: "users",
|
|
327
|
+
building: "building",
|
|
328
|
+
clock: "clock"
|
|
325
329
|
};
|
|
326
330
|
var ALIASES = {
|
|
327
331
|
home: "house",
|
|
@@ -333,7 +337,14 @@ var ALIASES = {
|
|
|
333
337
|
"credit-card": "wallet",
|
|
334
338
|
auth: "key",
|
|
335
339
|
lock: "key",
|
|
336
|
-
world: "globe"
|
|
340
|
+
world: "globe",
|
|
341
|
+
people: "users",
|
|
342
|
+
team: "users",
|
|
343
|
+
"building-2": "building",
|
|
344
|
+
office: "building",
|
|
345
|
+
company: "building",
|
|
346
|
+
history: "clock",
|
|
347
|
+
time: "clock"
|
|
337
348
|
};
|
|
338
349
|
function docsIcon(name) {
|
|
339
350
|
if (!name) {
|
|
@@ -348,6 +359,7 @@ function docsIcon(name) {
|
|
|
348
359
|
function docsNavLinks(links, options = {}) {
|
|
349
360
|
const baseUrl = options.baseUrl ?? "/docs";
|
|
350
361
|
const home = options.home ?? { text: "Home", url: "/", icon: "house" };
|
|
362
|
+
const icon2 = options.icon ?? docsIcon;
|
|
351
363
|
return [
|
|
352
364
|
...home === false ? [] : [home],
|
|
353
365
|
...links.filter((link) => home === false || link.url !== home.url)
|
|
@@ -356,12 +368,19 @@ function docsNavLinks(links, options = {}) {
|
|
|
356
368
|
return {
|
|
357
369
|
text: link.text,
|
|
358
370
|
url: link.url,
|
|
359
|
-
icon:
|
|
371
|
+
icon: icon2(link.icon),
|
|
360
372
|
active: exact ? "url" : "nested-url",
|
|
361
|
-
match: exact ? link.url : sectionPrefix(link.url, baseUrl)
|
|
373
|
+
match: exact ? link.url : providedMatch(link.match) ?? sectionPrefix(link.url, baseUrl)
|
|
362
374
|
};
|
|
363
375
|
});
|
|
364
376
|
}
|
|
377
|
+
function providedMatch(match) {
|
|
378
|
+
if (match === void 0) {
|
|
379
|
+
return void 0;
|
|
380
|
+
}
|
|
381
|
+
const entries = (typeof match === "string" ? [match] : match).filter((entry) => entry !== "");
|
|
382
|
+
return entries.length === 0 ? void 0 : entries;
|
|
383
|
+
}
|
|
365
384
|
function sectionPrefix(url, baseUrl) {
|
|
366
385
|
if (!url.startsWith(`${baseUrl}/`)) {
|
|
367
386
|
return url;
|
|
@@ -370,10 +389,45 @@ function sectionPrefix(url, baseUrl) {
|
|
|
370
389
|
return segment === "" ? url : `${baseUrl}/${segment}`;
|
|
371
390
|
}
|
|
372
391
|
function isDocsNavLinkActive(link, pathname) {
|
|
392
|
+
const matches = typeof link.match === "string" ? [link.match] : link.match;
|
|
373
393
|
if (link.active === "url") {
|
|
374
|
-
return pathname
|
|
394
|
+
return matches.includes(pathname);
|
|
375
395
|
}
|
|
376
|
-
return pathname ===
|
|
396
|
+
return matches.some((match) => pathname === match || pathname.startsWith(`${match}/`));
|
|
397
|
+
}
|
|
398
|
+
function docsLayoutTabs(links, tree, options = {}) {
|
|
399
|
+
const folders = tree.children.filter((node) => node.type === "folder");
|
|
400
|
+
const entryUrl = (folder) => {
|
|
401
|
+
const shape = folder;
|
|
402
|
+
const first = shape.index ?? shape.children?.find((child) => child.type === "page");
|
|
403
|
+
return first?.url;
|
|
404
|
+
};
|
|
405
|
+
return docsNavLinks(links, options).map((link) => {
|
|
406
|
+
const matches = typeof link.match === "string" ? [link.match] : [...link.match];
|
|
407
|
+
const prefix = matches[0] ?? link.url;
|
|
408
|
+
const folder = link.active === "nested-url" ? folders.find((candidate) => entryUrl(candidate)?.startsWith(`${prefix}/`)) : void 0;
|
|
409
|
+
return {
|
|
410
|
+
title: link.icon === void 0 ? link.text : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
411
|
+
link.icon,
|
|
412
|
+
link.text
|
|
413
|
+
] }),
|
|
414
|
+
url: link.url,
|
|
415
|
+
...folder ? { $folder: folder } : { urls: /* @__PURE__ */ new Set([...matches, link.url]) }
|
|
416
|
+
};
|
|
417
|
+
});
|
|
418
|
+
}
|
|
419
|
+
function NavActions({
|
|
420
|
+
navbar,
|
|
421
|
+
signOut = false,
|
|
422
|
+
signOutAction = "/api/auth/signout",
|
|
423
|
+
children
|
|
424
|
+
}) {
|
|
425
|
+
return /* @__PURE__ */ jsxs("div", { className: "nav-actions", children: [
|
|
426
|
+
children,
|
|
427
|
+
navbar?.secondary ? /* @__PURE__ */ jsx("a", { className: "nav-actions__secondary", href: navbar.secondary.href, children: navbar.secondary.text }) : null,
|
|
428
|
+
signOut ? /* @__PURE__ */ jsx("form", { method: "post", action: signOutAction, children: /* @__PURE__ */ jsx("button", { type: "submit", className: "nav-actions__signout", children: "Log out" }) }) : null,
|
|
429
|
+
navbar?.primary ? /* @__PURE__ */ jsx("a", { className: "nav-actions__primary", href: navbar.primary.href, children: navbar.primary.text }) : null
|
|
430
|
+
] });
|
|
377
431
|
}
|
|
378
432
|
function icon(name) {
|
|
379
433
|
return strokeIcon(name, { strokeWidth: 1.75 });
|
|
@@ -564,6 +618,6 @@ function DocsSidebar({
|
|
|
564
618
|
] }, `t-${String(index)}`)) });
|
|
565
619
|
}
|
|
566
620
|
|
|
567
|
-
export { Accordion, AccordionGroup, AuthScreen, Callout, Card, CardGroup, DocsSidebar, ErrorScreen, Info, MethodBadge, Note, Step, Steps, Tip, Warning, apiMethodBadges, apiOperationLayout, authErrorMessage, docsIcon, docsNavLinks, errorPreset, isDocsNavLinkActive, mdxComponents };
|
|
621
|
+
export { Accordion, AccordionGroup, AuthScreen, Callout, Card, CardGroup, DocsSidebar, ErrorScreen, Info, MethodBadge, NavActions, Note, Step, Steps, Tip, Warning, apiMethodBadges, apiOperationLayout, authErrorMessage, docsIcon, docsLayoutTabs, docsNavLinks, errorPreset, isDocsNavLinkActive, mdxComponents };
|
|
568
622
|
//# sourceMappingURL=ui.js.map
|
|
569
623
|
//# sourceMappingURL=ui.js.map
|