fumadocs-ui 15.0.16 → 15.0.18

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.
@@ -1,5 +1,5 @@
1
1
  import { type HTMLAttributes, type ReactNode } from 'react';
2
- export declare const Callout: import("react").ForwardRefExoticComponent<Omit<HTMLAttributes<HTMLDivElement>, "title" | "type" | "icon"> & {
2
+ export declare const Callout: import("react").ForwardRefExoticComponent<Omit<HTMLAttributes<HTMLDivElement>, "title" | "icon" | "type"> & {
3
3
  title?: ReactNode;
4
4
  /**
5
5
  * @defaultValue info
@@ -4,6 +4,7 @@ import { type SharedProps, type TagItem } from './search.js';
4
4
  export interface OramaSearchDialogProps extends SharedProps {
5
5
  client: OramaCloudOptions['client'];
6
6
  searchOptions?: OramaCloudOptions['params'];
7
+ index?: OramaCloudOptions['index'];
7
8
  footer?: ReactNode;
8
9
  defaultTag?: string;
9
10
  tags?: TagItem[];
@@ -23,5 +24,5 @@ export interface OramaSearchDialogProps extends SharedProps {
23
24
  /**
24
25
  * Orama Cloud integration
25
26
  */
26
- export default function OramaSearchDialog({ client, searchOptions, tags, defaultTag, showOrama, allowClear, ...props }: OramaSearchDialogProps): ReactNode;
27
+ export default function OramaSearchDialog({ client, searchOptions, tags, defaultTag, showOrama, allowClear, index, ...props }: OramaSearchDialogProps): ReactNode;
27
28
  //# sourceMappingURL=search-orama.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"search-orama.d.ts","sourceRoot":"","sources":["../../../src/components/dialog/search-orama.tsx"],"names":[],"mappings":"AAEA,OAAO,EAEL,KAAK,iBAAiB,EACvB,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAAE,KAAK,SAAS,EAAY,MAAM,OAAO,CAAC;AAEjD,OAAO,EAEL,KAAK,WAAW,EAChB,KAAK,OAAO,EAEb,MAAM,UAAU,CAAC;AAElB,MAAM,WAAW,sBAAuB,SAAQ,WAAW;IACzD,MAAM,EAAE,iBAAiB,CAAC,Q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iBAAiB,CAAC,EACxC,MAAM,EACN,aAAa,EACb,IAAI,EACJ,UAAU,EACV,SAAiB,EACjB,UAAkB,EAClB,KAAK,EACL,GAAG,KAAK,EACT,EAAE,sBAAsB,GAAG,SAAS,CA2CpC"}
@@ -7,11 +7,12 @@ import { SearchDialog, TagsList, } from './search.js';
7
7
  /**
8
8
  * Orama Cloud integration
9
9
  */
10
- export default function OramaSearchDialog({ client, searchOptions, tags, defaultTag, showOrama = false, allowClear = false, ...props }) {
10
+ export default function OramaSearchDialog({ client, searchOptions, tags, defaultTag, showOrama = false, allowClear = false, index, ...props }) {
11
11
  const [tag, setTag] = useState(defaultTag);
12
12
  const { search, setSearch, query } = useDocsSearch({
13
13
  type: 'orama-cloud',
14
14
  client,
15
+ index,
15
16
  params: searchOptions,
16
17
  }, undefined, tag);
17
18
  useOnChange(defaultTag, (v) => {
@@ -1,5 +1,5 @@
1
1
  export declare const buttonVariants: (props?: ({
2
2
  color?: "primary" | "outline" | "ghost" | "secondary" | null | undefined;
3
- size?: "sm" | "icon" | "icon-sm" | null | undefined;
3
+ size?: "icon" | "sm" | "icon-sm" | null | undefined;
4
4
  } & import("class-variance-authority/types").ClassProp) | undefined) => string;
5
5
  //# sourceMappingURL=button.d.ts.map
@@ -8,7 +8,7 @@ export interface DocsLayoutProps extends BaseLayoutProps {
8
8
  sidebar?: Partial<SidebarOptions>;
9
9
  containerProps?: HTMLAttributes<HTMLDivElement>;
10
10
  }
11
- export declare function DocsLayout({ nav: { enabled: navEnabled, component: navReplace, transparentMode, ...nav }, sidebar: { enabled: sidebarEnabled, collapsible, component: sidebarReplace, tabs: tabOptions, banner: sidebarBanner, footer: sidebarFooter, components: sidebarComponents, hideSearch: sidebarHideSearch, ...sidebar }, i18n, children, ...props }: DocsLayoutProps): ReactNode;
11
+ export declare function DocsLayout({ nav: { enabled: navEnabled, component: navReplace, transparentMode, ...nav }, themeSwitch, sidebar: { enabled: sidebarEnabled, collapsible, component: sidebarReplace, tabs: tabOptions, banner: sidebarBanner, footer: sidebarFooter, components: sidebarComponents, hideSearch: sidebarHideSearch, ...sidebar }, i18n, children, ...props }: DocsLayoutProps): ReactNode;
12
12
  export { getSidebarTabsFromOptions, type TabOptions } from './docs/shared.js';
13
13
  export { type LinkItemType };
14
14
  //# sourceMappingURL=docs.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"docs.d.ts","sourceRoot":"","sources":["../../src/layouts/docs.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,KAAK,SAAS,EAAE,KAAK,cAAc,EAAE,MAAM,OAAO,CAAC;AAe5D,OAAO,EAAE,KAAK,YAAY,EAAgB,MAAM,iBAAiB,CAAC;AAElE,OAAO,EAAE,KAAK,eAAe,EAAY,MAAM,UAAU,CAAC;AAa1D,OAAO,EAKL,KAAK,cAAc,EACpB,MAAM,uBAAuB,CAAC;AAG/B,MAAM,WAAW,eAAgB,SAAQ,eAAe;IACtD,IAAI,EAAE,QAAQ,CAAC,IAAI,CAAC;IAEpB,OAAO,CAAC,EAAE,OAAO,CAAC,cAAc,CAAC,CAAC;IAElC,cAAc,CAAC,EAAE,cAAc,CAAC,cAAc,CAAC,CAAC;CACjD;AAED,wBAAgB,UAAU,CAAC,EACzB,GAAG,EAAE,EACH,OAAO,EAAE,UAAiB,EAC1B,SAAS,EAAE,UAAU,EACrB,eAAe,EACf,GAAG,GAAG,EACF,EACN,OAAO,EAAE,EACP,OAAO,EAAE,cAAqB,EAC9B,WAAkB,EAClB,SAAS,EAAE,cAAc,EACzB,IAAI,EAAE,UAAU,EAChB,MAAM,EAAE,aAAa,EACrB,MAAM,EAAE,aAAa,EACrB,UAAU,EAAE,iBAAiB,EAC7B,UAAU,EAAE,iBAAiB,EAC7B,GAAG,OAAO,EACN,EACN,IAAY,EACZ,QAAQ,EACR,GAAG,KAAK,EACT,EAAE,eAAe,GAAG,SAAS,CA8H7B;AA2CD,OAA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AAC"}
@@ -16,7 +16,7 @@ import { ThemeToggle } from '../components/layout/theme-toggle.js';
16
16
  import { LargeSearchToggle, SearchToggle, } from '../components/layout/search-toggle.js';
17
17
  import { checkPageTree, getSidebarTabsFromOptions, layoutVariables, SidebarLinkItem, } from '../layouts/docs/shared.js';
18
18
  import { StylesProvider } from '../contexts/layout.js';
19
- export function DocsLayout({ nav: { enabled: navEnabled = true, component: navReplace, transparentMode, ...nav } = {}, sidebar: { enabled: sidebarEnabled = true, collapsible = true, component: sidebarReplace, tabs: tabOptions, banner: sidebarBanner, footer: sidebarFooter, components: sidebarComponents, hideSearch: sidebarHideSearch, ...sidebar } = {}, i18n = false, children, ...props }) {
19
+ export function DocsLayout({ nav: { enabled: navEnabled = true, component: navReplace, transparentMode, ...nav } = {}, themeSwitch, sidebar: { enabled: sidebarEnabled = true, collapsible = true, component: sidebarReplace, tabs: tabOptions, banner: sidebarBanner, footer: sidebarFooter, components: sidebarComponents, hideSearch: sidebarHideSearch, ...sidebar } = {}, i18n = false, children, ...props }) {
20
20
  checkPageTree(props.tree);
21
21
  const links = getLinks(props.links ?? [], props.githubUrl);
22
22
  const Aside = collapsible ? CollapsibleSidebar : Sidebar;
@@ -39,16 +39,16 @@ export function DocsLayout({ nav: { enabled: navEnabled = true, component: navRe
39
39
  size: 'icon-sm',
40
40
  }), 'ms-auto mb-auto text-fd-muted-foreground max-md:hidden') }))] }), sidebarBanner, tabs.length > 0 ? (_jsx(RootToggle, { options: tabs, className: "-mx-2" })) : null, !sidebarHideSearch ? (_jsx(LargeSearchToggle, { hideIfDisabled: true, className: "rounded-lg max-md:hidden" })) : null] }), _jsxs(SidebarViewport, { children: [_jsx("div", { className: "mb-4 empty:hidden", children: links
41
41
  .filter((v) => v.type !== 'icon')
42
- .map((item, i) => (_jsx(SidebarLinkItem, { item: item }, i))) }), _jsx(SidebarPageTree, { components: sidebarComponents })] }), _jsxs(SidebarFooter, { children: [_jsx(SidebarFooterItems, { links: links, i18n: i18n, disableThemeSwitch: props.disableThemeSwitch ?? false }), sidebarFooter] })] }), {
42
+ .map((item, i) => (_jsx(SidebarLinkItem, { item: item }, i))) }), _jsx(SidebarPageTree, { components: sidebarComponents })] }), _jsxs(SidebarFooter, { children: [_jsx(SidebarFooterItems, { links: links, i18n: i18n, themeSwitch: themeSwitch }), sidebarFooter] })] }), {
43
43
  ...sidebar,
44
44
  tabs,
45
45
  }), _jsx(StylesProvider, { ...pageStyles, children: children })] })] }) }));
46
46
  }
47
- function SidebarFooterItems({ i18n, disableThemeSwitch, links, }) {
47
+ function SidebarFooterItems({ i18n, themeSwitch, links, }) {
48
48
  const iconItems = links.filter((v) => v.type === 'icon');
49
49
  // empty footer items
50
- if (links.length === 0 && !i18n && disableThemeSwitch)
50
+ if (links.length === 0 && !i18n && themeSwitch?.enabled === false)
51
51
  return null;
52
- return (_jsxs("div", { className: "flex flex-row items-center", children: [iconItems.map((item, i) => (_jsx(BaseLinkItem, { item: item, className: cn(buttonVariants({ size: 'icon', color: 'ghost' }), 'text-fd-muted-foreground md:[&_svg]:size-4.5'), "aria-label": item.label, children: item.icon }, i))), _jsx("div", { role: "separator", className: "flex-1" }), i18n ? (_jsxs(LanguageToggle, { className: "me-1.5", children: [_jsx(Languages, { className: "size-4.5" }), _jsx(LanguageToggleText, { className: "md:hidden" })] })) : null, !disableThemeSwitch ? _jsx(ThemeToggle, { className: "p-0" }) : null] }));
52
+ return (_jsxs("div", { className: "flex flex-row items-center", children: [iconItems.map((item, i) => (_jsx(BaseLinkItem, { item: item, className: cn(buttonVariants({ size: 'icon', color: 'ghost' }), 'text-fd-muted-foreground md:[&_svg]:size-4.5'), "aria-label": item.label, children: item.icon }, i))), _jsx("div", { role: "separator", className: "flex-1" }), i18n ? (_jsxs(LanguageToggle, { className: "me-1.5", children: [_jsx(Languages, { className: "size-4.5" }), _jsx(LanguageToggleText, { className: "md:hidden" })] })) : null, replaceOrDefault(themeSwitch, _jsx(ThemeToggle, { className: "p-0", mode: themeSwitch?.mode }))] }));
53
53
  }
54
54
  export { getSidebarTabsFromOptions } from './docs/shared.js';
@@ -9,7 +9,7 @@ export declare function NavbarMenuContent(props: NavigationMenuContentProps): im
9
9
  export declare function NavbarMenuTrigger(props: NavigationMenuTriggerProps): import("react/jsx-runtime").JSX.Element;
10
10
  export declare function NavbarMenuLink(props: LinkProps): import("react/jsx-runtime").JSX.Element;
11
11
  declare const linkVariants: (props?: ({
12
- variant?: "button" | "main" | "icon" | null | undefined;
12
+ variant?: "icon" | "button" | "main" | null | undefined;
13
13
  } & import("class-variance-authority/types").ClassProp) | undefined) => string;
14
14
  export declare function NavbarLink({ item, variant, ...props }: ComponentProps<typeof BaseLinkItem> & VariantProps<typeof linkVariants>): import("react/jsx-runtime").JSX.Element;
15
15
  export {};
@@ -1 +1 @@
1
- {"version":3,"file":"home.d.ts","sourceRoot":"","sources":["../../src/layouts/home.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAY,KAAK,cAAc,EAAE,MAAM,OAAO,CAAC;AACtD,OAAO,EAAE,KAAK,UAAU,EAAoB,MAAM,kBAAkB,CAAC;AAErE,OAAO,EAAY,KAAK,eAAe,EAAE,MAAM,UAAU,CAAC;AA6B1D,MAAM,WAAW,eACf,SAAQ,eAAe,EACrB,cAAc,CAAC,WAAW,CAAC;IAC7B,GAAG,CAAC,EAAE,OAAO,CACX,UAAU,GAAG;QACX;;WAEG;QACH,iBAAiB,CAAC,EAAE,OAAO,CAAC;KAC7B,CACF,CAAC;CACH;AAED,wBAAgB,UAAU,CAAC,KAAK,EAAE,eAAe,2CA0BhD"}
1
+ {"version":3,"file":"home.d.ts","sourceRoot":"","sources":["../../src/layouts/home.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAY,KAAK,cAAc,EAAE,MAAM,OAAO,CAAC;AACtD,OAAO,EAAE,KAAK,UAAU,EAAoB,MAAM,kBAAkB,CAAC;AAErE,OAAO,EAAY,KAAK,eAAe,EAAE,MAAM,UAAU,CAAC;AA6B1D,MAAM,WAAW,eACf,SAAQ,eAAe,EACrB,cAAc,CAAC,WAAW,CAAC;IAC7B,GAAG,CAAC,EAAE,OAAO,CACX,UAAU,GAAG;QACX;;WAEG;QACH,iBAAiB,CAAC,EAAE,OAAO,CAAC;KAC7B,CACF,CAAC;CACH;AAED,wBAAgB,UAAU,CAAC,KAAK,EAAE,eAAe,2CA2BhD"}
@@ -12,20 +12,20 @@ import { ChevronDown, Languages } from 'lucide-react';
12
12
  import Link from 'fumadocs-core/link';
13
13
  import { Menu, MenuContent, MenuLinkItem, MenuTrigger, } from '../layouts/home/menu.js';
14
14
  export function HomeLayout(props) {
15
- const { nav, links, githubUrl, i18n: _i18n, disableThemeSwitch: _disableThemeSwitch, ...rest } = props;
15
+ const { nav, links, githubUrl, i18n: _i18n, themeSwitch: _themeSwitch, disableThemeSwitch: _disableThemeSwitch, ...rest } = props;
16
16
  const finalLinks = getLinks(links, githubUrl);
17
17
  return (_jsx(NavProvider, { transparentMode: nav?.transparentMode, children: _jsxs("main", { id: "nd-home-layout", ...rest, className: cn('flex flex-1 flex-col pt-14', rest.className), children: [replaceOrDefault(nav, _jsx(Header, { finalLinks: finalLinks, ...props }), {
18
18
  items: finalLinks,
19
19
  }), props.children] }) }));
20
20
  }
21
- function Header({ nav: { enableSearch = true, ...nav } = {}, i18n = false, finalLinks, disableThemeSwitch, }) {
21
+ function Header({ nav: { enableSearch = true, ...nav } = {}, i18n = false, finalLinks, themeSwitch, }) {
22
22
  const navItems = finalLinks.filter((item) => ['nav', 'all'].includes(item.on ?? 'all'));
23
23
  const menuItems = finalLinks.filter((item) => ['menu', 'all'].includes(item.on ?? 'all'));
24
24
  return (_jsxs(Navbar, { children: [_jsx(Title, { title: nav.title, url: nav.url }), nav.children, _jsx("ul", { className: "flex flex-row items-center gap-2 px-6 max-sm:hidden", children: navItems
25
25
  .filter((item) => !isSecondary(item))
26
- .map((item, i) => (_jsx(NavbarLinkItem, { item: item, className: "text-sm" }, i))) }), _jsxs("div", { className: "flex flex-row items-center justify-end gap-1.5 flex-1", children: [enableSearch ? (_jsxs(_Fragment, { children: [_jsx(SearchToggle, { className: "lg:hidden", hideIfDisabled: true }), _jsx(LargeSearchToggle, { className: "w-full max-w-[240px] max-lg:hidden", hideIfDisabled: true })] })) : null, !disableThemeSwitch ? _jsx(ThemeToggle, { className: "max-lg:hidden" }) : null, i18n ? (_jsx(LanguageToggle, { className: "max-lg:hidden", children: _jsx(Languages, { className: "size-5" }) })) : null] }), _jsxs("ul", { className: "flex flex-row items-center", children: [navItems.filter(isSecondary).map((item, i) => (_jsx(NavbarLinkItem, { item: item, className: "-me-1.5 max-lg:hidden" }, i))), _jsxs(Menu, { className: "lg:hidden", children: [_jsx(MenuTrigger, { "aria-label": "Toggle Menu", className: "group -me-2", enableHover: nav.enableHoverToOpen, children: _jsx(ChevronDown, { className: "size-3 transition-transform duration-300 group-data-[state=open]:rotate-180" }) }), _jsxs(MenuContent, { className: "sm:flex-row sm:items-center sm:justify-end", children: [menuItems
26
+ .map((item, i) => (_jsx(NavbarLinkItem, { item: item, className: "text-sm" }, i))) }), _jsxs("div", { className: "flex flex-row items-center justify-end gap-1.5 flex-1", children: [enableSearch ? (_jsxs(_Fragment, { children: [_jsx(SearchToggle, { className: "lg:hidden", hideIfDisabled: true }), _jsx(LargeSearchToggle, { className: "w-full max-w-[240px] max-lg:hidden", hideIfDisabled: true })] })) : null, replaceOrDefault(themeSwitch, _jsx(ThemeToggle, { className: "max-lg:hidden", mode: themeSwitch?.mode })), i18n ? (_jsx(LanguageToggle, { className: "max-lg:hidden", children: _jsx(Languages, { className: "size-5" }) })) : null] }), _jsxs("ul", { className: "flex flex-row items-center", children: [navItems.filter(isSecondary).map((item, i) => (_jsx(NavbarLinkItem, { item: item, className: "-me-1.5 max-lg:hidden" }, i))), _jsxs(Menu, { className: "lg:hidden", children: [_jsx(MenuTrigger, { "aria-label": "Toggle Menu", className: "group -me-2", enableHover: nav.enableHoverToOpen, children: _jsx(ChevronDown, { className: "size-3 transition-transform duration-300 group-data-[state=open]:rotate-180" }) }), _jsxs(MenuContent, { className: "sm:flex-row sm:items-center sm:justify-end", children: [menuItems
27
27
  .filter((item) => !isSecondary(item))
28
- .map((item, i) => (_jsx(MenuLinkItem, { item: item, className: "sm:hidden" }, i))), _jsxs("div", { className: "-ms-1.5 flex flex-row items-center gap-1.5 max-sm:mt-2", children: [menuItems.filter(isSecondary).map((item, i) => (_jsx(MenuLinkItem, { item: item, className: "-me-1.5" }, i))), _jsx("div", { role: "separator", className: "flex-1" }), i18n ? (_jsxs(LanguageToggle, { children: [_jsx(Languages, { className: "size-5" }), _jsx(LanguageToggleText, {}), _jsx(ChevronDown, { className: "size-3 text-fd-muted-foreground" })] })) : null, !disableThemeSwitch ? _jsx(ThemeToggle, {}) : null] })] })] })] })] }));
28
+ .map((item, i) => (_jsx(MenuLinkItem, { item: item, className: "sm:hidden" }, i))), _jsxs("div", { className: "-ms-1.5 flex flex-row items-center gap-1.5 max-sm:mt-2", children: [menuItems.filter(isSecondary).map((item, i) => (_jsx(MenuLinkItem, { item: item, className: "-me-1.5" }, i))), _jsx("div", { role: "separator", className: "flex-1" }), i18n ? (_jsxs(LanguageToggle, { children: [_jsx(Languages, { className: "size-5" }), _jsx(LanguageToggleText, {}), _jsx(ChevronDown, { className: "size-3 text-fd-muted-foreground" })] })) : null, replaceOrDefault(themeSwitch, _jsx(ThemeToggle, { mode: themeSwitch?.mode }))] })] })] })] })] }));
29
29
  }
30
30
  function NavbarLinkItem({ item, ...props }) {
31
31
  if (item.type === 'custom')
@@ -11,5 +11,5 @@ export interface DocsLayoutProps extends BaseLayoutProps {
11
11
  sidebar?: Omit<Partial<SidebarOptions>, 'component' | 'enabled'>;
12
12
  containerProps?: HTMLAttributes<HTMLDivElement>;
13
13
  }
14
- export declare function DocsLayout({ tabMode, nav: { transparentMode, ...nav }, sidebar: { collapsible: sidebarCollapsible, tabs: tabOptions, banner: sidebarBanner, footer: sidebarFooter, components: sidebarComponents, ...sidebar }, i18n, ...props }: DocsLayoutProps): import("react/jsx-runtime").JSX.Element;
14
+ export declare function DocsLayout({ tabMode, nav: { transparentMode, ...nav }, sidebar: { collapsible: sidebarCollapsible, tabs: tabOptions, banner: sidebarBanner, footer: sidebarFooter, components: sidebarComponents, ...sidebar }, i18n, themeSwitch, ...props }: DocsLayoutProps): import("react/jsx-runtime").JSX.Element;
15
15
  //# sourceMappingURL=notebook.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"notebook.d.ts","sourceRoot":"","sources":["../../src/layouts/notebook.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAY,KAAK,cAAc,EAAE,MAAM,OAAO,CAAC;AACtD,OAAO,EAAE,KAAK,eAAe,EAAY,MAAM,kBAAkB,CAAC;AA4BlE,OAAO,EAKL,KAAK,cAAc,EACpB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAWrD,MAAM,WAAW,eAAgB,SAAQ,eAAe;IACtD,IAAI,EAAE,QAAQ,CAAC,IAAI,CAAC;IACpB,OAAO,CAAC,EAAE,SAAS,GAAG,QAAQ,CAAC;IAE/B,GAAG,CAAC,EAAE,eAAe,CAAC,KAAK,CAAC,GAAG;QAC7B,IAAI,CAAC,EAAE,KAAK,GAAG,MAAM,CAAC;KACvB,CAAC;IAEF,OAAO,CAAC,EAAE,IAAI,CAAC,OAAO,CAAC,cAAc,CAAC,EAAE,WAAW,GAAG,SAAS,CAAC,CAAC;IAEjE,cAAc,CAAC,EAAE,cAAc,CAAC,cAAc,CAAC,CAAC;CACjD;AAED,wBAAgB,UAAU,CAAC,EACzB,OAAmB,EACnB,GAAG,EAAE,EAAE,eAAe,EAAE,GAAG,GAAG,EAAO,EACrC,OAAO,EAAE,EACP,WAAW,EAAE,kBAAyB,EACtC,IAAI,EAAE,UAAU,EAChB,MAAM,EAAE,aAAa,EACrB,MAAM,EAAE,aAAa,EACrB,UAAU,EAAE,iBAAiB,EAC7B,GAAG,OAAO,EACN,EACN,IAAY,EACZ,GAAG,KAAK,EACT,EAAE,eAAe,2CA4HjB"}
1
+ {"version":3,"file":"notebook.d.ts","sourceRoot":"","sources":["../../src/layouts/notebook.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAY,KAAK,cAAc,EAAE,MAAM,OAAO,CAAC;AACtD,OAAO,EACL,KAAK,eAAe,EAGrB,MAAM,kBAAkB,CAAC;AA4B1B,OAAO,EAKL,KAAK,cAAc,EACpB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAWrD,MAAM,WAAW,eAAgB,SAAQ,eAAe;IACtD,IAAI,EAAE,QAAQ,CAAC,IAAI,CAAC;IACpB,OAAO,CAAC,EAAE,SAAS,GAAG,QAAQ,CAAC;IAE/B,GAAG,CAAC,EAAE,eAAe,CAAC,KAAK,CAAC,GAAG;QAC7B,IAAI,CAAC,EAAE,KAAK,GAAG,MAAM,CAAC;KACvB,CAAC;IAEF,OAAO,CAAC,EAAE,IAAI,CAAC,OAAO,CAAC,cAAc,CAAC,EAAE,WAAW,GAAG,SAAS,CAAC,CAAC;IAEjE,cAAc,CAAC,EAAE,cAAc,CAAC,cAAc,CAAC,CAAC;CACjD;AAED,wBAAgB,UAAU,CAAC,EACzB,OAAmB,EACnB,GAAG,EAAE,EAAE,eAAe,EAAE,GAAG,GAAG,EAAO,EACrC,OAAO,EAAE,EACP,WAAW,EAAE,kBAAyB,EACtC,IAAI,EAAE,UAAU,EAChB,MAAM,EAAE,aAAa,EACrB,MAAM,EAAE,aAAa,EACrB,UAAU,EAAE,iBAAiB,EAC7B,GAAG,OAAO,EACN,EACN,IAAY,EACZ,WAAW,EACX,GAAG,KAAK,EACT,EAAE,eAAe,2CAgIjB"}
@@ -1,6 +1,6 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { Fragment } from 'react';
3
- import { getLinks } from '../layouts/shared.js';
3
+ import { getLinks, replaceOrDefault, } from '../layouts/shared.js';
4
4
  import { CollapsibleSidebar, Sidebar, SidebarCollapseTrigger, SidebarFooter, SidebarHeader, SidebarViewport, SidebarPageTree, } from '../layouts/docs/sidebar.js';
5
5
  import { TreeContextProvider } from '../contexts/tree.js';
6
6
  import { NavProvider, Title } from '../components/layout/nav.js';
@@ -17,7 +17,7 @@ import { checkPageTree, getSidebarTabsFromOptions, layoutVariables, SidebarLinkI
17
17
  import { LayoutTab, LayoutTabs, Navbar, NavbarSidebarTrigger, SidebarLayoutTab, } from './notebook.client.js';
18
18
  import { StylesProvider } from '../contexts/layout.js';
19
19
  import { RootToggle } from '../components/layout/root-toggle.js';
20
- export function DocsLayout({ tabMode = 'sidebar', nav: { transparentMode, ...nav } = {}, sidebar: { collapsible: sidebarCollapsible = true, tabs: tabOptions, banner: sidebarBanner, footer: sidebarFooter, components: sidebarComponents, ...sidebar } = {}, i18n = false, ...props }) {
20
+ export function DocsLayout({ tabMode = 'sidebar', nav: { transparentMode, ...nav } = {}, sidebar: { collapsible: sidebarCollapsible = true, tabs: tabOptions, banner: sidebarBanner, footer: sidebarFooter, components: sidebarComponents, ...sidebar } = {}, i18n = false, themeSwitch, ...props }) {
21
21
  checkPageTree(props.tree);
22
22
  const navMode = nav.mode ?? 'auto';
23
23
  const links = getLinks(props.links ?? [], props.githubUrl);
@@ -40,7 +40,7 @@ export function DocsLayout({ tabMode = 'sidebar', nav: { transparentMode, ...nav
40
40
  color: 'ghost',
41
41
  size: 'icon-sm',
42
42
  }), 'text-fd-muted-foreground mb-auto') })] })), nav.children, sidebarBanner, tabMode === 'sidebar' && tabs.length > 0 ? (_jsx(RootToggle, { options: tabs, className: "-mx-2" })) : null] }), _jsxs(SidebarViewport, { children: [tabMode === 'navbar' &&
43
- tabs.map((tab, i) => (_jsx(SidebarLayoutTab, { item: tab, className: cn('lg:hidden', i === tabs.length - 1 && 'mb-4') }, tab.url))), links.map((item, i) => (_jsx(SidebarLinkItem, { item: item, className: cn('lg:hidden', i === links.length - 1 && 'mb-4') }, i))), _jsx(SidebarPageTree, { components: sidebarComponents })] }), _jsxs(SidebarFooter, { className: cn('flex flex-row items-center', !sidebarFooter && 'md:hidden'), children: [i18n ? (_jsx(LanguageToggle, { className: "me-auto md:hidden", children: _jsx(Languages, { className: "size-5 text-fd-muted-foreground" }) })) : null, !props.disableThemeSwitch ? (_jsx(ThemeToggle, { className: "md:hidden", mode: "light-dark-system" })) : null, sidebarFooter] })] }), _jsx(DocsNavbar, { nav: nav, links: links, i18n: i18n, sidebarCollapsible: sidebarCollapsible, tabs: tabMode == 'navbar' ? tabs : [] }), _jsx(StylesProvider, { ...pageStyles, children: props.children })] }) }) }));
43
+ tabs.map((tab, i) => (_jsx(SidebarLayoutTab, { item: tab, className: cn('lg:hidden', i === tabs.length - 1 && 'mb-4') }, tab.url))), links.map((item, i) => (_jsx(SidebarLinkItem, { item: item, className: cn('lg:hidden', i === links.length - 1 && 'mb-4') }, i))), _jsx(SidebarPageTree, { components: sidebarComponents })] }), _jsxs(SidebarFooter, { className: cn('flex flex-row items-center', !sidebarFooter && 'md:hidden'), children: [i18n ? (_jsx(LanguageToggle, { className: "me-auto md:hidden", children: _jsx(Languages, { className: "size-5 text-fd-muted-foreground" }) })) : null, replaceOrDefault(themeSwitch, _jsx(ThemeToggle, { className: "md:hidden", mode: themeSwitch?.mode ?? 'light-dark-system' })), sidebarFooter] })] }), _jsx(DocsNavbar, { nav: nav, links: links, i18n: i18n, sidebarCollapsible: sidebarCollapsible, tabs: tabMode == 'navbar' ? tabs : [] }), _jsx(StylesProvider, { ...pageStyles, children: props.children })] }) }) }));
44
44
  }
45
45
  function DocsNavbar({ sidebarCollapsible, links, nav = {}, i18n, tabs, }) {
46
46
  const navMode = nav.mode ?? 'auto';
@@ -15,8 +15,15 @@ export interface SharedNavProps extends TitleProps, NavProviderProps {
15
15
  children?: ReactNode;
16
16
  }
17
17
  export interface BaseLayoutProps {
18
+ themeSwitch?: {
19
+ enabled?: boolean;
20
+ component?: ReactNode;
21
+ mode?: 'light-dark' | 'light-dark-system';
22
+ };
18
23
  /**
19
24
  * Remove theme switcher component
25
+ *
26
+ * @deprecated Use `themeSwitch.enabled` instead.
20
27
  */
21
28
  disableThemeSwitch?: boolean;
22
29
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"shared.d.ts","sourceRoot":"","sources":["../../src/layouts/shared.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AACpD,OAAO,KAAK,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAG5E,MAAM,WAAW,UAAW,SAAQ,cAAc;IAChD,OAAO,EAAE,OAAO,CAAC;IACjB,SAAS,EAAE,SAAS,CAAC;CACtB;AAED,MAAM,WAAW,cAAe,SAAQ,UAAU,EAAE,gBAAgB;IAClE;;;;OAIG;IACH,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB;AAED,MAAM,WAAW,eAAe;IAC9B;;OAEG;IACH,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAE7B;;;;OAIG;IACH,IAAI,CAAC,EAAE,OAAO,CAAC;IAEf;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB,KAAK,CAAC,EAAE,YAAY,EAAE,CAAC;IACvB;;OAEG;IACH,GAAG,CAAC,EAAE,OAAO,CAAC,UAAU,CAAC,CAAC;IAE1B,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB;AAED;;GAEG;AACH,wBAAgB,QAAQ,CACtB,KAAK,CAAC,EAAE,YAAY,EAAE,EACtB,SAAS,CAAC,EAAE,MAAM,GACjB,YAAY,EAAE,CAqBhB;AAED,wBAAgB,gBAAgB,CAC9B,GAAG,EACC;IACE,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,SAAS,C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AE,MAAM,GACjB,YAAY,EAAE,CAqBhB;AAED,wBAAgB,gBAAgB,CAC9B,GAAG,EACC;IACE,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,SAAS,CAAC,EAAE,SAAS,CAAC;CACvB,GACD,SAAS,EACb,GAAG,EAAE,SAAS,EACd,oBAAoB,CAAC,EAAE,MAAM,EAC7B,QAAQ,CAAC,EAAE,SAAS,GACnB,SAAS,CAMX"}
package/dist/mdx.d.ts CHANGED
@@ -3,7 +3,7 @@ import { Card, Cards } from './components/card.js';
3
3
  declare function Image(props: ImgHTMLAttributes<HTMLImageElement>): import("react/jsx-runtime").JSX.Element;
4
4
  declare function Table(props: TableHTMLAttributes<HTMLTableElement>): import("react/jsx-runtime").JSX.Element;
5
5
  declare const defaultMdxComponents: {
6
- pre: FC<HTMLAttributes<HTMLPreElement>>;
6
+ pre: (props: HTMLAttributes<HTMLPreElement>) => import("react/jsx-runtime").JSX.Element;
7
7
  Card: typeof Card;
8
8
  Cards: typeof Cards;
9
9
  a: FC<AnchorHTMLAttributes<HTMLAnchorElement>>;
@@ -15,11 +15,12 @@ declare const defaultMdxComponents: {
15
15
  h5: (props: HTMLAttributes<HTMLHeadingElement>) => import("react/jsx-runtime").JSX.Element;
16
16
  h6: (props: HTMLAttributes<HTMLHeadingElement>) => import("react/jsx-runtime").JSX.Element;
17
17
  table: typeof Table;
18
- Callout: import("react").ForwardRefExoticComponent<Omit<HTMLAttributes<HTMLDivElement>, "title" | "type" | "icon"> & {
18
+ Callout: import("react").ForwardRefExoticComponent<Omit<HTMLAttributes<HTMLDivElement>, "title" | "icon" | "type"> & {
19
19
  title?: import("react").ReactNode;
20
20
  type?: "info" | "warn" | "error";
21
21
  icon?: import("react").ReactNode;
22
22
  } & import("react").RefAttributes<HTMLDivElement>>;
23
23
  };
24
+ export declare const createRelativeLink: typeof import('./mdx.server.js').createRelativeLink;
24
25
  export { defaultMdxComponents as default };
25
26
  //# sourceMappingURL=mdx.d.ts.map
package/dist/mdx.d.ts.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"mdx.d.ts","sourceRoot":"","sources":["../src/mdx.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,oBAAoB,EACpB,EAAE,EACF,cAAc,EACd,iBAAiB,EACjB,mBAAmB,EACpB,MAAM,OAAO,CAAC;AAGf,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAMhD,iBAAS,KAAK,CAAC,KAAK,EAAE,iBAAiB,CAAC,gBAAgB,CAAC,2CAQxD;AAED,iBAAS,KAAK,CAAC,KAAK,EAAE,mBAAmB,CAAC,gBAAgB,CAAC,2CAM1D;AAED,QAAA,MAAM,oBAAoB;SACZ,EAAE,CAAC,cAAc,CAAC,cAAc,CAAC,CAAC;;;OAGnC,EAAE,CAAC,oBAAoB,CAAC,iBAAiB,CAAC,CAAC;;gBAE1C,cAAc,CAAC,kBAAkB,CAAC;gBAGlC,cAAc,CAAC,kBAAkB,CAAC;gBAGlC,cAAc,CAAC,kBAAkB,CAAC;gBAGlC,cAAc,CAAC,kBAAkB,CAAC;gBAGlC,cAAc,CAAC,kBAAkB,CAAC;gBAGlC,cAAc,CAAC,kBAAkB,CAAC;;;;;;;CAK/C,CAAC;AAEF,OAAO,EAAE,oBAAoB,IAAI,OAAO,EAAE,CAAC"}
1
+ {"version":3,"file":"mdx.d.ts","sourceRoot":"","sources":["../src/mdx.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,oBAAoB,EACpB,EAAE,EACF,cAAc,EACd,iBAAiB,EACjB,mBAAmB,EACpB,MAAM,OAAO,CAAC;AAGf,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAMhD,iBAAS,KAAK,CAAC,KAAK,EAAE,iBAAiB,CAAC,gBAAgB,CAAC,2CAQxD;AAED,iBAAS,KAAK,CAAC,KAAK,EAAE,mBAAmB,CAAC,gBAAgB,CAAC,2CAM1D;AAED,QAAA,MAAM,oBAAoB;iBACX,cAAc,CAAC,cAAc,CAAC;;;OAOhC,EAAE,CAAC,oBAAoB,CAAC,iBAAiB,CAAC,CAAC;;gBAE1C,cAAc,CAAC,kBAAkB,CAAC;gBAGlC,cAAc,CAAC,kBAAkB,CAAC;gBAGlC,cAAc,CAAC,kBAAkB,CAAC;gBAGlC,cAAc,CAAC,kBAAkB,CAAC;gBAGlC,cAAc,CAAC,kBAAkB,CAAC;gBAGlC,cAAc,CAAC,kBAAkB,CAAC;;;;;;;CAK/C,CAAC;AAEF,eAAO,MAAM,kBAAkB,EAAE,cAAc,cAAc,EAAE,kBAK5D,CAAC;AAEJ,OAAO,EAAE,oBAAoB,IAAI,OAAO,EAAE,CAAC"}
package/dist/mdx.js CHANGED
@@ -5,7 +5,7 @@ import { Card, Cards } from './components/card.js';
5
5
  import { Callout } from './components/callout.js';
6
6
  import { Heading } from './components/heading.js';
7
7
  import { cn } from './utils/cn.js';
8
- import { Pre } from './mdx.client.js';
8
+ import { CodeBlock, Pre } from './components/codeblock.js';
9
9
  function Image(props) {
10
10
  return (_jsx(NextImage, { sizes: "(max-width: 768px) 100vw, (max-width: 1200px) 70vw, 900px", ...props, className: cn('rounded-lg', props.className) }));
11
11
  }
@@ -13,7 +13,7 @@ function Table(props) {
13
13
  return (_jsx("div", { className: "relative overflow-auto", children: _jsx("table", { ...props }) }));
14
14
  }
15
15
  const defaultMdxComponents = {
16
- pre: Pre,
16
+ pre: (props) => (_jsx(CodeBlock, { ...props, children: _jsx(Pre, { children: props.children }) })),
17
17
  Card,
18
18
  Cards,
19
19
  a: Link,
@@ -27,4 +27,7 @@ const defaultMdxComponents = {
27
27
  table: Table,
28
28
  Callout,
29
29
  };
30
+ export const createRelativeLink = () => {
31
+ throw new Error('`createRelativeLink` is only supported in Node.js environment');
32
+ };
30
33
  export { defaultMdxComponents as default };
@@ -0,0 +1,13 @@
1
+ import type { LoaderConfig, LoaderOutput, Page } from 'fumadocs-core/source';
2
+ import type { ComponentProps, FC } from 'react';
3
+ import defaultMdxComponents from './mdx.js';
4
+ /**
5
+ * Extend the default Link component to resolve relative file paths in `href`.
6
+ *
7
+ * @param page the current page
8
+ * @param source the source object
9
+ * @param OverrideLink The component to override from
10
+ */
11
+ export declare function createRelativeLink(source: LoaderOutput<LoaderConfig>, page: Page, OverrideLink?: FC<ComponentProps<'a'>>): FC<ComponentProps<'a'>>;
12
+ export { defaultMdxComponents as default };
13
+ //# sourceMappingURL=mdx.server.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mdx.server.d.ts","sourceRoot":"","sources":["../src/mdx.server.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,YAAY,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAC;AAC7E,OAAO,KAAK,EAAE,cAAc,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAChD,OAAO,oBAAoB,MAAM,OAAO,CAAC;AAGzC;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAChC,MAAM,EAAE,YAAY,CAAC,YAAY,CAAC,EAClC,IAAI,EAAE,IAAI,EACV,YAAY,GAAE,EAAE,CAAC,cAAc,CAAC,GAAG,CAAC,CAA0B,GAC7D,EAAE,CAAC,cAAc,CAAC,GAAG,CAAC,CAAC,CAgBzB;AAED,OAAO,EAAE,oBAAoB,IAAI,OAAO,EAAE,CAAC"}
@@ -0,0 +1,25 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import defaultMdxComponents from './mdx.js';
3
+ import * as path from 'node:path';
4
+ /**
5
+ * Extend the default Link component to resolve relative file paths in `href`.
6
+ *
7
+ * @param page the current page
8
+ * @param source the source object
9
+ * @param OverrideLink The component to override from
10
+ */
11
+ export function createRelativeLink(source, page, OverrideLink = defaultMdxComponents.a) {
12
+ return async function RelativeLink({ href, ...props }) {
13
+ if (href &&
14
+ href.startsWith('.') &&
15
+ (href.endsWith('.md') || href.endsWith('.mdx'))) {
16
+ const pages = source.getPages();
17
+ const hrefPath = path.join(page.file.dirname, href);
18
+ const targetPage = pages.find((item) => item.file.path === hrefPath);
19
+ if (targetPage)
20
+ href = targetPage.url;
21
+ }
22
+ return _jsx(OverrideLink, { href: href, ...props });
23
+ };
24
+ }
25
+ export { defaultMdxComponents as default };
package/dist/style.css CHANGED
@@ -1,4 +1,4 @@
1
- /*! tailwindcss v4.0.12 | MIT License | https://tailwindcss.com */
1
+ /*! tailwindcss v4.0.14 | MIT License | https://tailwindcss.com */
2
2
  @layer theme, base, components, utilities;
3
3
  @layer theme {
4
4
  :root, :host {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fumadocs-ui",
3
- "version": "15.0.16",
3
+ "version": "15.0.18",
4
4
  "description": "The framework for building a documentation website in Next.js",
5
5
  "keywords": [
6
6
  "NextJs",
@@ -37,6 +37,7 @@
37
37
  "types": "./dist/provider.d.ts"
38
38
  },
39
39
  "./mdx": {
40
+ "node": "./dist/mdx.server.js",
40
41
  "import": "./dist/mdx.js",
41
42
  "types": "./dist/mdx.d.ts"
42
43
  },
@@ -66,23 +67,23 @@
66
67
  "class-variance-authority": "^0.7.1",
67
68
  "lodash.merge": "^4.6.2",
68
69
  "lucide-react": "^0.479.0",
69
- "next-themes": "^0.4.4",
70
+ "next-themes": "^0.4.6",
70
71
  "postcss-selector-parser": "^7.1.0",
71
72
  "react-medium-image-zoom": "^5.2.14",
72
73
  "tailwind-merge": "^3.0.2"
73
74
  },
74
75
  "devDependencies": {
75
- "@next/eslint-plugin-next": "^15.2.1",
76
- "@tailwindcss/cli": "^4.0.12",
76
+ "@next/eslint-plugin-next": "^15.2.2",
77
+ "@tailwindcss/cli": "^4.0.14",
77
78
  "@types/lodash.merge": "^4.6.9",
78
79
  "@types/react": "^19.0.10",
79
80
  "@types/react-dom": "^19.0.4",
80
- "next": "15.2.1",
81
- "tailwindcss": "^4.0.12",
81
+ "next": "15.2.2",
82
+ "tailwindcss": "^4.0.14",
82
83
  "tsc-alias": "^1.8.11",
83
84
  "@fumadocs/cli": "0.0.8",
84
85
  "eslint-config-custom": "0.0.0",
85
- "fumadocs-core": "15.0.16",
86
+ "fumadocs-core": "15.0.18",
86
87
  "tsconfig": "0.0.0"
87
88
  },
88
89
  "peerDependencies": {
@@ -90,7 +91,7 @@
90
91
  "react": "18.x.x || 19.x.x",
91
92
  "react-dom": "18.x.x || 19.x.x",
92
93
  "tailwindcss": "^3.4.14 || ^4.0.0",
93
- "fumadocs-core": "15.0.16"
94
+ "fumadocs-core": "15.0.18"
94
95
  },
95
96
  "peerDependenciesMeta": {
96
97
  "tailwindcss": {
@@ -1,10 +0,0 @@
1
- import * as Base from './components/codeblock.js';
2
- /**
3
- * You are NOT supposed to use this component directly.
4
- *
5
- * This should be referenced in the output generated by the Rehype Code plugin.
6
- *
7
- * @internal
8
- */
9
- export declare function Pre(props: Base.CodeBlockProps): React.ReactElement;
10
- //# sourceMappingURL=mdx.client.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"mdx.client.d.ts","sourceRoot":"","sources":["../src/mdx.client.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,IAAI,MAAM,wBAAwB,CAAC;AAE/C;;;;;;GAMG;AACH,wBAAgB,GAAG,CAAC,KAAK,EAAE,IAAI,CAAC,cAAc,GAAG,KAAK,CAAC,YAAY,CAMlE"}
@@ -1,13 +0,0 @@
1
- 'use client';
2
- import { jsx as _jsx } from "react/jsx-runtime";
3
- import * as Base from './components/codeblock.js';
4
- /**
5
- * You are NOT supposed to use this component directly.
6
- *
7
- * This should be referenced in the output generated by the Rehype Code plugin.
8
- *
9
- * @internal
10
- */
11
- export function Pre(props) {
12
- return (_jsx(Base.CodeBlock, { ...props, children: _jsx(Base.Pre, { children: props.children }) }));
13
- }