blodemd 0.1.0 → 0.2.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/cli.mjs +50 -174
- package/dist/cli.mjs.map +1 -1
- package/package.json +3 -36
- package/dev-server/app/[[...slug]]/page.tsx +0 -140
- package/dev-server/app/blodemd-dev/invalidate/route.ts +0 -12
- package/dev-server/app/blodemd-dev/static/[...path]/route.ts +0 -32
- package/dev-server/app/blodemd-dev/version/route.ts +0 -14
- package/dev-server/app/blodemd-internal/proxy/route.ts +0 -86
- package/dev-server/app/error.tsx +0 -24
- package/dev-server/app/favicon.ico +0 -0
- package/dev-server/app/globals.css +0 -4
- package/dev-server/app/layout.tsx +0 -38
- package/dev-server/app/not-found.tsx +0 -18
- package/dev-server/app/search/route.ts +0 -17
- package/dev-server/components/dev-reload-script.tsx +0 -86
- package/dev-server/components/providers.tsx +0 -15
- package/dev-server/lib/dev-state.ts +0 -8
- package/dev-server/lib/local-content-source.ts +0 -103
- package/dev-server/lib/local-runtime.tsx +0 -555
- package/dev-server/next-env.d.ts +0 -5
- package/dev-server/next.config.js +0 -54
- package/dev-server/package.json +0 -61
- package/dev-server/postcss.config.mjs +0 -7
- package/dev-server/public/glide-variable.woff2 +0 -0
- package/dev-server/tsconfig.json +0 -50
- package/docs/app/globals.css +0 -471
- package/docs/components/animate-ui/primitives/buttons/button.tsx +0 -14
- package/docs/components/api/api-playground.tsx +0 -467
- package/docs/components/api/api-reference.tsx +0 -157
- package/docs/components/content/collection-index.tsx +0 -114
- package/docs/components/docs/contextual-menu.tsx +0 -495
- package/docs/components/docs/copy-page-menu.tsx +0 -364
- package/docs/components/docs/doc-header.tsx +0 -223
- package/docs/components/docs/doc-shell.tsx +0 -355
- package/docs/components/docs/doc-sidebar.tsx +0 -256
- package/docs/components/docs/doc-toc.tsx +0 -46
- package/docs/components/docs/mobile-nav.tsx +0 -195
- package/docs/components/docs/sidebar-active-highlight.tsx +0 -34
- package/docs/components/docs/sidebar-scroll-area.tsx +0 -63
- package/docs/components/git/repo-picker.tsx +0 -529
- package/docs/components/icons/doc-icon.tsx +0 -96
- package/docs/components/mdx/accordion.tsx +0 -83
- package/docs/components/mdx/agent-instructions.tsx +0 -17
- package/docs/components/mdx/badge.tsx +0 -79
- package/docs/components/mdx/callout.tsx +0 -88
- package/docs/components/mdx/card.tsx +0 -110
- package/docs/components/mdx/code-block.tsx +0 -80
- package/docs/components/mdx/code-group.tsx +0 -203
- package/docs/components/mdx/color.tsx +0 -87
- package/docs/components/mdx/columns.tsx +0 -25
- package/docs/components/mdx/expandable.tsx +0 -45
- package/docs/components/mdx/field-layout.tsx +0 -77
- package/docs/components/mdx/frame.tsx +0 -23
- package/docs/components/mdx/get-text-content.ts +0 -18
- package/docs/components/mdx/icon.tsx +0 -12
- package/docs/components/mdx/iframe.tsx +0 -62
- package/docs/components/mdx/index.tsx +0 -121
- package/docs/components/mdx/installer.tsx +0 -20
- package/docs/components/mdx/panel.tsx +0 -11
- package/docs/components/mdx/param-field.tsx +0 -56
- package/docs/components/mdx/preview.tsx +0 -36
- package/docs/components/mdx/prompt.tsx +0 -63
- package/docs/components/mdx/request-example.tsx +0 -27
- package/docs/components/mdx/response-field.tsx +0 -42
- package/docs/components/mdx/steps.tsx +0 -92
- package/docs/components/mdx/tabs.tsx +0 -193
- package/docs/components/mdx/tile.tsx +0 -43
- package/docs/components/mdx/tooltip.tsx +0 -71
- package/docs/components/mdx/tree.tsx +0 -120
- package/docs/components/mdx/type-table.tsx +0 -71
- package/docs/components/mdx/update.tsx +0 -44
- package/docs/components/mdx/video.tsx +0 -45
- package/docs/components/mdx/view.tsx +0 -66
- package/docs/components/posthog-provider.tsx +0 -42
- package/docs/components/providers.tsx +0 -15
- package/docs/components/tenant-analytics.tsx +0 -49
- package/docs/components/third-parties.tsx +0 -32
- package/docs/components/ui/badge.tsx +0 -61
- package/docs/components/ui/breadcrumb.tsx +0 -112
- package/docs/components/ui/button-group.tsx +0 -83
- package/docs/components/ui/button.tsx +0 -65
- package/docs/components/ui/card.tsx +0 -92
- package/docs/components/ui/command.tsx +0 -167
- package/docs/components/ui/copy-button.tsx +0 -129
- package/docs/components/ui/dialog.tsx +0 -146
- package/docs/components/ui/field.tsx +0 -237
- package/docs/components/ui/input.tsx +0 -23
- package/docs/components/ui/kbd.tsx +0 -98
- package/docs/components/ui/label.tsx +0 -22
- package/docs/components/ui/morph-icon.tsx +0 -79
- package/docs/components/ui/popover.tsx +0 -267
- package/docs/components/ui/search-dialog.tsx +0 -431
- package/docs/components/ui/search.tsx +0 -101
- package/docs/components/ui/separator.tsx +0 -26
- package/docs/components/ui/sheet.tsx +0 -133
- package/docs/components/ui/sidebar.tsx +0 -758
- package/docs/components/ui/skeleton.tsx +0 -11
- package/docs/components/ui/switch.tsx +0 -32
- package/docs/components/ui/tabs.tsx +0 -138
- package/docs/components/ui/theme-toggle.tsx +0 -62
- package/docs/components/ui/tooltip.tsx +0 -53
- package/docs/components/web-mcp.tsx +0 -115
- package/docs/lib/agent-skills.ts +0 -48
- package/docs/lib/api-client.ts +0 -72
- package/docs/lib/config.ts +0 -6
- package/docs/lib/content-root.ts +0 -33
- package/docs/lib/content-source.ts +0 -70
- package/docs/lib/contextual-options.ts +0 -222
- package/docs/lib/dashboard-session.ts +0 -167
- package/docs/lib/db.ts +0 -13
- package/docs/lib/docs-collection.ts +0 -7
- package/docs/lib/docs-runtime.tsx +0 -745
- package/docs/lib/edge-config.ts +0 -95
- package/docs/lib/env.ts +0 -23
- package/docs/lib/etag.ts +0 -22
- package/docs/lib/github-install.ts +0 -33
- package/docs/lib/llms-full.ts +0 -82
- package/docs/lib/marketing-markdown.ts +0 -79
- package/docs/lib/marketing-site.ts +0 -31
- package/docs/lib/mdx.ts +0 -98
- package/docs/lib/navigation.ts +0 -288
- package/docs/lib/openapi-proxy.ts +0 -88
- package/docs/lib/openapi.ts +0 -158
- package/docs/lib/platform-config.ts +0 -6
- package/docs/lib/project-authz.ts +0 -46
- package/docs/lib/routes.ts +0 -103
- package/docs/lib/server-cache.ts +0 -83
- package/docs/lib/shiki.ts +0 -44
- package/docs/lib/supabase.ts +0 -37
- package/docs/lib/tenancy.ts +0 -364
- package/docs/lib/tenant-headers.ts +0 -43
- package/docs/lib/tenant-static.ts +0 -705
- package/docs/lib/tenant-utility-context.ts +0 -62
- package/docs/lib/tenants.ts +0 -72
- package/docs/lib/theme.ts +0 -29
- package/docs/lib/time-ago.ts +0 -24
- package/docs/lib/toc.ts +0 -2
- package/docs/lib/use-mobile.ts +0 -19
- package/docs/lib/use-tab-observer.ts +0 -71
- package/docs/lib/utils.ts +0 -5
- package/packages/@repo/common/dist/index.d.ts +0 -16
- package/packages/@repo/common/dist/index.d.ts.map +0 -1
- package/packages/@repo/common/dist/index.js +0 -84
- package/packages/@repo/common/package.json +0 -34
- package/packages/@repo/common/src/index.ts +0 -101
- package/packages/@repo/contracts/dist/analytics.d.ts +0 -21
- package/packages/@repo/contracts/dist/analytics.d.ts.map +0 -1
- package/packages/@repo/contracts/dist/analytics.js +0 -18
- package/packages/@repo/contracts/dist/api-key.d.ts +0 -27
- package/packages/@repo/contracts/dist/api-key.d.ts.map +0 -1
- package/packages/@repo/contracts/dist/api-key.js +0 -20
- package/packages/@repo/contracts/dist/dates.d.ts +0 -4
- package/packages/@repo/contracts/dist/dates.d.ts.map +0 -1
- package/packages/@repo/contracts/dist/dates.js +0 -2
- package/packages/@repo/contracts/dist/deployment.d.ts +0 -71
- package/packages/@repo/contracts/dist/deployment.d.ts.map +0 -1
- package/packages/@repo/contracts/dist/deployment.js +0 -46
- package/packages/@repo/contracts/dist/domain.d.ts +0 -94
- package/packages/@repo/contracts/dist/domain.d.ts.map +0 -1
- package/packages/@repo/contracts/dist/domain.js +0 -36
- package/packages/@repo/contracts/dist/git.d.ts +0 -28
- package/packages/@repo/contracts/dist/git.d.ts.map +0 -1
- package/packages/@repo/contracts/dist/git.js +0 -24
- package/packages/@repo/contracts/dist/ids.d.ts +0 -14
- package/packages/@repo/contracts/dist/ids.d.ts.map +0 -1
- package/packages/@repo/contracts/dist/ids.js +0 -11
- package/packages/@repo/contracts/dist/index.d.ts +0 -12
- package/packages/@repo/contracts/dist/index.d.ts.map +0 -1
- package/packages/@repo/contracts/dist/index.js +0 -13
- package/packages/@repo/contracts/dist/pagination.d.ts +0 -23
- package/packages/@repo/contracts/dist/pagination.d.ts.map +0 -1
- package/packages/@repo/contracts/dist/pagination.js +0 -15
- package/packages/@repo/contracts/dist/project.d.ts +0 -42
- package/packages/@repo/contracts/dist/project.d.ts.map +0 -1
- package/packages/@repo/contracts/dist/project.js +0 -25
- package/packages/@repo/contracts/dist/tenant.d.ts +0 -147
- package/packages/@repo/contracts/dist/tenant.d.ts.map +0 -1
- package/packages/@repo/contracts/dist/tenant.js +0 -58
- package/packages/@repo/contracts/dist/user.d.ts +0 -9
- package/packages/@repo/contracts/dist/user.d.ts.map +0 -1
- package/packages/@repo/contracts/dist/user.js +0 -9
- package/packages/@repo/contracts/package.json +0 -37
- package/packages/@repo/contracts/src/analytics.ts +0 -33
- package/packages/@repo/contracts/src/api-key.ts +0 -27
- package/packages/@repo/contracts/src/dates.ts +0 -4
- package/packages/@repo/contracts/src/deployment.ts +0 -73
- package/packages/@repo/contracts/src/domain.ts +0 -51
- package/packages/@repo/contracts/src/git.ts +0 -31
- package/packages/@repo/contracts/src/ids.ts +0 -23
- package/packages/@repo/contracts/src/index.ts +0 -13
- package/packages/@repo/contracts/src/pagination.ts +0 -21
- package/packages/@repo/contracts/src/project.ts +0 -32
- package/packages/@repo/contracts/src/tenant.ts +0 -94
- package/packages/@repo/contracts/src/user.ts +0 -12
- package/packages/@repo/models/dist/docs-config.d.ts +0 -961
- package/packages/@repo/models/dist/docs-config.d.ts.map +0 -1
- package/packages/@repo/models/dist/docs-config.js +0 -531
- package/packages/@repo/models/dist/index.d.ts +0 -3
- package/packages/@repo/models/dist/index.d.ts.map +0 -1
- package/packages/@repo/models/dist/index.js +0 -3
- package/packages/@repo/models/dist/tenant.d.ts +0 -37
- package/packages/@repo/models/dist/tenant.d.ts.map +0 -1
- package/packages/@repo/models/dist/tenant.js +0 -1
- package/packages/@repo/models/package.json +0 -37
- package/packages/@repo/models/src/docs-config.ts +0 -629
- package/packages/@repo/models/src/index.ts +0 -3
- package/packages/@repo/models/src/tenant.ts +0 -44
- package/packages/@repo/prebuild/dist/index.d.ts +0 -2
- package/packages/@repo/prebuild/dist/index.d.ts.map +0 -1
- package/packages/@repo/prebuild/dist/index.js +0 -2
- package/packages/@repo/prebuild/dist/openapi.d.ts +0 -43
- package/packages/@repo/prebuild/dist/openapi.d.ts.map +0 -1
- package/packages/@repo/prebuild/dist/openapi.js +0 -86
- package/packages/@repo/prebuild/package.json +0 -39
- package/packages/@repo/prebuild/src/index.ts +0 -2
- package/packages/@repo/prebuild/src/openapi.ts +0 -154
- package/packages/@repo/previewing/dist/blob-source.d.ts +0 -16
- package/packages/@repo/previewing/dist/blob-source.d.ts.map +0 -1
- package/packages/@repo/previewing/dist/blob-source.js +0 -128
- package/packages/@repo/previewing/dist/config-loader.d.ts +0 -134
- package/packages/@repo/previewing/dist/config-loader.d.ts.map +0 -1
- package/packages/@repo/previewing/dist/config-loader.js +0 -231
- package/packages/@repo/previewing/dist/constants.d.ts +0 -15
- package/packages/@repo/previewing/dist/constants.d.ts.map +0 -1
- package/packages/@repo/previewing/dist/constants.js +0 -14
- package/packages/@repo/previewing/dist/content-index.d.ts +0 -7
- package/packages/@repo/previewing/dist/content-index.d.ts.map +0 -1
- package/packages/@repo/previewing/dist/content-index.js +0 -291
- package/packages/@repo/previewing/dist/content-source.d.ts +0 -12
- package/packages/@repo/previewing/dist/content-source.d.ts.map +0 -1
- package/packages/@repo/previewing/dist/content-source.js +0 -1
- package/packages/@repo/previewing/dist/fs-source.d.ts +0 -11
- package/packages/@repo/previewing/dist/fs-source.d.ts.map +0 -1
- package/packages/@repo/previewing/dist/fs-source.js +0 -71
- package/packages/@repo/previewing/dist/index.d.ts +0 -16
- package/packages/@repo/previewing/dist/index.d.ts.map +0 -1
- package/packages/@repo/previewing/dist/index.js +0 -13
- package/packages/@repo/previewing/dist/markdown/agent-markdown.d.ts +0 -3
- package/packages/@repo/previewing/dist/markdown/agent-markdown.d.ts.map +0 -1
- package/packages/@repo/previewing/dist/markdown/agent-markdown.js +0 -176
- package/packages/@repo/previewing/dist/markdown/format.d.ts +0 -8
- package/packages/@repo/previewing/dist/markdown/format.d.ts.map +0 -1
- package/packages/@repo/previewing/dist/markdown/format.js +0 -43
- package/packages/@repo/previewing/dist/markdown/links.d.ts +0 -3
- package/packages/@repo/previewing/dist/markdown/links.d.ts.map +0 -1
- package/packages/@repo/previewing/dist/markdown/links.js +0 -31
- package/packages/@repo/previewing/dist/openapi-pages.d.ts +0 -7
- package/packages/@repo/previewing/dist/openapi-pages.d.ts.map +0 -1
- package/packages/@repo/previewing/dist/openapi-pages.js +0 -200
- package/packages/@repo/previewing/dist/search-index.d.ts +0 -4
- package/packages/@repo/previewing/dist/search-index.d.ts.map +0 -1
- package/packages/@repo/previewing/dist/search-index.js +0 -23
- package/packages/@repo/previewing/dist/serialization.d.ts +0 -13
- package/packages/@repo/previewing/dist/serialization.d.ts.map +0 -1
- package/packages/@repo/previewing/dist/serialization.js +0 -108
- package/packages/@repo/previewing/dist/toc-index.d.ts +0 -5
- package/packages/@repo/previewing/dist/toc-index.d.ts.map +0 -1
- package/packages/@repo/previewing/dist/toc-index.js +0 -53
- package/packages/@repo/previewing/dist/types.d.ts +0 -92
- package/packages/@repo/previewing/dist/types.d.ts.map +0 -1
- package/packages/@repo/previewing/dist/types.js +0 -1
- package/packages/@repo/previewing/dist/utility-index.d.ts +0 -7
- package/packages/@repo/previewing/dist/utility-index.d.ts.map +0 -1
- package/packages/@repo/previewing/dist/utility-index.js +0 -201
- package/packages/@repo/previewing/package.json +0 -41
- package/packages/@repo/previewing/src/blob-source.ts +0 -185
- package/packages/@repo/previewing/src/config-loader.ts +0 -316
- package/packages/@repo/previewing/src/constants.ts +0 -16
- package/packages/@repo/previewing/src/content-index.ts +0 -384
- package/packages/@repo/previewing/src/content-source.ts +0 -12
- package/packages/@repo/previewing/src/fs-source.ts +0 -103
- package/packages/@repo/previewing/src/index.ts +0 -71
- package/packages/@repo/previewing/src/markdown/agent-markdown.ts +0 -254
- package/packages/@repo/previewing/src/markdown/format.ts +0 -63
- package/packages/@repo/previewing/src/markdown/links.ts +0 -46
- package/packages/@repo/previewing/src/openapi-pages.ts +0 -319
- package/packages/@repo/previewing/src/search-index.ts +0 -38
- package/packages/@repo/previewing/src/serialization.ts +0 -191
- package/packages/@repo/previewing/src/toc-index.ts +0 -72
- package/packages/@repo/previewing/src/types.ts +0 -105
- package/packages/@repo/previewing/src/utility-index.ts +0 -304
- package/packages/@repo/validation/dist/index.d.ts +0 -12
- package/packages/@repo/validation/dist/index.d.ts.map +0 -1
- package/packages/@repo/validation/dist/index.js +0 -30
- package/packages/@repo/validation/package.json +0 -38
- package/packages/@repo/validation/src/blodemd-docs-schema.json +0 -3575
- package/packages/@repo/validation/src/index.ts +0 -59
- package/scripts/prepare-package.mjs +0 -53
- package/scripts/repo-packages.mjs +0 -8
|
@@ -1,195 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
|
|
3
|
-
import Link from "next/link";
|
|
4
|
-
import { useCallback, useState } from "react";
|
|
5
|
-
import type { ReactNode } from "react";
|
|
6
|
-
|
|
7
|
-
import { Button } from "@/components/ui/button";
|
|
8
|
-
import { MorphIcon } from "@/components/ui/morph-icon";
|
|
9
|
-
import {
|
|
10
|
-
Popover,
|
|
11
|
-
PopoverContent,
|
|
12
|
-
PopoverTrigger,
|
|
13
|
-
} from "@/components/ui/popover";
|
|
14
|
-
import { getNavPageHref, getNavPageTitle } from "@/lib/navigation";
|
|
15
|
-
import type { NavEntry, NavPage, NavTab } from "@/lib/navigation";
|
|
16
|
-
import { isExternalHref, resolveHref, toDocHref } from "@/lib/routes";
|
|
17
|
-
import { cn } from "@/lib/utils";
|
|
18
|
-
|
|
19
|
-
const MobileLink = ({
|
|
20
|
-
href,
|
|
21
|
-
onOpenChange,
|
|
22
|
-
className,
|
|
23
|
-
children,
|
|
24
|
-
onClick,
|
|
25
|
-
...props
|
|
26
|
-
}: React.ComponentProps<typeof Link> & {
|
|
27
|
-
onOpenChange?: (open: boolean) => void;
|
|
28
|
-
children: ReactNode;
|
|
29
|
-
className?: string;
|
|
30
|
-
}) => {
|
|
31
|
-
const handleClick = useCallback(
|
|
32
|
-
(event: React.MouseEvent<HTMLAnchorElement>) => {
|
|
33
|
-
onClick?.(event);
|
|
34
|
-
onOpenChange?.(false);
|
|
35
|
-
},
|
|
36
|
-
[onClick, onOpenChange]
|
|
37
|
-
);
|
|
38
|
-
|
|
39
|
-
return (
|
|
40
|
-
<Link
|
|
41
|
-
className={cn("flex items-center gap-2 text-2xl font-medium", className)}
|
|
42
|
-
href={href}
|
|
43
|
-
onClick={handleClick}
|
|
44
|
-
{...props}
|
|
45
|
-
>
|
|
46
|
-
{children}
|
|
47
|
-
</Link>
|
|
48
|
-
);
|
|
49
|
-
};
|
|
50
|
-
|
|
51
|
-
export const MobileNav = ({
|
|
52
|
-
entries,
|
|
53
|
-
globalLinks,
|
|
54
|
-
basePath,
|
|
55
|
-
tabs,
|
|
56
|
-
activeTabIndex,
|
|
57
|
-
className,
|
|
58
|
-
}: {
|
|
59
|
-
entries: NavEntry[];
|
|
60
|
-
globalLinks: { label: string; href: string }[];
|
|
61
|
-
basePath: string;
|
|
62
|
-
tabs?: NavTab[] | null;
|
|
63
|
-
activeTabIndex?: number;
|
|
64
|
-
className?: string;
|
|
65
|
-
}) => {
|
|
66
|
-
const [open, setOpen] = useState(false);
|
|
67
|
-
|
|
68
|
-
const renderPageLink = (page: NavPage) => {
|
|
69
|
-
const href = getNavPageHref(page, basePath);
|
|
70
|
-
const isExternal = Boolean(page.url && isExternalHref(page.url));
|
|
71
|
-
|
|
72
|
-
return (
|
|
73
|
-
<MobileLink
|
|
74
|
-
href={href}
|
|
75
|
-
key={page.path}
|
|
76
|
-
onOpenChange={setOpen}
|
|
77
|
-
rel={isExternal ? "noopener noreferrer" : undefined}
|
|
78
|
-
target={isExternal ? "_blank" : undefined}
|
|
79
|
-
>
|
|
80
|
-
{getNavPageTitle(page)}
|
|
81
|
-
</MobileLink>
|
|
82
|
-
);
|
|
83
|
-
};
|
|
84
|
-
|
|
85
|
-
return (
|
|
86
|
-
<Popover onOpenChange={setOpen} open={open}>
|
|
87
|
-
<PopoverTrigger asChild>
|
|
88
|
-
<Button
|
|
89
|
-
className={cn(
|
|
90
|
-
"extend-touch-target !p-0 -ml-3 size-10 touch-manipulation items-center justify-start gap-2.5 hover:bg-transparent focus-visible:bg-transparent focus-visible:ring-0 active:bg-transparent dark:hover:bg-transparent",
|
|
91
|
-
className
|
|
92
|
-
)}
|
|
93
|
-
variant="ghost"
|
|
94
|
-
>
|
|
95
|
-
<div className="relative flex size-10 items-center justify-center">
|
|
96
|
-
<MorphIcon
|
|
97
|
-
icon={open ? "cross" : "menu"}
|
|
98
|
-
size={16}
|
|
99
|
-
strokeWidth={2}
|
|
100
|
-
/>
|
|
101
|
-
<span className="sr-only">Toggle Menu</span>
|
|
102
|
-
</div>
|
|
103
|
-
</Button>
|
|
104
|
-
</PopoverTrigger>
|
|
105
|
-
<PopoverContent
|
|
106
|
-
align="start"
|
|
107
|
-
alignOffset={-16}
|
|
108
|
-
className="no-scrollbar h-(--available-height) w-(--available-width) overflow-y-auto rounded-none border-none bg-background/90 p-0 shadow-none backdrop-blur duration-100 data-open:animate-none!"
|
|
109
|
-
side="bottom"
|
|
110
|
-
sideOffset={14}
|
|
111
|
-
>
|
|
112
|
-
{open ? (
|
|
113
|
-
<div className="flex flex-col gap-12 overflow-auto px-6 py-6">
|
|
114
|
-
{tabs?.length ? (
|
|
115
|
-
<div className="flex flex-col gap-4">
|
|
116
|
-
<div className="text-sm font-medium text-muted-foreground">
|
|
117
|
-
Sections
|
|
118
|
-
</div>
|
|
119
|
-
<div className="flex flex-col gap-3">
|
|
120
|
-
{tabs.map((tab, index) => {
|
|
121
|
-
const href =
|
|
122
|
-
(tab.href
|
|
123
|
-
? resolveHref(tab.href, basePath)
|
|
124
|
-
: undefined) ??
|
|
125
|
-
(tab.slugPrefix
|
|
126
|
-
? toDocHref(tab.slugPrefix, basePath)
|
|
127
|
-
: undefined);
|
|
128
|
-
if (!href) {
|
|
129
|
-
return null;
|
|
130
|
-
}
|
|
131
|
-
const isActive = index === activeTabIndex;
|
|
132
|
-
|
|
133
|
-
return (
|
|
134
|
-
<MobileLink
|
|
135
|
-
className={isActive ? "text-primary" : ""}
|
|
136
|
-
href={href}
|
|
137
|
-
key={tab.label}
|
|
138
|
-
onOpenChange={setOpen}
|
|
139
|
-
rel={
|
|
140
|
-
tab.href && isExternalHref(tab.href)
|
|
141
|
-
? "noopener noreferrer"
|
|
142
|
-
: undefined
|
|
143
|
-
}
|
|
144
|
-
target={
|
|
145
|
-
tab.href && isExternalHref(tab.href)
|
|
146
|
-
? "_blank"
|
|
147
|
-
: undefined
|
|
148
|
-
}
|
|
149
|
-
>
|
|
150
|
-
{tab.label}
|
|
151
|
-
</MobileLink>
|
|
152
|
-
);
|
|
153
|
-
})}
|
|
154
|
-
</div>
|
|
155
|
-
</div>
|
|
156
|
-
) : null}
|
|
157
|
-
{globalLinks.length > 0 ? (
|
|
158
|
-
<div className="flex flex-col gap-4">
|
|
159
|
-
<div className="flex flex-col gap-3">
|
|
160
|
-
{globalLinks.map((link) => (
|
|
161
|
-
<MobileLink
|
|
162
|
-
href={link.href}
|
|
163
|
-
key={link.label}
|
|
164
|
-
onOpenChange={setOpen}
|
|
165
|
-
rel="noopener noreferrer"
|
|
166
|
-
target="_blank"
|
|
167
|
-
>
|
|
168
|
-
{link.label}
|
|
169
|
-
</MobileLink>
|
|
170
|
-
))}
|
|
171
|
-
</div>
|
|
172
|
-
</div>
|
|
173
|
-
) : null}
|
|
174
|
-
{entries.map((entry) => {
|
|
175
|
-
if (entry.type === "page") {
|
|
176
|
-
return renderPageLink(entry);
|
|
177
|
-
}
|
|
178
|
-
|
|
179
|
-
return (
|
|
180
|
-
<div className="flex flex-col gap-4" key={entry.title}>
|
|
181
|
-
<div className="text-sm font-medium text-muted-foreground">
|
|
182
|
-
{entry.title}
|
|
183
|
-
</div>
|
|
184
|
-
<div className="flex flex-col gap-3">
|
|
185
|
-
{entry.items.map((item) => renderPageLink(item))}
|
|
186
|
-
</div>
|
|
187
|
-
</div>
|
|
188
|
-
);
|
|
189
|
-
})}
|
|
190
|
-
</div>
|
|
191
|
-
) : null}
|
|
192
|
-
</PopoverContent>
|
|
193
|
-
</Popover>
|
|
194
|
-
);
|
|
195
|
-
};
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
|
|
3
|
-
import { normalizePath } from "@repo/common";
|
|
4
|
-
import { usePathname } from "next/navigation";
|
|
5
|
-
import { useEffect } from "react";
|
|
6
|
-
|
|
7
|
-
const ACTIVE_CLASSES = ["border-accent", "bg-accent", "text-foreground"];
|
|
8
|
-
|
|
9
|
-
export const SidebarActiveHighlight = ({ basePath }: { basePath: string }) => {
|
|
10
|
-
const pathname = usePathname();
|
|
11
|
-
|
|
12
|
-
useEffect(() => {
|
|
13
|
-
const stripped = basePath
|
|
14
|
-
? pathname.replace(new RegExp(`^${basePath}`), "")
|
|
15
|
-
: pathname;
|
|
16
|
-
const target = normalizePath(stripped) || "index";
|
|
17
|
-
|
|
18
|
-
const links = document.querySelectorAll<HTMLElement>(
|
|
19
|
-
"[data-sidebar-link][data-path]"
|
|
20
|
-
);
|
|
21
|
-
for (const link of links) {
|
|
22
|
-
const isActive = link.dataset.path === target;
|
|
23
|
-
if (isActive) {
|
|
24
|
-
link.dataset.active = "true";
|
|
25
|
-
link.classList.add(...ACTIVE_CLASSES);
|
|
26
|
-
} else {
|
|
27
|
-
delete link.dataset.active;
|
|
28
|
-
link.classList.remove(...ACTIVE_CLASSES);
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
}, [basePath, pathname]);
|
|
32
|
-
|
|
33
|
-
return null;
|
|
34
|
-
};
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
|
|
3
|
-
import { useEffect, useRef } from "react";
|
|
4
|
-
|
|
5
|
-
let savedScrollTop = 0;
|
|
6
|
-
|
|
7
|
-
export const SidebarScrollArea = ({
|
|
8
|
-
children,
|
|
9
|
-
className,
|
|
10
|
-
}: {
|
|
11
|
-
children: React.ReactNode;
|
|
12
|
-
className?: string;
|
|
13
|
-
}) => {
|
|
14
|
-
const scrollRef = useRef<HTMLDivElement>(null);
|
|
15
|
-
|
|
16
|
-
useEffect(() => {
|
|
17
|
-
const el = scrollRef.current;
|
|
18
|
-
if (!el) {
|
|
19
|
-
return;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
if (savedScrollTop > 0) {
|
|
23
|
-
el.scrollTop = savedScrollTop;
|
|
24
|
-
return;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
// Defer to allow SidebarActiveHighlight to mark the active link first.
|
|
28
|
-
const id = requestAnimationFrame(() => {
|
|
29
|
-
const active = el.querySelector<HTMLElement>("[data-active]");
|
|
30
|
-
if (active) {
|
|
31
|
-
active.scrollIntoView({ behavior: "instant", block: "center" });
|
|
32
|
-
}
|
|
33
|
-
});
|
|
34
|
-
return () => cancelAnimationFrame(id);
|
|
35
|
-
});
|
|
36
|
-
|
|
37
|
-
useEffect(() => {
|
|
38
|
-
const el = scrollRef.current;
|
|
39
|
-
if (!el) {
|
|
40
|
-
return;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
let raf = 0;
|
|
44
|
-
const onScroll = () => {
|
|
45
|
-
cancelAnimationFrame(raf);
|
|
46
|
-
raf = requestAnimationFrame(() => {
|
|
47
|
-
savedScrollTop = el.scrollTop;
|
|
48
|
-
});
|
|
49
|
-
};
|
|
50
|
-
|
|
51
|
-
el.addEventListener("scroll", onScroll, { passive: true });
|
|
52
|
-
return () => {
|
|
53
|
-
cancelAnimationFrame(raf);
|
|
54
|
-
el.removeEventListener("scroll", onScroll);
|
|
55
|
-
};
|
|
56
|
-
}, []);
|
|
57
|
-
|
|
58
|
-
return (
|
|
59
|
-
<div ref={scrollRef} className={className}>
|
|
60
|
-
{children}
|
|
61
|
-
</div>
|
|
62
|
-
);
|
|
63
|
-
};
|