@blackwork/docs 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 +330 -0
- package/dist/_virtual/_rolldown/runtime.cjs +9 -0
- package/dist/config/defaults.cjs +9 -0
- package/dist/config/defaults.mjs +9 -0
- package/dist/config/define-config.cjs +9 -0
- package/dist/config/define-config.d.mts +7 -0
- package/dist/config/define-config.d.ts +7 -0
- package/dist/config/define-config.mjs +9 -0
- package/dist/config/define-docs-config.cjs +9 -0
- package/dist/config/define-docs-config.d.mts +9 -0
- package/dist/config/define-docs-config.d.ts +9 -0
- package/dist/config/define-docs-config.mjs +9 -0
- package/dist/config/load-content-config.cjs +9 -0
- package/dist/config/load-content-config.d.mts +8 -0
- package/dist/config/load-content-config.d.ts +8 -0
- package/dist/config/load-content-config.mjs +9 -0
- package/dist/config/types.d.mts +78 -0
- package/dist/config/types.d.ts +78 -0
- package/dist/index.cjs +9 -0
- package/dist/index.d.mts +24 -0
- package/dist/index.d.ts +24 -0
- package/dist/index.mjs +9 -0
- package/dist/mdx/default-docs-components.cjs +9 -0
- package/dist/mdx/default-docs-components.d.mts +7 -0
- package/dist/mdx/default-docs-components.d.ts +7 -0
- package/dist/mdx/default-docs-components.mjs +9 -0
- package/dist/mdx/merge-docs-components.cjs +9 -0
- package/dist/mdx/merge-docs-components.d.mts +7 -0
- package/dist/mdx/merge-docs-components.d.ts +7 -0
- package/dist/mdx/merge-docs-components.mjs +9 -0
- package/dist/metadata/create-doc-metadata.cjs +9 -0
- package/dist/metadata/create-doc-metadata.d.mts +33 -0
- package/dist/metadata/create-doc-metadata.d.ts +33 -0
- package/dist/metadata/create-doc-metadata.mjs +9 -0
- package/dist/navigation/build-locale-links.cjs +9 -0
- package/dist/navigation/build-locale-links.d.mts +24 -0
- package/dist/navigation/build-locale-links.d.ts +24 -0
- package/dist/navigation/build-locale-links.mjs +9 -0
- package/dist/navigation/build-pager.cjs +9 -0
- package/dist/navigation/build-pager.d.mts +25 -0
- package/dist/navigation/build-pager.d.ts +25 -0
- package/dist/navigation/build-pager.mjs +9 -0
- package/dist/navigation/build-sidebar.cjs +9 -0
- package/dist/navigation/build-sidebar.d.mts +28 -0
- package/dist/navigation/build-sidebar.d.ts +28 -0
- package/dist/navigation/build-sidebar.mjs +9 -0
- package/dist/navigation/resolve-sidebar.cjs +9 -0
- package/dist/navigation/resolve-sidebar.d.mts +20 -0
- package/dist/navigation/resolve-sidebar.d.ts +20 -0
- package/dist/navigation/resolve-sidebar.mjs +9 -0
- package/dist/next/context.cjs +9 -0
- package/dist/next/context.mjs +9 -0
- package/dist/next/load-doc-content.cjs +9 -0
- package/dist/next/load-doc-content.mjs +9 -0
- package/dist/next/load-generated-manifest.cjs +9 -0
- package/dist/next/load-generated-manifest.mjs +9 -0
- package/dist/next/metadata.cjs +9 -0
- package/dist/next/metadata.d.mts +12 -0
- package/dist/next/metadata.d.ts +12 -0
- package/dist/next/metadata.mjs +9 -0
- package/dist/next/page.cjs +9 -0
- package/dist/next/page.d.mts +16 -0
- package/dist/next/page.d.ts +16 -0
- package/dist/next/page.mjs +9 -0
- package/dist/next/render-route.cjs +9 -0
- package/dist/next/render-route.d.mts +10 -0
- package/dist/next/render-route.d.ts +10 -0
- package/dist/next/render-route.mjs +9 -0
- package/dist/next/resolve-document-lang.cjs +9 -0
- package/dist/next/resolve-document-lang.mjs +9 -0
- package/dist/next/root-layout.cjs +9 -0
- package/dist/next/root-layout.d.mts +19 -0
- package/dist/next/root-layout.d.ts +19 -0
- package/dist/next/root-layout.mjs +9 -0
- package/dist/next-plugin/generate.cjs +32 -0
- package/dist/next-plugin/generate.mjs +32 -0
- package/dist/next.cjs +9 -0
- package/dist/next.d.mts +21 -0
- package/dist/next.d.ts +21 -0
- package/dist/next.mjs +9 -0
- package/dist/routing/build-static-params.cjs +9 -0
- package/dist/routing/build-static-params.d.mts +13 -0
- package/dist/routing/build-static-params.d.ts +13 -0
- package/dist/routing/build-static-params.mjs +9 -0
- package/dist/routing/resolve-docs-route.cjs +9 -0
- package/dist/routing/resolve-docs-route.d.mts +35 -0
- package/dist/routing/resolve-docs-route.d.ts +35 -0
- package/dist/routing/resolve-docs-route.mjs +9 -0
- package/dist/runtime.cjs +9 -0
- package/dist/runtime.d.mts +4 -0
- package/dist/runtime.d.ts +4 -0
- package/dist/runtime.mjs +9 -0
- package/dist/source/build-docs-source.cjs +9 -0
- package/dist/source/build-docs-source.mjs +9 -0
- package/dist/source/collect-docs-manifest.cjs +9 -0
- package/dist/source/collect-docs-manifest.mjs +9 -0
- package/dist/source/create-docs-source-from-manifest.cjs +9 -0
- package/dist/source/create-docs-source-from-manifest.mjs +9 -0
- package/dist/source/create-docs-source.cjs +9 -0
- package/dist/source/create-docs-source.d.mts +10 -0
- package/dist/source/create-docs-source.d.ts +10 -0
- package/dist/source/create-docs-source.mjs +9 -0
- package/dist/source/types.d.mts +36 -0
- package/dist/source/types.d.ts +36 -0
- package/dist/theme/components/content-shell.cjs +9 -0
- package/dist/theme/components/content-shell.d.mts +17 -0
- package/dist/theme/components/content-shell.d.ts +17 -0
- package/dist/theme/components/content-shell.mjs +9 -0
- package/dist/theme/components/docs-rail-scroll-state.cjs +9 -0
- package/dist/theme/components/docs-rail-scroll-state.mjs +9 -0
- package/dist/theme/components/docs-rail-scroll.cjs +9 -0
- package/dist/theme/components/docs-rail-scroll.mjs +9 -0
- package/dist/theme/components/docs-scroll-reset.cjs +9 -0
- package/dist/theme/components/docs-scroll-reset.mjs +9 -0
- package/dist/theme/components/docs-shell.cjs +9 -0
- package/dist/theme/components/docs-shell.d.mts +17 -0
- package/dist/theme/components/docs-shell.d.ts +17 -0
- package/dist/theme/components/docs-shell.mjs +9 -0
- package/dist/theme/components/docs-toc-geometry.cjs +9 -0
- package/dist/theme/components/docs-toc-geometry.mjs +9 -0
- package/dist/theme/components/docs-toc.cjs +9 -0
- package/dist/theme/components/docs-toc.mjs +9 -0
- package/dist/theme/components/footer.cjs +9 -0
- package/dist/theme/components/footer.d.mts +11 -0
- package/dist/theme/components/footer.d.ts +11 -0
- package/dist/theme/components/footer.mjs +9 -0
- package/dist/theme/components/header.cjs +9 -0
- package/dist/theme/components/header.d.mts +16 -0
- package/dist/theme/components/header.d.ts +16 -0
- package/dist/theme/components/header.mjs +9 -0
- package/dist/theme/components/home-shell.cjs +9 -0
- package/dist/theme/components/home-shell.d.mts +14 -0
- package/dist/theme/components/home-shell.d.ts +14 -0
- package/dist/theme/components/home-shell.mjs +9 -0
- package/dist/theme/components/link.cjs +9 -0
- package/dist/theme/components/link.d.mts +9 -0
- package/dist/theme/components/link.d.ts +9 -0
- package/dist/theme/components/link.mjs +9 -0
- package/dist/theme/components/shell-shared.cjs +9 -0
- package/dist/theme/components/shell-shared.mjs +9 -0
- package/dist/theme/create-home-data.cjs +9 -0
- package/dist/theme/create-home-data.d.mts +18 -0
- package/dist/theme/create-home-data.d.ts +18 -0
- package/dist/theme/create-home-data.mjs +9 -0
- package/dist/theme/slots.cjs +9 -0
- package/dist/theme/slots.d.mts +7 -0
- package/dist/theme/slots.d.ts +7 -0
- package/dist/theme/slots.mjs +9 -0
- package/dist/theme/types.d.mts +64 -0
- package/dist/theme/types.d.ts +64 -0
- package/dist/theme.cjs +9 -0
- package/dist/theme.d.mts +11 -0
- package/dist/theme.d.ts +11 -0
- package/dist/theme.mjs +9 -0
- package/package.json +81 -0
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* name: @blackwork/docs
|
|
3
|
+
* version: v0.1.0
|
|
4
|
+
* description: Next-first documentation framework for Blackwork projects.
|
|
5
|
+
* author: chengpeiquan <chengpeiquan@chengpeiquan.com>
|
|
6
|
+
* homepage: https://chengpeiquan.com
|
|
7
|
+
* license: MIT
|
|
8
|
+
*/
|
|
9
|
+
const e=require(`./build-docs-source.cjs`),t=require(`./collect-docs-manifest.cjs`);function n({rootDir:n=`.`,config:r}={}){return e.buildDocsSource(t.collectDocsManifest({rootDir:n,config:r}))}exports.createDocsSource=n;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
|
|
2
|
+
import { CreateDocsSourceOptions, DocsSource } from "./types.mjs";
|
|
3
|
+
|
|
4
|
+
//#region src/source/create-docs-source.d.ts
|
|
5
|
+
declare function createDocsSource({
|
|
6
|
+
rootDir,
|
|
7
|
+
config
|
|
8
|
+
}?: CreateDocsSourceOptions): DocsSource;
|
|
9
|
+
//#endregion
|
|
10
|
+
export { createDocsSource };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
|
|
2
|
+
import { CreateDocsSourceOptions, DocsSource } from "./types.js";
|
|
3
|
+
|
|
4
|
+
//#region src/source/create-docs-source.d.ts
|
|
5
|
+
declare function createDocsSource({
|
|
6
|
+
rootDir,
|
|
7
|
+
config
|
|
8
|
+
}?: CreateDocsSourceOptions): DocsSource;
|
|
9
|
+
//#endregion
|
|
10
|
+
export { createDocsSource };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* name: @blackwork/docs
|
|
3
|
+
* version: v0.1.0
|
|
4
|
+
* description: Next-first documentation framework for Blackwork projects.
|
|
5
|
+
* author: chengpeiquan <chengpeiquan@chengpeiquan.com>
|
|
6
|
+
* homepage: https://chengpeiquan.com
|
|
7
|
+
* license: MIT
|
|
8
|
+
*/
|
|
9
|
+
import{buildDocsSource as e}from"./build-docs-source.mjs";import{collectDocsManifest as t}from"./collect-docs-manifest.mjs";function n({rootDir:n=`.`,config:r}={}){return e(t({rootDir:n,config:r}))}export{n as createDocsSource};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
|
|
2
|
+
import { DocsConfig, NormalizedDocsConfig } from "../config/types.mjs";
|
|
3
|
+
|
|
4
|
+
//#region src/source/types.d.ts
|
|
5
|
+
type DocFormat = 'md' | 'mdx';
|
|
6
|
+
interface DocEntry {
|
|
7
|
+
locale: string;
|
|
8
|
+
slugSegments: string[];
|
|
9
|
+
href: string;
|
|
10
|
+
legacyHref: string | null;
|
|
11
|
+
sourcePath: string;
|
|
12
|
+
loadSource?: () => Promise<string>;
|
|
13
|
+
format: DocFormat;
|
|
14
|
+
title: string;
|
|
15
|
+
description: string;
|
|
16
|
+
order?: number;
|
|
17
|
+
frontmatter: Record<string, unknown>;
|
|
18
|
+
}
|
|
19
|
+
interface CreateDocsSourceOptions {
|
|
20
|
+
rootDir?: string;
|
|
21
|
+
config?: DocsConfig | NormalizedDocsConfig;
|
|
22
|
+
}
|
|
23
|
+
interface DocsSource {
|
|
24
|
+
getAliasEntries(): Array<DocEntry & {
|
|
25
|
+
legacyHref: string;
|
|
26
|
+
}>;
|
|
27
|
+
getCanonicalHref(locale: string, slugSegments?: string[]): string;
|
|
28
|
+
getDefaultLocale(): string | undefined;
|
|
29
|
+
getEntries(locale: string): DocEntry[];
|
|
30
|
+
getEntry(locale: string, slugSegments?: string[]): DocEntry | null;
|
|
31
|
+
isDefaultLocaleRedirectEnabled(): boolean;
|
|
32
|
+
getLegacyAliasHref(locale: string, slugSegments?: string[]): string | null;
|
|
33
|
+
getLocaleCodes(): string[];
|
|
34
|
+
}
|
|
35
|
+
//#endregion
|
|
36
|
+
export { CreateDocsSourceOptions, DocEntry, DocFormat, DocsSource };
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
|
|
2
|
+
import { DocsConfig, NormalizedDocsConfig } from "../config/types.js";
|
|
3
|
+
|
|
4
|
+
//#region src/source/types.d.ts
|
|
5
|
+
type DocFormat = 'md' | 'mdx';
|
|
6
|
+
interface DocEntry {
|
|
7
|
+
locale: string;
|
|
8
|
+
slugSegments: string[];
|
|
9
|
+
href: string;
|
|
10
|
+
legacyHref: string | null;
|
|
11
|
+
sourcePath: string;
|
|
12
|
+
loadSource?: () => Promise<string>;
|
|
13
|
+
format: DocFormat;
|
|
14
|
+
title: string;
|
|
15
|
+
description: string;
|
|
16
|
+
order?: number;
|
|
17
|
+
frontmatter: Record<string, unknown>;
|
|
18
|
+
}
|
|
19
|
+
interface CreateDocsSourceOptions {
|
|
20
|
+
rootDir?: string;
|
|
21
|
+
config?: DocsConfig | NormalizedDocsConfig;
|
|
22
|
+
}
|
|
23
|
+
interface DocsSource {
|
|
24
|
+
getAliasEntries(): Array<DocEntry & {
|
|
25
|
+
legacyHref: string;
|
|
26
|
+
}>;
|
|
27
|
+
getCanonicalHref(locale: string, slugSegments?: string[]): string;
|
|
28
|
+
getDefaultLocale(): string | undefined;
|
|
29
|
+
getEntries(locale: string): DocEntry[];
|
|
30
|
+
getEntry(locale: string, slugSegments?: string[]): DocEntry | null;
|
|
31
|
+
isDefaultLocaleRedirectEnabled(): boolean;
|
|
32
|
+
getLegacyAliasHref(locale: string, slugSegments?: string[]): string | null;
|
|
33
|
+
getLocaleCodes(): string[];
|
|
34
|
+
}
|
|
35
|
+
//#endregion
|
|
36
|
+
export { CreateDocsSourceOptions, DocEntry, DocFormat, DocsSource };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* name: @blackwork/docs
|
|
3
|
+
* version: v0.1.0
|
|
4
|
+
* description: Next-first documentation framework for Blackwork projects.
|
|
5
|
+
* author: chengpeiquan <chengpeiquan@chengpeiquan.com>
|
|
6
|
+
* homepage: https://chengpeiquan.com
|
|
7
|
+
* license: MIT
|
|
8
|
+
*/
|
|
9
|
+
const e=require(`../../_virtual/_rolldown/runtime.cjs`),t=require(`../../config/define-config.cjs`),n=require(`../../navigation/build-locale-links.cjs`),r=require(`../../navigation/resolve-sidebar.cjs`),i=require(`../../navigation/build-pager.cjs`),a=require(`../../navigation/build-sidebar.cjs`),o=require(`./link.cjs`),s=require(`./footer.cjs`),c=require(`./header.cjs`),l=require(`../slots.cjs`),u=require(`./docs-toc.cjs`),d=require(`./shell-shared.cjs`);let f=require(`react`);f=e.__toESM(f);let p=require(`react/jsx-runtime`);const m=({children:e,config:f,entry:m,headings:h=[],source:g})=>{let _=t.defineConfig(f),v=g.getEntries(m.locale),y=d.getEntrySectionKey(m),b=d.getEntrySectionConfig(_,m),x=Array.isArray(b.sidebar),S=d.getSectionEntries(v,m),C=x?r.resolveSidebar({config:_,entries:v,currentHref:m.href,sectionKey:y}):[],w=d.toNavigation(m,x?r.flattenResolvedSidebarItems(C):a.buildSidebar({entries:v,currentHref:m.href})),T=i.buildPager({entries:S,currentHref:m.href,...x?{sidebar:C}:{}}),E=n.buildLocaleLinks({config:_,entry:m,source:g}),D=d.getTocHeadings(h),O=D.length>=2,k=g.getCanonicalHref(m.locale,[]),A=l.resolveThemeSlots(_.slots),j=A.link??o.DefaultDocsLink,M=A.footer??s.DefaultDocsFooter,N=O?(0,p.jsx)(u.DefaultDocsToc,{headings:D,collapseEnabled:!0,dock:`fixed`,className:`xl:left-8`}):null;return(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(c.DefaultDocsHeader,{homeHref:k,LinkComponent:j,localeLinks:E,navigation:w,siteDescription:_.site.description,siteTitle:d.getSiteTitle(_)}),N,(0,p.jsxs)(`main`,{"data-docs-region":`content-shell`,className:`mx-auto flex w-full max-w-screen-2xl flex-col gap-10 px-6 py-8 sm:px-8 xl:flex-row xl:items-start xl:gap-12 xl:px-10 2xl:gap-16 2xl:px-12`,children:[O?(0,p.jsx)(`div`,{"aria-hidden":`true`,className:`hidden w-64 shrink-0 xl:block`}):null,(0,p.jsx)(`div`,{className:`flex min-w-0 flex-1 justify-center`,children:(0,p.jsxs)(`div`,{className:`flex w-full max-w-4xl flex-col gap-10`,children:[(0,p.jsxs)(`header`,{"data-docs-region":`article-header`,className:`flex flex-col gap-3 border-b border-border/60 pb-6`,children:[(0,p.jsx)(`h1`,{className:`text-3xl font-semibold tracking-tight text-foreground`,children:m.title}),m.description?(0,p.jsx)(`p`,{className:`max-w-3xl text-muted-foreground`,children:m.description}):null]}),(0,p.jsx)(`article`,{"data-docs-region":`article-body`,className:`prose prose-neutral max-w-none dark:prose-invert`,children:e}),(0,p.jsxs)(`nav`,{"data-docs-region":`pager`,"aria-label":`Document pager`,className:`flex flex-wrap items-center justify-between gap-3 border-t border-border/60 pt-6 text-sm`,children:[T.previous?(0,p.jsxs)(j,{href:T.previous.href,className:`text-muted-foreground`,children:[`Previous: `,T.previous.title]}):(0,p.jsx)(`span`,{}),T.next?(0,p.jsxs)(j,{href:T.next.href,className:`text-muted-foreground`,children:[`Next: `,T.next.title]}):null]})]})}),O?(0,p.jsx)(`div`,{"aria-hidden":`true`,className:`hidden w-64 shrink-0 xl:block`}):null]}),(0,p.jsx)(M,{description:d.getFooterDescription(_,m),homeHref:k,LinkComponent:j,navigation:w,siteTitle:d.getSiteTitle(_)})]})};exports.DefaultContentShell=m;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
|
|
2
|
+
import { DocsConfig, NormalizedDocsConfig } from "../../config/types.mjs";
|
|
3
|
+
import { DocEntry, DocsSource } from "../../source/types.mjs";
|
|
4
|
+
import React from "react";
|
|
5
|
+
import { HeadingItem } from "@blackwork/machine";
|
|
6
|
+
|
|
7
|
+
//#region src/theme/components/content-shell.d.ts
|
|
8
|
+
interface DefaultContentShellProps {
|
|
9
|
+
children: React.ReactNode;
|
|
10
|
+
config?: DocsConfig | NormalizedDocsConfig;
|
|
11
|
+
entry: DocEntry;
|
|
12
|
+
headings?: HeadingItem[];
|
|
13
|
+
source: DocsSource;
|
|
14
|
+
}
|
|
15
|
+
declare const DefaultContentShell: React.FC<DefaultContentShellProps>;
|
|
16
|
+
//#endregion
|
|
17
|
+
export { DefaultContentShell, DefaultContentShellProps };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
|
|
2
|
+
import { DocsConfig, NormalizedDocsConfig } from "../../config/types.js";
|
|
3
|
+
import { DocEntry, DocsSource } from "../../source/types.js";
|
|
4
|
+
import React from "react";
|
|
5
|
+
import { HeadingItem } from "@blackwork/machine";
|
|
6
|
+
|
|
7
|
+
//#region src/theme/components/content-shell.d.ts
|
|
8
|
+
interface DefaultContentShellProps {
|
|
9
|
+
children: React.ReactNode;
|
|
10
|
+
config?: DocsConfig | NormalizedDocsConfig;
|
|
11
|
+
entry: DocEntry;
|
|
12
|
+
headings?: HeadingItem[];
|
|
13
|
+
source: DocsSource;
|
|
14
|
+
}
|
|
15
|
+
declare const DefaultContentShell: React.FC<DefaultContentShellProps>;
|
|
16
|
+
//#endregion
|
|
17
|
+
export { DefaultContentShell, DefaultContentShellProps };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* name: @blackwork/docs
|
|
3
|
+
* version: v0.1.0
|
|
4
|
+
* description: Next-first documentation framework for Blackwork projects.
|
|
5
|
+
* author: chengpeiquan <chengpeiquan@chengpeiquan.com>
|
|
6
|
+
* homepage: https://chengpeiquan.com
|
|
7
|
+
* license: MIT
|
|
8
|
+
*/
|
|
9
|
+
import{defineConfig as e}from"../../config/define-config.mjs";import{buildLocaleLinks as t}from"../../navigation/build-locale-links.mjs";import{flattenResolvedSidebarItems as n,resolveSidebar as r}from"../../navigation/resolve-sidebar.mjs";import{buildPager as i}from"../../navigation/build-pager.mjs";import{buildSidebar as a}from"../../navigation/build-sidebar.mjs";import{DefaultDocsLink as o}from"./link.mjs";import{DefaultDocsFooter as s}from"./footer.mjs";import{DefaultDocsHeader as c}from"./header.mjs";import{resolveThemeSlots as l}from"../slots.mjs";import{DefaultDocsToc as u}from"./docs-toc.mjs";import{getEntrySectionConfig as d,getEntrySectionKey as f,getFooterDescription as p,getSectionEntries as m,getSiteTitle as h,getTocHeadings as g,toNavigation as _}from"./shell-shared.mjs";import"react";import{Fragment as v,jsx as y,jsxs as b}from"react/jsx-runtime";const x=({children:x,config:S,entry:C,headings:w=[],source:T})=>{let E=e(S),D=T.getEntries(C.locale),O=f(C),k=d(E,C),A=Array.isArray(k.sidebar),j=m(D,C),M=A?r({config:E,entries:D,currentHref:C.href,sectionKey:O}):[],N=_(C,A?n(M):a({entries:D,currentHref:C.href})),P=i({entries:j,currentHref:C.href,...A?{sidebar:M}:{}}),F=t({config:E,entry:C,source:T}),I=g(w),L=I.length>=2,R=T.getCanonicalHref(C.locale,[]),z=l(E.slots),B=z.link??o,V=z.footer??s,H=L?y(u,{headings:I,collapseEnabled:!0,dock:`fixed`,className:`xl:left-8`}):null;return b(v,{children:[y(c,{homeHref:R,LinkComponent:B,localeLinks:F,navigation:N,siteDescription:E.site.description,siteTitle:h(E)}),H,b(`main`,{"data-docs-region":`content-shell`,className:`mx-auto flex w-full max-w-screen-2xl flex-col gap-10 px-6 py-8 sm:px-8 xl:flex-row xl:items-start xl:gap-12 xl:px-10 2xl:gap-16 2xl:px-12`,children:[L?y(`div`,{"aria-hidden":`true`,className:`hidden w-64 shrink-0 xl:block`}):null,y(`div`,{className:`flex min-w-0 flex-1 justify-center`,children:b(`div`,{className:`flex w-full max-w-4xl flex-col gap-10`,children:[b(`header`,{"data-docs-region":`article-header`,className:`flex flex-col gap-3 border-b border-border/60 pb-6`,children:[y(`h1`,{className:`text-3xl font-semibold tracking-tight text-foreground`,children:C.title}),C.description?y(`p`,{className:`max-w-3xl text-muted-foreground`,children:C.description}):null]}),y(`article`,{"data-docs-region":`article-body`,className:`prose prose-neutral max-w-none dark:prose-invert`,children:x}),b(`nav`,{"data-docs-region":`pager`,"aria-label":`Document pager`,className:`flex flex-wrap items-center justify-between gap-3 border-t border-border/60 pt-6 text-sm`,children:[P.previous?b(B,{href:P.previous.href,className:`text-muted-foreground`,children:[`Previous: `,P.previous.title]}):y(`span`,{}),P.next?b(B,{href:P.next.href,className:`text-muted-foreground`,children:[`Next: `,P.next.title]}):null]})]})}),L?y(`div`,{"aria-hidden":`true`,className:`hidden w-64 shrink-0 xl:block`}):null]}),y(V,{description:p(E,C),homeHref:R,LinkComponent:B,navigation:N,siteTitle:h(E)})]})};export{x as DefaultContentShell};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* name: @blackwork/docs
|
|
3
|
+
* version: v0.1.0
|
|
4
|
+
* description: Next-first documentation framework for Blackwork projects.
|
|
5
|
+
* author: chengpeiquan <chengpeiquan@chengpeiquan.com>
|
|
6
|
+
* homepage: https://chengpeiquan.com
|
|
7
|
+
* license: MIT
|
|
8
|
+
*/
|
|
9
|
+
const e=({scrollTop:e,clientHeight:t,scrollHeight:n})=>{let r=Math.max(n-t,0);return r<=1?{showTop:!1,showBottom:!1}:{showTop:e>1,showBottom:r-e>1}};exports.getDocsRailFadeState=e;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* name: @blackwork/docs
|
|
3
|
+
* version: v0.1.0
|
|
4
|
+
* description: Next-first documentation framework for Blackwork projects.
|
|
5
|
+
* author: chengpeiquan <chengpeiquan@chengpeiquan.com>
|
|
6
|
+
* homepage: https://chengpeiquan.com
|
|
7
|
+
* license: MIT
|
|
8
|
+
*/
|
|
9
|
+
const e=({scrollTop:e,clientHeight:t,scrollHeight:n})=>{let r=Math.max(n-t,0);return r<=1?{showTop:!1,showBottom:!1}:{showTop:e>1,showBottom:r-e>1}};export{e as getDocsRailFadeState};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* name: @blackwork/docs
|
|
3
|
+
* version: v0.1.0
|
|
4
|
+
* description: Next-first documentation framework for Blackwork projects.
|
|
5
|
+
* author: chengpeiquan <chengpeiquan@chengpeiquan.com>
|
|
6
|
+
* homepage: https://chengpeiquan.com
|
|
7
|
+
* license: MIT
|
|
8
|
+
*/
|
|
9
|
+
"use client";require(`../../_virtual/_rolldown/runtime.cjs`);const e=require(`./docs-rail-scroll-state.cjs`);let t=require(`react`),n=require(`react/jsx-runtime`);const r={showTop:!1,showBottom:!1},i=e=>e?`opacity-100`:`opacity-0`,a=({children:a})=>{let o=(0,t.useRef)(null),[s,c]=(0,t.useState)(r);return(0,t.useEffect)(()=>{let t=o.current;if(!t)return;let n=()=>{let n=e.getDocsRailFadeState({scrollTop:t.scrollTop,clientHeight:t.clientHeight,scrollHeight:t.scrollHeight});c(e=>e.showTop===n.showTop&&e.showBottom===n.showBottom?e:n)};n(),t.addEventListener(`scroll`,n,{passive:!0});let r=typeof ResizeObserver>`u`?null:new ResizeObserver(()=>{n()});r?.observe(t);let i=t.firstElementChild;return i instanceof HTMLElement&&r?.observe(i),()=>{t.removeEventListener(`scroll`,n),r?.disconnect()}},[]),(0,n.jsxs)(`div`,{"data-docs-sidebar-scroll":`true`,className:`relative lg:max-h-[calc(100dvh-6rem)] lg:overflow-hidden`,children:[(0,n.jsx)(`div`,{"aria-hidden":`true`,"data-docs-sidebar-fade":`top`,className:[`pointer-events-none absolute inset-x-0 top-0 z-10 hidden h-8 bg-gradient-to-b from-background via-background/80 to-transparent transition-opacity lg:block`,i(s.showTop)].join(` `)}),(0,n.jsx)(`div`,{ref:o,"data-docs-rail-viewport":`true`,className:`lg:max-h-[calc(100dvh-6rem)] lg:overflow-auto lg:pb-8 lg:pr-4 [scrollbar-width:none]`,children:a}),(0,n.jsx)(`div`,{"aria-hidden":`true`,"data-docs-sidebar-fade":`bottom`,className:[`pointer-events-none absolute inset-x-0 bottom-0 z-10 hidden h-12 bg-gradient-to-t from-background via-background/80 to-transparent transition-opacity lg:block`,i(s.showBottom)].join(` `)})]})};exports.DocsRailScroll=a;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* name: @blackwork/docs
|
|
3
|
+
* version: v0.1.0
|
|
4
|
+
* description: Next-first documentation framework for Blackwork projects.
|
|
5
|
+
* author: chengpeiquan <chengpeiquan@chengpeiquan.com>
|
|
6
|
+
* homepage: https://chengpeiquan.com
|
|
7
|
+
* license: MIT
|
|
8
|
+
*/
|
|
9
|
+
"use client";import{getDocsRailFadeState as e}from"./docs-rail-scroll-state.mjs";import{useEffect as t,useRef as n,useState as r}from"react";import{jsx as i,jsxs as a}from"react/jsx-runtime";const o={showTop:!1,showBottom:!1},s=e=>e?`opacity-100`:`opacity-0`,c=({children:c})=>{let l=n(null),[u,d]=r(o);return t(()=>{let t=l.current;if(!t)return;let n=()=>{let n=e({scrollTop:t.scrollTop,clientHeight:t.clientHeight,scrollHeight:t.scrollHeight});d(e=>e.showTop===n.showTop&&e.showBottom===n.showBottom?e:n)};n(),t.addEventListener(`scroll`,n,{passive:!0});let r=typeof ResizeObserver>`u`?null:new ResizeObserver(()=>{n()});r?.observe(t);let i=t.firstElementChild;return i instanceof HTMLElement&&r?.observe(i),()=>{t.removeEventListener(`scroll`,n),r?.disconnect()}},[]),a(`div`,{"data-docs-sidebar-scroll":`true`,className:`relative lg:max-h-[calc(100dvh-6rem)] lg:overflow-hidden`,children:[i(`div`,{"aria-hidden":`true`,"data-docs-sidebar-fade":`top`,className:[`pointer-events-none absolute inset-x-0 top-0 z-10 hidden h-8 bg-gradient-to-b from-background via-background/80 to-transparent transition-opacity lg:block`,s(u.showTop)].join(` `)}),i(`div`,{ref:l,"data-docs-rail-viewport":`true`,className:`lg:max-h-[calc(100dvh-6rem)] lg:overflow-auto lg:pb-8 lg:pr-4 [scrollbar-width:none]`,children:c}),i(`div`,{"aria-hidden":`true`,"data-docs-sidebar-fade":`bottom`,className:[`pointer-events-none absolute inset-x-0 bottom-0 z-10 hidden h-12 bg-gradient-to-t from-background via-background/80 to-transparent transition-opacity lg:block`,s(u.showBottom)].join(` `)})]})};export{c as DocsRailScroll};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* name: @blackwork/docs
|
|
3
|
+
* version: v0.1.0
|
|
4
|
+
* description: Next-first documentation framework for Blackwork projects.
|
|
5
|
+
* author: chengpeiquan <chengpeiquan@chengpeiquan.com>
|
|
6
|
+
* homepage: https://chengpeiquan.com
|
|
7
|
+
* license: MIT
|
|
8
|
+
*/
|
|
9
|
+
"use client";require(`../../_virtual/_rolldown/runtime.cjs`);let e=require(`next/navigation.js`),t=require(`react`);const n=(e,t)=>e!==null&&e!==t,r=e=>{e.scrollTo({left:0,top:0,behavior:`instant`})},i=()=>{let i=(0,e.usePathname)(),a=(0,t.useRef)(null);return(0,t.useEffect)(()=>{typeof window<`u`&&typeof i==`string`&&n(a.current,i)&&r(window),a.current=typeof i==`string`?i:null},[i]),null};exports.DocsScrollReset=i;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* name: @blackwork/docs
|
|
3
|
+
* version: v0.1.0
|
|
4
|
+
* description: Next-first documentation framework for Blackwork projects.
|
|
5
|
+
* author: chengpeiquan <chengpeiquan@chengpeiquan.com>
|
|
6
|
+
* homepage: https://chengpeiquan.com
|
|
7
|
+
* license: MIT
|
|
8
|
+
*/
|
|
9
|
+
"use client";import{usePathname as e}from"next/navigation.js";import{useEffect as t,useRef as n}from"react";const r=(e,t)=>e!==null&&e!==t,i=e=>{e.scrollTo({left:0,top:0,behavior:`instant`})},a=()=>{let a=e(),o=n(null);return t(()=>{typeof window<`u`&&typeof a==`string`&&r(o.current,a)&&i(window),o.current=typeof a==`string`?a:null},[a]),null};export{a as DocsScrollReset};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* name: @blackwork/docs
|
|
3
|
+
* version: v0.1.0
|
|
4
|
+
* description: Next-first documentation framework for Blackwork projects.
|
|
5
|
+
* author: chengpeiquan <chengpeiquan@chengpeiquan.com>
|
|
6
|
+
* homepage: https://chengpeiquan.com
|
|
7
|
+
* license: MIT
|
|
8
|
+
*/
|
|
9
|
+
const e=require(`../../_virtual/_rolldown/runtime.cjs`),t=require(`../../config/define-config.cjs`),n=require(`../../navigation/build-locale-links.cjs`),r=require(`../../navigation/resolve-sidebar.cjs`),i=require(`../../navigation/build-pager.cjs`),a=require(`../../navigation/build-sidebar.cjs`),o=require(`./link.cjs`),s=require(`./footer.cjs`),c=require(`./header.cjs`),l=require(`../slots.cjs`),u=require(`./docs-toc.cjs`),d=require(`./shell-shared.cjs`),f=require(`./docs-rail-scroll.cjs`);let p=require(`react`);p=e.__toESM(p);let m=require(`react/jsx-runtime`);const h=e=>[`block rounded-md py-1.5 pr-3 text-sm transition-colors`,e?`bg-accent font-medium text-accent-foreground`:`text-muted-foreground hover:text-foreground`].join(` `),g=e=>e.isExternal||e.slugSegments.length>0,_=e=>e.flatMap(e=>{if(e.type===`group`){let t=e.items.filter(g);return t.length===0?[]:[{...e,items:t}]}return g(e)?[e]:[]}),v=({children:e,config:p,entry:g,headings:v=[],source:y})=>{let b=t.defineConfig(p),x=y.getEntries(g.locale),S=d.getEntrySectionKey(g),C=d.getEntrySectionConfig(b,g),w=Array.isArray(C.sidebar),T=d.getSectionEntries(x,g),E=r.resolveSidebar({config:b,entries:x,currentHref:g.href,sectionKey:S}),D=_(E),O=i.buildPager({entries:T,currentHref:g.href,...w?{sidebar:E}:{}}),k=d.toNavigation(g,w?r.flattenResolvedSidebarItems(E):a.buildSidebar({entries:x,currentHref:g.href})),A=n.buildLocaleLinks({config:b,entry:g,source:y}),j=y.getCanonicalHref(g.locale,[]),M=l.resolveThemeSlots(b.slots),N=M.link??o.DefaultDocsLink,P=M.footer??s.DefaultDocsFooter;return(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(c.DefaultDocsHeader,{homeHref:j,LinkComponent:N,localeLinks:A,navigation:k,siteDescription:b.site.description,siteTitle:d.getSiteTitle(b)}),(0,m.jsxs)(`main`,{"data-docs-region":`docs-shell`,className:`mx-auto flex w-full max-w-screen-2xl flex-col gap-10 px-6 py-8 sm:px-8 lg:flex-row lg:gap-14 xl:gap-20 xl:px-10 2xl:gap-24 2xl:px-12`,children:[(0,m.jsx)(`aside`,{"data-docs-region":`sidebar`,className:`w-full shrink-0 lg:w-72 lg:self-start lg:sticky lg:top-24`,children:(0,m.jsx)(f.DocsRailScroll,{children:(0,m.jsx)(`nav`,{"aria-label":`Documentation pages`,className:`flex flex-col gap-1`,children:D.map(e=>e.type===`group`?(0,m.jsxs)(`div`,{className:`flex flex-col gap-1 pt-4 first:pt-0`,children:[(0,m.jsx)(`p`,{className:`px-3 text-xs font-medium uppercase tracking-[0.08em] text-muted-foreground/80`,children:e.title}),e.items.map(e=>(0,m.jsx)(N,{href:e.href,"aria-current":e.isActive?`page`:void 0,"data-current-page":e.isActive?`true`:void 0,className:h(e.isActive),style:{paddingLeft:`${.75+e.depth*.75}rem`},children:e.title},e.href))]},e.title):(0,m.jsx)(N,{href:e.href,"aria-current":e.isActive?`page`:void 0,"data-current-page":e.isActive?`true`:void 0,className:h(e.isActive),style:{paddingLeft:`${.75+e.depth*.75}rem`},children:e.title},e.href))})})}),(0,m.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col gap-10`,children:[(0,m.jsxs)(`header`,{"data-docs-region":`article-header`,className:`flex flex-col gap-3 border-b border-border/60 pb-6`,children:[(0,m.jsx)(`h1`,{className:`text-3xl font-semibold tracking-tight text-foreground`,children:g.title}),g.description?(0,m.jsx)(`p`,{className:`max-w-3xl text-muted-foreground`,children:g.description}):null]}),(0,m.jsx)(`article`,{"data-docs-region":`article-body`,className:`prose prose-neutral max-w-none dark:prose-invert`,children:e}),(0,m.jsxs)(`nav`,{"data-docs-region":`pager`,"aria-label":`Document pager`,className:`flex flex-wrap items-center justify-between gap-3 border-t border-border/60 pt-6 text-sm`,children:[O.previous?(0,m.jsxs)(N,{href:O.previous.href,className:`text-muted-foreground`,children:[`Previous: `,O.previous.title]}):(0,m.jsx)(`span`,{}),O.next?(0,m.jsxs)(N,{href:O.next.href,className:`text-muted-foreground`,children:[`Next: `,O.next.title]}):null]})]}),(0,m.jsx)(u.DefaultDocsToc,{headings:d.getTocHeadings(v)})]}),(0,m.jsx)(P,{description:d.getFooterDescription(b,g),homeHref:j,LinkComponent:N,navigation:k,siteTitle:d.getSiteTitle(b)})]})};exports.DefaultDocsShell=v;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
|
|
2
|
+
import { DocsConfig, NormalizedDocsConfig } from "../../config/types.mjs";
|
|
3
|
+
import { DocEntry, DocsSource } from "../../source/types.mjs";
|
|
4
|
+
import React from "react";
|
|
5
|
+
import { HeadingItem } from "@blackwork/machine";
|
|
6
|
+
|
|
7
|
+
//#region src/theme/components/docs-shell.d.ts
|
|
8
|
+
interface DefaultDocsShellProps {
|
|
9
|
+
children: React.ReactNode;
|
|
10
|
+
config?: DocsConfig | NormalizedDocsConfig;
|
|
11
|
+
entry: DocEntry;
|
|
12
|
+
headings?: HeadingItem[];
|
|
13
|
+
source: DocsSource;
|
|
14
|
+
}
|
|
15
|
+
declare const DefaultDocsShell: React.FC<DefaultDocsShellProps>;
|
|
16
|
+
//#endregion
|
|
17
|
+
export { DefaultDocsShell, DefaultDocsShellProps };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
|
|
2
|
+
import { DocsConfig, NormalizedDocsConfig } from "../../config/types.js";
|
|
3
|
+
import { DocEntry, DocsSource } from "../../source/types.js";
|
|
4
|
+
import React from "react";
|
|
5
|
+
import { HeadingItem } from "@blackwork/machine";
|
|
6
|
+
|
|
7
|
+
//#region src/theme/components/docs-shell.d.ts
|
|
8
|
+
interface DefaultDocsShellProps {
|
|
9
|
+
children: React.ReactNode;
|
|
10
|
+
config?: DocsConfig | NormalizedDocsConfig;
|
|
11
|
+
entry: DocEntry;
|
|
12
|
+
headings?: HeadingItem[];
|
|
13
|
+
source: DocsSource;
|
|
14
|
+
}
|
|
15
|
+
declare const DefaultDocsShell: React.FC<DefaultDocsShellProps>;
|
|
16
|
+
//#endregion
|
|
17
|
+
export { DefaultDocsShell, DefaultDocsShellProps };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* name: @blackwork/docs
|
|
3
|
+
* version: v0.1.0
|
|
4
|
+
* description: Next-first documentation framework for Blackwork projects.
|
|
5
|
+
* author: chengpeiquan <chengpeiquan@chengpeiquan.com>
|
|
6
|
+
* homepage: https://chengpeiquan.com
|
|
7
|
+
* license: MIT
|
|
8
|
+
*/
|
|
9
|
+
import{defineConfig as e}from"../../config/define-config.mjs";import{buildLocaleLinks as t}from"../../navigation/build-locale-links.mjs";import{flattenResolvedSidebarItems as n,resolveSidebar as r}from"../../navigation/resolve-sidebar.mjs";import{buildPager as i}from"../../navigation/build-pager.mjs";import{buildSidebar as a}from"../../navigation/build-sidebar.mjs";import{DefaultDocsLink as o}from"./link.mjs";import{DefaultDocsFooter as s}from"./footer.mjs";import{DefaultDocsHeader as c}from"./header.mjs";import{resolveThemeSlots as l}from"../slots.mjs";import{DefaultDocsToc as u}from"./docs-toc.mjs";import{getEntrySectionConfig as d,getEntrySectionKey as f,getFooterDescription as p,getSectionEntries as m,getSiteTitle as h,getTocHeadings as g,toNavigation as _}from"./shell-shared.mjs";import{DocsRailScroll as v}from"./docs-rail-scroll.mjs";import"react";import{Fragment as y,jsx as b,jsxs as x}from"react/jsx-runtime";const S=e=>[`block rounded-md py-1.5 pr-3 text-sm transition-colors`,e?`bg-accent font-medium text-accent-foreground`:`text-muted-foreground hover:text-foreground`].join(` `),C=e=>e.isExternal||e.slugSegments.length>0,w=e=>e.flatMap(e=>{if(e.type===`group`){let t=e.items.filter(C);return t.length===0?[]:[{...e,items:t}]}return C(e)?[e]:[]}),T=({children:C,config:T,entry:E,headings:D=[],source:O})=>{let k=e(T),A=O.getEntries(E.locale),j=f(E),M=d(k,E),N=Array.isArray(M.sidebar),P=m(A,E),F=r({config:k,entries:A,currentHref:E.href,sectionKey:j}),I=w(F),L=i({entries:P,currentHref:E.href,...N?{sidebar:F}:{}}),R=_(E,N?n(F):a({entries:A,currentHref:E.href})),z=t({config:k,entry:E,source:O}),B=O.getCanonicalHref(E.locale,[]),V=l(k.slots),H=V.link??o,U=V.footer??s;return x(y,{children:[b(c,{homeHref:B,LinkComponent:H,localeLinks:z,navigation:R,siteDescription:k.site.description,siteTitle:h(k)}),x(`main`,{"data-docs-region":`docs-shell`,className:`mx-auto flex w-full max-w-screen-2xl flex-col gap-10 px-6 py-8 sm:px-8 lg:flex-row lg:gap-14 xl:gap-20 xl:px-10 2xl:gap-24 2xl:px-12`,children:[b(`aside`,{"data-docs-region":`sidebar`,className:`w-full shrink-0 lg:w-72 lg:self-start lg:sticky lg:top-24`,children:b(v,{children:b(`nav`,{"aria-label":`Documentation pages`,className:`flex flex-col gap-1`,children:I.map(e=>e.type===`group`?x(`div`,{className:`flex flex-col gap-1 pt-4 first:pt-0`,children:[b(`p`,{className:`px-3 text-xs font-medium uppercase tracking-[0.08em] text-muted-foreground/80`,children:e.title}),e.items.map(e=>b(H,{href:e.href,"aria-current":e.isActive?`page`:void 0,"data-current-page":e.isActive?`true`:void 0,className:S(e.isActive),style:{paddingLeft:`${.75+e.depth*.75}rem`},children:e.title},e.href))]},e.title):b(H,{href:e.href,"aria-current":e.isActive?`page`:void 0,"data-current-page":e.isActive?`true`:void 0,className:S(e.isActive),style:{paddingLeft:`${.75+e.depth*.75}rem`},children:e.title},e.href))})})}),x(`div`,{className:`flex min-w-0 flex-1 flex-col gap-10`,children:[x(`header`,{"data-docs-region":`article-header`,className:`flex flex-col gap-3 border-b border-border/60 pb-6`,children:[b(`h1`,{className:`text-3xl font-semibold tracking-tight text-foreground`,children:E.title}),E.description?b(`p`,{className:`max-w-3xl text-muted-foreground`,children:E.description}):null]}),b(`article`,{"data-docs-region":`article-body`,className:`prose prose-neutral max-w-none dark:prose-invert`,children:C}),x(`nav`,{"data-docs-region":`pager`,"aria-label":`Document pager`,className:`flex flex-wrap items-center justify-between gap-3 border-t border-border/60 pt-6 text-sm`,children:[L.previous?x(H,{href:L.previous.href,className:`text-muted-foreground`,children:[`Previous: `,L.previous.title]}):b(`span`,{}),L.next?x(H,{href:L.next.href,className:`text-muted-foreground`,children:[`Next: `,L.next.title]}):null]})]}),b(u,{headings:g(D)})]}),b(U,{description:p(k,E),homeHref:B,LinkComponent:H,navigation:R,siteTitle:h(k)})]})};export{T as DefaultDocsShell};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* name: @blackwork/docs
|
|
3
|
+
* version: v0.1.0
|
|
4
|
+
* description: Next-first documentation framework for Blackwork projects.
|
|
5
|
+
* author: chengpeiquan <chengpeiquan@chengpeiquan.com>
|
|
6
|
+
* homepage: https://chengpeiquan.com
|
|
7
|
+
* license: MIT
|
|
8
|
+
*/
|
|
9
|
+
const e=e=>8+Math.max(e-2,0)*8,t=e=>20+Math.max(e-2,0)*12;function n(t){let n=[],r=1,i=``,a=1;return t.forEach((t,o)=>{let s=e(t.depth)+.5,c={...t,x:s};if(r=Math.max(r,t.bottom),a=Math.max(a,s+8),o===0)i+=`M${s} ${t.top} L${s} ${t.bottom}`;else{let e=n[o-1];i+=` C ${e.x} ${t.top-4} ${s} ${e.bottom+4} ${s} ${t.top} L${s} ${t.bottom}`}n.push(c)}),{height:r,path:i,positions:n,width:a}}exports.buildTocTrackGeometry=n,exports.getTocGuideOffset=e,exports.getTocItemPadding=t;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* name: @blackwork/docs
|
|
3
|
+
* version: v0.1.0
|
|
4
|
+
* description: Next-first documentation framework for Blackwork projects.
|
|
5
|
+
* author: chengpeiquan <chengpeiquan@chengpeiquan.com>
|
|
6
|
+
* homepage: https://chengpeiquan.com
|
|
7
|
+
* license: MIT
|
|
8
|
+
*/
|
|
9
|
+
const e=e=>8+Math.max(e-2,0)*8,t=e=>20+Math.max(e-2,0)*12;function n(t){let n=[],r=1,i=``,a=1;return t.forEach((t,o)=>{let s=e(t.depth)+.5,c={...t,x:s};if(r=Math.max(r,t.bottom),a=Math.max(a,s+8),o===0)i+=`M${s} ${t.top} L${s} ${t.bottom}`;else{let e=n[o-1];i+=` C ${e.x} ${t.top-4} ${s} ${e.bottom+4} ${s} ${t.top} L${s} ${t.bottom}`}n.push(c)}),{height:r,path:i,positions:n,width:a}}export{n as buildTocTrackGeometry,e as getTocGuideOffset,t as getTocItemPadding};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* name: @blackwork/docs
|
|
3
|
+
* version: v0.1.0
|
|
4
|
+
* description: Next-first documentation framework for Blackwork projects.
|
|
5
|
+
* author: chengpeiquan <chengpeiquan@chengpeiquan.com>
|
|
6
|
+
* homepage: https://chengpeiquan.com
|
|
7
|
+
* license: MIT
|
|
8
|
+
*/
|
|
9
|
+
"use client";const e=require(`../../_virtual/_rolldown/runtime.cjs`),t=require(`./docs-toc-geometry.cjs`);let n=require(`blackwork`),r=require(`react`);r=e.__toESM(r);let i=require(`react/jsx-runtime`),a=require(`blackwork/icons`);const o=()=>[`relative block py-1.5 pr-3 text-sm text-muted-foreground transition-colors`,`hover:text-foreground data-[active=true]:text-primary`].join(` `),s=(e,t)=>({height:`${e?.height??1}px`,transform:`translateY(${-t}px)`,width:`${e?.width??1}px`}),c=e=>{let t=e?.top??0,n=e?.bottom??0;return{clipPath:`polygon(0 ${t}px, 100% ${t}px, 100% ${n}px, 0 ${n}px)`,opacity:+!!e}},l=(e,t)=>({offsetDistance:`${t?.offsetDistance??0}px`,offsetPath:`path("${e?.path||`M0 0 L0 0`}")`,opacity:+!!t}),u=e=>e.filter(e=>e.active).sort((e,t)=>e.t-t.t).map(e=>e.id),d=(e,t)=>{let n=null,r=1/0;for(let i of e){let e=document.getElementById(i.id);if(!e)continue;let a=Math.abs(e.getBoundingClientRect().top-t);a<r&&(r=a,n=i.id)}return n},f=e=>{let t=Number.parseFloat(e);return Number.isFinite(t)?t:0},p=(e,t)=>{let n=new Map(Array.from(e.querySelectorAll(`a[data-heading-id]`)).map(e=>[e.dataset.headingId??``,e]));return t.flatMap(e=>{let t=n.get(e.id);if(!t)return[];let r=getComputedStyle(t);return[{bottom:t.offsetTop+t.clientHeight-f(r.paddingBottom),depth:e.depth,id:e.id,top:t.offsetTop+f(r.paddingTop)}]})},m=(e,t)=>{if(t.length===0||e.length===0)return[];try{let n=document.createElementNS(`http://www.w3.org/2000/svg`,`path`);n.setAttribute(`d`,t);let r=[],i=n.getTotalLength();return e.forEach((t,a)=>{let o=a>0?r[a-1][1]+(t.top-e[a-1].bottom):t.top;for(;o<i&&n.getPointAtLength(o).y<t.top;)o+=1;r.push([o,o+(t.bottom-t.top)])}),r}catch{return e.map(e=>[e.top,e.bottom])}},h=(e,t)=>{if(!e||!t)return e===t;if(e.height!==t.height||e.path!==t.path||e.width!==t.width||e.positions.length!==t.positions.length||e.itemLineLengths.length!==t.itemLineLengths.length)return!1;for(let n=0;n<e.positions.length;n+=1){let r=e.positions[n],i=t.positions[n];if(r.bottom!==i.bottom||r.depth!==i.depth||r.id!==i.id||r.top!==i.top||r.x!==i.x)return!1}for(let n=0;n<e.itemLineLengths.length;n+=1){let r=e.itemLineLengths[n],i=t.itemLineLengths[n];if(r[0]!==i[0]||r[1]!==i[1])return!1}return!0},g=(e,t)=>!e||!t?e===t:e.bottom===t.bottom&&e.offsetDistance===t.offsetDistance&&e.top===t.top,_=(e,t,n)=>{let r=new Set(e),i=t.positions.findIndex(e=>r.has(e.id));if(i===-1)return[null,null];let a=i;t.positions.forEach((e,t)=>{r.has(e.id)&&(a=t)});let o=n?n.startIdx>i||n.endIdx>a||n.startIdx===i&&n.endIdx===a&&n.isUp:!1,s=t.itemLineLengths[i]?.[0]??t.positions[i].top,c=t.itemLineLengths[a]?.[1]??t.positions[a].bottom;return[{bottom:t.positions[a].bottom,offsetDistance:o?s:c,top:t.positions[i].top},{endIdx:a,isUp:o,startIdx:i}]};function v(e){let[t,n]=(0,r.useState)([]);return(0,r.useEffect)(()=>{if(e.length===0||typeof document>`u`||typeof IntersectionObserver>`u`)return;let t=new Map(e.map(e=>[e.id,{active:!1,fallback:!1,id:e.id,t:0}])),r=(e=0)=>{for(let e of t.values())e.fallback&&(e.active=!1,e.fallback=!1);let r=u([...t.values()]);if(r.length===0){let n=d([...t.values()],e),i=n?t.get(n):void 0;i&&(i.active=!0,i.fallback=!0,i.t=Date.now(),r=[i.id])}n(r)},i=new IntersectionObserver(e=>{let n=Date.now();for(let r of e){let e=t.get(r.target.id);e&&(e.active!==r.isIntersecting||e.fallback)&&(e.active=r.isIntersecting,e.fallback=!1,e.t=n)}r(e[0]?.rootBounds?.top??0)},{threshold:.9});return e.forEach(e=>{let t=document.getElementById(e.id);t&&i.observe(t)}),r(),()=>{i.disconnect()}},[e]),t}function y(e,n){let i=(0,r.useRef)(null),[a,o]=(0,r.useState)(null),[s,c]=(0,r.useState)(null),l=(0,r.useRef)(null);return(0,r.useEffect)(()=>{let e=i.current;if(!e)return;let r=0,a=()=>{cancelAnimationFrame(r),r=requestAnimationFrame(()=>{let r=t.buildTocTrackGeometry(p(e,n)),i={...r,itemLineLengths:m(r.positions,r.path)};o(e=>h(e,i)?e:i)})},s=typeof ResizeObserver>`u`?null:new ResizeObserver(a);return s?.observe(e),window.addEventListener(`resize`,a),a(),()=>{cancelAnimationFrame(r),s?.disconnect(),window.removeEventListener(`resize`,a)}},[n]),(0,r.useEffect)(()=>{let t=0;return t=requestAnimationFrame(()=>{if(!a||e.length===0){l.current=null,c(e=>e===null?e:null);return}let[t,n]=_(e,a,l.current);l.current=n,c(e=>g(e,t)?e:t)}),()=>{cancelAnimationFrame(t)}},[e,a]),[i,a,s]}const b=({className:e,collapseEnabled:u=!1,defaultCollapsed:d=!1,dock:f=`sticky`,headings:p,minHeadings:m=1})=>{let h=v(p),[g,_,b]=y(h,p),x=(0,r.useMemo)(()=>new Set(h),[h]),S=(0,r.useId)(),[C,w]=(0,r.useState)(d),[T,E]=(0,r.useState)(0);return p.length<m?null:(0,i.jsx)(`aside`,{"data-docs-region":`toc`,"data-docs-toc-collapsible":u?`true`:void 0,"data-docs-toc-collapsed":u?String(C):void 0,className:(0,n.cn)(`hidden w-64 xl:block`,f===`sticky`?`shrink-0 xl:self-start xl:sticky xl:top-24`:`xl:fixed xl:top-24`,e),children:(0,i.jsxs)(`nav`,{"aria-label":`On This Page`,className:`flex flex-col gap-3 text-sm`,children:[C?null:(0,i.jsxs)(`div`,{className:(0,n.cn)(`flex items-center gap-2`,u?`justify-between`:void 0),children:[(0,i.jsx)(`p`,{className:`font-medium text-foreground`,children:`On This Page`}),u?(0,i.jsxs)(n.Button,{type:`button`,variant:`ghost`,size:`icon`,"data-docs-toc-toggle":`true`,"aria-controls":S,"aria-expanded":`true`,title:`Collapse outline`,"aria-label":`Collapse outline`,className:`size-8 shrink-0 text-muted-foreground hover:text-foreground`,onClick:()=>{w(e=>!e)},children:[(0,i.jsx)(a.ChevronsLeft,{className:`size-4`,"aria-hidden":`true`}),(0,i.jsx)(`span`,{className:`sr-only`,children:`Collapse outline`})]}):null]}),C?(0,i.jsxs)(n.Button,{type:`button`,"data-docs-toc-panel":`collapsed`,variant:`ghost`,size:`icon`,"aria-label":`Expand outline`,"aria-expanded":`false`,title:`Expand outline`,className:`self-start shrink-0 text-muted-foreground hover:text-foreground`,onClick:()=>{w(!1)},children:[(0,i.jsx)(a.Toc,{className:`size-4`,"aria-hidden":`true`}),(0,i.jsx)(`span`,{className:`sr-only`,children:`Expand outline`})]}):(0,i.jsxs)(`div`,{className:`relative`,children:[(0,i.jsxs)(`div`,{"aria-hidden":`true`,"data-docs-toc-track":`true`,className:`pointer-events-none absolute left-0 top-0 transition-transform duration-150 ease-out`,style:s(_,T),children:[(0,i.jsx)(`svg`,{"data-docs-toc-track-path":`true`,height:_?.height??1,viewBox:`0 0 ${_?.width??1} ${_?.height??1}`,width:_?.width??1,className:`absolute left-0 top-0 transition-[clip-path,opacity] duration-150 ease-out`,style:c(b),children:(0,i.jsx)(`path`,{d:_?.path||`M0 0 L0 0`,stroke:`currentColor`,strokeWidth:`1`,fill:`none`,className:`text-primary`})}),(0,i.jsx)(`span`,{"data-docs-toc-thumb":`true`,className:`absolute left-0 top-0 size-1 rounded-full bg-primary transition-[opacity,offset-distance] duration-150 ease-out`,style:l(_,b)})]}),(0,i.jsx)(`ol`,{id:S,ref:g,className:`flex max-h-[calc(100dvh-8rem)] flex-col overflow-auto py-1 [scrollbar-width:none]`,onScroll:e=>{E(e.currentTarget.scrollTop)},children:p.map((e,n)=>{let r=x.has(e.id),a=t.getTocGuideOffset(e.depth),s=n>0?t.getTocGuideOffset(p[n-1].depth):a,c=n+1<p.length?t.getTocGuideOffset(p[n+1].depth):a;return(0,i.jsx)(`li`,{children:(0,i.jsxs)(`a`,{href:`#${e.id}`,"data-active":r?`true`:`false`,"data-depth":e.depth,"data-heading-id":e.id,className:o(),style:{paddingInlineStart:`${t.getTocItemPadding(e.depth)}px`},children:[a===s?null:(0,i.jsx)(`svg`,{"aria-hidden":`true`,"data-docs-toc-item-curve":`true`,viewBox:`${Math.min(a,s)} 0 ${Math.abs(s-a)} 12`,className:`pointer-events-none absolute`,style:{height:`12px`,insetInlineStart:`${Math.min(a,s)}px`,top:`-6px`,width:`${Math.abs(s-a)+1}px`,zIndex:-1},children:(0,i.jsx)(`path`,{d:`M ${s} 0 C ${s} 8 ${a} 4 ${a} 12`,stroke:`currentColor`,strokeWidth:`1`,fill:`none`,className:`text-border`})}),(0,i.jsx)(`span`,{"aria-hidden":`true`,"data-docs-toc-item-line":`true`,className:`pointer-events-none absolute w-px bg-border`,style:{bottom:a===c?`0px`:`6px`,insetInlineStart:`${a}px`,top:a===s?`0px`:`6px`,zIndex:-1}}),e.title]})},e.id)})})]})]})})};exports.DefaultDocsToc=b;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* name: @blackwork/docs
|
|
3
|
+
* version: v0.1.0
|
|
4
|
+
* description: Next-first documentation framework for Blackwork projects.
|
|
5
|
+
* author: chengpeiquan <chengpeiquan@chengpeiquan.com>
|
|
6
|
+
* homepage: https://chengpeiquan.com
|
|
7
|
+
* license: MIT
|
|
8
|
+
*/
|
|
9
|
+
"use client";import{buildTocTrackGeometry as e,getTocGuideOffset as t,getTocItemPadding as n}from"./docs-toc-geometry.mjs";import{Button as r,cn as i}from"blackwork";import{useEffect as a,useId as o,useMemo as s,useRef as c,useState as l}from"react";import{jsx as u,jsxs as d}from"react/jsx-runtime";import{ChevronsLeft as f,Toc as p}from"blackwork/icons";const m=()=>[`relative block py-1.5 pr-3 text-sm text-muted-foreground transition-colors`,`hover:text-foreground data-[active=true]:text-primary`].join(` `),h=(e,t)=>({height:`${e?.height??1}px`,transform:`translateY(${-t}px)`,width:`${e?.width??1}px`}),g=e=>{let t=e?.top??0,n=e?.bottom??0;return{clipPath:`polygon(0 ${t}px, 100% ${t}px, 100% ${n}px, 0 ${n}px)`,opacity:+!!e}},_=(e,t)=>({offsetDistance:`${t?.offsetDistance??0}px`,offsetPath:`path("${e?.path||`M0 0 L0 0`}")`,opacity:+!!t}),v=e=>e.filter(e=>e.active).sort((e,t)=>e.t-t.t).map(e=>e.id),y=(e,t)=>{let n=null,r=1/0;for(let i of e){let e=document.getElementById(i.id);if(!e)continue;let a=Math.abs(e.getBoundingClientRect().top-t);a<r&&(r=a,n=i.id)}return n},b=e=>{let t=Number.parseFloat(e);return Number.isFinite(t)?t:0},x=(e,t)=>{let n=new Map(Array.from(e.querySelectorAll(`a[data-heading-id]`)).map(e=>[e.dataset.headingId??``,e]));return t.flatMap(e=>{let t=n.get(e.id);if(!t)return[];let r=getComputedStyle(t);return[{bottom:t.offsetTop+t.clientHeight-b(r.paddingBottom),depth:e.depth,id:e.id,top:t.offsetTop+b(r.paddingTop)}]})},S=(e,t)=>{if(t.length===0||e.length===0)return[];try{let n=document.createElementNS(`http://www.w3.org/2000/svg`,`path`);n.setAttribute(`d`,t);let r=[],i=n.getTotalLength();return e.forEach((t,a)=>{let o=a>0?r[a-1][1]+(t.top-e[a-1].bottom):t.top;for(;o<i&&n.getPointAtLength(o).y<t.top;)o+=1;r.push([o,o+(t.bottom-t.top)])}),r}catch{return e.map(e=>[e.top,e.bottom])}},C=(e,t)=>{if(!e||!t)return e===t;if(e.height!==t.height||e.path!==t.path||e.width!==t.width||e.positions.length!==t.positions.length||e.itemLineLengths.length!==t.itemLineLengths.length)return!1;for(let n=0;n<e.positions.length;n+=1){let r=e.positions[n],i=t.positions[n];if(r.bottom!==i.bottom||r.depth!==i.depth||r.id!==i.id||r.top!==i.top||r.x!==i.x)return!1}for(let n=0;n<e.itemLineLengths.length;n+=1){let r=e.itemLineLengths[n],i=t.itemLineLengths[n];if(r[0]!==i[0]||r[1]!==i[1])return!1}return!0},w=(e,t)=>!e||!t?e===t:e.bottom===t.bottom&&e.offsetDistance===t.offsetDistance&&e.top===t.top,T=(e,t,n)=>{let r=new Set(e),i=t.positions.findIndex(e=>r.has(e.id));if(i===-1)return[null,null];let a=i;t.positions.forEach((e,t)=>{r.has(e.id)&&(a=t)});let o=n?n.startIdx>i||n.endIdx>a||n.startIdx===i&&n.endIdx===a&&n.isUp:!1,s=t.itemLineLengths[i]?.[0]??t.positions[i].top,c=t.itemLineLengths[a]?.[1]??t.positions[a].bottom;return[{bottom:t.positions[a].bottom,offsetDistance:o?s:c,top:t.positions[i].top},{endIdx:a,isUp:o,startIdx:i}]};function E(e){let[t,n]=l([]);return a(()=>{if(e.length===0||typeof document>`u`||typeof IntersectionObserver>`u`)return;let t=new Map(e.map(e=>[e.id,{active:!1,fallback:!1,id:e.id,t:0}])),r=(e=0)=>{for(let e of t.values())e.fallback&&(e.active=!1,e.fallback=!1);let r=v([...t.values()]);if(r.length===0){let n=y([...t.values()],e),i=n?t.get(n):void 0;i&&(i.active=!0,i.fallback=!0,i.t=Date.now(),r=[i.id])}n(r)},i=new IntersectionObserver(e=>{let n=Date.now();for(let r of e){let e=t.get(r.target.id);e&&(e.active!==r.isIntersecting||e.fallback)&&(e.active=r.isIntersecting,e.fallback=!1,e.t=n)}r(e[0]?.rootBounds?.top??0)},{threshold:.9});return e.forEach(e=>{let t=document.getElementById(e.id);t&&i.observe(t)}),r(),()=>{i.disconnect()}},[e]),t}function D(t,n){let r=c(null),[i,o]=l(null),[s,u]=l(null),d=c(null);return a(()=>{let t=r.current;if(!t)return;let i=0,a=()=>{cancelAnimationFrame(i),i=requestAnimationFrame(()=>{let r=e(x(t,n)),i={...r,itemLineLengths:S(r.positions,r.path)};o(e=>C(e,i)?e:i)})},s=typeof ResizeObserver>`u`?null:new ResizeObserver(a);return s?.observe(t),window.addEventListener(`resize`,a),a(),()=>{cancelAnimationFrame(i),s?.disconnect(),window.removeEventListener(`resize`,a)}},[n]),a(()=>{let e=0;return e=requestAnimationFrame(()=>{if(!i||t.length===0){d.current=null,u(e=>e===null?e:null);return}let[e,n]=T(t,i,d.current);d.current=n,u(t=>w(t,e)?t:e)}),()=>{cancelAnimationFrame(e)}},[t,i]),[r,i,s]}const O=({className:e,collapseEnabled:a=!1,defaultCollapsed:c=!1,dock:v=`sticky`,headings:y,minHeadings:b=1})=>{let x=E(y),[S,C,w]=D(x,y),T=s(()=>new Set(x),[x]),O=o(),[k,A]=l(c),[j,M]=l(0);return y.length<b?null:u(`aside`,{"data-docs-region":`toc`,"data-docs-toc-collapsible":a?`true`:void 0,"data-docs-toc-collapsed":a?String(k):void 0,className:i(`hidden w-64 xl:block`,v===`sticky`?`shrink-0 xl:self-start xl:sticky xl:top-24`:`xl:fixed xl:top-24`,e),children:d(`nav`,{"aria-label":`On This Page`,className:`flex flex-col gap-3 text-sm`,children:[k?null:d(`div`,{className:i(`flex items-center gap-2`,a?`justify-between`:void 0),children:[u(`p`,{className:`font-medium text-foreground`,children:`On This Page`}),a?d(r,{type:`button`,variant:`ghost`,size:`icon`,"data-docs-toc-toggle":`true`,"aria-controls":O,"aria-expanded":`true`,title:`Collapse outline`,"aria-label":`Collapse outline`,className:`size-8 shrink-0 text-muted-foreground hover:text-foreground`,onClick:()=>{A(e=>!e)},children:[u(f,{className:`size-4`,"aria-hidden":`true`}),u(`span`,{className:`sr-only`,children:`Collapse outline`})]}):null]}),k?d(r,{type:`button`,"data-docs-toc-panel":`collapsed`,variant:`ghost`,size:`icon`,"aria-label":`Expand outline`,"aria-expanded":`false`,title:`Expand outline`,className:`self-start shrink-0 text-muted-foreground hover:text-foreground`,onClick:()=>{A(!1)},children:[u(p,{className:`size-4`,"aria-hidden":`true`}),u(`span`,{className:`sr-only`,children:`Expand outline`})]}):d(`div`,{className:`relative`,children:[d(`div`,{"aria-hidden":`true`,"data-docs-toc-track":`true`,className:`pointer-events-none absolute left-0 top-0 transition-transform duration-150 ease-out`,style:h(C,j),children:[u(`svg`,{"data-docs-toc-track-path":`true`,height:C?.height??1,viewBox:`0 0 ${C?.width??1} ${C?.height??1}`,width:C?.width??1,className:`absolute left-0 top-0 transition-[clip-path,opacity] duration-150 ease-out`,style:g(w),children:u(`path`,{d:C?.path||`M0 0 L0 0`,stroke:`currentColor`,strokeWidth:`1`,fill:`none`,className:`text-primary`})}),u(`span`,{"data-docs-toc-thumb":`true`,className:`absolute left-0 top-0 size-1 rounded-full bg-primary transition-[opacity,offset-distance] duration-150 ease-out`,style:_(C,w)})]}),u(`ol`,{id:O,ref:S,className:`flex max-h-[calc(100dvh-8rem)] flex-col overflow-auto py-1 [scrollbar-width:none]`,onScroll:e=>{M(e.currentTarget.scrollTop)},children:y.map((e,r)=>{let i=T.has(e.id),a=t(e.depth),o=r>0?t(y[r-1].depth):a,s=r+1<y.length?t(y[r+1].depth):a;return u(`li`,{children:d(`a`,{href:`#${e.id}`,"data-active":i?`true`:`false`,"data-depth":e.depth,"data-heading-id":e.id,className:m(),style:{paddingInlineStart:`${n(e.depth)}px`},children:[a===o?null:u(`svg`,{"aria-hidden":`true`,"data-docs-toc-item-curve":`true`,viewBox:`${Math.min(a,o)} 0 ${Math.abs(o-a)} 12`,className:`pointer-events-none absolute`,style:{height:`12px`,insetInlineStart:`${Math.min(a,o)}px`,top:`-6px`,width:`${Math.abs(o-a)+1}px`,zIndex:-1},children:u(`path`,{d:`M ${o} 0 C ${o} 8 ${a} 4 ${a} 12`,stroke:`currentColor`,strokeWidth:`1`,fill:`none`,className:`text-border`})}),u(`span`,{"aria-hidden":`true`,"data-docs-toc-item-line":`true`,className:`pointer-events-none absolute w-px bg-border`,style:{bottom:a===s?`0px`:`6px`,insetInlineStart:`${a}px`,top:a===o?`0px`:`6px`,zIndex:-1}}),e.title]})},e.id)})})]})]})})};export{O as DefaultDocsToc};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* name: @blackwork/docs
|
|
3
|
+
* version: v0.1.0
|
|
4
|
+
* description: Next-first documentation framework for Blackwork projects.
|
|
5
|
+
* author: chengpeiquan <chengpeiquan@chengpeiquan.com>
|
|
6
|
+
* homepage: https://chengpeiquan.com
|
|
7
|
+
* license: MIT
|
|
8
|
+
*/
|
|
9
|
+
const e=require(`../../_virtual/_rolldown/runtime.cjs`),t=require(`./link.cjs`);let n=require(`react`);n=e.__toESM(n);let r=require(`react/jsx-runtime`),i=require(`blackwork/rsc`);const a=({description:e,homeHref:n,LinkComponent:a=t.DefaultDocsLink,navigation:o,siteTitle:s})=>(0,r.jsx)(i.LayoutFooter,{"data-docs-region":`footer`,className:`h-auto min-h-32 border-t border-border/60 bg-background py-8`,children:(0,r.jsxs)(`div`,{className:`mx-auto flex w-full max-w-screen-2xl flex-col gap-4`,children:[(0,r.jsxs)(`div`,{className:`space-y-2`,children:[(0,r.jsx)(a,{href:n,className:`text-sm font-semibold tracking-tight text-foreground`,children:s}),(0,r.jsx)(`p`,{className:`max-w-2xl text-sm text-muted-foreground`,children:e})]}),o.length>0?(0,r.jsx)(`nav`,{className:`flex flex-wrap items-center gap-3 text-sm`,children:o.map(e=>(0,r.jsx)(a,{href:e.href,"aria-current":e.current?`page`:void 0,className:`text-muted-foreground`,children:e.label},e.href))}):null]})});exports.DefaultDocsFooter=a;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
|
|
2
|
+
import { DocsThemeFooterSlotProps, DocsThemeLinkComponent } from "../types.mjs";
|
|
3
|
+
import React from "react";
|
|
4
|
+
|
|
5
|
+
//#region src/theme/components/footer.d.ts
|
|
6
|
+
interface DefaultDocsFooterProps extends DocsThemeFooterSlotProps {
|
|
7
|
+
LinkComponent?: DocsThemeLinkComponent;
|
|
8
|
+
}
|
|
9
|
+
declare const DefaultDocsFooter: React.FC<DefaultDocsFooterProps>;
|
|
10
|
+
//#endregion
|
|
11
|
+
export { DefaultDocsFooter, DefaultDocsFooterProps };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
|
|
2
|
+
import { DocsThemeFooterSlotProps, DocsThemeLinkComponent } from "../types.js";
|
|
3
|
+
import React from "react";
|
|
4
|
+
|
|
5
|
+
//#region src/theme/components/footer.d.ts
|
|
6
|
+
interface DefaultDocsFooterProps extends DocsThemeFooterSlotProps {
|
|
7
|
+
LinkComponent?: DocsThemeLinkComponent;
|
|
8
|
+
}
|
|
9
|
+
declare const DefaultDocsFooter: React.FC<DefaultDocsFooterProps>;
|
|
10
|
+
//#endregion
|
|
11
|
+
export { DefaultDocsFooter, DefaultDocsFooterProps };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* name: @blackwork/docs
|
|
3
|
+
* version: v0.1.0
|
|
4
|
+
* description: Next-first documentation framework for Blackwork projects.
|
|
5
|
+
* author: chengpeiquan <chengpeiquan@chengpeiquan.com>
|
|
6
|
+
* homepage: https://chengpeiquan.com
|
|
7
|
+
* license: MIT
|
|
8
|
+
*/
|
|
9
|
+
import{DefaultDocsLink as e}from"./link.mjs";import"react";import{jsx as t,jsxs as n}from"react/jsx-runtime";import{LayoutFooter as r}from"blackwork/rsc";const i=({description:i,homeHref:a,LinkComponent:o=e,navigation:s,siteTitle:c})=>t(r,{"data-docs-region":`footer`,className:`h-auto min-h-32 border-t border-border/60 bg-background py-8`,children:n(`div`,{className:`mx-auto flex w-full max-w-screen-2xl flex-col gap-4`,children:[n(`div`,{className:`space-y-2`,children:[t(o,{href:a,className:`text-sm font-semibold tracking-tight text-foreground`,children:c}),t(`p`,{className:`max-w-2xl text-sm text-muted-foreground`,children:i})]}),s.length>0?t(`nav`,{className:`flex flex-wrap items-center gap-3 text-sm`,children:s.map(e=>t(o,{href:e.href,"aria-current":e.current?`page`:void 0,className:`text-muted-foreground`,children:e.label},e.href))}):null]})});export{i as DefaultDocsFooter};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* name: @blackwork/docs
|
|
3
|
+
* version: v0.1.0
|
|
4
|
+
* description: Next-first documentation framework for Blackwork projects.
|
|
5
|
+
* author: chengpeiquan <chengpeiquan@chengpeiquan.com>
|
|
6
|
+
* homepage: https://chengpeiquan.com
|
|
7
|
+
* license: MIT
|
|
8
|
+
*/
|
|
9
|
+
const e=require(`../../_virtual/_rolldown/runtime.cjs`),t=require(`./link.cjs`);let n=require(`blackwork`),r=require(`react`);r=e.__toESM(r);let i=require(`react/jsx-runtime`),a=require(`blackwork/icons`);const o=e=>e.label||e.locale,s=({LinkComponent:e,localeLinks:t})=>{if(t.length<=1)return null;let r=t.find(e=>e.current),s=r?`Change language: ${o(r)}`:`Change language`;return(0,i.jsxs)(n.DropdownMenu,{children:[(0,i.jsx)(n.DropdownMenuTrigger,{asChild:!0,children:(0,i.jsxs)(n.Button,{variant:`ghost`,size:`icon`,title:s,"aria-label":`Change language`,"data-current-locale":r?`true`:void 0,className:`focus-visible:ring-0 focus-visible:ring-offset-0`,children:[(0,i.jsx)(a.Language,{className:`size-5`,"aria-hidden":`true`}),(0,i.jsx)(`span`,{className:`sr-only`,children:s})]})}),(0,i.jsx)(n.DropdownMenuContent,{align:`end`,className:`border-border`,children:t.map(t=>(0,i.jsx)(n.DropdownMenuItem,{asChild:!0,className:t.current?`gap-3 font-medium text-foreground`:`gap-3 text-muted-foreground`,children:(0,i.jsxs)(e,{href:t.href,hrefLang:t.lang,"aria-current":t.current?`page`:void 0,"data-current-locale":t.current?`true`:void 0,children:[(0,i.jsx)(`span`,{"aria-hidden":`true`,className:`flex size-4 items-center justify-center`,"data-current-locale-indicator":t.current?``:void 0,children:t.current?(0,i.jsx)(a.Check,{className:`size-4`}):null}),o(t)]})},t.href))})]})},c=({homeHref:e,LinkComponent:r=t.DefaultDocsLink,localeLinks:a=[],siteTitle:o})=>(0,i.jsx)(n.LayoutHeader,{"data-docs-region":`header`,socialLinksVisible:!1,wrapperClassName:`mx-auto w-full max-w-screen-2xl px-6 sm:px-8 md:px-10 lg:px-12 xl:px-14`,contentClassName:`min-w-0`,className:`border-b border-border/60`,languageToggle:(0,i.jsx)(s,{LinkComponent:r,localeLinks:a}),themeToggle:(0,i.jsx)(n.ThemeToggle,{title:`Toggle theme`,ariaLabel:`Toggle theme`}),children:(0,i.jsx)(r,{href:e,"data-docs-region":`header-brand`,className:`truncate text-lg font-semibold text-foreground`,children:o})});exports.DefaultDocsHeader=c;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
|
|
2
|
+
import { DocsThemeLinkComponent, DocsThemeLocaleLink, DocsThemeNavItem } from "../types.mjs";
|
|
3
|
+
import React from "react";
|
|
4
|
+
|
|
5
|
+
//#region src/theme/components/header.d.ts
|
|
6
|
+
interface DefaultDocsHeaderProps {
|
|
7
|
+
homeHref: string;
|
|
8
|
+
LinkComponent?: DocsThemeLinkComponent;
|
|
9
|
+
localeLinks?: DocsThemeLocaleLink[];
|
|
10
|
+
navigation: DocsThemeNavItem[];
|
|
11
|
+
siteDescription?: string;
|
|
12
|
+
siteTitle: string;
|
|
13
|
+
}
|
|
14
|
+
declare const DefaultDocsHeader: React.FC<DefaultDocsHeaderProps>;
|
|
15
|
+
//#endregion
|
|
16
|
+
export { DefaultDocsHeader, DefaultDocsHeaderProps };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
|
|
2
|
+
import { DocsThemeLinkComponent, DocsThemeLocaleLink, DocsThemeNavItem } from "../types.js";
|
|
3
|
+
import React from "react";
|
|
4
|
+
|
|
5
|
+
//#region src/theme/components/header.d.ts
|
|
6
|
+
interface DefaultDocsHeaderProps {
|
|
7
|
+
homeHref: string;
|
|
8
|
+
LinkComponent?: DocsThemeLinkComponent;
|
|
9
|
+
localeLinks?: DocsThemeLocaleLink[];
|
|
10
|
+
navigation: DocsThemeNavItem[];
|
|
11
|
+
siteDescription?: string;
|
|
12
|
+
siteTitle: string;
|
|
13
|
+
}
|
|
14
|
+
declare const DefaultDocsHeader: React.FC<DefaultDocsHeaderProps>;
|
|
15
|
+
//#endregion
|
|
16
|
+
export { DefaultDocsHeader, DefaultDocsHeaderProps };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* name: @blackwork/docs
|
|
3
|
+
* version: v0.1.0
|
|
4
|
+
* description: Next-first documentation framework for Blackwork projects.
|
|
5
|
+
* author: chengpeiquan <chengpeiquan@chengpeiquan.com>
|
|
6
|
+
* homepage: https://chengpeiquan.com
|
|
7
|
+
* license: MIT
|
|
8
|
+
*/
|
|
9
|
+
import{DefaultDocsLink as e}from"./link.mjs";import{Button as t,DropdownMenu as n,DropdownMenuContent as r,DropdownMenuItem as i,DropdownMenuTrigger as a,LayoutHeader as o,ThemeToggle as s}from"blackwork";import"react";import{jsx as c,jsxs as l}from"react/jsx-runtime";import{Check as u,Language as d}from"blackwork/icons";const f=e=>e.label||e.locale,p=({LinkComponent:e,localeLinks:o})=>{if(o.length<=1)return null;let s=o.find(e=>e.current),p=s?`Change language: ${f(s)}`:`Change language`;return l(n,{children:[c(a,{asChild:!0,children:l(t,{variant:`ghost`,size:`icon`,title:p,"aria-label":`Change language`,"data-current-locale":s?`true`:void 0,className:`focus-visible:ring-0 focus-visible:ring-offset-0`,children:[c(d,{className:`size-5`,"aria-hidden":`true`}),c(`span`,{className:`sr-only`,children:p})]})}),c(r,{align:`end`,className:`border-border`,children:o.map(t=>c(i,{asChild:!0,className:t.current?`gap-3 font-medium text-foreground`:`gap-3 text-muted-foreground`,children:l(e,{href:t.href,hrefLang:t.lang,"aria-current":t.current?`page`:void 0,"data-current-locale":t.current?`true`:void 0,children:[c(`span`,{"aria-hidden":`true`,className:`flex size-4 items-center justify-center`,"data-current-locale-indicator":t.current?``:void 0,children:t.current?c(u,{className:`size-4`}):null}),f(t)]})},t.href))})]})},m=({homeHref:t,LinkComponent:n=e,localeLinks:r=[],siteTitle:i})=>c(o,{"data-docs-region":`header`,socialLinksVisible:!1,wrapperClassName:`mx-auto w-full max-w-screen-2xl px-6 sm:px-8 md:px-10 lg:px-12 xl:px-14`,contentClassName:`min-w-0`,className:`border-b border-border/60`,languageToggle:c(p,{LinkComponent:n,localeLinks:r}),themeToggle:c(s,{title:`Toggle theme`,ariaLabel:`Toggle theme`}),children:c(n,{href:t,"data-docs-region":`header-brand`,className:`truncate text-lg font-semibold text-foreground`,children:i})});export{m as DefaultDocsHeader};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* name: @blackwork/docs
|
|
3
|
+
* version: v0.1.0
|
|
4
|
+
* description: Next-first documentation framework for Blackwork projects.
|
|
5
|
+
* author: chengpeiquan <chengpeiquan@chengpeiquan.com>
|
|
6
|
+
* homepage: https://chengpeiquan.com
|
|
7
|
+
* license: MIT
|
|
8
|
+
*/
|
|
9
|
+
const e=require(`../../_virtual/_rolldown/runtime.cjs`),t=require(`../../config/define-config.cjs`),n=require(`../../navigation/build-locale-links.cjs`),r=require(`../../navigation/build-sidebar.cjs`),i=require(`./link.cjs`),a=require(`./header.cjs`),o=require(`../slots.cjs`),s=require(`../create-home-data.cjs`);let c=require(`blackwork`),l=require(`react`);l=e.__toESM(l);let u=require(`react/jsx-runtime`);const d=e=>e.site.title||`Documentation`,f=(e,t,r)=>{let i=r.getEntry(t,[]);return i?n.buildLocaleLinks({config:e,entry:i,source:r}):r.getLocaleCodes().map(n=>{let i=Object.values(e.content.locales??{}).find(e=>e.code===n);return{locale:n,href:r.getCanonicalHref(n,[]),label:i?.label,lang:i?.lang,current:n===t}})},p=(e,t)=>t.filter(e=>e.depth===0).map(t=>({href:t.href,label:t.title,current:e?.href===t.href})),m=({config:e,locale:n,source:l})=>{let m=t.defineConfig(e),h=l.getEntries(n),g=l.getEntry(n,[]),_=s.createHomeData({config:m,locale:n,source:l}),v=p(g,r.buildSidebar({entries:h,currentHref:_.homeHref})),y=f(m,n,l),b=o.resolveThemeSlots(m.slots).link??i.DefaultDocsLink;return(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(a.DefaultDocsHeader,{homeHref:_.homeHref,LinkComponent:b,localeLinks:y,navigation:v,siteDescription:m.site.description,siteTitle:d(m)}),(0,u.jsxs)(`main`,{"data-docs-region":`home-shell`,className:`flex min-h-[calc(100dvh-4rem)] w-full flex-col bg-background px-6 py-10`,children:[(0,u.jsxs)(`section`,{"data-docs-region":`home-hero`,"data-home-mode":_.mode,className:`mx-auto flex w-full max-w-6xl flex-1 flex-col items-center justify-center gap-8 text-center`,children:[_.badge||_.eyebrow?(0,u.jsxs)(c.Badge,{variant:`secondary`,className:`max-w-full gap-2 px-4 py-2 text-sm font-medium`,children:[_.badge?(0,u.jsx)(`span`,{className:`truncate`,children:_.badge}):null,_.badge&&_.eyebrow?(0,u.jsx)(c.Separator,{orientation:`vertical`,"aria-hidden":`true`,className:`h-4 bg-border`}):null,_.eyebrow?(0,u.jsx)(`span`,{className:`truncate text-muted-foreground`,children:_.eyebrow}):null]}):null,(0,u.jsxs)(`div`,{className:`flex flex-col items-center gap-6`,children:[(0,u.jsx)(`h1`,{className:`max-w-5xl text-balance text-5xl font-semibold leading-none text-foreground sm:text-6xl lg:text-7xl`,children:_.title}),(0,u.jsx)(`p`,{className:`max-w-3xl text-pretty text-lg leading-8 text-muted-foreground sm:text-xl`,children:_.description})]}),(0,u.jsxs)(`div`,{className:`flex flex-col items-center gap-3 text-base font-medium sm:flex-row`,children:[(0,u.jsx)(c.Button,{asChild:!0,size:`lg`,className:`rounded-full px-6 shadow-sm`,children:(0,u.jsx)(b,{href:_.primaryAction.href,children:_.primaryAction.label})}),_.secondaryAction?(0,u.jsx)(c.Button,{asChild:!0,variant:`ghost`,size:`lg`,className:`rounded-full px-6`,children:(0,u.jsx)(b,{href:_.secondaryAction.href,children:_.secondaryAction.label})}):null]})]}),_.highlights.length>0?(0,u.jsx)(`section`,{"data-docs-region":`home-highlights`,className:`mx-auto grid w-full max-w-6xl gap-4 pb-16 md:grid-cols-3`,children:_.highlights.map(e=>(0,u.jsx)(b,{href:e.href,className:`block transition-colors`,children:(0,u.jsx)(c.Card,{className:`h-full border-border/60 transition-colors hover:bg-accent hover:text-accent-foreground`,children:(0,u.jsxs)(c.CardContent,{className:`flex flex-col gap-2 p-4`,children:[(0,u.jsx)(`h2`,{className:`text-lg font-medium text-foreground`,children:e.title}),(0,u.jsx)(`p`,{className:`text-pretty text-sm text-muted-foreground`,children:e.description})]})})},e.href))}):null]})]})};exports.DefaultHomeShell=m;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
|
|
2
|
+
import { DocsConfig, NormalizedDocsConfig } from "../../config/types.mjs";
|
|
3
|
+
import { DocsSource } from "../../source/types.mjs";
|
|
4
|
+
import React from "react";
|
|
5
|
+
|
|
6
|
+
//#region src/theme/components/home-shell.d.ts
|
|
7
|
+
interface DefaultHomeShellProps {
|
|
8
|
+
config?: DocsConfig | NormalizedDocsConfig;
|
|
9
|
+
locale: string;
|
|
10
|
+
source: DocsSource;
|
|
11
|
+
}
|
|
12
|
+
declare const DefaultHomeShell: React.FC<DefaultHomeShellProps>;
|
|
13
|
+
//#endregion
|
|
14
|
+
export { DefaultHomeShell, DefaultHomeShellProps };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
|
|
2
|
+
import { DocsConfig, NormalizedDocsConfig } from "../../config/types.js";
|
|
3
|
+
import { DocsSource } from "../../source/types.js";
|
|
4
|
+
import React from "react";
|
|
5
|
+
|
|
6
|
+
//#region src/theme/components/home-shell.d.ts
|
|
7
|
+
interface DefaultHomeShellProps {
|
|
8
|
+
config?: DocsConfig | NormalizedDocsConfig;
|
|
9
|
+
locale: string;
|
|
10
|
+
source: DocsSource;
|
|
11
|
+
}
|
|
12
|
+
declare const DefaultHomeShell: React.FC<DefaultHomeShellProps>;
|
|
13
|
+
//#endregion
|
|
14
|
+
export { DefaultHomeShell, DefaultHomeShellProps };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* name: @blackwork/docs
|
|
3
|
+
* version: v0.1.0
|
|
4
|
+
* description: Next-first documentation framework for Blackwork projects.
|
|
5
|
+
* author: chengpeiquan <chengpeiquan@chengpeiquan.com>
|
|
6
|
+
* homepage: https://chengpeiquan.com
|
|
7
|
+
* license: MIT
|
|
8
|
+
*/
|
|
9
|
+
import{defineConfig as e}from"../../config/define-config.mjs";import{buildLocaleLinks as t}from"../../navigation/build-locale-links.mjs";import{buildSidebar as n}from"../../navigation/build-sidebar.mjs";import{DefaultDocsLink as r}from"./link.mjs";import{DefaultDocsHeader as i}from"./header.mjs";import{resolveThemeSlots as a}from"../slots.mjs";import{createHomeData as o}from"../create-home-data.mjs";import{Badge as s,Button as c,Card as l,CardContent as u,Separator as d}from"blackwork";import"react";import{Fragment as f,jsx as p,jsxs as m}from"react/jsx-runtime";const h=e=>e.site.title||`Documentation`,g=(e,n,r)=>{let i=r.getEntry(n,[]);return i?t({config:e,entry:i,source:r}):r.getLocaleCodes().map(t=>{let i=Object.values(e.content.locales??{}).find(e=>e.code===t);return{locale:t,href:r.getCanonicalHref(t,[]),label:i?.label,lang:i?.lang,current:t===n}})},_=(e,t)=>t.filter(e=>e.depth===0).map(t=>({href:t.href,label:t.title,current:e?.href===t.href})),v=({config:t,locale:v,source:y})=>{let b=e(t),x=y.getEntries(v),S=y.getEntry(v,[]),C=o({config:b,locale:v,source:y}),w=_(S,n({entries:x,currentHref:C.homeHref})),T=g(b,v,y),E=a(b.slots).link??r;return m(f,{children:[p(i,{homeHref:C.homeHref,LinkComponent:E,localeLinks:T,navigation:w,siteDescription:b.site.description,siteTitle:h(b)}),m(`main`,{"data-docs-region":`home-shell`,className:`flex min-h-[calc(100dvh-4rem)] w-full flex-col bg-background px-6 py-10`,children:[m(`section`,{"data-docs-region":`home-hero`,"data-home-mode":C.mode,className:`mx-auto flex w-full max-w-6xl flex-1 flex-col items-center justify-center gap-8 text-center`,children:[C.badge||C.eyebrow?m(s,{variant:`secondary`,className:`max-w-full gap-2 px-4 py-2 text-sm font-medium`,children:[C.badge?p(`span`,{className:`truncate`,children:C.badge}):null,C.badge&&C.eyebrow?p(d,{orientation:`vertical`,"aria-hidden":`true`,className:`h-4 bg-border`}):null,C.eyebrow?p(`span`,{className:`truncate text-muted-foreground`,children:C.eyebrow}):null]}):null,m(`div`,{className:`flex flex-col items-center gap-6`,children:[p(`h1`,{className:`max-w-5xl text-balance text-5xl font-semibold leading-none text-foreground sm:text-6xl lg:text-7xl`,children:C.title}),p(`p`,{className:`max-w-3xl text-pretty text-lg leading-8 text-muted-foreground sm:text-xl`,children:C.description})]}),m(`div`,{className:`flex flex-col items-center gap-3 text-base font-medium sm:flex-row`,children:[p(c,{asChild:!0,size:`lg`,className:`rounded-full px-6 shadow-sm`,children:p(E,{href:C.primaryAction.href,children:C.primaryAction.label})}),C.secondaryAction?p(c,{asChild:!0,variant:`ghost`,size:`lg`,className:`rounded-full px-6`,children:p(E,{href:C.secondaryAction.href,children:C.secondaryAction.label})}):null]})]}),C.highlights.length>0?p(`section`,{"data-docs-region":`home-highlights`,className:`mx-auto grid w-full max-w-6xl gap-4 pb-16 md:grid-cols-3`,children:C.highlights.map(e=>p(E,{href:e.href,className:`block transition-colors`,children:p(l,{className:`h-full border-border/60 transition-colors hover:bg-accent hover:text-accent-foreground`,children:m(u,{className:`flex flex-col gap-2 p-4`,children:[p(`h2`,{className:`text-lg font-medium text-foreground`,children:e.title}),p(`p`,{className:`text-pretty text-sm text-muted-foreground`,children:e.description})]})})},e.href))}):null]})]})};export{v as DefaultHomeShell};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* name: @blackwork/docs
|
|
3
|
+
* version: v0.1.0
|
|
4
|
+
* description: Next-first documentation framework for Blackwork projects.
|
|
5
|
+
* author: chengpeiquan <chengpeiquan@chengpeiquan.com>
|
|
6
|
+
* homepage: https://chengpeiquan.com
|
|
7
|
+
* license: MIT
|
|
8
|
+
*/
|
|
9
|
+
const e=require(`../../_virtual/_rolldown/runtime.cjs`);let t=require(`react`);t=e.__toESM(t);let n=require(`react/jsx-runtime`),r=require(`next/link.js`);r=e.__toESM(r);const i=({children:e,href:t,...i})=>(0,n.jsx)(r.default,{href:t,scroll:!1,...i,children:e});exports.DefaultDocsLink=i;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
|
|
2
|
+
import { DocsThemeLinkProps } from "../types.mjs";
|
|
3
|
+
import React from "react";
|
|
4
|
+
|
|
5
|
+
//#region src/theme/components/link.d.ts
|
|
6
|
+
interface DefaultDocsLinkProps extends DocsThemeLinkProps {}
|
|
7
|
+
declare const DefaultDocsLink: React.FC<DefaultDocsLinkProps>;
|
|
8
|
+
//#endregion
|
|
9
|
+
export { DefaultDocsLink, DefaultDocsLinkProps };
|