@blackwork/docs 0.1.0 → 0.3.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 (130) 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/config/types.d.mts +11 -1
  11. package/dist/config/types.d.ts +11 -1
  12. package/dist/export/process-exported-docs.cjs +9 -0
  13. package/dist/export/process-exported-docs.d.mts +16 -0
  14. package/dist/export/process-exported-docs.d.ts +16 -0
  15. package/dist/export/process-exported-docs.mjs +9 -0
  16. package/dist/index.cjs +2 -2
  17. package/dist/index.d.mts +3 -2
  18. package/dist/index.d.ts +3 -2
  19. package/dist/index.mjs +2 -2
  20. package/dist/mdx/default-docs-components.cjs +1 -1
  21. package/dist/mdx/default-docs-components.mjs +1 -1
  22. package/dist/mdx/merge-docs-components.cjs +1 -1
  23. package/dist/mdx/merge-docs-components.mjs +1 -1
  24. package/dist/metadata/create-doc-metadata.cjs +1 -1
  25. package/dist/metadata/create-doc-metadata.d.mts +1 -1
  26. package/dist/metadata/create-doc-metadata.d.ts +1 -1
  27. package/dist/metadata/create-doc-metadata.mjs +1 -1
  28. package/dist/navigation/build-locale-links.cjs +1 -1
  29. package/dist/navigation/build-locale-links.d.mts +1 -1
  30. package/dist/navigation/build-locale-links.d.ts +1 -1
  31. package/dist/navigation/build-locale-links.mjs +1 -1
  32. package/dist/navigation/build-pager.cjs +1 -1
  33. package/dist/navigation/build-pager.mjs +1 -1
  34. package/dist/navigation/build-sidebar.cjs +1 -1
  35. package/dist/navigation/build-sidebar.d.mts +1 -1
  36. package/dist/navigation/build-sidebar.d.ts +1 -1
  37. package/dist/navigation/build-sidebar.mjs +1 -1
  38. package/dist/navigation/resolve-sidebar.cjs +1 -1
  39. package/dist/navigation/resolve-sidebar.mjs +1 -1
  40. package/dist/next/context.cjs +1 -1
  41. package/dist/next/context.mjs +1 -1
  42. package/dist/next/document-lang-sync.cjs +9 -0
  43. package/dist/next/document-lang-sync.mjs +9 -0
  44. package/dist/next/load-doc-content.cjs +1 -1
  45. package/dist/next/load-doc-content.mjs +1 -1
  46. package/dist/next/load-generated-manifest.cjs +1 -1
  47. package/dist/next/load-generated-manifest.mjs +1 -1
  48. package/dist/next/metadata.cjs +1 -1
  49. package/dist/next/metadata.mjs +1 -1
  50. package/dist/next/page.cjs +1 -1
  51. package/dist/next/page.mjs +1 -1
  52. package/dist/next/render-route.cjs +1 -1
  53. package/dist/next/render-route.mjs +1 -1
  54. package/dist/next/resolve-document-lang.cjs +1 -1
  55. package/dist/next/resolve-document-lang.mjs +1 -1
  56. package/dist/next/root-layout.cjs +2 -2
  57. package/dist/next/root-layout.mjs +2 -2
  58. package/dist/next-plugin/generate.cjs +1 -1
  59. package/dist/next-plugin/generate.mjs +1 -1
  60. package/dist/next.cjs +1 -1
  61. package/dist/next.mjs +1 -1
  62. package/dist/routing/build-static-params.cjs +1 -1
  63. package/dist/routing/build-static-params.mjs +1 -1
  64. package/dist/routing/resolve-docs-route.cjs +1 -1
  65. package/dist/routing/resolve-docs-route.mjs +1 -1
  66. package/dist/runtime.cjs +1 -1
  67. package/dist/runtime.mjs +1 -1
  68. package/dist/source/build-docs-source.cjs +1 -1
  69. package/dist/source/build-docs-source.mjs +1 -1
  70. package/dist/source/collect-docs-manifest.cjs +1 -1
  71. package/dist/source/collect-docs-manifest.mjs +1 -1
  72. package/dist/source/create-docs-source-from-manifest.cjs +1 -1
  73. package/dist/source/create-docs-source-from-manifest.mjs +1 -1
  74. package/dist/source/create-docs-source.cjs +1 -1
  75. package/dist/source/create-docs-source.mjs +1 -1
  76. package/dist/theme/components/content-layout.cjs +9 -0
  77. package/dist/theme/components/content-layout.d.mts +15 -0
  78. package/dist/theme/components/content-layout.d.ts +15 -0
  79. package/dist/theme/components/content-layout.mjs +9 -0
  80. package/dist/theme/components/content-shell.cjs +2 -2
  81. package/dist/theme/components/content-shell.d.mts +1 -1
  82. package/dist/theme/components/content-shell.d.ts +1 -1
  83. package/dist/theme/components/content-shell.mjs +2 -2
  84. package/dist/theme/components/docs-rail-scroll-state.cjs +2 -2
  85. package/dist/theme/components/docs-rail-scroll-state.mjs +2 -2
  86. package/dist/theme/components/docs-rail-scroll.cjs +2 -2
  87. package/dist/theme/components/docs-rail-scroll.mjs +2 -2
  88. package/dist/theme/components/docs-scroll-reset.cjs +1 -1
  89. package/dist/theme/components/docs-scroll-reset.mjs +1 -1
  90. package/dist/theme/components/docs-scroll-to-top.cjs +9 -0
  91. package/dist/theme/components/docs-scroll-to-top.mjs +9 -0
  92. package/dist/theme/components/docs-shell.cjs +2 -2
  93. package/dist/theme/components/docs-shell.d.mts +1 -1
  94. package/dist/theme/components/docs-shell.d.ts +1 -1
  95. package/dist/theme/components/docs-shell.mjs +2 -2
  96. package/dist/theme/components/docs-toc-geometry.cjs +1 -1
  97. package/dist/theme/components/docs-toc-geometry.mjs +1 -1
  98. package/dist/theme/components/docs-toc.cjs +2 -2
  99. package/dist/theme/components/docs-toc.d.mts +32 -0
  100. package/dist/theme/components/docs-toc.d.ts +32 -0
  101. package/dist/theme/components/docs-toc.mjs +2 -2
  102. package/dist/theme/components/floating-actions.cjs +9 -0
  103. package/dist/theme/components/floating-actions.mjs +9 -0
  104. package/dist/theme/components/footer.cjs +1 -1
  105. package/dist/theme/components/footer.mjs +1 -1
  106. package/dist/theme/components/header.cjs +2 -2
  107. package/dist/theme/components/header.d.mts +1 -0
  108. package/dist/theme/components/header.d.ts +1 -0
  109. package/dist/theme/components/header.mjs +2 -2
  110. package/dist/theme/components/home-shell.cjs +2 -2
  111. package/dist/theme/components/home-shell.d.mts +1 -1
  112. package/dist/theme/components/home-shell.d.ts +1 -1
  113. package/dist/theme/components/home-shell.mjs +2 -2
  114. package/dist/theme/components/link.cjs +1 -1
  115. package/dist/theme/components/link.mjs +1 -1
  116. package/dist/theme/components/shell-shared.cjs +2 -2
  117. package/dist/theme/components/shell-shared.mjs +2 -2
  118. package/dist/theme/create-home-data.cjs +1 -1
  119. package/dist/theme/create-home-data.d.mts +1 -1
  120. package/dist/theme/create-home-data.d.ts +1 -1
  121. package/dist/theme/create-home-data.mjs +1 -1
  122. package/dist/theme/slots.cjs +2 -2
  123. package/dist/theme/slots.mjs +2 -2
  124. package/dist/theme/types.d.mts +14 -1
  125. package/dist/theme/types.d.ts +14 -1
  126. package/dist/theme.cjs +2 -2
  127. package/dist/theme.d.mts +4 -2
  128. package/dist/theme.d.ts +4 -2
  129. package/dist/theme.mjs +2 -2
  130. package/package.json +5 -5
@@ -1,9 +1,9 @@
1
1
  /**
2
2
  * name: @blackwork/docs
3
- * version: v0.1.0
3
+ * version: v0.3.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
- require(`../_virtual/_rolldown/runtime.cjs`);const e=require(`../config/define-config.cjs`),t=require(`../theme/components/docs-scroll-reset.cjs`),n=require(`./resolve-document-lang.cjs`);let r=require(`blackwork`),i=require(`react/jsx-runtime`);const a=async e=>{let t=(e?await e:void 0)?.slug?.filter(e=>e.length>0)??[];return t.length>0?`/${t.join(`/`)}`:`/`},o=e=>e===`light`||e===`dark`,s=e=>{let t=typeof e.storageKey==`string`?e.storageKey:void 0,n=o(e.defaultTheme)?e.defaultTheme:void 0;return{...t?{storageKey:t}:{},...n?{defaultTheme:n}:{}}},c=async({children:o,config:c,params:l})=>{let u=e.defineConfig(c),d=n.resolveDocumentLang({config:u,pathname:await a(l)}),f=s(u.theme);return(0,i.jsxs)(`html`,{lang:d,suppressHydrationWarning:!0,children:[(0,i.jsx)(`head`,{children:(0,i.jsx)(r.ThemeScript,{...f})}),(0,i.jsx)(`body`,{className:`flex min-h-screen w-screen flex-col`,children:(0,i.jsxs)(r.ThemeProvider,{...f,children:[(0,i.jsx)(t.DocsScrollReset,{}),o]})})]})};exports.DocsRootLayout=c;
9
+ require(`../_virtual/_rolldown/runtime.cjs`);const e=require(`../config/define-config.cjs`),t=require(`../theme/components/docs-scroll-reset.cjs`),n=require(`./resolve-document-lang.cjs`),r=require(`./document-lang-sync.cjs`);let i=require(`blackwork`),a=require(`react/jsx-runtime`);const o=async e=>{let t=(e?await e:void 0)?.slug?.filter(e=>e.length>0)??[];return t.length>0?`/${t.join(`/`)}`:`/`},s=e=>e===`light`||e===`dark`,c=e=>{let t=typeof e.storageKey==`string`?e.storageKey:void 0,n=s(e.defaultTheme)?e.defaultTheme:void 0;return{...t?{storageKey:t}:{},...n?{defaultTheme:n}:{}}},l=async({children:s,config:l,params:u})=>{let d=e.defineConfig(l),f=n.resolveDocumentLang({config:d,pathname:await o(u)}),p=c(d.theme);return(0,a.jsxs)(`html`,{lang:f,suppressHydrationWarning:!0,children:[(0,a.jsx)(`head`,{children:(0,a.jsx)(i.ThemeScript,{...p})}),(0,a.jsx)(`body`,{className:`flex min-h-screen w-screen flex-col`,children:(0,a.jsxs)(i.ThemeProvider,{...p,children:[(0,a.jsx)(r.DocsDocumentLangSync,{content:d.content}),(0,a.jsx)(t.DocsScrollReset,{}),s]})})]})};exports.DocsRootLayout=l;
@@ -1,9 +1,9 @@
1
1
  /**
2
2
  * name: @blackwork/docs
3
- * version: v0.1.0
3
+ * version: v0.3.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{DocsScrollReset as t}from"../theme/components/docs-scroll-reset.mjs";import{resolveDocumentLang as n}from"./resolve-document-lang.mjs";import{ThemeProvider as r,ThemeScript as i}from"blackwork";import{jsx as a,jsxs as o}from"react/jsx-runtime";const s=async e=>{let t=(e?await e:void 0)?.slug?.filter(e=>e.length>0)??[];return t.length>0?`/${t.join(`/`)}`:`/`},c=e=>e===`light`||e===`dark`,l=e=>{let t=typeof e.storageKey==`string`?e.storageKey:void 0,n=c(e.defaultTheme)?e.defaultTheme:void 0;return{...t?{storageKey:t}:{},...n?{defaultTheme:n}:{}}},u=async({children:c,config:u,params:d})=>{let f=e(u),p=n({config:f,pathname:await s(d)}),m=l(f.theme);return o(`html`,{lang:p,suppressHydrationWarning:!0,children:[a(`head`,{children:a(i,{...m})}),a(`body`,{className:`flex min-h-screen w-screen flex-col`,children:o(r,{...m,children:[a(t,{}),c]})})]})};export{u as DocsRootLayout};
9
+ import{defineConfig as e}from"../config/define-config.mjs";import{DocsScrollReset as t}from"../theme/components/docs-scroll-reset.mjs";import{resolveDocumentLang as n}from"./resolve-document-lang.mjs";import{DocsDocumentLangSync as r}from"./document-lang-sync.mjs";import{ThemeProvider as i,ThemeScript as a}from"blackwork";import{jsx as o,jsxs as s}from"react/jsx-runtime";const c=async e=>{let t=(e?await e:void 0)?.slug?.filter(e=>e.length>0)??[];return t.length>0?`/${t.join(`/`)}`:`/`},l=e=>e===`light`||e===`dark`,u=e=>{let t=typeof e.storageKey==`string`?e.storageKey:void 0,n=l(e.defaultTheme)?e.defaultTheme:void 0;return{...t?{storageKey:t}:{},...n?{defaultTheme:n}:{}}},d=async({children:l,config:d,params:f})=>{let p=e(d),m=n({config:p,pathname:await c(f)}),h=u(p.theme);return s(`html`,{lang:m,suppressHydrationWarning:!0,children:[o(`head`,{children:o(a,{...h})}),o(`body`,{className:`flex min-h-screen w-screen flex-col`,children:s(i,{...h,children:[o(r,{content:p.content}),o(t,{}),l]})})]})};export{d as DocsRootLayout};
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * name: @blackwork/docs
3
- * version: v0.1.0
3
+ * version: v0.3.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.3.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/next.cjs CHANGED
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * name: @blackwork/docs
3
- * version: v0.1.0
3
+ * version: v0.3.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/next.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * name: @blackwork/docs
3
- * version: v0.1.0
3
+ * version: v0.3.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.3.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.3.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.3.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.3.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/runtime.cjs CHANGED
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * name: @blackwork/docs
3
- * version: v0.1.0
3
+ * version: v0.3.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/runtime.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * name: @blackwork/docs
3
- * version: v0.1.0
3
+ * version: v0.3.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.3.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.3.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.3.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.3.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.3.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.3.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.3.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.3.0
4
4
  * description: Next-first documentation framework for Blackwork projects.
5
5
  * author: chengpeiquan <chengpeiquan@chengpeiquan.com>
6
6
  * homepage: https://chengpeiquan.com
@@ -0,0 +1,9 @@
1
+ /**
2
+ * name: @blackwork/docs
3
+ * version: v0.3.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`);const r=({children:e,contentTocVisible:t=!1,footer:r,headerMeta:i,pagefindFilterEntries:a=[],title:o})=>(0,n.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:[t?(0,n.jsx)(`div`,{"aria-hidden":`true`,className:`hidden w-64 shrink-0 xl:block`}):null,(0,n.jsx)(`div`,{className:`flex min-w-0 flex-1 justify-center`,children:(0,n.jsxs)(`div`,{className:`flex w-full max-w-4xl flex-col gap-8`,children:[(0,n.jsxs)(`div`,{"data-docs-region":`article-content`,"data-pagefind-body":``,className:`flex flex-col gap-8`,children:[(0,n.jsx)(`div`,{hidden:!0,children:a.map(e=>(0,n.jsx)(`span`,{"data-pagefind-filter":e},e))}),(0,n.jsxs)(`header`,{"data-docs-region":`article-header`,className:`flex flex-col gap-5`,children:[(0,n.jsx)(`h1`,{className:`text-3xl font-semibold tracking-tight text-foreground`,children:o}),i?(0,n.jsx)(`div`,{"data-docs-region":`article-header-meta`,children:i}):null]}),(0,n.jsx)(`article`,{"data-docs-region":`article-body`,className:`prose prose-neutral max-w-none dark:prose-invert`,children:e})]}),r]})}),t?(0,n.jsx)(`div`,{"aria-hidden":`true`,className:`hidden w-64 shrink-0 xl:block`}):null]});exports.DefaultContentLayout=r;
@@ -0,0 +1,15 @@
1
+
2
+ import React from "react";
3
+
4
+ //#region src/theme/components/content-layout.d.ts
5
+ interface DefaultContentLayoutProps {
6
+ children: React.ReactNode;
7
+ contentTocVisible?: boolean;
8
+ footer?: React.ReactNode;
9
+ headerMeta?: React.ReactNode;
10
+ pagefindFilterEntries?: string[];
11
+ title: React.ReactNode;
12
+ }
13
+ declare const DefaultContentLayout: React.FC<DefaultContentLayoutProps>;
14
+ //#endregion
15
+ export { DefaultContentLayout, DefaultContentLayoutProps };
@@ -0,0 +1,15 @@
1
+
2
+ import React from "react";
3
+
4
+ //#region src/theme/components/content-layout.d.ts
5
+ interface DefaultContentLayoutProps {
6
+ children: React.ReactNode;
7
+ contentTocVisible?: boolean;
8
+ footer?: React.ReactNode;
9
+ headerMeta?: React.ReactNode;
10
+ pagefindFilterEntries?: string[];
11
+ title: React.ReactNode;
12
+ }
13
+ declare const DefaultContentLayout: React.FC<DefaultContentLayoutProps>;
14
+ //#endregion
15
+ export { DefaultContentLayout, DefaultContentLayoutProps };
@@ -0,0 +1,9 @@
1
+ /**
2
+ * name: @blackwork/docs
3
+ * version: v0.3.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,jsxs as t}from"react/jsx-runtime";const n=({children:n,contentTocVisible:r=!1,footer:i,headerMeta:a,pagefindFilterEntries:o=[],title:s})=>t(`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:[r?e(`div`,{"aria-hidden":`true`,className:`hidden w-64 shrink-0 xl:block`}):null,e(`div`,{className:`flex min-w-0 flex-1 justify-center`,children:t(`div`,{className:`flex w-full max-w-4xl flex-col gap-8`,children:[t(`div`,{"data-docs-region":`article-content`,"data-pagefind-body":``,className:`flex flex-col gap-8`,children:[e(`div`,{hidden:!0,children:o.map(t=>e(`span`,{"data-pagefind-filter":t},t))}),t(`header`,{"data-docs-region":`article-header`,className:`flex flex-col gap-5`,children:[e(`h1`,{className:`text-3xl font-semibold tracking-tight text-foreground`,children:s}),a?e(`div`,{"data-docs-region":`article-header-meta`,children:a}):null]}),e(`article`,{"data-docs-region":`article-body`,className:`prose prose-neutral max-w-none dark:prose-invert`,children:n})]}),i]})}),r?e(`div`,{"aria-hidden":`true`,className:`hidden w-64 shrink-0 xl:block`}):null]});export{n as DefaultContentLayout};
@@ -1,9 +1,9 @@
1
1
  /**
2
2
  * name: @blackwork/docs
3
- * version: v0.1.0
3
+ * version: v0.3.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/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;
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(`./docs-toc.cjs`),u=require(`./content-layout.cjs`),d=require(`../slots.cjs`),f=require(`./docs-scroll-to-top.cjs`),p=require(`./shell-shared.cjs`);let m=require(`react`);m=e.__toESM(m);let h=require(`react/jsx-runtime`);const g=({children:e,config:m,entry:g,headings:_=[],source:v})=>{let y=t.defineConfig(m),b=v.getEntries(g.locale),x=p.getEntrySectionKey(g),S=p.getEntrySectionConfig(y,g),C=Array.isArray(S.sidebar),w=p.getSectionEntries(b,g),T=C?r.resolveSidebar({config:y,entries:b,currentHref:g.href,sectionKey:x}):[],E=p.toNavigation(g,C?r.flattenResolvedSidebarItems(T):a.buildSidebar({entries:b,currentHref:g.href})),D=i.buildPager({entries:w,currentHref:g.href,...C?{sidebar:T}:{}}),O=n.buildLocaleLinks({config:y,entry:g,source:v}),k=p.getTocHeadings(_),A=k.length>=2,j=p.getTocLabels(y,g.locale),M=v.getCanonicalHref(g.locale,[]),N=d.resolveThemeSlots(y.slots),P=N.contentHeaderMeta,F=N.headerActions,I=N.link??o.DefaultDocsLink,L=N.footer??s.DefaultDocsFooter,R=p.getPagefindFilterEntries(p.getPagefindFilters({layout:S.layout,locale:g.locale,section:x})),z=A?(0,h.jsx)(l.DefaultDocsToc,{headings:k,...j,collapseDirection:`right`,collapseEnabled:!0,dock:`fixed`,className:`xl:right-8`}):null,B=A?(0,h.jsx)(l.MobileDocsToc,{headings:k,minHeadings:2,...j}):null;return(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(c.DefaultDocsHeader,{headerActions:F?(0,h.jsx)(F,{homeHref:M,localeLinks:O,navigation:E,siteDescription:y.site.description,siteTitle:p.getSiteTitle(y)}):void 0,homeHref:M,LinkComponent:I,localeLinks:O,navigation:E,siteDescription:y.site.description,siteTitle:p.getSiteTitle(y)}),(0,h.jsx)(f.DocsScrollToTop,{}),B,z,(0,h.jsx)(u.DefaultContentLayout,{footer:(0,h.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:[D.previous?(0,h.jsxs)(I,{href:D.previous.href,className:`text-muted-foreground`,children:[`Previous: `,D.previous.title]}):(0,h.jsx)(`span`,{}),D.next?(0,h.jsxs)(I,{href:D.next.href,className:`text-muted-foreground`,children:[`Next: `,D.next.title]}):null]}),headerMeta:P?(0,h.jsx)(P,{entry:g}):void 0,pagefindFilterEntries:R,contentTocVisible:A,title:g.title,children:e}),(0,h.jsx)(L,{description:p.getFooterDescription(y,g),homeHref:M,LinkComponent:I,navigation:E,siteTitle:p.getSiteTitle(y)})]})};exports.DefaultContentShell=g;
@@ -1,6 +1,6 @@
1
1
 
2
- import { DocsConfig, NormalizedDocsConfig } from "../../config/types.mjs";
3
2
  import { DocEntry, DocsSource } from "../../source/types.mjs";
3
+ import { DocsConfig, NormalizedDocsConfig } from "../../config/types.mjs";
4
4
  import React from "react";
5
5
  import { HeadingItem } from "@blackwork/machine";
6
6
 
@@ -1,6 +1,6 @@
1
1
 
2
- import { DocsConfig, NormalizedDocsConfig } from "../../config/types.js";
3
2
  import { DocEntry, DocsSource } from "../../source/types.js";
3
+ import { DocsConfig, NormalizedDocsConfig } from "../../config/types.js";
4
4
  import React from "react";
5
5
  import { HeadingItem } from "@blackwork/machine";
6
6
 
@@ -1,9 +1,9 @@
1
1
  /**
2
2
  * name: @blackwork/docs
3
- * version: v0.1.0
3
+ * version: v0.3.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{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};
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{DefaultDocsToc as l,MobileDocsToc as u}from"./docs-toc.mjs";import{DefaultContentLayout as d}from"./content-layout.mjs";import{resolveThemeSlots as f}from"../slots.mjs";import{DocsScrollToTop as p}from"./docs-scroll-to-top.mjs";import{getEntrySectionConfig as m,getEntrySectionKey as h,getFooterDescription as g,getPagefindFilterEntries as _,getPagefindFilters as v,getSectionEntries as y,getSiteTitle as b,getTocHeadings as x,getTocLabels as S,toNavigation as C}from"./shell-shared.mjs";import"react";import{Fragment as w,jsx as T,jsxs as E}from"react/jsx-runtime";const D=({children:D,config:O,entry:k,headings:A=[],source:j})=>{let M=e(O),N=j.getEntries(k.locale),P=h(k),F=m(M,k),I=Array.isArray(F.sidebar),L=y(N,k),R=I?r({config:M,entries:N,currentHref:k.href,sectionKey:P}):[],z=C(k,I?n(R):a({entries:N,currentHref:k.href})),B=i({entries:L,currentHref:k.href,...I?{sidebar:R}:{}}),V=t({config:M,entry:k,source:j}),H=x(A),U=H.length>=2,W=S(M,k.locale),G=j.getCanonicalHref(k.locale,[]),K=f(M.slots),q=K.contentHeaderMeta,J=K.headerActions,Y=K.link??o,X=K.footer??s,Z=_(v({layout:F.layout,locale:k.locale,section:P})),Q=U?T(l,{headings:H,...W,collapseDirection:`right`,collapseEnabled:!0,dock:`fixed`,className:`xl:right-8`}):null,$=U?T(u,{headings:H,minHeadings:2,...W}):null;return E(w,{children:[T(c,{headerActions:J?T(J,{homeHref:G,localeLinks:V,navigation:z,siteDescription:M.site.description,siteTitle:b(M)}):void 0,homeHref:G,LinkComponent:Y,localeLinks:V,navigation:z,siteDescription:M.site.description,siteTitle:b(M)}),T(p,{}),$,Q,T(d,{footer:E(`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:[B.previous?E(Y,{href:B.previous.href,className:`text-muted-foreground`,children:[`Previous: `,B.previous.title]}):T(`span`,{}),B.next?E(Y,{href:B.next.href,className:`text-muted-foreground`,children:[`Next: `,B.next.title]}):null]}),headerMeta:q?T(q,{entry:k}):void 0,pagefindFilterEntries:Z,contentTocVisible:U,title:k.title,children:D}),T(X,{description:g(M,k),homeHref:G,LinkComponent:Y,navigation:z,siteTitle:b(M)})]})};export{D as DefaultContentShell};
@@ -1,9 +1,9 @@
1
1
  /**
2
2
  * name: @blackwork/docs
3
- * version: v0.1.0
3
+ * version: v0.3.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=({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;
9
+ const e=({scrollTop:e,clientHeight:t,scrollHeight:n})=>{let r=Math.max(n-t,0);return r<=1?{bottomVisible:!1,topVisible:!1}:{bottomVisible:r-e>1,topVisible:e>1}};exports.getDocsRailFadeState=e;
@@ -1,9 +1,9 @@
1
1
  /**
2
2
  * name: @blackwork/docs
3
- * version: v0.1.0
3
+ * version: v0.3.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=({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};
9
+ const e=({scrollTop:e,clientHeight:t,scrollHeight:n})=>{let r=Math.max(n-t,0);return r<=1?{bottomVisible:!1,topVisible:!1}:{bottomVisible:r-e>1,topVisible:e>1}};export{e as getDocsRailFadeState};
@@ -1,9 +1,9 @@
1
1
  /**
2
2
  * name: @blackwork/docs
3
- * version: v0.1.0
3
+ * version: v0.3.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
- "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;
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={bottomVisible:!1,topVisible:!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.bottomVisible===n.bottomVisible&&e.topVisible===n.topVisible?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.topVisible)].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.bottomVisible)].join(` `)})]})};exports.DocsRailScroll=a;
@@ -1,9 +1,9 @@
1
1
  /**
2
2
  * name: @blackwork/docs
3
- * version: v0.1.0
3
+ * version: v0.3.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
- "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};
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={bottomVisible:!1,topVisible:!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.bottomVisible===n.bottomVisible&&e.topVisible===n.topVisible?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.topVisible)].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.bottomVisible)].join(` `)})]})};export{c as DocsRailScroll};
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * name: @blackwork/docs
3
- * version: v0.1.0
3
+ * version: v0.3.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.3.0
4
4
  * description: Next-first documentation framework for Blackwork projects.
5
5
  * author: chengpeiquan <chengpeiquan@chengpeiquan.com>
6
6
  * homepage: https://chengpeiquan.com
@@ -0,0 +1,9 @@
1
+ /**
2
+ * name: @blackwork/docs
3
+ * version: v0.3.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(`./floating-actions.cjs`);let n=require(`blackwork`),r=require(`react`);r=e.__toESM(r);let i=require(`react/jsx-runtime`),a=require(`blackwork/icons`);const o=()=>(0,i.jsx)(n.Button,{asChild:!0,type:`button`,variant:`outline`,size:`icon`,title:`Scroll to top`,"aria-label":`Scroll to top`,className:`fixed border border-input bg-background shadow-sm md:bg-transparent md:shadow-none`,style:t.getDocsFloatingActionStyle(0),children:(0,i.jsxs)(`a`,{href:`#`,children:[(0,i.jsx)(a.ArrowUpFromLine,{className:`size-5`,"aria-hidden":`true`}),(0,i.jsx)(`span`,{className:`sr-only`,children:`Scroll to top`})]})});exports.DocsScrollToTop=o;
@@ -0,0 +1,9 @@
1
+ /**
2
+ * name: @blackwork/docs
3
+ * version: v0.3.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{getDocsFloatingActionStyle as e}from"./floating-actions.mjs";import{Button as t}from"blackwork";import"react";import{jsx as n,jsxs as r}from"react/jsx-runtime";import{ArrowUpFromLine as i}from"blackwork/icons";const a=()=>n(t,{asChild:!0,type:`button`,variant:`outline`,size:`icon`,title:`Scroll to top`,"aria-label":`Scroll to top`,className:`fixed border border-input bg-background shadow-sm md:bg-transparent md:shadow-none`,style:e(0),children:r(`a`,{href:`#`,children:[n(i,{className:`size-5`,"aria-hidden":`true`}),n(`span`,{className:`sr-only`,children:`Scroll to top`})]})});export{a as DocsScrollToTop};
@@ -1,9 +1,9 @@
1
1
  /**
2
2
  * name: @blackwork/docs
3
- * version: v0.1.0
3
+ * version: v0.3.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/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;
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(`./docs-toc.cjs`),u=require(`../slots.cjs`),d=require(`./docs-scroll-to-top.cjs`),f=require(`./shell-shared.cjs`),p=require(`./docs-rail-scroll.cjs`);let m=require(`blackwork`),h=require(`react`);h=e.__toESM(h);let g=require(`react/jsx-runtime`),_=require(`blackwork/icons`);const v=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(` `),y=e=>e.isExternal||e.slugSegments.length>0,b=e=>e.flatMap(e=>{if(e.type===`group`){let t=e.items.filter(y);return t.length===0?[]:[{...e,items:t}]}return y(e)?[e]:[]}),x=({LinkComponent:e,nodes:t})=>(0,g.jsx)(`nav`,{"aria-label":`Documentation pages`,className:`flex flex-col gap-1`,children:t.map(t=>t.type===`group`?(0,g.jsxs)(`div`,{className:`flex flex-col gap-1 pt-4 first:pt-0`,children:[(0,g.jsx)(`p`,{className:`px-3 text-xs font-medium uppercase tracking-[0.08em] text-muted-foreground/80`,children:t.title}),t.items.map(t=>(0,g.jsx)(e,{href:t.href,"aria-current":t.isActive?`page`:void 0,"data-current-page":t.isActive?`true`:void 0,className:v(t.isActive),style:{paddingLeft:`${.75+t.depth*.75}rem`},children:t.title},t.href))]},t.title):(0,g.jsx)(e,{href:t.href,"aria-current":t.isActive?`page`:void 0,"data-current-page":t.isActive?`true`:void 0,className:v(t.isActive),style:{paddingLeft:`${.75+t.depth*.75}rem`},children:t.title},t.href))}),S=({currentTitle:e,LinkComponent:t,nodes:n})=>n.length===0?null:(0,g.jsx)(`div`,{className:`lg:hidden`,children:(0,g.jsxs)(m.Sheet,{children:[(0,g.jsx)(m.SheetTrigger,{asChild:!0,children:(0,g.jsxs)(m.Button,{type:`button`,variant:`outline`,"aria-label":`Open section navigation`,className:`h-auto w-full justify-start gap-3 rounded-lg px-4 py-3`,children:[(0,g.jsx)(_.Menu,{className:`size-4 shrink-0`,"aria-hidden":`true`}),(0,g.jsxs)(`span`,{className:`flex min-w-0 flex-1 flex-col items-start text-left`,children:[(0,g.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`Sections`}),(0,g.jsx)(`span`,{className:`truncate text-sm font-medium text-foreground`,children:e})]})]})}),(0,g.jsxs)(m.SheetContent,{side:`left`,className:`flex h-dvh flex-col gap-0 p-0 sm:max-w-sm`,children:[(0,g.jsx)(m.SheetHeader,{className:`border-b border-border/60 px-6 pb-4 pt-[calc(env(safe-area-inset-top)+1.5rem)] text-left`,children:(0,g.jsx)(m.SheetTitle,{children:`Sections`})}),(0,g.jsx)(`div`,{className:`min-h-0 flex-1 overflow-auto px-6 pb-[calc(env(safe-area-inset-bottom)+1.5rem)] pt-4`,children:(0,g.jsx)(x,{LinkComponent:t,nodes:n})})]})]})}),C=({children:e,config:m,entry:h,headings:_=[],source:v})=>{let y=t.defineConfig(m),C=v.getEntries(h.locale),w=f.getEntrySectionKey(h),T=f.getEntrySectionConfig(y,h),E=Array.isArray(T.sidebar),D=f.getSectionEntries(C,h),O=r.resolveSidebar({config:y,entries:C,currentHref:h.href,sectionKey:w}),k=b(O),A=i.buildPager({entries:D,currentHref:h.href,...E?{sidebar:O}:{}}),j=f.toNavigation(h,E?r.flattenResolvedSidebarItems(O):a.buildSidebar({entries:C,currentHref:h.href})),M=n.buildLocaleLinks({config:y,entry:h,source:v}),N=f.getTocHeadings(_),P=f.getTocLabels(y,h.locale),F=v.getCanonicalHref(h.locale,[]),I=u.resolveThemeSlots(y.slots),L=I.headerActions,R=I.link??o.DefaultDocsLink,z=I.footer??s.DefaultDocsFooter,B=f.getPagefindFilterEntries(f.getPagefindFilters({layout:T.layout,locale:h.locale,section:w}));return(0,g.jsxs)(g.Fragment,{children:[(0,g.jsx)(c.DefaultDocsHeader,{headerActions:L?(0,g.jsx)(L,{homeHref:F,localeLinks:M,navigation:j,siteDescription:y.site.description,siteTitle:f.getSiteTitle(y)}):void 0,homeHref:F,LinkComponent:R,localeLinks:M,navigation:j,siteDescription:y.site.description,siteTitle:f.getSiteTitle(y)}),(0,g.jsx)(d.DocsScrollToTop,{}),(0,g.jsx)(l.MobileDocsToc,{headings:N,...P}),(0,g.jsxs)(`main`,{"data-docs-region":`docs-shell`,className:`mx-auto flex w-full max-w-screen-2xl flex-col gap-6 px-6 py-8 sm:gap-8 sm:px-8 lg:flex-row lg:gap-14 xl:gap-20 xl:px-10 2xl:gap-24 2xl:px-12`,children:[(0,g.jsx)(S,{currentTitle:h.title,LinkComponent:R,nodes:k}),(0,g.jsx)(`aside`,{"data-docs-region":`sidebar`,className:`hidden w-full shrink-0 lg:block lg:w-72 lg:self-start lg:sticky lg:top-24`,children:(0,g.jsx)(p.DocsRailScroll,{children:(0,g.jsx)(x,{LinkComponent:R,nodes:k})})}),(0,g.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col gap-10`,children:[(0,g.jsxs)(`div`,{"data-docs-region":`article-content`,"data-pagefind-body":``,className:`flex flex-col gap-10`,children:[(0,g.jsx)(`div`,{hidden:!0,children:B.map(e=>(0,g.jsx)(`span`,{"data-pagefind-filter":e},e))}),(0,g.jsxs)(`header`,{"data-docs-region":`article-header`,className:`flex flex-col gap-3 border-b border-border/60 pb-6`,children:[(0,g.jsx)(`h1`,{className:`text-balance text-3xl font-semibold tracking-tight text-foreground`,children:h.title}),h.description?(0,g.jsx)(`p`,{className:`max-w-3xl text-pretty text-muted-foreground`,children:h.description}):null]}),(0,g.jsx)(`article`,{"data-docs-region":`article-body`,className:`prose prose-neutral max-w-none dark:prose-invert`,children:e})]}),(0,g.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:[A.previous?(0,g.jsxs)(R,{href:A.previous.href,className:`text-muted-foreground`,children:[`Previous: `,A.previous.title]}):(0,g.jsx)(`span`,{}),A.next?(0,g.jsxs)(R,{href:A.next.href,className:`text-muted-foreground`,children:[`Next: `,A.next.title]}):null]})]}),(0,g.jsx)(l.DefaultDocsToc,{headings:N,...P})]}),(0,g.jsx)(z,{description:f.getFooterDescription(y,h),homeHref:F,LinkComponent:R,navigation:j,siteTitle:f.getSiteTitle(y)})]})};exports.DefaultDocsShell=C;
@@ -1,6 +1,6 @@
1
1
 
2
- import { DocsConfig, NormalizedDocsConfig } from "../../config/types.mjs";
3
2
  import { DocEntry, DocsSource } from "../../source/types.mjs";
3
+ import { DocsConfig, NormalizedDocsConfig } from "../../config/types.mjs";
4
4
  import React from "react";
5
5
  import { HeadingItem } from "@blackwork/machine";
6
6
 
@@ -1,6 +1,6 @@
1
1
 
2
- import { DocsConfig, NormalizedDocsConfig } from "../../config/types.js";
3
2
  import { DocEntry, DocsSource } from "../../source/types.js";
3
+ import { DocsConfig, NormalizedDocsConfig } from "../../config/types.js";
4
4
  import React from "react";
5
5
  import { HeadingItem } from "@blackwork/machine";
6
6
 
@@ -1,9 +1,9 @@
1
1
  /**
2
2
  * name: @blackwork/docs
3
- * version: v0.1.0
3
+ * version: v0.3.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{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};
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{DefaultDocsToc as l,MobileDocsToc as u}from"./docs-toc.mjs";import{resolveThemeSlots as d}from"../slots.mjs";import{DocsScrollToTop as f}from"./docs-scroll-to-top.mjs";import{getEntrySectionConfig as p,getEntrySectionKey as m,getFooterDescription as h,getPagefindFilterEntries as g,getPagefindFilters as _,getSectionEntries as v,getSiteTitle as y,getTocHeadings as b,getTocLabels as x,toNavigation as S}from"./shell-shared.mjs";import{DocsRailScroll as C}from"./docs-rail-scroll.mjs";import{Button as w,Sheet as T,SheetContent as E,SheetHeader as D,SheetTitle as O,SheetTrigger as k}from"blackwork";import"react";import{Fragment as A,jsx as j,jsxs as M}from"react/jsx-runtime";import{Menu as N}from"blackwork/icons";const P=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(` `),F=e=>e.isExternal||e.slugSegments.length>0,I=e=>e.flatMap(e=>{if(e.type===`group`){let t=e.items.filter(F);return t.length===0?[]:[{...e,items:t}]}return F(e)?[e]:[]}),L=({LinkComponent:e,nodes:t})=>j(`nav`,{"aria-label":`Documentation pages`,className:`flex flex-col gap-1`,children:t.map(t=>t.type===`group`?M(`div`,{className:`flex flex-col gap-1 pt-4 first:pt-0`,children:[j(`p`,{className:`px-3 text-xs font-medium uppercase tracking-[0.08em] text-muted-foreground/80`,children:t.title}),t.items.map(t=>j(e,{href:t.href,"aria-current":t.isActive?`page`:void 0,"data-current-page":t.isActive?`true`:void 0,className:P(t.isActive),style:{paddingLeft:`${.75+t.depth*.75}rem`},children:t.title},t.href))]},t.title):j(e,{href:t.href,"aria-current":t.isActive?`page`:void 0,"data-current-page":t.isActive?`true`:void 0,className:P(t.isActive),style:{paddingLeft:`${.75+t.depth*.75}rem`},children:t.title},t.href))}),R=({currentTitle:e,LinkComponent:t,nodes:n})=>n.length===0?null:j(`div`,{className:`lg:hidden`,children:M(T,{children:[j(k,{asChild:!0,children:M(w,{type:`button`,variant:`outline`,"aria-label":`Open section navigation`,className:`h-auto w-full justify-start gap-3 rounded-lg px-4 py-3`,children:[j(N,{className:`size-4 shrink-0`,"aria-hidden":`true`}),M(`span`,{className:`flex min-w-0 flex-1 flex-col items-start text-left`,children:[j(`span`,{className:`text-xs text-muted-foreground`,children:`Sections`}),j(`span`,{className:`truncate text-sm font-medium text-foreground`,children:e})]})]})}),M(E,{side:`left`,className:`flex h-dvh flex-col gap-0 p-0 sm:max-w-sm`,children:[j(D,{className:`border-b border-border/60 px-6 pb-4 pt-[calc(env(safe-area-inset-top)+1.5rem)] text-left`,children:j(O,{children:`Sections`})}),j(`div`,{className:`min-h-0 flex-1 overflow-auto px-6 pb-[calc(env(safe-area-inset-bottom)+1.5rem)] pt-4`,children:j(L,{LinkComponent:t,nodes:n})})]})]})}),z=({children:w,config:T,entry:E,headings:D=[],source:O})=>{let k=e(T),N=O.getEntries(E.locale),P=m(E),F=p(k,E),z=Array.isArray(F.sidebar),B=v(N,E),V=r({config:k,entries:N,currentHref:E.href,sectionKey:P}),H=I(V),U=i({entries:B,currentHref:E.href,...z?{sidebar:V}:{}}),W=S(E,z?n(V):a({entries:N,currentHref:E.href})),G=t({config:k,entry:E,source:O}),K=b(D),q=x(k,E.locale),J=O.getCanonicalHref(E.locale,[]),Y=d(k.slots),X=Y.headerActions,Z=Y.link??o,Q=Y.footer??s,$=g(_({layout:F.layout,locale:E.locale,section:P}));return M(A,{children:[j(c,{headerActions:X?j(X,{homeHref:J,localeLinks:G,navigation:W,siteDescription:k.site.description,siteTitle:y(k)}):void 0,homeHref:J,LinkComponent:Z,localeLinks:G,navigation:W,siteDescription:k.site.description,siteTitle:y(k)}),j(f,{}),j(u,{headings:K,...q}),M(`main`,{"data-docs-region":`docs-shell`,className:`mx-auto flex w-full max-w-screen-2xl flex-col gap-6 px-6 py-8 sm:gap-8 sm:px-8 lg:flex-row lg:gap-14 xl:gap-20 xl:px-10 2xl:gap-24 2xl:px-12`,children:[j(R,{currentTitle:E.title,LinkComponent:Z,nodes:H}),j(`aside`,{"data-docs-region":`sidebar`,className:`hidden w-full shrink-0 lg:block lg:w-72 lg:self-start lg:sticky lg:top-24`,children:j(C,{children:j(L,{LinkComponent:Z,nodes:H})})}),M(`div`,{className:`flex min-w-0 flex-1 flex-col gap-10`,children:[M(`div`,{"data-docs-region":`article-content`,"data-pagefind-body":``,className:`flex flex-col gap-10`,children:[j(`div`,{hidden:!0,children:$.map(e=>j(`span`,{"data-pagefind-filter":e},e))}),M(`header`,{"data-docs-region":`article-header`,className:`flex flex-col gap-3 border-b border-border/60 pb-6`,children:[j(`h1`,{className:`text-balance text-3xl font-semibold tracking-tight text-foreground`,children:E.title}),E.description?j(`p`,{className:`max-w-3xl text-pretty text-muted-foreground`,children:E.description}):null]}),j(`article`,{"data-docs-region":`article-body`,className:`prose prose-neutral max-w-none dark:prose-invert`,children:w})]}),M(`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:[U.previous?M(Z,{href:U.previous.href,className:`text-muted-foreground`,children:[`Previous: `,U.previous.title]}):j(`span`,{}),U.next?M(Z,{href:U.next.href,className:`text-muted-foreground`,children:[`Next: `,U.next.title]}):null]})]}),j(l,{headings:K,...q})]}),j(Q,{description:h(k,E),homeHref:J,LinkComponent:Z,navigation:W,siteTitle:y(k)})]})};export{z as DefaultDocsShell};
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * name: @blackwork/docs
3
- * version: v0.1.0
3
+ * version: v0.3.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.3.0
4
4
  * description: Next-first documentation framework for Blackwork projects.
5
5
  * author: chengpeiquan <chengpeiquan@chengpeiquan.com>
6
6
  * homepage: https://chengpeiquan.com