@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
|
+
import { DocsThemeLinkProps } from "../types.js";
|
|
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 };
|
|
@@ -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"react";import{jsx as e}from"react/jsx-runtime";import t from"next/link.js";const n=({children:n,href:r,...i})=>e(t,{href:r,scroll:!1,...i,children:n});export{n as DefaultDocsLink};
|
|
@@ -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={layout:`docs`,sidebar:`auto`},t=e=>e.site.title||`Documentation`,n=(e,t)=>e.site.description||t.description||`Browse the available documentation.`,r=(e,t,n)=>t===e.href?!0:n.length===0?!1:n.every((t,n)=>e.slugSegments[n]===t),i=(e,t)=>t.filter(e=>e.depth===0).map(t=>({href:t.href,label:t.title,current:r(e,t.href,t.slugSegments)})),a=e=>e.flatMap(e=>{let t=e.children?a(e.children):[];return(e.depth??0)<=1?t:[{depth:e.depth??2,id:e.id,title:e.value??e.id},...t]}),o=e=>e.slugSegments[0],s=(e,t)=>{let n=o(t);return n?e.filter(e=>e.slugSegments[0]===n):e},c=(t,n)=>{let r=o(n);if(!r)return e;let i=t.content?.sections?.[r],a=i?.layout??e.layout;return{layout:a,sidebar:i?.sidebar??(a===`content`?!1:e.sidebar)}};exports.getEntrySectionConfig=c,exports.getEntrySectionKey=o,exports.getFooterDescription=n,exports.getSectionEntries=s,exports.getSiteTitle=t,exports.getTocHeadings=a,exports.toNavigation=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
|
+
const e={layout:`docs`,sidebar:`auto`},t=e=>e.site.title||`Documentation`,n=(e,t)=>e.site.description||t.description||`Browse the available documentation.`,r=(e,t,n)=>t===e.href?!0:n.length===0?!1:n.every((t,n)=>e.slugSegments[n]===t),i=(e,t)=>t.filter(e=>e.depth===0).map(t=>({href:t.href,label:t.title,current:r(e,t.href,t.slugSegments)})),a=e=>e.flatMap(e=>{let t=e.children?a(e.children):[];return(e.depth??0)<=1?t:[{depth:e.depth??2,id:e.id,title:e.value??e.id},...t]}),o=e=>e.slugSegments[0],s=(e,t)=>{let n=o(t);return n?e.filter(e=>e.slugSegments[0]===n):e},c=(t,n)=>{let r=o(n);if(!r)return e;let i=t.content?.sections?.[r],a=i?.layout??e.layout;return{layout:a,sidebar:i?.sidebar??(a===`content`?!1:e.sidebar)}};export{c as getEntrySectionConfig,o as getEntrySectionKey,n as getFooterDescription,s as getSectionEntries,t as getSiteTitle,a as getTocHeadings,i as toNavigation};
|
|
@@ -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(`../config/define-config.cjs`),t=e=>typeof e==`object`&&!!e,n=e=>typeof e==`string`&&e.trim()||void 0,r=e=>{if(e!==!1)return n(e)},i=e=>{let t=e.search(/[?#]/u);return t<0?{pathname:e,suffix:``}:{pathname:e.slice(0,t),suffix:e.slice(t)}},a=(e,t)=>{let[,n]=e.match(/^\/([^/]+)(?:\/|$)/u)??[];return t.getLocaleCodes().find(e=>e===n)},o=(e,t,n)=>{if(!e.startsWith(`/`)||e.startsWith(`//`))return e;let{pathname:r,suffix:o}=i(e);if(a(r,n))return e;let s=n.getDefaultLocale(),c=s?n.getEntries(s).find(e=>e.href===r):n.getLocaleCodes().flatMap(e=>n.getEntries(e)).find(e=>e.href===r);if(!c)return e;let l=n.getEntry(t,c.slugSegments);return l?`${l.href}${o}`:e},s=(e,r,i)=>{if(!t(e))return;let a=n(e.href),s=n(e.label);if(!(!a||!s))return{href:o(a,r,i),label:s}},c=(e,r,i)=>{if(e===!1)return[];if(Array.isArray(e))return e.flatMap(e=>{if(!t(e))return[];let a=n(e.href),s=n(e.title),c=n(e.description);return a&&s&&c?[{href:o(a,r,i),title:s,description:c}]:[]})},l=e=>e.site.title||`Documentation`,u=(e,t,n)=>{let r=n.getEntries(t),i=n.getCanonicalHref(t,[]),a=n.getEntry(t,[])??r[0],o=r.find(e=>e.href!==a?.href),s=e.site.description||a?.description||`Browse the available documentation.`;return{mode:`auto`,badge:`${r.length} page${r.length===1?``:`s`}`,eyebrow:a?.title||`Documentation`,title:l(e),description:s,homeHref:i,primaryAction:{href:a?.href??i,label:a?`Read ${a.title}`:`Browse docs`},...o?{secondaryAction:{href:o.href,label:o.title}}:{},highlights:[]}},d=e=>[e.badge,e.eyebrow,e.title,e.description,e.primaryAction,e.secondaryAction,e.highlights].some(e=>e!==void 0);function f({config:t,locale:i,source:a}){let o=e.defineConfig(t),l=u(o,i,a);return d(o.home)?{...l,mode:`configured`,badge:r(o.home.badge),eyebrow:r(o.home.eyebrow),title:n(o.home.title)||l.title,description:n(o.home.description)||l.description,primaryAction:s(o.home.primaryAction,i,a)||l.primaryAction,secondaryAction:s(o.home.secondaryAction,i,a)||l.secondaryAction,highlights:c(o.home.highlights,i,a)??[]}:l}exports.createHomeData=f;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
|
|
2
|
+
import { DocsThemeHomeData } from "./types.mjs";
|
|
3
|
+
import { DocsConfig, NormalizedDocsConfig } from "../config/types.mjs";
|
|
4
|
+
import { DocsSource } from "../source/types.mjs";
|
|
5
|
+
|
|
6
|
+
//#region src/theme/create-home-data.d.ts
|
|
7
|
+
interface CreateHomeDataOptions {
|
|
8
|
+
config?: DocsConfig | NormalizedDocsConfig;
|
|
9
|
+
locale: string;
|
|
10
|
+
source: DocsSource;
|
|
11
|
+
}
|
|
12
|
+
declare function createHomeData({
|
|
13
|
+
config,
|
|
14
|
+
locale,
|
|
15
|
+
source
|
|
16
|
+
}: CreateHomeDataOptions): DocsThemeHomeData;
|
|
17
|
+
//#endregion
|
|
18
|
+
export { CreateHomeDataOptions, createHomeData };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
|
|
2
|
+
import { DocsThemeHomeData } from "./types.js";
|
|
3
|
+
import { DocsConfig, NormalizedDocsConfig } from "../config/types.js";
|
|
4
|
+
import { DocsSource } from "../source/types.js";
|
|
5
|
+
|
|
6
|
+
//#region src/theme/create-home-data.d.ts
|
|
7
|
+
interface CreateHomeDataOptions {
|
|
8
|
+
config?: DocsConfig | NormalizedDocsConfig;
|
|
9
|
+
locale: string;
|
|
10
|
+
source: DocsSource;
|
|
11
|
+
}
|
|
12
|
+
declare function createHomeData({
|
|
13
|
+
config,
|
|
14
|
+
locale,
|
|
15
|
+
source
|
|
16
|
+
}: CreateHomeDataOptions): DocsThemeHomeData;
|
|
17
|
+
//#endregion
|
|
18
|
+
export { CreateHomeDataOptions, createHomeData };
|
|
@@ -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";const t=e=>typeof e==`object`&&!!e,n=e=>typeof e==`string`&&e.trim()||void 0,r=e=>{if(e!==!1)return n(e)},i=e=>{let t=e.search(/[?#]/u);return t<0?{pathname:e,suffix:``}:{pathname:e.slice(0,t),suffix:e.slice(t)}},a=(e,t)=>{let[,n]=e.match(/^\/([^/]+)(?:\/|$)/u)??[];return t.getLocaleCodes().find(e=>e===n)},o=(e,t,n)=>{if(!e.startsWith(`/`)||e.startsWith(`//`))return e;let{pathname:r,suffix:o}=i(e);if(a(r,n))return e;let s=n.getDefaultLocale(),c=s?n.getEntries(s).find(e=>e.href===r):n.getLocaleCodes().flatMap(e=>n.getEntries(e)).find(e=>e.href===r);if(!c)return e;let l=n.getEntry(t,c.slugSegments);return l?`${l.href}${o}`:e},s=(e,r,i)=>{if(!t(e))return;let a=n(e.href),s=n(e.label);if(!(!a||!s))return{href:o(a,r,i),label:s}},c=(e,r,i)=>{if(e===!1)return[];if(Array.isArray(e))return e.flatMap(e=>{if(!t(e))return[];let a=n(e.href),s=n(e.title),c=n(e.description);return a&&s&&c?[{href:o(a,r,i),title:s,description:c}]:[]})},l=e=>e.site.title||`Documentation`,u=(e,t,n)=>{let r=n.getEntries(t),i=n.getCanonicalHref(t,[]),a=n.getEntry(t,[])??r[0],o=r.find(e=>e.href!==a?.href),s=e.site.description||a?.description||`Browse the available documentation.`;return{mode:`auto`,badge:`${r.length} page${r.length===1?``:`s`}`,eyebrow:a?.title||`Documentation`,title:l(e),description:s,homeHref:i,primaryAction:{href:a?.href??i,label:a?`Read ${a.title}`:`Browse docs`},...o?{secondaryAction:{href:o.href,label:o.title}}:{},highlights:[]}},d=e=>[e.badge,e.eyebrow,e.title,e.description,e.primaryAction,e.secondaryAction,e.highlights].some(e=>e!==void 0);function f({config:t,locale:i,source:a}){let o=e(t),l=u(o,i,a);return d(o.home)?{...l,mode:`configured`,badge:r(o.home.badge),eyebrow:r(o.home.eyebrow),title:n(o.home.title)||l.title,description:n(o.home.description)||l.description,primaryAction:s(o.home.primaryAction,i,a)||l.primaryAction,secondaryAction:s(o.home.secondaryAction,i,a)||l.secondaryAction,highlights:c(o.home.highlights,i,a)??[]}:l}export{f as createHomeData};
|
|
@@ -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=>typeof e==`object`&&!!e,t=e=>typeof e==`function`,n=e=>typeof e==`function`;function r(r){return e(r)?{...t(r.footer)?{footer:r.footer}:{},...n(r.link)?{link:r.link}:{}}:{}}exports.resolveThemeSlots=r;
|
|
@@ -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=>typeof e==`object`&&!!e,t=e=>typeof e==`function`,n=e=>typeof e==`function`;function r(r){return e(r)?{...t(r.footer)?{footer:r.footer}:{},...n(r.link)?{link:r.link}:{}}:{}}export{r as resolveThemeSlots};
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
|
|
2
|
+
import { AnchorHTMLAttributes, ComponentType, ReactNode } from "react";
|
|
3
|
+
|
|
4
|
+
//#region src/theme/types.d.ts
|
|
5
|
+
interface DocsThemeNavItem {
|
|
6
|
+
href: string;
|
|
7
|
+
label: string;
|
|
8
|
+
current: boolean;
|
|
9
|
+
}
|
|
10
|
+
interface DocsThemeLocaleLink {
|
|
11
|
+
locale: string;
|
|
12
|
+
href: string;
|
|
13
|
+
label?: string;
|
|
14
|
+
lang?: string;
|
|
15
|
+
current: boolean;
|
|
16
|
+
}
|
|
17
|
+
interface DocsThemeLinkProps extends AnchorHTMLAttributes<HTMLAnchorElement> {
|
|
18
|
+
href: string;
|
|
19
|
+
children?: ReactNode;
|
|
20
|
+
}
|
|
21
|
+
type DocsThemeLinkComponent = ComponentType<DocsThemeLinkProps>;
|
|
22
|
+
interface DocsThemeFooterSlotProps {
|
|
23
|
+
description: string;
|
|
24
|
+
homeHref: string;
|
|
25
|
+
navigation: DocsThemeNavItem[];
|
|
26
|
+
siteTitle: string;
|
|
27
|
+
LinkComponent?: DocsThemeLinkComponent;
|
|
28
|
+
}
|
|
29
|
+
interface DocsThemeSlots {
|
|
30
|
+
footer?: ComponentType<DocsThemeFooterSlotProps>;
|
|
31
|
+
link?: DocsThemeLinkComponent;
|
|
32
|
+
}
|
|
33
|
+
interface DocsThemeHomeAction {
|
|
34
|
+
href: string;
|
|
35
|
+
label: string;
|
|
36
|
+
}
|
|
37
|
+
interface DocsThemeHomeHighlight {
|
|
38
|
+
href: string;
|
|
39
|
+
title: string;
|
|
40
|
+
description: string;
|
|
41
|
+
}
|
|
42
|
+
interface DocsThemeHomeData {
|
|
43
|
+
badge?: string;
|
|
44
|
+
description: string;
|
|
45
|
+
eyebrow?: string;
|
|
46
|
+
highlights: DocsThemeHomeHighlight[];
|
|
47
|
+
homeHref: string;
|
|
48
|
+
mode: 'auto' | 'configured';
|
|
49
|
+
primaryAction: DocsThemeHomeAction;
|
|
50
|
+
secondaryAction?: DocsThemeHomeAction;
|
|
51
|
+
title: string;
|
|
52
|
+
}
|
|
53
|
+
interface DocsHomeConfig {
|
|
54
|
+
badge?: string | false;
|
|
55
|
+
eyebrow?: string | false;
|
|
56
|
+
title?: string;
|
|
57
|
+
description?: string;
|
|
58
|
+
primaryAction?: DocsThemeHomeAction;
|
|
59
|
+
secondaryAction?: DocsThemeHomeAction;
|
|
60
|
+
highlights?: DocsThemeHomeHighlight[] | false;
|
|
61
|
+
}
|
|
62
|
+
type DocsSlotsConfig = DocsThemeSlots;
|
|
63
|
+
//#endregion
|
|
64
|
+
export { DocsHomeConfig, DocsSlotsConfig, DocsThemeFooterSlotProps, DocsThemeHomeAction, DocsThemeHomeData, DocsThemeHomeHighlight, DocsThemeLinkComponent, DocsThemeLinkProps, DocsThemeLocaleLink, DocsThemeNavItem, DocsThemeSlots };
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
|
|
2
|
+
import { AnchorHTMLAttributes, ComponentType, ReactNode } from "react";
|
|
3
|
+
|
|
4
|
+
//#region src/theme/types.d.ts
|
|
5
|
+
interface DocsThemeNavItem {
|
|
6
|
+
href: string;
|
|
7
|
+
label: string;
|
|
8
|
+
current: boolean;
|
|
9
|
+
}
|
|
10
|
+
interface DocsThemeLocaleLink {
|
|
11
|
+
locale: string;
|
|
12
|
+
href: string;
|
|
13
|
+
label?: string;
|
|
14
|
+
lang?: string;
|
|
15
|
+
current: boolean;
|
|
16
|
+
}
|
|
17
|
+
interface DocsThemeLinkProps extends AnchorHTMLAttributes<HTMLAnchorElement> {
|
|
18
|
+
href: string;
|
|
19
|
+
children?: ReactNode;
|
|
20
|
+
}
|
|
21
|
+
type DocsThemeLinkComponent = ComponentType<DocsThemeLinkProps>;
|
|
22
|
+
interface DocsThemeFooterSlotProps {
|
|
23
|
+
description: string;
|
|
24
|
+
homeHref: string;
|
|
25
|
+
navigation: DocsThemeNavItem[];
|
|
26
|
+
siteTitle: string;
|
|
27
|
+
LinkComponent?: DocsThemeLinkComponent;
|
|
28
|
+
}
|
|
29
|
+
interface DocsThemeSlots {
|
|
30
|
+
footer?: ComponentType<DocsThemeFooterSlotProps>;
|
|
31
|
+
link?: DocsThemeLinkComponent;
|
|
32
|
+
}
|
|
33
|
+
interface DocsThemeHomeAction {
|
|
34
|
+
href: string;
|
|
35
|
+
label: string;
|
|
36
|
+
}
|
|
37
|
+
interface DocsThemeHomeHighlight {
|
|
38
|
+
href: string;
|
|
39
|
+
title: string;
|
|
40
|
+
description: string;
|
|
41
|
+
}
|
|
42
|
+
interface DocsThemeHomeData {
|
|
43
|
+
badge?: string;
|
|
44
|
+
description: string;
|
|
45
|
+
eyebrow?: string;
|
|
46
|
+
highlights: DocsThemeHomeHighlight[];
|
|
47
|
+
homeHref: string;
|
|
48
|
+
mode: 'auto' | 'configured';
|
|
49
|
+
primaryAction: DocsThemeHomeAction;
|
|
50
|
+
secondaryAction?: DocsThemeHomeAction;
|
|
51
|
+
title: string;
|
|
52
|
+
}
|
|
53
|
+
interface DocsHomeConfig {
|
|
54
|
+
badge?: string | false;
|
|
55
|
+
eyebrow?: string | false;
|
|
56
|
+
title?: string;
|
|
57
|
+
description?: string;
|
|
58
|
+
primaryAction?: DocsThemeHomeAction;
|
|
59
|
+
secondaryAction?: DocsThemeHomeAction;
|
|
60
|
+
highlights?: DocsThemeHomeHighlight[] | false;
|
|
61
|
+
}
|
|
62
|
+
type DocsSlotsConfig = DocsThemeSlots;
|
|
63
|
+
//#endregion
|
|
64
|
+
export { DocsHomeConfig, DocsSlotsConfig, DocsThemeFooterSlotProps, DocsThemeHomeAction, DocsThemeHomeData, DocsThemeHomeHighlight, DocsThemeLinkComponent, DocsThemeLinkProps, DocsThemeLocaleLink, DocsThemeNavItem, DocsThemeSlots };
|
package/dist/theme.cjs
ADDED
|
@@ -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
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`./theme/components/link.cjs`),t=require(`./theme/components/footer.cjs`),n=require(`./theme/components/header.cjs`),r=require(`./theme/slots.cjs`),i=require(`./theme/components/content-shell.cjs`),a=require(`./theme/components/docs-shell.cjs`),o=require(`./theme/create-home-data.cjs`),s=require(`./theme/components/home-shell.cjs`);exports.DefaultContentShell=i.DefaultContentShell,exports.DefaultDocsFooter=t.DefaultDocsFooter,exports.DefaultDocsHeader=n.DefaultDocsHeader,exports.DefaultDocsLink=e.DefaultDocsLink,exports.DefaultDocsShell=a.DefaultDocsShell,exports.DefaultHomeShell=s.DefaultHomeShell,exports.createHomeData=o.createHomeData,exports.resolveThemeSlots=r.resolveThemeSlots;
|
package/dist/theme.d.mts
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
|
|
2
|
+
import { DocsHomeConfig, DocsSlotsConfig, DocsThemeFooterSlotProps, DocsThemeHomeAction, DocsThemeHomeData, DocsThemeHomeHighlight, DocsThemeLinkComponent, DocsThemeLinkProps, DocsThemeLocaleLink, DocsThemeNavItem, DocsThemeSlots } from "./theme/types.mjs";
|
|
3
|
+
import { DefaultDocsFooter, DefaultDocsFooterProps } from "./theme/components/footer.mjs";
|
|
4
|
+
import { DefaultDocsHeader, DefaultDocsHeaderProps } from "./theme/components/header.mjs";
|
|
5
|
+
import { DefaultDocsLink, DefaultDocsLinkProps } from "./theme/components/link.mjs";
|
|
6
|
+
import { DefaultContentShell, DefaultContentShellProps } from "./theme/components/content-shell.mjs";
|
|
7
|
+
import { DefaultDocsShell, DefaultDocsShellProps } from "./theme/components/docs-shell.mjs";
|
|
8
|
+
import { DefaultHomeShell, DefaultHomeShellProps } from "./theme/components/home-shell.mjs";
|
|
9
|
+
import { CreateHomeDataOptions, createHomeData } from "./theme/create-home-data.mjs";
|
|
10
|
+
import { resolveThemeSlots } from "./theme/slots.mjs";
|
|
11
|
+
export { type CreateHomeDataOptions, DefaultContentShell, type DefaultContentShellProps, DefaultDocsFooter, type DefaultDocsFooterProps, DefaultDocsHeader, type DefaultDocsHeaderProps, DefaultDocsLink, type DefaultDocsLinkProps, DefaultDocsShell, type DefaultDocsShellProps, DefaultHomeShell, type DefaultHomeShellProps, type DocsHomeConfig, type DocsSlotsConfig, type DocsThemeFooterSlotProps, type DocsThemeHomeAction, type DocsThemeHomeData, type DocsThemeHomeHighlight, type DocsThemeLinkComponent, type DocsThemeLinkProps, type DocsThemeLocaleLink, type DocsThemeNavItem, type DocsThemeSlots, createHomeData, resolveThemeSlots };
|
package/dist/theme.d.ts
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
|
|
2
|
+
import { DocsHomeConfig, DocsSlotsConfig, DocsThemeFooterSlotProps, DocsThemeHomeAction, DocsThemeHomeData, DocsThemeHomeHighlight, DocsThemeLinkComponent, DocsThemeLinkProps, DocsThemeLocaleLink, DocsThemeNavItem, DocsThemeSlots } from "./theme/types.js";
|
|
3
|
+
import { DefaultDocsFooter, DefaultDocsFooterProps } from "./theme/components/footer.js";
|
|
4
|
+
import { DefaultDocsHeader, DefaultDocsHeaderProps } from "./theme/components/header.js";
|
|
5
|
+
import { DefaultDocsLink, DefaultDocsLinkProps } from "./theme/components/link.js";
|
|
6
|
+
import { DefaultContentShell, DefaultContentShellProps } from "./theme/components/content-shell.js";
|
|
7
|
+
import { DefaultDocsShell, DefaultDocsShellProps } from "./theme/components/docs-shell.js";
|
|
8
|
+
import { DefaultHomeShell, DefaultHomeShellProps } from "./theme/components/home-shell.js";
|
|
9
|
+
import { CreateHomeDataOptions, createHomeData } from "./theme/create-home-data.js";
|
|
10
|
+
import { resolveThemeSlots } from "./theme/slots.js";
|
|
11
|
+
export { type CreateHomeDataOptions, DefaultContentShell, type DefaultContentShellProps, DefaultDocsFooter, type DefaultDocsFooterProps, DefaultDocsHeader, type DefaultDocsHeaderProps, DefaultDocsLink, type DefaultDocsLinkProps, DefaultDocsShell, type DefaultDocsShellProps, DefaultHomeShell, type DefaultHomeShellProps, type DocsHomeConfig, type DocsSlotsConfig, type DocsThemeFooterSlotProps, type DocsThemeHomeAction, type DocsThemeHomeData, type DocsThemeHomeHighlight, type DocsThemeLinkComponent, type DocsThemeLinkProps, type DocsThemeLocaleLink, type DocsThemeNavItem, type DocsThemeSlots, createHomeData, resolveThemeSlots };
|
package/dist/theme.mjs
ADDED
|
@@ -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"./theme/components/link.mjs";import{DefaultDocsFooter as t}from"./theme/components/footer.mjs";import{DefaultDocsHeader as n}from"./theme/components/header.mjs";import{resolveThemeSlots as r}from"./theme/slots.mjs";import{DefaultContentShell as i}from"./theme/components/content-shell.mjs";import{DefaultDocsShell as a}from"./theme/components/docs-shell.mjs";import{createHomeData as o}from"./theme/create-home-data.mjs";import{DefaultHomeShell as s}from"./theme/components/home-shell.mjs";export{i as DefaultContentShell,t as DefaultDocsFooter,n as DefaultDocsHeader,e as DefaultDocsLink,a as DefaultDocsShell,s as DefaultHomeShell,o as createHomeData,r as resolveThemeSlots};
|
package/package.json
ADDED
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@blackwork/docs",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Next-first documentation framework for Blackwork projects.",
|
|
5
|
+
"author": "chengpeiquan <chengpeiquan@chengpeiquan.com>",
|
|
6
|
+
"homepage": "https://chengpeiquan.com",
|
|
7
|
+
"type": "module",
|
|
8
|
+
"license": "MIT",
|
|
9
|
+
"files": [
|
|
10
|
+
"dist"
|
|
11
|
+
],
|
|
12
|
+
"main": "./dist/index.cjs",
|
|
13
|
+
"module": "./dist/index.mjs",
|
|
14
|
+
"types": "./dist/index.d.ts",
|
|
15
|
+
"exports": {
|
|
16
|
+
".": {
|
|
17
|
+
"types": "./dist/index.d.ts",
|
|
18
|
+
"import": "./dist/index.mjs",
|
|
19
|
+
"require": "./dist/index.cjs"
|
|
20
|
+
},
|
|
21
|
+
"./next": {
|
|
22
|
+
"types": "./dist/next.d.ts",
|
|
23
|
+
"import": "./dist/next.mjs",
|
|
24
|
+
"require": "./dist/next.cjs"
|
|
25
|
+
},
|
|
26
|
+
"./theme": {
|
|
27
|
+
"types": "./dist/theme.d.ts",
|
|
28
|
+
"import": "./dist/theme.mjs",
|
|
29
|
+
"require": "./dist/theme.cjs"
|
|
30
|
+
},
|
|
31
|
+
"./runtime": {
|
|
32
|
+
"types": "./dist/runtime.d.ts",
|
|
33
|
+
"import": "./dist/runtime.mjs",
|
|
34
|
+
"require": "./dist/runtime.cjs"
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
"publishConfig": {
|
|
38
|
+
"registry": "https://registry.npmjs.org/"
|
|
39
|
+
},
|
|
40
|
+
"keywords": [
|
|
41
|
+
"docs",
|
|
42
|
+
"nextjs",
|
|
43
|
+
"react",
|
|
44
|
+
"blackwork"
|
|
45
|
+
],
|
|
46
|
+
"repository": {
|
|
47
|
+
"type": "git",
|
|
48
|
+
"url": "git+https://github.com/chengpeiquan/blackwork.git"
|
|
49
|
+
},
|
|
50
|
+
"dependencies": {
|
|
51
|
+
"chokidar": "^4.0.3",
|
|
52
|
+
"jiti": "^1.21.7",
|
|
53
|
+
"@blackwork/machine": "0.1.0"
|
|
54
|
+
},
|
|
55
|
+
"peerDependencies": {
|
|
56
|
+
"blackwork": ">=0.10.0",
|
|
57
|
+
"next": ">=16.0.0",
|
|
58
|
+
"react": ">=19.0.0",
|
|
59
|
+
"react-dom": ">=19.0.0"
|
|
60
|
+
},
|
|
61
|
+
"devDependencies": {
|
|
62
|
+
"@bassist/build-config": "^0.2.0",
|
|
63
|
+
"@bassist/eslint-config": "^0.4.1",
|
|
64
|
+
"@bassist/oxc-integration": "^0.1.4",
|
|
65
|
+
"@bassist/tsconfig": "^0.1.1",
|
|
66
|
+
"@types/node": "^25.5.2",
|
|
67
|
+
"eslint": "^9.39.4",
|
|
68
|
+
"tsdown": "^0.21.7",
|
|
69
|
+
"typescript": "^6.0.2",
|
|
70
|
+
"vitest": "^4.0.7",
|
|
71
|
+
"blackwork": "0.10.0"
|
|
72
|
+
},
|
|
73
|
+
"scripts": {
|
|
74
|
+
"build": "tsdown",
|
|
75
|
+
"lint": "pnpm -C ../.. exec eslint --config eslint.config.js packages/docs/src packages/docs/test",
|
|
76
|
+
"test": "vitest run",
|
|
77
|
+
"test:types": "tsc -p test/tsconfig.theme-types.json --noEmit",
|
|
78
|
+
"test:watch": "vitest",
|
|
79
|
+
"format": "oxfmt ."
|
|
80
|
+
}
|
|
81
|
+
}
|