@blackwork/docs 0.1.0 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (108) hide show
  1. package/dist/_virtual/_rolldown/runtime.cjs +1 -1
  2. package/dist/config/defaults.cjs +1 -1
  3. package/dist/config/defaults.mjs +1 -1
  4. package/dist/config/define-config.cjs +1 -1
  5. package/dist/config/define-config.mjs +1 -1
  6. package/dist/config/define-docs-config.cjs +1 -1
  7. package/dist/config/define-docs-config.mjs +1 -1
  8. package/dist/config/load-content-config.cjs +1 -1
  9. package/dist/config/load-content-config.mjs +1 -1
  10. package/dist/export/process-exported-docs.cjs +9 -0
  11. package/dist/export/process-exported-docs.d.mts +16 -0
  12. package/dist/export/process-exported-docs.d.ts +16 -0
  13. package/dist/export/process-exported-docs.mjs +9 -0
  14. package/dist/index.cjs +2 -2
  15. package/dist/index.d.mts +2 -1
  16. package/dist/index.d.ts +2 -1
  17. package/dist/index.mjs +2 -2
  18. package/dist/mdx/default-docs-components.cjs +1 -1
  19. package/dist/mdx/default-docs-components.mjs +1 -1
  20. package/dist/mdx/merge-docs-components.cjs +1 -1
  21. package/dist/mdx/merge-docs-components.mjs +1 -1
  22. package/dist/metadata/create-doc-metadata.cjs +1 -1
  23. package/dist/metadata/create-doc-metadata.mjs +1 -1
  24. package/dist/navigation/build-locale-links.cjs +1 -1
  25. package/dist/navigation/build-locale-links.mjs +1 -1
  26. package/dist/navigation/build-pager.cjs +1 -1
  27. package/dist/navigation/build-pager.mjs +1 -1
  28. package/dist/navigation/build-sidebar.cjs +1 -1
  29. package/dist/navigation/build-sidebar.mjs +1 -1
  30. package/dist/navigation/resolve-sidebar.cjs +1 -1
  31. package/dist/navigation/resolve-sidebar.mjs +1 -1
  32. package/dist/next/context.cjs +1 -1
  33. package/dist/next/context.mjs +1 -1
  34. package/dist/next/document-lang-sync.cjs +9 -0
  35. package/dist/next/document-lang-sync.mjs +9 -0
  36. package/dist/next/load-doc-content.cjs +1 -1
  37. package/dist/next/load-doc-content.mjs +1 -1
  38. package/dist/next/load-generated-manifest.cjs +1 -1
  39. package/dist/next/load-generated-manifest.mjs +1 -1
  40. package/dist/next/metadata.cjs +1 -1
  41. package/dist/next/metadata.mjs +1 -1
  42. package/dist/next/page.cjs +1 -1
  43. package/dist/next/page.mjs +1 -1
  44. package/dist/next/render-route.cjs +1 -1
  45. package/dist/next/render-route.mjs +1 -1
  46. package/dist/next/resolve-document-lang.cjs +1 -1
  47. package/dist/next/resolve-document-lang.mjs +1 -1
  48. package/dist/next/root-layout.cjs +2 -2
  49. package/dist/next/root-layout.mjs +2 -2
  50. package/dist/next-plugin/generate.cjs +1 -1
  51. package/dist/next-plugin/generate.mjs +1 -1
  52. package/dist/next.cjs +1 -1
  53. package/dist/next.mjs +1 -1
  54. package/dist/routing/build-static-params.cjs +1 -1
  55. package/dist/routing/build-static-params.mjs +1 -1
  56. package/dist/routing/resolve-docs-route.cjs +1 -1
  57. package/dist/routing/resolve-docs-route.mjs +1 -1
  58. package/dist/runtime.cjs +1 -1
  59. package/dist/runtime.mjs +1 -1
  60. package/dist/source/build-docs-source.cjs +1 -1
  61. package/dist/source/build-docs-source.mjs +1 -1
  62. package/dist/source/collect-docs-manifest.cjs +1 -1
  63. package/dist/source/collect-docs-manifest.mjs +1 -1
  64. package/dist/source/create-docs-source-from-manifest.cjs +1 -1
  65. package/dist/source/create-docs-source-from-manifest.mjs +1 -1
  66. package/dist/source/create-docs-source.cjs +1 -1
  67. package/dist/source/create-docs-source.mjs +1 -1
  68. package/dist/theme/components/content-shell.cjs +2 -2
  69. package/dist/theme/components/content-shell.mjs +2 -2
  70. package/dist/theme/components/docs-rail-scroll-state.cjs +1 -1
  71. package/dist/theme/components/docs-rail-scroll-state.mjs +1 -1
  72. package/dist/theme/components/docs-rail-scroll.cjs +1 -1
  73. package/dist/theme/components/docs-rail-scroll.mjs +1 -1
  74. package/dist/theme/components/docs-scroll-reset.cjs +1 -1
  75. package/dist/theme/components/docs-scroll-reset.mjs +1 -1
  76. package/dist/theme/components/docs-scroll-to-top.cjs +9 -0
  77. package/dist/theme/components/docs-scroll-to-top.mjs +9 -0
  78. package/dist/theme/components/docs-shell.cjs +2 -2
  79. package/dist/theme/components/docs-shell.mjs +2 -2
  80. package/dist/theme/components/docs-toc-geometry.cjs +1 -1
  81. package/dist/theme/components/docs-toc-geometry.mjs +1 -1
  82. package/dist/theme/components/docs-toc.cjs +2 -2
  83. package/dist/theme/components/docs-toc.mjs +2 -2
  84. package/dist/theme/components/floating-actions.cjs +9 -0
  85. package/dist/theme/components/floating-actions.mjs +9 -0
  86. package/dist/theme/components/footer.cjs +1 -1
  87. package/dist/theme/components/footer.mjs +1 -1
  88. package/dist/theme/components/header.cjs +2 -2
  89. package/dist/theme/components/header.d.mts +1 -0
  90. package/dist/theme/components/header.d.ts +1 -0
  91. package/dist/theme/components/header.mjs +2 -2
  92. package/dist/theme/components/home-shell.cjs +2 -2
  93. package/dist/theme/components/home-shell.mjs +2 -2
  94. package/dist/theme/components/link.cjs +1 -1
  95. package/dist/theme/components/link.mjs +1 -1
  96. package/dist/theme/components/shell-shared.cjs +2 -2
  97. package/dist/theme/components/shell-shared.mjs +2 -2
  98. package/dist/theme/create-home-data.cjs +1 -1
  99. package/dist/theme/create-home-data.mjs +1 -1
  100. package/dist/theme/slots.cjs +2 -2
  101. package/dist/theme/slots.mjs +2 -2
  102. package/dist/theme/types.d.mts +9 -1
  103. package/dist/theme/types.d.ts +9 -1
  104. package/dist/theme.cjs +1 -1
  105. package/dist/theme.d.mts +2 -2
  106. package/dist/theme.d.ts +2 -2
  107. package/dist/theme.mjs +1 -1
  108. package/package.json +4 -4
@@ -1,9 +1,9 @@
1
1
  /**
2
2
  * name: @blackwork/docs
3
- * version: v0.1.0
3
+ * version: v0.2.0
4
4
  * description: Next-first documentation framework for Blackwork projects.
5
5
  * author: chengpeiquan <chengpeiquan@chengpeiquan.com>
6
6
  * homepage: https://chengpeiquan.com
7
7
  * license: MIT
8
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;
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(`./docs-scroll-to-top.cjs`),c=require(`./shell-shared.cjs`),l=require(`../create-home-data.cjs`);let u=require(`blackwork`),d=require(`react`);d=e.__toESM(d);let f=require(`react/jsx-runtime`);const p=e=>e.site.title||`Documentation`,m=(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}})},h=(e,t)=>t.filter(e=>e.depth===0).map(t=>({href:t.href,label:t.title,current:e?.href===t.href})),g=({config:e,locale:n,source:d})=>{let g=t.defineConfig(e),_=d.getEntries(n),v=d.getEntry(n,[]),y=l.createHomeData({config:g,locale:n,source:d}),b=h(v,r.buildSidebar({entries:_,currentHref:y.homeHref})),x=m(g,n,d),S=o.resolveThemeSlots(g.slots),C=S.headerActions,w=S.link??i.DefaultDocsLink,T=c.getPagefindFilterEntries(c.getPagefindFilters({locale:n}));return(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(a.DefaultDocsHeader,{headerActions:C?(0,f.jsx)(C,{homeHref:y.homeHref,localeLinks:x,navigation:b,siteDescription:g.site.description,siteTitle:p(g)}):void 0,homeHref:y.homeHref,LinkComponent:w,localeLinks:x,navigation:b,siteDescription:g.site.description,siteTitle:p(g)}),(0,f.jsx)(s.DocsScrollToTop,{}),(0,f.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,f.jsxs)(`section`,{"data-docs-region":`home-hero`,"data-home-mode":y.mode,"data-pagefind-body":``,className:`mx-auto flex w-full max-w-6xl flex-1 flex-col items-center justify-center gap-8 text-center`,children:[(0,f.jsx)(`div`,{hidden:!0,children:T.map(e=>(0,f.jsx)(`span`,{"data-pagefind-filter":e},e))}),y.badge||y.eyebrow?(0,f.jsxs)(u.Badge,{variant:`secondary`,className:`max-w-full gap-2 px-4 py-2 text-sm font-medium`,children:[y.badge?(0,f.jsx)(`span`,{className:`truncate`,children:y.badge}):null,y.badge&&y.eyebrow?(0,f.jsx)(u.Separator,{orientation:`vertical`,"aria-hidden":`true`,className:`h-4 bg-border`}):null,y.eyebrow?(0,f.jsx)(`span`,{className:`truncate text-muted-foreground`,children:y.eyebrow}):null]}):null,(0,f.jsxs)(`div`,{className:`flex flex-col items-center gap-6`,children:[(0,f.jsx)(`h1`,{className:`max-w-5xl text-balance text-5xl font-semibold leading-none text-foreground sm:text-6xl lg:text-7xl`,children:y.title}),(0,f.jsx)(`p`,{className:`max-w-3xl text-pretty text-lg leading-8 text-muted-foreground sm:text-xl`,children:y.description})]}),(0,f.jsxs)(`div`,{className:`flex flex-col items-center gap-3 text-base font-medium sm:flex-row`,children:[(0,f.jsx)(u.Button,{asChild:!0,size:`lg`,className:`rounded-full px-6 shadow-sm`,children:(0,f.jsx)(w,{href:y.primaryAction.href,children:y.primaryAction.label})}),y.secondaryAction?(0,f.jsx)(u.Button,{asChild:!0,variant:`ghost`,size:`lg`,className:`rounded-full px-6`,children:(0,f.jsx)(w,{href:y.secondaryAction.href,children:y.secondaryAction.label})}):null]})]}),y.highlights.length>0?(0,f.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:y.highlights.map(e=>(0,f.jsx)(w,{href:e.href,className:`block transition-colors`,children:(0,f.jsx)(u.Card,{className:`h-full border-border/60 transition-colors hover:bg-accent hover:text-accent-foreground`,children:(0,f.jsxs)(u.CardContent,{className:`flex flex-col gap-2 p-4`,children:[(0,f.jsx)(`h2`,{className:`text-lg font-medium text-foreground`,children:e.title}),(0,f.jsx)(`p`,{className:`text-pretty text-sm text-muted-foreground`,children:e.description})]})})},e.href))}):null]})]})};exports.DefaultHomeShell=g;
@@ -1,9 +1,9 @@
1
1
  /**
2
2
  * name: @blackwork/docs
3
- * version: v0.1.0
3
+ * version: v0.2.0
4
4
  * description: Next-first documentation framework for Blackwork projects.
5
5
  * author: chengpeiquan <chengpeiquan@chengpeiquan.com>
6
6
  * homepage: https://chengpeiquan.com
7
7
  * license: MIT
8
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};
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{DocsScrollToTop as o}from"./docs-scroll-to-top.mjs";import{getPagefindFilterEntries as s,getPagefindFilters as c}from"./shell-shared.mjs";import{createHomeData as l}from"../create-home-data.mjs";import{Badge as u,Button as d,Card as f,CardContent as p,Separator as m}from"blackwork";import"react";import{Fragment as h,jsx as g,jsxs as _}from"react/jsx-runtime";const v=e=>e.site.title||`Documentation`,y=(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}})},b=(e,t)=>t.filter(e=>e.depth===0).map(t=>({href:t.href,label:t.title,current:e?.href===t.href})),x=({config:t,locale:x,source:S})=>{let C=e(t),w=S.getEntries(x),T=S.getEntry(x,[]),E=l({config:C,locale:x,source:S}),D=b(T,n({entries:w,currentHref:E.homeHref})),O=y(C,x,S),k=a(C.slots),A=k.headerActions,j=k.link??r,M=s(c({locale:x}));return _(h,{children:[g(i,{headerActions:A?g(A,{homeHref:E.homeHref,localeLinks:O,navigation:D,siteDescription:C.site.description,siteTitle:v(C)}):void 0,homeHref:E.homeHref,LinkComponent:j,localeLinks:O,navigation:D,siteDescription:C.site.description,siteTitle:v(C)}),g(o,{}),_(`main`,{"data-docs-region":`home-shell`,className:`flex min-h-[calc(100dvh-4rem)] w-full flex-col bg-background px-6 py-10`,children:[_(`section`,{"data-docs-region":`home-hero`,"data-home-mode":E.mode,"data-pagefind-body":``,className:`mx-auto flex w-full max-w-6xl flex-1 flex-col items-center justify-center gap-8 text-center`,children:[g(`div`,{hidden:!0,children:M.map(e=>g(`span`,{"data-pagefind-filter":e},e))}),E.badge||E.eyebrow?_(u,{variant:`secondary`,className:`max-w-full gap-2 px-4 py-2 text-sm font-medium`,children:[E.badge?g(`span`,{className:`truncate`,children:E.badge}):null,E.badge&&E.eyebrow?g(m,{orientation:`vertical`,"aria-hidden":`true`,className:`h-4 bg-border`}):null,E.eyebrow?g(`span`,{className:`truncate text-muted-foreground`,children:E.eyebrow}):null]}):null,_(`div`,{className:`flex flex-col items-center gap-6`,children:[g(`h1`,{className:`max-w-5xl text-balance text-5xl font-semibold leading-none text-foreground sm:text-6xl lg:text-7xl`,children:E.title}),g(`p`,{className:`max-w-3xl text-pretty text-lg leading-8 text-muted-foreground sm:text-xl`,children:E.description})]}),_(`div`,{className:`flex flex-col items-center gap-3 text-base font-medium sm:flex-row`,children:[g(d,{asChild:!0,size:`lg`,className:`rounded-full px-6 shadow-sm`,children:g(j,{href:E.primaryAction.href,children:E.primaryAction.label})}),E.secondaryAction?g(d,{asChild:!0,variant:`ghost`,size:`lg`,className:`rounded-full px-6`,children:g(j,{href:E.secondaryAction.href,children:E.secondaryAction.label})}):null]})]}),E.highlights.length>0?g(`section`,{"data-docs-region":`home-highlights`,className:`mx-auto grid w-full max-w-6xl gap-4 pb-16 md:grid-cols-3`,children:E.highlights.map(e=>g(j,{href:e.href,className:`block transition-colors`,children:g(f,{className:`h-full border-border/60 transition-colors hover:bg-accent hover:text-accent-foreground`,children:_(p,{className:`flex flex-col gap-2 p-4`,children:[g(`h2`,{className:`text-lg font-medium text-foreground`,children:e.title}),g(`p`,{className:`text-pretty text-sm text-muted-foreground`,children:e.description})]})})},e.href))}):null]})]})};export{x as DefaultHomeShell};
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * name: @blackwork/docs
3
- * version: v0.1.0
3
+ * version: v0.2.0
4
4
  * description: Next-first documentation framework for Blackwork projects.
5
5
  * author: chengpeiquan <chengpeiquan@chengpeiquan.com>
6
6
  * homepage: https://chengpeiquan.com
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * name: @blackwork/docs
3
- * version: v0.1.0
3
+ * version: v0.2.0
4
4
  * description: Next-first documentation framework for Blackwork projects.
5
5
  * author: chengpeiquan <chengpeiquan@chengpeiquan.com>
6
6
  * homepage: https://chengpeiquan.com
@@ -1,9 +1,9 @@
1
1
  /**
2
2
  * name: @blackwork/docs
3
- * version: v0.1.0
3
+ * version: v0.2.0
4
4
  * description: Next-first documentation framework for Blackwork projects.
5
5
  * author: chengpeiquan <chengpeiquan@chengpeiquan.com>
6
6
  * homepage: https://chengpeiquan.com
7
7
  * license: MIT
8
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;
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)}},l=e=>e?.trim(),u=e=>{let t=e.split(/[-_]/u).map(e=>l(e)).filter(e=>!!e);return{language:t[0]?.toLowerCase(),region:t.slice(1).find(e=>/^(?:[A-Za-z]{2}|\d{3})$/u.test(e))?.toUpperCase()}},d=({kind:e=`docs`,layout:t,locale:n,section:r})=>{let{language:i,region:a}=u(n);return{kind:e,locale:n,...i?{language:i}:{},...a?{region:a}:{},...r?{section:r}:{},...t?{layout:t}:{}}},f=e=>Object.entries(e).map(([e,t])=>`${e}:${t}`);exports.getEntrySectionConfig=c,exports.getEntrySectionKey=o,exports.getFooterDescription=n,exports.getPagefindFilterEntries=f,exports.getPagefindFilters=d,exports.getSectionEntries=s,exports.getSiteTitle=t,exports.getTocHeadings=a,exports.toNavigation=i;
@@ -1,9 +1,9 @@
1
1
  /**
2
2
  * name: @blackwork/docs
3
- * version: v0.1.0
3
+ * version: v0.2.0
4
4
  * description: Next-first documentation framework for Blackwork projects.
5
5
  * author: chengpeiquan <chengpeiquan@chengpeiquan.com>
6
6
  * homepage: https://chengpeiquan.com
7
7
  * license: MIT
8
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};
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)}},l=e=>e?.trim(),u=e=>{let t=e.split(/[-_]/u).map(e=>l(e)).filter(e=>!!e);return{language:t[0]?.toLowerCase(),region:t.slice(1).find(e=>/^(?:[A-Za-z]{2}|\d{3})$/u.test(e))?.toUpperCase()}},d=({kind:e=`docs`,layout:t,locale:n,section:r})=>{let{language:i,region:a}=u(n);return{kind:e,locale:n,...i?{language:i}:{},...a?{region:a}:{},...r?{section:r}:{},...t?{layout:t}:{}}},f=e=>Object.entries(e).map(([e,t])=>`${e}:${t}`);export{c as getEntrySectionConfig,o as getEntrySectionKey,n as getFooterDescription,f as getPagefindFilterEntries,d as getPagefindFilters,s as getSectionEntries,t as getSiteTitle,a as getTocHeadings,i as toNavigation};
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * name: @blackwork/docs
3
- * version: v0.1.0
3
+ * version: v0.2.0
4
4
  * description: Next-first documentation framework for Blackwork projects.
5
5
  * author: chengpeiquan <chengpeiquan@chengpeiquan.com>
6
6
  * homepage: https://chengpeiquan.com
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * name: @blackwork/docs
3
- * version: v0.1.0
3
+ * version: v0.2.0
4
4
  * description: Next-first documentation framework for Blackwork projects.
5
5
  * author: chengpeiquan <chengpeiquan@chengpeiquan.com>
6
6
  * homepage: https://chengpeiquan.com
@@ -1,9 +1,9 @@
1
1
  /**
2
2
  * name: @blackwork/docs
3
- * version: v0.1.0
3
+ * version: v0.2.0
4
4
  * description: Next-first documentation framework for Blackwork projects.
5
5
  * author: chengpeiquan <chengpeiquan@chengpeiquan.com>
6
6
  * homepage: https://chengpeiquan.com
7
7
  * license: MIT
8
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;
9
+ const e=e=>typeof e==`object`&&!!e,t=e=>typeof e==`function`,n=e=>typeof e==`function`,r=e=>typeof e==`function`;function i(i){return e(i)?{...t(i.footer)?{footer:i.footer}:{},...n(i.headerActions)?{headerActions:i.headerActions}:{},...r(i.link)?{link:i.link}:{}}:{}}exports.resolveThemeSlots=i;
@@ -1,9 +1,9 @@
1
1
  /**
2
2
  * name: @blackwork/docs
3
- * version: v0.1.0
3
+ * version: v0.2.0
4
4
  * description: Next-first documentation framework for Blackwork projects.
5
5
  * author: chengpeiquan <chengpeiquan@chengpeiquan.com>
6
6
  * homepage: https://chengpeiquan.com
7
7
  * license: MIT
8
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};
9
+ const e=e=>typeof e==`object`&&!!e,t=e=>typeof e==`function`,n=e=>typeof e==`function`,r=e=>typeof e==`function`;function i(i){return e(i)?{...t(i.footer)?{footer:i.footer}:{},...n(i.headerActions)?{headerActions:i.headerActions}:{},...r(i.link)?{link:i.link}:{}}:{}}export{i as resolveThemeSlots};
@@ -26,8 +26,16 @@ interface DocsThemeFooterSlotProps {
26
26
  siteTitle: string;
27
27
  LinkComponent?: DocsThemeLinkComponent;
28
28
  }
29
+ interface DocsThemeHeaderActionsProps {
30
+ homeHref: string;
31
+ localeLinks?: DocsThemeLocaleLink[];
32
+ navigation: DocsThemeNavItem[];
33
+ siteDescription?: string;
34
+ siteTitle: string;
35
+ }
29
36
  interface DocsThemeSlots {
30
37
  footer?: ComponentType<DocsThemeFooterSlotProps>;
38
+ headerActions?: ComponentType<DocsThemeHeaderActionsProps>;
31
39
  link?: DocsThemeLinkComponent;
32
40
  }
33
41
  interface DocsThemeHomeAction {
@@ -61,4 +69,4 @@ interface DocsHomeConfig {
61
69
  }
62
70
  type DocsSlotsConfig = DocsThemeSlots;
63
71
  //#endregion
64
- export { DocsHomeConfig, DocsSlotsConfig, DocsThemeFooterSlotProps, DocsThemeHomeAction, DocsThemeHomeData, DocsThemeHomeHighlight, DocsThemeLinkComponent, DocsThemeLinkProps, DocsThemeLocaleLink, DocsThemeNavItem, DocsThemeSlots };
72
+ export { DocsHomeConfig, DocsSlotsConfig, DocsThemeFooterSlotProps, DocsThemeHeaderActionsProps, DocsThemeHomeAction, DocsThemeHomeData, DocsThemeHomeHighlight, DocsThemeLinkComponent, DocsThemeLinkProps, DocsThemeLocaleLink, DocsThemeNavItem, DocsThemeSlots };
@@ -26,8 +26,16 @@ interface DocsThemeFooterSlotProps {
26
26
  siteTitle: string;
27
27
  LinkComponent?: DocsThemeLinkComponent;
28
28
  }
29
+ interface DocsThemeHeaderActionsProps {
30
+ homeHref: string;
31
+ localeLinks?: DocsThemeLocaleLink[];
32
+ navigation: DocsThemeNavItem[];
33
+ siteDescription?: string;
34
+ siteTitle: string;
35
+ }
29
36
  interface DocsThemeSlots {
30
37
  footer?: ComponentType<DocsThemeFooterSlotProps>;
38
+ headerActions?: ComponentType<DocsThemeHeaderActionsProps>;
31
39
  link?: DocsThemeLinkComponent;
32
40
  }
33
41
  interface DocsThemeHomeAction {
@@ -61,4 +69,4 @@ interface DocsHomeConfig {
61
69
  }
62
70
  type DocsSlotsConfig = DocsThemeSlots;
63
71
  //#endregion
64
- export { DocsHomeConfig, DocsSlotsConfig, DocsThemeFooterSlotProps, DocsThemeHomeAction, DocsThemeHomeData, DocsThemeHomeHighlight, DocsThemeLinkComponent, DocsThemeLinkProps, DocsThemeLocaleLink, DocsThemeNavItem, DocsThemeSlots };
72
+ export { DocsHomeConfig, DocsSlotsConfig, DocsThemeFooterSlotProps, DocsThemeHeaderActionsProps, DocsThemeHomeAction, DocsThemeHomeData, DocsThemeHomeHighlight, DocsThemeLinkComponent, DocsThemeLinkProps, DocsThemeLocaleLink, DocsThemeNavItem, DocsThemeSlots };
package/dist/theme.cjs CHANGED
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * name: @blackwork/docs
3
- * version: v0.1.0
3
+ * version: v0.2.0
4
4
  * description: Next-first documentation framework for Blackwork projects.
5
5
  * author: chengpeiquan <chengpeiquan@chengpeiquan.com>
6
6
  * homepage: https://chengpeiquan.com
package/dist/theme.d.mts CHANGED
@@ -1,5 +1,5 @@
1
1
 
2
- import { DocsHomeConfig, DocsSlotsConfig, DocsThemeFooterSlotProps, DocsThemeHomeAction, DocsThemeHomeData, DocsThemeHomeHighlight, DocsThemeLinkComponent, DocsThemeLinkProps, DocsThemeLocaleLink, DocsThemeNavItem, DocsThemeSlots } from "./theme/types.mjs";
2
+ import { DocsHomeConfig, DocsSlotsConfig, DocsThemeFooterSlotProps, DocsThemeHeaderActionsProps, DocsThemeHomeAction, DocsThemeHomeData, DocsThemeHomeHighlight, DocsThemeLinkComponent, DocsThemeLinkProps, DocsThemeLocaleLink, DocsThemeNavItem, DocsThemeSlots } from "./theme/types.mjs";
3
3
  import { DefaultDocsFooter, DefaultDocsFooterProps } from "./theme/components/footer.mjs";
4
4
  import { DefaultDocsHeader, DefaultDocsHeaderProps } from "./theme/components/header.mjs";
5
5
  import { DefaultDocsLink, DefaultDocsLinkProps } from "./theme/components/link.mjs";
@@ -8,4 +8,4 @@ import { DefaultDocsShell, DefaultDocsShellProps } from "./theme/components/docs
8
8
  import { DefaultHomeShell, DefaultHomeShellProps } from "./theme/components/home-shell.mjs";
9
9
  import { CreateHomeDataOptions, createHomeData } from "./theme/create-home-data.mjs";
10
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 };
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 DocsThemeHeaderActionsProps, type DocsThemeHomeAction, type DocsThemeHomeData, type DocsThemeHomeHighlight, type DocsThemeLinkComponent, type DocsThemeLinkProps, type DocsThemeLocaleLink, type DocsThemeNavItem, type DocsThemeSlots, createHomeData, resolveThemeSlots };
package/dist/theme.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
 
2
- import { DocsHomeConfig, DocsSlotsConfig, DocsThemeFooterSlotProps, DocsThemeHomeAction, DocsThemeHomeData, DocsThemeHomeHighlight, DocsThemeLinkComponent, DocsThemeLinkProps, DocsThemeLocaleLink, DocsThemeNavItem, DocsThemeSlots } from "./theme/types.js";
2
+ import { DocsHomeConfig, DocsSlotsConfig, DocsThemeFooterSlotProps, DocsThemeHeaderActionsProps, DocsThemeHomeAction, DocsThemeHomeData, DocsThemeHomeHighlight, DocsThemeLinkComponent, DocsThemeLinkProps, DocsThemeLocaleLink, DocsThemeNavItem, DocsThemeSlots } from "./theme/types.js";
3
3
  import { DefaultDocsFooter, DefaultDocsFooterProps } from "./theme/components/footer.js";
4
4
  import { DefaultDocsHeader, DefaultDocsHeaderProps } from "./theme/components/header.js";
5
5
  import { DefaultDocsLink, DefaultDocsLinkProps } from "./theme/components/link.js";
@@ -8,4 +8,4 @@ import { DefaultDocsShell, DefaultDocsShellProps } from "./theme/components/docs
8
8
  import { DefaultHomeShell, DefaultHomeShellProps } from "./theme/components/home-shell.js";
9
9
  import { CreateHomeDataOptions, createHomeData } from "./theme/create-home-data.js";
10
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 };
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 DocsThemeHeaderActionsProps, type DocsThemeHomeAction, type DocsThemeHomeData, type DocsThemeHomeHighlight, type DocsThemeLinkComponent, type DocsThemeLinkProps, type DocsThemeLocaleLink, type DocsThemeNavItem, type DocsThemeSlots, createHomeData, resolveThemeSlots };
package/dist/theme.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * name: @blackwork/docs
3
- * version: v0.1.0
3
+ * version: v0.2.0
4
4
  * description: Next-first documentation framework for Blackwork projects.
5
5
  * author: chengpeiquan <chengpeiquan@chengpeiquan.com>
6
6
  * homepage: https://chengpeiquan.com
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@blackwork/docs",
3
- "version": "0.1.0",
3
+ "version": "0.2.0",
4
4
  "description": "Next-first documentation framework for Blackwork projects.",
5
5
  "author": "chengpeiquan <chengpeiquan@chengpeiquan.com>",
6
6
  "homepage": "https://chengpeiquan.com",
@@ -45,7 +45,8 @@
45
45
  ],
46
46
  "repository": {
47
47
  "type": "git",
48
- "url": "git+https://github.com/chengpeiquan/blackwork.git"
48
+ "url": "https://github.com/chengpeiquan/blackwork",
49
+ "directory": "packages/docs"
49
50
  },
50
51
  "dependencies": {
51
52
  "chokidar": "^4.0.3",
@@ -60,11 +61,10 @@
60
61
  },
61
62
  "devDependencies": {
62
63
  "@bassist/build-config": "^0.2.0",
63
- "@bassist/eslint-config": "^0.4.1",
64
- "@bassist/oxc-integration": "^0.1.4",
65
64
  "@bassist/tsconfig": "^0.1.1",
66
65
  "@types/node": "^25.5.2",
67
66
  "eslint": "^9.39.4",
67
+ "jsdom": "^26.1.0",
68
68
  "tsdown": "^0.21.7",
69
69
  "typescript": "^6.0.2",
70
70
  "vitest": "^4.0.7",