@sleetch/react 1.0.4 → 1.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/button.css +1 -1
- package/dist/assets/content.css +1 -1
- package/dist/assets/content2.css +1 -1
- package/dist/assets/content3.css +1 -1
- package/dist/assets/file-system.css +1 -1
- package/dist/assets/header.css +1 -1
- package/dist/assets/layout.css +1 -1
- package/dist/assets/navigation.css +1 -1
- package/dist/assets/sidebar.css +1 -1
- package/dist/assets/toc.css +1 -1
- package/dist/{button-B1pw1TFm.js → button-BVRKTAnQ.js} +8 -4
- package/dist/button-BVRKTAnQ.js.map +1 -0
- package/dist/button-rojnIyoM.cjs +2 -0
- package/dist/button-rojnIyoM.cjs.map +1 -0
- package/dist/{clsx-CeX9s6vy.js → clsx-CaAiuA5w.js} +7 -5
- package/dist/{clsx-CeX9s6vy.js.map → clsx-CaAiuA5w.js.map} +1 -1
- package/dist/clsx-GLXUd3yb.cjs +2 -0
- package/dist/{clsx-CPcBvw4Z.cjs.map → clsx-GLXUd3yb.cjs.map} +1 -1
- package/dist/components/button.cjs.js +1 -1
- package/dist/components/button.d.ts +1 -1
- package/dist/components/button.es.js +2 -0
- package/dist/components/documentation/content.cjs.js +1 -1
- package/dist/components/documentation/content.es.js +2 -0
- package/dist/components/documentation/header.cjs.js +1 -1
- package/dist/components/documentation/header.es.js +2 -0
- package/dist/components/documentation/layout.cjs.js +1 -1
- package/dist/components/documentation/layout.d.ts +0 -7
- package/dist/components/documentation/layout.es.js +2 -0
- package/dist/components/documentation/page/content.cjs.js +1 -1
- package/dist/components/documentation/page/content.es.js +2 -0
- package/dist/components/documentation/page/header.cjs.js +1 -1
- package/dist/components/documentation/page/header.cjs.js.map +1 -1
- package/dist/components/documentation/page/header.d.ts +1 -1
- package/dist/components/documentation/page/{header.esm.js → header.es.js} +3 -3
- package/dist/components/documentation/page/header.es.js.map +1 -0
- package/dist/components/documentation/page/navigation.cjs.js +1 -1
- package/dist/components/documentation/page/navigation.d.ts +1 -5
- package/dist/components/documentation/page/navigation.es.js +3 -0
- package/dist/components/documentation/sidebar/content.cjs.js +1 -1
- package/dist/components/documentation/sidebar/content.es.js +2 -0
- package/dist/components/documentation/sidebar/index.cjs.js +1 -1
- package/dist/components/documentation/sidebar/index.d.ts +2 -9
- package/dist/components/documentation/sidebar/index.es.js +3 -0
- package/dist/components/documentation/toc/content.cjs.js +1 -1
- package/dist/components/documentation/toc/content.es.js +2 -0
- package/dist/components/documentation/toc/index.cjs.js +1 -1
- package/dist/components/documentation/toc/index.es.js +2 -0
- package/dist/components/file-system.cjs.js +1 -1
- package/dist/components/file-system.es.js +2 -0
- package/dist/{content-CePPkmqw.cjs → content-CQ5PQ1-Z.cjs} +2 -2
- package/dist/content-CQ5PQ1-Z.cjs.map +1 -0
- package/dist/{content-mbVWCXX0.js → content-CoLxuTJs.js} +3 -3
- package/dist/content-CoLxuTJs.js.map +1 -0
- package/dist/{content-D_P9xOgL.cjs → content-DOo3vcgG.cjs} +2 -2
- package/dist/content-DOo3vcgG.cjs.map +1 -0
- package/dist/content-DsE39ENV.cjs +2 -0
- package/dist/content-DsE39ENV.cjs.map +1 -0
- package/dist/{content-x_2bnG7q.js → content-DvLxAJYd.js} +3 -3
- package/dist/content-DvLxAJYd.js.map +1 -0
- package/dist/content-KDKeEwv-.cjs +2 -0
- package/dist/content-KDKeEwv-.cjs.map +1 -0
- package/dist/{content-CRXZ7aLX.js → content-Wo136UBd.js} +3 -3
- package/dist/content-Wo136UBd.js.map +1 -0
- package/dist/{content-DusAp8Q6.js → content-xKdbA544.js} +11 -6
- package/dist/content-xKdbA544.js.map +1 -0
- package/dist/contexts/documentation.cjs.js +2 -0
- package/dist/contexts/documentation.cjs.js.map +1 -0
- package/dist/contexts/documentation.d.ts +30 -0
- package/dist/contexts/documentation.es.js +32 -0
- package/dist/contexts/documentation.es.js.map +1 -0
- package/dist/{file-system-BtXBcLmT.js → file-system-CMsswKsJ.js} +12 -12
- package/dist/file-system-CMsswKsJ.js.map +1 -0
- package/dist/{file-system-Dr4N-WNs.cjs → file-system-Ca6fqwTn.cjs} +2 -2
- package/dist/file-system-Ca6fqwTn.cjs.map +1 -0
- package/dist/{header-DbR9X4YP.cjs → header-D6vF0VLY.cjs} +2 -2
- package/dist/header-D6vF0VLY.cjs.map +1 -0
- package/dist/{header-D59bdlay.js → header-aBbFHuW8.js} +4 -4
- package/dist/header-aBbFHuW8.js.map +1 -0
- package/dist/index.cjs.js +1 -1
- package/dist/index.d.ts +2 -3
- package/dist/index.es.js +15 -0
- package/dist/layout-B9nkyVRH.cjs +2 -0
- package/dist/layout-B9nkyVRH.cjs.map +1 -0
- package/dist/layout-C_NguCrO.js +17 -0
- package/dist/layout-C_NguCrO.js.map +1 -0
- package/dist/navigation-BCpfEaXG.cjs +2 -0
- package/dist/navigation-BCpfEaXG.cjs.map +1 -0
- package/dist/navigation-bIVcotMC.js +139 -0
- package/dist/navigation-bIVcotMC.js.map +1 -0
- package/dist/sidebar-CiheJpEa.cjs +2 -0
- package/dist/sidebar-CiheJpEa.cjs.map +1 -0
- package/dist/sidebar-aXd_UA6s.js +162 -0
- package/dist/sidebar-aXd_UA6s.js.map +1 -0
- package/dist/toc-CI_8-KFH.cjs +2 -0
- package/dist/toc-CI_8-KFH.cjs.map +1 -0
- package/dist/{toc-BuFdWsti.js → toc-Dvn-UEjm.js} +13 -13
- package/dist/toc-Dvn-UEjm.js.map +1 -0
- package/package.json +6 -6
- package/dist/button-B1pw1TFm.js.map +0 -1
- package/dist/button-DWM5D_of.cjs +0 -2
- package/dist/button-DWM5D_of.cjs.map +0 -1
- package/dist/clsx-CPcBvw4Z.cjs +0 -2
- package/dist/components/button.esm.js +0 -2
- package/dist/components/documentation/connected-header.cjs.js +0 -2
- package/dist/components/documentation/connected-header.cjs.js.map +0 -1
- package/dist/components/documentation/connected-header.d.ts +0 -4
- package/dist/components/documentation/connected-header.esm.js +0 -15
- package/dist/components/documentation/connected-header.esm.js.map +0 -1
- package/dist/components/documentation/connected-sidebar.cjs.js +0 -2
- package/dist/components/documentation/connected-sidebar.cjs.js.map +0 -1
- package/dist/components/documentation/connected-sidebar.d.ts +0 -9
- package/dist/components/documentation/connected-sidebar.esm.js +0 -16
- package/dist/components/documentation/connected-sidebar.esm.js.map +0 -1
- package/dist/components/documentation/content.esm.js +0 -2
- package/dist/components/documentation/header.esm.js +0 -2
- package/dist/components/documentation/layout.esm.js +0 -2
- package/dist/components/documentation/page/content.esm.js +0 -2
- package/dist/components/documentation/page/header.esm.js.map +0 -1
- package/dist/components/documentation/page/navigation.esm.js +0 -2
- package/dist/components/documentation/sidebar/content.esm.js +0 -2
- package/dist/components/documentation/sidebar/index.esm.js +0 -2
- package/dist/components/documentation/toc/content.esm.js +0 -2
- package/dist/components/documentation/toc/index.esm.js +0 -2
- package/dist/components/file-system.esm.js +0 -2
- package/dist/content-CRXZ7aLX.js.map +0 -1
- package/dist/content-CePPkmqw.cjs.map +0 -1
- package/dist/content-D_P9xOgL.cjs.map +0 -1
- package/dist/content-DusAp8Q6.js.map +0 -1
- package/dist/content-_OkOg-pq.cjs +0 -2
- package/dist/content-_OkOg-pq.cjs.map +0 -1
- package/dist/content-mbVWCXX0.js.map +0 -1
- package/dist/content-r8d8MkOf.cjs +0 -2
- package/dist/content-r8d8MkOf.cjs.map +0 -1
- package/dist/content-x_2bnG7q.js.map +0 -1
- package/dist/file-system-BtXBcLmT.js.map +0 -1
- package/dist/file-system-Dr4N-WNs.cjs.map +0 -1
- package/dist/header-D59bdlay.js.map +0 -1
- package/dist/header-DbR9X4YP.cjs.map +0 -1
- package/dist/index.esm.js +0 -16
- package/dist/layout-BRE4zrjG.js +0 -29
- package/dist/layout-BRE4zrjG.js.map +0 -1
- package/dist/layout-D6mjobyq.cjs +0 -2
- package/dist/layout-D6mjobyq.cjs.map +0 -1
- package/dist/navigation-BdVu1Uh-.cjs +0 -2
- package/dist/navigation-BdVu1Uh-.cjs.map +0 -1
- package/dist/navigation-kP1-q7Ux.js +0 -141
- package/dist/navigation-kP1-q7Ux.js.map +0 -1
- package/dist/sidebar-DGEZFbBi.cjs +0 -2
- package/dist/sidebar-DGEZFbBi.cjs.map +0 -1
- package/dist/sidebar-DgVlWEfQ.js +0 -168
- package/dist/sidebar-DgVlWEfQ.js.map +0 -1
- package/dist/toc-BuFdWsti.js.map +0 -1
- package/dist/toc-CMwm46RH.cjs +0 -2
- package/dist/toc-CMwm46RH.cjs.map +0 -1
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { BaseHTMLAttributes, ReactNode } from 'react';
|
|
2
|
-
import { tree_object } from 'packages/core/dist/compiler';
|
|
3
|
-
export interface ConnectedDocumentationSidebarProps extends BaseHTMLAttributes<HTMLBaseElement> {
|
|
4
|
-
tree: tree_object[];
|
|
5
|
-
currentPath?: string;
|
|
6
|
-
hrefBuilder?: (path: string) => string;
|
|
7
|
-
iconResolver?: (icon?: string) => ReactNode;
|
|
8
|
-
}
|
|
9
|
-
export declare function ConnectedDocumentationSidebar(props: ConnectedDocumentationSidebarProps): import("react").JSX.Element;
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { t as e } from "../../sidebar-DgVlWEfQ.js";
|
|
2
|
-
import { n as t } from "../../layout-BRE4zrjG.js";
|
|
3
|
-
import { jsx as n } from "react/jsx-runtime";
|
|
4
|
-
//#region src/components/documentation/connected-sidebar.tsx
|
|
5
|
-
function r(r) {
|
|
6
|
-
let { isSidebarOpen: i, closeSidebar: a } = t();
|
|
7
|
-
return /* @__PURE__ */ n(e, {
|
|
8
|
-
isOpen: i,
|
|
9
|
-
onClose: a,
|
|
10
|
-
...r
|
|
11
|
-
});
|
|
12
|
-
}
|
|
13
|
-
//#endregion
|
|
14
|
-
export { r as ConnectedDocumentationSidebar };
|
|
15
|
-
|
|
16
|
-
//# sourceMappingURL=connected-sidebar.esm.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"connected-sidebar.esm.js","names":[],"sources":["../../../src/components/documentation/connected-sidebar.tsx"],"sourcesContent":["import type { BaseHTMLAttributes, ReactNode } from 'react';\nimport { DocumentationSidebar } from './sidebar';\nimport { useDocumentationLayout } from './layout';\nimport type { tree_object } from 'packages/core/dist/compiler';\n\nexport interface ConnectedDocumentationSidebarProps extends BaseHTMLAttributes<HTMLBaseElement> {\n tree: tree_object[];\n currentPath?: string;\n hrefBuilder?: (path: string) => string;\n iconResolver?: (icon?: string) => ReactNode;\n}\n\nexport function ConnectedDocumentationSidebar(props: ConnectedDocumentationSidebarProps) {\n const { isSidebarOpen, closeSidebar } = useDocumentationLayout();\n\n return <DocumentationSidebar isOpen={isSidebarOpen} onClose={closeSidebar} {...props} />;\n}\n"],"mappings":";;;;AAYA,SAAgB,EAA8B,GAA2C;CACvF,IAAM,EAAE,kBAAe,oBAAiB,EAAuB;CAE/D,OAAO,kBAAC,GAAD;EAAsB,QAAQ;EAAe,SAAS;EAAc,GAAI;CAAQ,CAAA;AACzF"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"header.esm.js","names":[],"sources":["../../../../src/components/documentation/page/header.tsx"],"sourcesContent":["import { use, type BaseHTMLAttributes } from 'react';\n//import styles from '@sleetch/styles/components/Page/header.module.css';\nimport clsx from 'clsx';\nimport { Button } from '../../button';\nimport type { markdown_module } from 'packages/core/dist/compiler';\n\nexport interface PageHeaderProps extends BaseHTMLAttributes<HTMLDivElement> {\n page: Promise<markdown_module>;\n}\n\nexport function PageHeader({ page, className, children, ...props }: PageHeaderProps) {\n const value = use(page);\n return (\n <div className={clsx(/*styles['default'],*/ className, 'sleetch-markdown')} {...props}>\n <h1>{value.default.frontmatter.title}</h1>\n <p>{value.default.frontmatter.description}</p>\n <div style={{ gap: '15px', display: 'flex' }}>\n <Button variant=\"secondary\">View as markdown</Button>\n <Button>Copy for LLM</Button>\n </div>\n <hr />\n </div>\n );\n}\n"],"mappings":";;;;;AAUA,SAAgB,EAAW,EAAE,SAAM,cAAW,aAAU,GAAG,KAA0B;CACnF,IAAM,IAAQ,EAAI,CAAI;CACtB,OACE,kBAAC,OAAD;EAAK,WAAW,EAA4B,GAAW,kBAAkB;EAAG,GAAI;YAAhF;GACE,kBAAC,MAAD,EAAA,UAAK,EAAM,QAAQ,YAAY,MAAU,CAAA;GACzC,kBAAC,KAAD,EAAA,UAAI,EAAM,QAAQ,YAAY,YAAe,CAAA;GAC7C,kBAAC,OAAD;IAAK,OAAO;KAAE,KAAK;KAAQ,SAAS;IAAO;cAA3C,CACE,kBAAC,GAAD;KAAQ,SAAQ;eAAY;IAAwB,CAAA,GACpD,kBAAC,GAAD,EAAA,UAAQ,eAAoB,CAAA,CACzB;;GACL,kBAAC,MAAD,CAAK,CAAA;EACF;;AAET"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"content-CRXZ7aLX.js","names":[],"sources":["../../styles/src/components/documentation/toc/content.module.css","../src/components/documentation/toc/content.tsx"],"sourcesContent":["@import '../../../variables.css';\n\n.default {\n color: var(--_sleetch-color-text);\n width: 100%;\n flex: 1;\n padding: 0 2em;\n max-width: 1200px;\n margin: 0 auto;\n}\n\n@media (max-width: 768px) {\n .default {\n padding: 0 1em;\n }\n}\n\n@media (min-width: 769px) and (max-width: 1024px) {\n .default {\n padding: 0 1.5em;\n }\n}\n","import type { BaseHTMLAttributes } from 'react';\nimport styles from '@sleetch/styles/components/documentation/toc/content.module.css';\nimport clsx from 'clsx';\n\nexport interface DocumentationTocContentProps extends BaseHTMLAttributes<HTMLDivElement> {}\n\nexport function DocumentationTocContent({ className, children, ...props }: DocumentationTocContentProps) {\n return (\n <div className={clsx(styles['default'], className)} {...props}>\n {children}\n </div>\n );\n}\n"],"mappings":";;;;;;ACMA,SAAgB,EAAwB,EAAE,cAAW,aAAU,GAAG,KAAuC;CACvG,OACE,kBAAC,OAAD;EAAK,WAAW,EAAK,EAAO,SAAY,CAAS;EAAG,GAAI;EACrD;CACE,CAAA;AAET"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"content-CePPkmqw.cjs","names":[],"sources":["../../styles/src/components/documentation/sidebar/content.module.css","../src/components/documentation/sidebar/content.tsx"],"sourcesContent":["@import '../../../variables.css';\n\n.default {\n color: var(--_sleetch-color-text);\n width: 100%;\n flex: 1;\n padding: 0 2em;\n max-width: 1200px;\n margin: 0 auto;\n}\n\n@media (max-width: 768px) {\n .default {\n padding: 0 1em;\n }\n}\n\n@media (min-width: 769px) and (max-width: 1024px) {\n .default {\n padding: 0 1.5em;\n }\n}\n","import type { BaseHTMLAttributes } from 'react';\nimport styles from '@sleetch/styles/components/documentation/sidebar/content.module.css';\nimport clsx from 'clsx';\n\nexport interface DocumentationSidebarContentProps extends BaseHTMLAttributes<HTMLDivElement> {}\n\nexport function DocumentationSidebarContent({ className, children, ...props }: DocumentationSidebarContentProps) {\n return (\n <div className={clsx(styles['default'], className)} {...props}>\n {children}\n </div>\n );\n}\n"],"mappings":"6GCMA,SAAgB,EAA4B,CAAE,YAAW,WAAU,GAAG,GAA2C,CAC/G,OACE,EAAA,EAAA,IAAA,CAAC,MAAD,CAAK,UAAW,EAAA,EAAK,EAAO,QAAY,CAAS,EAAG,GAAI,EACrD,UACE,CAAA,CAET"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"content-D_P9xOgL.cjs","names":[],"sources":["../../styles/src/components/documentation/toc/content.module.css","../src/components/documentation/toc/content.tsx"],"sourcesContent":["@import '../../../variables.css';\n\n.default {\n color: var(--_sleetch-color-text);\n width: 100%;\n flex: 1;\n padding: 0 2em;\n max-width: 1200px;\n margin: 0 auto;\n}\n\n@media (max-width: 768px) {\n .default {\n padding: 0 1em;\n }\n}\n\n@media (min-width: 769px) and (max-width: 1024px) {\n .default {\n padding: 0 1.5em;\n }\n}\n","import type { BaseHTMLAttributes } from 'react';\nimport styles from '@sleetch/styles/components/documentation/toc/content.module.css';\nimport clsx from 'clsx';\n\nexport interface DocumentationTocContentProps extends BaseHTMLAttributes<HTMLDivElement> {}\n\nexport function DocumentationTocContent({ className, children, ...props }: DocumentationTocContentProps) {\n return (\n <div className={clsx(styles['default'], className)} {...props}>\n {children}\n </div>\n );\n}\n"],"mappings":"6GCMA,SAAgB,EAAwB,CAAE,YAAW,WAAU,GAAG,GAAuC,CACvG,OACE,EAAA,EAAA,IAAA,CAAC,MAAD,CAAK,UAAW,EAAA,EAAK,EAAO,QAAY,CAAS,EAAG,GAAI,EACrD,UACE,CAAA,CAET"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"content-DusAp8Q6.js","names":[],"sources":["../../../node_modules/.bun/@mdx-js+mdx@3.1.1/node_modules/@mdx-js/mdx/lib/run.js","../src/components/documentation/page/content.tsx"],"sourcesContent":["/**\n * @import {MDXModule} from 'mdx/types.js'\n * @import {RunOptions} from './util/resolve-evaluate-options.js'\n */\n\n/** @type {new (code: string, ...args: Array<unknown>) => Function} **/\nconst AsyncFunction = Object.getPrototypeOf(run).constructor\n\n/**\n * Run code compiled with `outputFormat: 'function-body'`.\n *\n * > ☢️ **Danger**: this `eval`s JavaScript.\n *\n * @param {{toString(): string}} code\n * JavaScript function body to run.\n * @param {RunOptions} options\n * Configuration (**required**).\n * @return {Promise<MDXModule>}\n * Promise to a module;\n * the result is an object with a `default` field set to the component;\n * anything else that was exported is available too.\n */\nexport async function run(code, options) {\n return new AsyncFunction(String(code))(options)\n}\n\n/**\n * Run code, synchronously.\n *\n * When possible please use the async `run`.\n *\n * > ☢️ **Danger**: this `eval`s JavaScript.\n *\n * @param {{toString(): string}} code\n * JavaScript function body to run.\n * @param {RunOptions} options\n * Configuration (**required**).\n * @return {MDXModule}\n * Module.\n */\nexport function runSync(code, options) {\n // eslint-disable-next-line no-new-func\n return new Function(String(code))(options)\n}\n","import { use } from 'react';\nimport '@sleetch/styles/markdown.css';\nimport '@sleetch/styles/katex.css';\nimport { run } from '@mdx-js/mdx';\nimport * as runtime from 'react/jsx-runtime';\nimport type { MDXComponents } from 'mdx/types';\nimport type { markdown_module } from '@sleetch/core/compiler';\n\nfunction compileMDX(code: string) {\n return run(code, {\n ...runtime,\n baseUrl: import.meta.url,\n });\n}\n\nexport function PageContent({ page, components }: { page: Promise<markdown_module>; components?: MDXComponents }) {\n const value = use(page);\n\n if (value.default.parsed.type == 'html') {\n return (\n <div className=\"sleetch-markdown\">\n <div dangerouslySetInnerHTML={{ __html: value.default.parsed.html }} />\n </div>\n );\n }\n\n const compiled = use(compileMDX(value.default.parsed.code));\n const Content = compiled.default;\n\n return (\n <div className=\"sleetch-markdown\">\n <Content components={components} />\n </div>\n );\n}\n"],"x_google_ignoreList":[0],"mappings":";;;;AAMA,IAAM,IAAgB,OAAO,eAAe,CAAG,CAAC,CAAC;AAgBjD,eAAsB,EAAI,GAAM,GAAS;CACvC,OAAO,IAAI,EAAc,OAAO,CAAI,CAAC,CAAC,CAAC,CAAO;AAChD;;;AChBA,SAAS,EAAW,GAAc;CAChC,OAAO,EAAI,GAAM;EACf,GAAG;EACH,SAAS,OAAO,KAAK;CACvB,CAAC;AACH;AAEA,SAAgB,EAAY,EAAE,SAAM,iBAA8E;CAChH,IAAM,IAAQ,EAAI,CAAI;CAEtB,IAAI,EAAM,QAAQ,OAAO,QAAQ,QAC/B,OACE,kBAAC,OAAD;EAAK,WAAU;YACb,kBAAC,OAAD,EAAK,yBAAyB,EAAE,QAAQ,EAAM,QAAQ,OAAO,KAAK,EAAI,CAAA;CACnE,CAAA;CAKT,IAAM,IADW,EAAI,EAAW,EAAM,QAAQ,OAAO,IAAI,CACzC,CAAA,CAAS;CAEzB,OACE,kBAAC,OAAD;EAAK,WAAU;YACb,kBAAC,GAAD,EAAqB,cAAa,CAAA;CAC/B,CAAA;AAET"}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
require('./assets/content2.css');const e=require("./clsx-CPcBvw4Z.cjs");let t=require("react/jsx-runtime");var n={default:`_default_1ip00_3`};function r({className:r,children:i,...a}){return(0,t.jsx)(`div`,{className:e.t(n.default,r),...a,children:i})}Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return r}});
|
|
2
|
-
//# sourceMappingURL=content-_OkOg-pq.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"content-_OkOg-pq.cjs","names":[],"sources":["../../styles/src/components/documentation/content.module.css","../src/components/documentation/content.tsx"],"sourcesContent":["@import '../../variables.css';\n\n.default {\n display: flex;\n flex: 1;\n min-height: calc(100vh - var(--_sleetch-header-height));\n}\n\n@media (max-width: 768px) {\n .default {\n flex-direction: column;\n }\n}\n","import type { BaseHTMLAttributes } from 'react';\nimport styles from '@sleetch/styles/components/documentation/content.module.css';\nimport clsx from 'clsx';\n\nexport interface DocumentationContentProps extends BaseHTMLAttributes<HTMLDivElement> {}\n\nexport function DocumentationContent({ className, children, ...props }: DocumentationContentProps) {\n return (\n <div className={clsx(styles['default'], className)} {...props}>\n {children}\n </div>\n );\n}\n"],"mappings":"6GCMA,SAAgB,EAAqB,CAAE,YAAW,WAAU,GAAG,GAAoC,CACjG,OACE,EAAA,EAAA,IAAA,CAAC,MAAD,CAAK,UAAW,EAAA,EAAK,EAAO,QAAY,CAAS,EAAG,GAAI,EACrD,UACE,CAAA,CAET"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"content-mbVWCXX0.js","names":[],"sources":["../../styles/src/components/documentation/content.module.css","../src/components/documentation/content.tsx"],"sourcesContent":["@import '../../variables.css';\n\n.default {\n display: flex;\n flex: 1;\n min-height: calc(100vh - var(--_sleetch-header-height));\n}\n\n@media (max-width: 768px) {\n .default {\n flex-direction: column;\n }\n}\n","import type { BaseHTMLAttributes } from 'react';\nimport styles from '@sleetch/styles/components/documentation/content.module.css';\nimport clsx from 'clsx';\n\nexport interface DocumentationContentProps extends BaseHTMLAttributes<HTMLDivElement> {}\n\nexport function DocumentationContent({ className, children, ...props }: DocumentationContentProps) {\n return (\n <div className={clsx(styles['default'], className)} {...props}>\n {children}\n </div>\n );\n}\n"],"mappings":";;;;;;ACMA,SAAgB,EAAqB,EAAE,cAAW,aAAU,GAAG,KAAoC;CACjG,OACE,kBAAC,OAAD;EAAK,WAAW,EAAK,EAAO,SAAY,CAAS;EAAG,GAAI;EACrD;CACE,CAAA;AAET"}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
require('./assets/content3.css');var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},s=(n,r,a)=>(a=n==null?{}:e(i(n)),o(r||!n||!n.__esModule?t(a,`default`,{value:n,enumerable:!0}):a,n));let c=require("react"),l=require("react/jsx-runtime");l=s(l,1);var u=Object.getPrototypeOf(d).constructor;async function d(e,t){return new u(String(e))(t)}function f(e){return d(e,{...l,baseUrl:{}.url})}function p({page:e,components:t}){let n=(0,c.use)(e);if(n.default.parsed.type==`html`)return(0,l.jsx)(`div`,{className:`sleetch-markdown`,children:(0,l.jsx)(`div`,{dangerouslySetInnerHTML:{__html:n.default.parsed.html}})});let r=(0,c.use)(f(n.default.parsed.code)).default;return(0,l.jsx)(`div`,{className:`sleetch-markdown`,children:(0,l.jsx)(r,{components:t})})}Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return p}});
|
|
2
|
-
//# sourceMappingURL=content-r8d8MkOf.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"content-r8d8MkOf.cjs","names":[],"sources":["../../../node_modules/.bun/@mdx-js+mdx@3.1.1/node_modules/@mdx-js/mdx/lib/run.js","../src/components/documentation/page/content.tsx"],"sourcesContent":["/**\n * @import {MDXModule} from 'mdx/types.js'\n * @import {RunOptions} from './util/resolve-evaluate-options.js'\n */\n\n/** @type {new (code: string, ...args: Array<unknown>) => Function} **/\nconst AsyncFunction = Object.getPrototypeOf(run).constructor\n\n/**\n * Run code compiled with `outputFormat: 'function-body'`.\n *\n * > ☢️ **Danger**: this `eval`s JavaScript.\n *\n * @param {{toString(): string}} code\n * JavaScript function body to run.\n * @param {RunOptions} options\n * Configuration (**required**).\n * @return {Promise<MDXModule>}\n * Promise to a module;\n * the result is an object with a `default` field set to the component;\n * anything else that was exported is available too.\n */\nexport async function run(code, options) {\n return new AsyncFunction(String(code))(options)\n}\n\n/**\n * Run code, synchronously.\n *\n * When possible please use the async `run`.\n *\n * > ☢️ **Danger**: this `eval`s JavaScript.\n *\n * @param {{toString(): string}} code\n * JavaScript function body to run.\n * @param {RunOptions} options\n * Configuration (**required**).\n * @return {MDXModule}\n * Module.\n */\nexport function runSync(code, options) {\n // eslint-disable-next-line no-new-func\n return new Function(String(code))(options)\n}\n","import { use } from 'react';\nimport '@sleetch/styles/markdown.css';\nimport '@sleetch/styles/katex.css';\nimport { run } from '@mdx-js/mdx';\nimport * as runtime from 'react/jsx-runtime';\nimport type { MDXComponents } from 'mdx/types';\nimport type { markdown_module } from '@sleetch/core/compiler';\n\nfunction compileMDX(code: string) {\n return run(code, {\n ...runtime,\n baseUrl: import.meta.url,\n });\n}\n\nexport function PageContent({ page, components }: { page: Promise<markdown_module>; components?: MDXComponents }) {\n const value = use(page);\n\n if (value.default.parsed.type == 'html') {\n return (\n <div className=\"sleetch-markdown\">\n <div dangerouslySetInnerHTML={{ __html: value.default.parsed.html }} />\n </div>\n );\n }\n\n const compiled = use(compileMDX(value.default.parsed.code));\n const Content = compiled.default;\n\n return (\n <div className=\"sleetch-markdown\">\n <Content components={components} />\n </div>\n );\n}\n"],"x_google_ignoreList":[0],"mappings":"6hBAMA,IAAM,EAAgB,OAAO,eAAe,CAAG,CAAC,CAAC,YAgBjD,eAAsB,EAAI,EAAM,EAAS,CACvC,OAAO,IAAI,EAAc,OAAO,CAAI,CAAC,CAAC,CAAC,CAAO,CAChD,CChBA,SAAS,EAAW,EAAc,CAChC,OAAO,EAAI,EAAM,CACf,GAAG,EACH,QAAA,CAAA,EAAqB,GACvB,CAAC,CACH,CAEA,SAAgB,EAAY,CAAE,OAAM,cAA8E,CAChH,IAAM,GAAA,EAAA,EAAA,IAAA,CAAY,CAAI,EAEtB,GAAI,EAAM,QAAQ,OAAO,MAAQ,OAC/B,OACE,EAAA,EAAA,IAAA,CAAC,MAAD,CAAK,UAAU,6BACb,EAAA,EAAA,IAAA,CAAC,MAAD,CAAK,wBAAyB,CAAE,OAAQ,EAAM,QAAQ,OAAO,IAAK,CAAI,CAAA,CACnE,CAAA,EAKT,IAAM,GAAA,EAAA,EAAA,IAAA,CADe,EAAW,EAAM,QAAQ,OAAO,IAAI,CACzC,CAAA,CAAS,QAEzB,OACE,EAAA,EAAA,IAAA,CAAC,MAAD,CAAK,UAAU,6BACb,EAAA,EAAA,IAAA,CAAC,EAAD,CAAqB,YAAa,CAAA,CAC/B,CAAA,CAET"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"content-x_2bnG7q.js","names":[],"sources":["../../styles/src/components/documentation/sidebar/content.module.css","../src/components/documentation/sidebar/content.tsx"],"sourcesContent":["@import '../../../variables.css';\n\n.default {\n color: var(--_sleetch-color-text);\n width: 100%;\n flex: 1;\n padding: 0 2em;\n max-width: 1200px;\n margin: 0 auto;\n}\n\n@media (max-width: 768px) {\n .default {\n padding: 0 1em;\n }\n}\n\n@media (min-width: 769px) and (max-width: 1024px) {\n .default {\n padding: 0 1.5em;\n }\n}\n","import type { BaseHTMLAttributes } from 'react';\nimport styles from '@sleetch/styles/components/documentation/sidebar/content.module.css';\nimport clsx from 'clsx';\n\nexport interface DocumentationSidebarContentProps extends BaseHTMLAttributes<HTMLDivElement> {}\n\nexport function DocumentationSidebarContent({ className, children, ...props }: DocumentationSidebarContentProps) {\n return (\n <div className={clsx(styles['default'], className)} {...props}>\n {children}\n </div>\n );\n}\n"],"mappings":";;;;;;ACMA,SAAgB,EAA4B,EAAE,cAAW,aAAU,GAAG,KAA2C;CAC/G,OACE,kBAAC,OAAD;EAAK,WAAW,EAAK,EAAO,SAAY,CAAS;EAAG,GAAI;EACrD;CACE,CAAA;AAET"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"file-system-BtXBcLmT.js","names":[],"sources":["../../styles/src/components/file-system.module.css","../src/components/file-system.tsx"],"sourcesContent":[".file-system {\n display: flex;\n flex-direction: column;\n gap: 0.15em;\n color: var(--_sleetch-color-text);\n font-family: var(--_sleetch-font-base);\n font-size: var(--_sleetch-font-size-small);\n line-height: var(--_sleetch-line-height);\n padding: 0.85em;\n background: var(--_sleetch-color-card);\n border-radius: var(--_sleetch-radius);\n border: var(--_sleetch-hr-height) solid var(--_sleetch-color-muted);\n margin: 0 0 1em;\n}\n\n.folder {\n display: flex;\n flex-direction: column;\n}\n\n.folder.hidden {\n opacity: 0.5;\n}\n\n.row {\n display: flex;\n align-items: center;\n gap: 0.55em;\n padding: 0.4em 0.6em;\n border-radius: calc(var(--_sleetch-radius) - 2px);\n transition:\n background-color var(--_sleetch-transition-duration) var(--_sleetch-transition-timing),\n color var(--_sleetch-transition-duration) var(--_sleetch-transition-timing);\n}\n\n.folderRow {\n color: var(--_sleetch-color-muted-foreground);\n}\n\n.icon {\n flex-shrink: 0;\n color: currentColor;\n}\n\n.label {\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n\n.comment {\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n color: var(--_sleetch-color-muted-foreground);\n font-style: italic;\n}\n\n.children {\n display: flex;\n flex-direction: column;\n gap: 0.15em;\n margin-left: 0.75em;\n padding-left: 0.65em;\n border-left: var(--_sleetch-underline-height) solid var(--_sleetch-color-muted);\n}\n\n.file {\n color: var(--_sleetch-color-text);\n cursor: default;\n}\n\n.file:hover {\n background: var(--_sleetch-color-muted);\n}\n\n.file.selected {\n color: var(--_sleetch-color-text-primary);\n background: color-mix(in srgb, var(--_sleetch-color-text-primary) 12%, transparent);\n}\n\n.file.selected:hover {\n background: color-mix(in srgb, var(--_sleetch-color-text-primary) 18%, transparent);\n}\n","import styles from '@sleetch/styles/components/file-system.module.css';\nimport type { ReactNode, SVGProps } from 'react';\n\ninterface IconProps extends SVGProps<SVGSVGElement> {\n className?: string;\n}\n\nfunction FolderIcon({ className, ...props }: IconProps) {\n return (\n <svg\n className={className}\n width=\"16\"\n height=\"16\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"1.75\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n aria-hidden=\"true\"\n {...props}\n >\n <path d=\"M3 7a2 2 0 0 1 2-2h4l2 2h8a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V7Z\" />\n </svg>\n );\n}\n\nfunction FileIcon({ className, ...props }: IconProps) {\n return (\n <svg\n className={className}\n width=\"16\"\n height=\"16\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"1.75\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n aria-hidden=\"true\"\n {...props}\n >\n <path d=\"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8Z\" />\n <path d=\"M14 2v6h6\" />\n </svg>\n );\n}\n\nexport interface FilesProps {\n children?: ReactNode;\n className?: string;\n}\n\nexport function FileSystem({ children, className = '' }: FilesProps) {\n return (\n <div className=\"no-sleetch-markdown\">\n <div className={[styles['file-system'], className].filter(Boolean).join(' ')}>{children}</div>\n </div>\n );\n}\n\nexport interface FolderProps {\n name: string;\n children?: ReactNode;\n hidden?: boolean;\n className?: string;\n}\n\nexport function Folder({ name, children, hidden = false, className = '' }: FolderProps) {\n return (\n <div className={[styles.folder, hidden && styles.hidden, className].filter(Boolean).join(' ')}>\n <div className={[styles.row, styles.folderRow].join(' ')}>\n <FolderIcon className={styles.icon} />\n <span className={styles.label}>{name}</span>\n </div>\n {children && <div className={styles.children}>{children}</div>}\n </div>\n );\n}\n\nexport interface FileProps {\n name: string;\n comment?: string;\n selected?: boolean;\n className?: string;\n}\n\nexport function File({ name, comment, selected = false, className = '' }: FileProps) {\n return (\n <div className={[styles.row, styles.file, selected && styles.selected, className].filter(Boolean).join(' ')}>\n <FileIcon className={styles.icon} />\n <span className={styles.label}>{name}</span>\n <span className={styles.comment}>{comment}</span>\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;ACOA,SAAS,EAAW,EAAE,cAAW,GAAG,KAAoB;CACtD,OACE,kBAAC,OAAD;EACa;EACX,OAAM;EACN,QAAO;EACP,SAAQ;EACR,MAAK;EACL,QAAO;EACP,aAAY;EACZ,eAAc;EACd,gBAAe;EACf,eAAY;EACZ,GAAI;YAEJ,kBAAC,QAAD,EAAM,GAAE,8EAA+E,CAAA;CACpF,CAAA;AAET;AAEA,SAAS,EAAS,EAAE,cAAW,GAAG,KAAoB;CACpD,OACE,kBAAC,OAAD;EACa;EACX,OAAM;EACN,QAAO;EACP,SAAQ;EACR,MAAK;EACL,QAAO;EACP,aAAY;EACZ,eAAc;EACd,gBAAe;EACf,eAAY;EACZ,GAAI;YAXN,CAaE,kBAAC,QAAD,EAAM,GAAE,6DAA8D,CAAA,GACtE,kBAAC,QAAD,EAAM,GAAE,YAAa,CAAA,CAClB;;AAET;AAOA,SAAgB,EAAW,EAAE,aAAU,eAAY,MAAkB;CACnE,OACE,kBAAC,OAAD;EAAK,WAAU;YACb,kBAAC,OAAD;GAAK,WAAW,CAAC,EAAO,gBAAgB,CAAS,CAAC,CAAC,OAAO,OAAO,CAAC,CAAC,KAAK,GAAG;GAAI;EAAc,CAAA;CAC1F,CAAA;AAET;AASA,SAAgB,EAAO,EAAE,SAAM,aAAU,YAAS,IAAO,eAAY,MAAmB;CACtF,OACE,kBAAC,OAAD;EAAK,WAAW;GAAC,EAAO;GAAQ,KAAU,EAAO;GAAQ;EAAS,CAAC,CAAC,OAAO,OAAO,CAAC,CAAC,KAAK,GAAG;YAA5F,CACE,kBAAC,OAAD;GAAK,WAAW,CAAC,EAAO,KAAK,EAAO,SAAS,CAAC,CAAC,KAAK,GAAG;aAAvD,CACE,kBAAC,GAAD,EAAY,WAAW,EAAO,KAAO,CAAA,GACrC,kBAAC,QAAD;IAAM,WAAW,EAAO;cAAQ;GAAW,CAAA,CACxC;MACJ,KAAY,kBAAC,OAAD;GAAK,WAAW,EAAO;GAAW;EAAc,CAAA,CAC1D;;AAET;AASA,SAAgB,EAAK,EAAE,SAAM,YAAS,cAAW,IAAO,eAAY,MAAiB;CACnF,OACE,kBAAC,OAAD;EAAK,WAAW;GAAC,EAAO;GAAK,EAAO;GAAM,KAAY,EAAO;GAAU;EAAS,CAAC,CAAC,OAAO,OAAO,CAAC,CAAC,KAAK,GAAG;YAA1G;GACE,kBAAC,GAAD,EAAU,WAAW,EAAO,KAAO,CAAA;GACnC,kBAAC,QAAD;IAAM,WAAW,EAAO;cAAQ;GAAW,CAAA;GAC3C,kBAAC,QAAD;IAAM,WAAW,EAAO;cAAU;GAAc,CAAA;EAC7C;;AAET"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"file-system-Dr4N-WNs.cjs","names":[],"sources":["../../styles/src/components/file-system.module.css","../src/components/file-system.tsx"],"sourcesContent":[".file-system {\n display: flex;\n flex-direction: column;\n gap: 0.15em;\n color: var(--_sleetch-color-text);\n font-family: var(--_sleetch-font-base);\n font-size: var(--_sleetch-font-size-small);\n line-height: var(--_sleetch-line-height);\n padding: 0.85em;\n background: var(--_sleetch-color-card);\n border-radius: var(--_sleetch-radius);\n border: var(--_sleetch-hr-height) solid var(--_sleetch-color-muted);\n margin: 0 0 1em;\n}\n\n.folder {\n display: flex;\n flex-direction: column;\n}\n\n.folder.hidden {\n opacity: 0.5;\n}\n\n.row {\n display: flex;\n align-items: center;\n gap: 0.55em;\n padding: 0.4em 0.6em;\n border-radius: calc(var(--_sleetch-radius) - 2px);\n transition:\n background-color var(--_sleetch-transition-duration) var(--_sleetch-transition-timing),\n color var(--_sleetch-transition-duration) var(--_sleetch-transition-timing);\n}\n\n.folderRow {\n color: var(--_sleetch-color-muted-foreground);\n}\n\n.icon {\n flex-shrink: 0;\n color: currentColor;\n}\n\n.label {\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n\n.comment {\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n color: var(--_sleetch-color-muted-foreground);\n font-style: italic;\n}\n\n.children {\n display: flex;\n flex-direction: column;\n gap: 0.15em;\n margin-left: 0.75em;\n padding-left: 0.65em;\n border-left: var(--_sleetch-underline-height) solid var(--_sleetch-color-muted);\n}\n\n.file {\n color: var(--_sleetch-color-text);\n cursor: default;\n}\n\n.file:hover {\n background: var(--_sleetch-color-muted);\n}\n\n.file.selected {\n color: var(--_sleetch-color-text-primary);\n background: color-mix(in srgb, var(--_sleetch-color-text-primary) 12%, transparent);\n}\n\n.file.selected:hover {\n background: color-mix(in srgb, var(--_sleetch-color-text-primary) 18%, transparent);\n}\n","import styles from '@sleetch/styles/components/file-system.module.css';\nimport type { ReactNode, SVGProps } from 'react';\n\ninterface IconProps extends SVGProps<SVGSVGElement> {\n className?: string;\n}\n\nfunction FolderIcon({ className, ...props }: IconProps) {\n return (\n <svg\n className={className}\n width=\"16\"\n height=\"16\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"1.75\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n aria-hidden=\"true\"\n {...props}\n >\n <path d=\"M3 7a2 2 0 0 1 2-2h4l2 2h8a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V7Z\" />\n </svg>\n );\n}\n\nfunction FileIcon({ className, ...props }: IconProps) {\n return (\n <svg\n className={className}\n width=\"16\"\n height=\"16\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"1.75\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n aria-hidden=\"true\"\n {...props}\n >\n <path d=\"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8Z\" />\n <path d=\"M14 2v6h6\" />\n </svg>\n );\n}\n\nexport interface FilesProps {\n children?: ReactNode;\n className?: string;\n}\n\nexport function FileSystem({ children, className = '' }: FilesProps) {\n return (\n <div className=\"no-sleetch-markdown\">\n <div className={[styles['file-system'], className].filter(Boolean).join(' ')}>{children}</div>\n </div>\n );\n}\n\nexport interface FolderProps {\n name: string;\n children?: ReactNode;\n hidden?: boolean;\n className?: string;\n}\n\nexport function Folder({ name, children, hidden = false, className = '' }: FolderProps) {\n return (\n <div className={[styles.folder, hidden && styles.hidden, className].filter(Boolean).join(' ')}>\n <div className={[styles.row, styles.folderRow].join(' ')}>\n <FolderIcon className={styles.icon} />\n <span className={styles.label}>{name}</span>\n </div>\n {children && <div className={styles.children}>{children}</div>}\n </div>\n );\n}\n\nexport interface FileProps {\n name: string;\n comment?: string;\n selected?: boolean;\n className?: string;\n}\n\nexport function File({ name, comment, selected = false, className = '' }: FileProps) {\n return (\n <div className={[styles.row, styles.file, selected && styles.selected, className].filter(Boolean).join(' ')}>\n <FileIcon className={styles.icon} />\n <span className={styles.label}>{name}</span>\n <span className={styles.comment}>{comment}</span>\n </div>\n );\n}\n"],"mappings":"mVCOA,SAAS,EAAW,CAAE,YAAW,GAAG,GAAoB,CACtD,OACE,EAAA,EAAA,IAAA,CAAC,MAAD,CACa,YACX,MAAM,KACN,OAAO,KACP,QAAQ,YACR,KAAK,OACL,OAAO,eACP,YAAY,OACZ,cAAc,QACd,eAAe,QACf,cAAY,OACZ,GAAI,YAEJ,EAAA,EAAA,IAAA,CAAC,OAAD,CAAM,EAAE,6EAA+E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AAiB,CACnF,OACE,EAAA,EAAA,KAAA,CAAC,MAAD,CAAK,UAAW,CAAC,EAAO,IAAK,EAAO,KAAM,GAAY,EAAO,SAAU,CAAS,CAAC,CAAC,OAAO,OAAO,CAAC,CAAC,KAAK,GAAG,WAA1G,EACE,EAAA,EAAA,IAAA,CAAC,EAAD,CAAU,UAAW,EAAO,IAAO,CAAA,GACnC,EAAA,EAAA,IAAA,CAAC,OAAD,CAAM,UAAW,EAAO,eAAQ,CAAW,CAAA,GAC3C,EAAA,EAAA,IAAA,CAAC,OAAD,CAAM,UAAW,EAAO,iBAAU,CAAc,CAAA,CAC7C,GAET"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"header-D59bdlay.js","names":[],"sources":["../../styles/src/components/documentation/header.module.css","../src/components/documentation/header.tsx"],"sourcesContent":["@import '../../variables.css';\n\n.default {\n color: var(--_sleetch-color-text);\n height: var(--_sleetch-header-height);\n background-color: color-mix(in srgb, var(--_sleetch-color-card) 30%, transparent);\n backdrop-filter: blur(15px);\n border-bottom: 1px solid var(--_sleetch-color-muted);\n position: sticky;\n top: 0;\n display: flex;\n align-items: center;\n padding: 0 2em;\n gap: 1em;\n z-index: 100;\n}\n\n.menu-toggle {\n display: none;\n background: none;\n border: none;\n color: var(--_sleetch-color-text);\n cursor: pointer;\n padding: 0.5em;\n border-radius: var(--_sleetch-radius);\n transition: background-color var(--_sleetch-transition-duration) var(--_sleetch-transition-timing);\n}\n\n.menu-toggle:hover {\n background-color: var(--_sleetch-color-muted);\n}\n\n.menu-toggle:active {\n transform: scale(0.95);\n}\n\n@media (max-width: 768px) {\n .default {\n padding: 0 1em;\n }\n\n .menu-toggle {\n display: flex;\n align-items: center;\n justify-content: center;\n }\n}\n","import type { BaseHTMLAttributes } from 'react';\nimport styles from '@sleetch/styles/components/documentation/header.module.css';\nimport clsx from 'clsx';\n\nexport interface DocumentationHeaderProps extends BaseHTMLAttributes<HTMLDivElement> {\n onMenuToggle?: () => void;\n}\n\nexport function DocumentationHeader({ className, children, onMenuToggle, ...props }: DocumentationHeaderProps) {\n return (\n <div className={clsx(styles['default'], className)} {...props}>\n {onMenuToggle && (\n <button className={styles['menu-toggle']} onClick={onMenuToggle} aria-label=\"Toggle sidebar\" type=\"button\">\n <svg\n viewBox=\"0 0 24 24\"\n width=\"24\"\n height=\"24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <line x1=\"3\" y1=\"12\" x2=\"21\" y2=\"12\" />\n <line x1=\"3\" y1=\"6\" x2=\"21\" y2=\"6\" />\n <line x1=\"3\" y1=\"18\" x2=\"21\" y2=\"18\" />\n </svg>\n </button>\n )}\n {children}\n </div>\n );\n}\n"],"mappings":";;;;;;;;;ACQA,SAAgB,EAAoB,EAAE,cAAW,aAAU,iBAAc,GAAG,KAAmC;CAC7G,OACE,kBAAC,OAAD;EAAK,WAAW,EAAK,EAAO,SAAY,CAAS;EAAG,GAAI;YAAxD,CACG,KACC,kBAAC,UAAD;GAAQ,WAAW,EAAO;GAAgB,SAAS;GAAc,cAAW;GAAiB,MAAK;aAChG,kBAAC,OAAD;IACE,SAAQ;IACR,OAAM;IACN,QAAO;IACP,MAAK;IACL,QAAO;IACP,aAAY;IACZ,eAAc;IACd,gBAAe;cARjB;KAUE,kBAAC,QAAD;MAAM,IAAG;MAAI,IAAG;MAAK,IAAG;MAAK,IAAG;KAAM,CAAA;KACtC,kBAAC,QAAD;MAAM,IAAG;MAAI,IAAG;MAAI,IAAG;MAAK,IAAG;KAAK,CAAA;KACpC,kBAAC,QAAD;MAAM,IAAG;MAAI,IAAG;MAAK,IAAG;MAAK,IAAG;KAAM,CAAA;IACnC;;EACC,CAAA,GAET,CACE;;AAET"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"header-DbR9X4YP.cjs","names":[],"sources":["../../styles/src/components/documentation/header.module.css","../src/components/documentation/header.tsx"],"sourcesContent":["@import '../../variables.css';\n\n.default {\n color: var(--_sleetch-color-text);\n height: var(--_sleetch-header-height);\n background-color: color-mix(in srgb, var(--_sleetch-color-card) 30%, transparent);\n backdrop-filter: blur(15px);\n border-bottom: 1px solid var(--_sleetch-color-muted);\n position: sticky;\n top: 0;\n display: flex;\n align-items: center;\n padding: 0 2em;\n gap: 1em;\n z-index: 100;\n}\n\n.menu-toggle {\n display: none;\n background: none;\n border: none;\n color: var(--_sleetch-color-text);\n cursor: pointer;\n padding: 0.5em;\n border-radius: var(--_sleetch-radius);\n transition: background-color var(--_sleetch-transition-duration) var(--_sleetch-transition-timing);\n}\n\n.menu-toggle:hover {\n background-color: var(--_sleetch-color-muted);\n}\n\n.menu-toggle:active {\n transform: scale(0.95);\n}\n\n@media (max-width: 768px) {\n .default {\n padding: 0 1em;\n }\n\n .menu-toggle {\n display: flex;\n align-items: center;\n justify-content: center;\n }\n}\n","import type { BaseHTMLAttributes } from 'react';\nimport styles from '@sleetch/styles/components/documentation/header.module.css';\nimport clsx from 'clsx';\n\nexport interface DocumentationHeaderProps extends BaseHTMLAttributes<HTMLDivElement> {\n onMenuToggle?: () => void;\n}\n\nexport function DocumentationHeader({ className, children, onMenuToggle, ...props }: DocumentationHeaderProps) {\n return (\n <div className={clsx(styles['default'], className)} {...props}>\n {onMenuToggle && (\n <button className={styles['menu-toggle']} onClick={onMenuToggle} aria-label=\"Toggle sidebar\" type=\"button\">\n <svg\n viewBox=\"0 0 24 24\"\n width=\"24\"\n height=\"24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <line x1=\"3\" y1=\"12\" x2=\"21\" y2=\"12\" />\n <line x1=\"3\" y1=\"6\" x2=\"21\" y2=\"6\" />\n <line x1=\"3\" y1=\"18\" x2=\"21\" y2=\"18\" />\n </svg>\n </button>\n )}\n {children}\n </div>\n );\n}\n"],"mappings":"mJCQA,SAAgB,EAAoB,CAAE,YAAW,WAAU,eAAc,GAAG,GAAmC,CAC7G,OACE,EAAA,EAAA,KAAA,CAAC,MAAD,CAAK,UAAW,EAAA,EAAK,EAAO,QAAY,CAAS,EAAG,GAAI,WAAxD,CACG,IACC,EAAA,EAAA,IAAA,CAAC,SAAD,CAAQ,UAAW,EAAO,eAAgB,QAAS,EAAc,aAAW,iBAAiB,KAAK,mBAChG,EAAA,EAAA,KAAA,CAAC,MAAD,CACE,QAAQ,YACR,MAAM,KACN,OAAO,KACP,KAAK,OACL,OAAO,eACP,YAAY,IACZ,cAAc,QACd,eAAe,iBARjB,EAUE,EAAA,EAAA,IAAA,CAAC,OAAD,CAAM,GAAG,IAAI,GAAG,KAAK,GAAG,KAAK,GAAG,IAAM,CAAA,GACtC,EAAA,EAAA,IAAA,CAAC,OAAD,CAAM,GAAG,IAAI,GAAG,IAAI,GAAG,KAAK,GAAG,GAAK,CAAA,GACpC,EAAA,EAAA,IAAA,CAAC,OAAD,CAAM,GAAG,IAAI,GAAG,KAAK,GAAG,KAAK,GAAG,IAAM,CAAA,CACnC,GACC,CAAA,EAET,CACE,GAET"}
|
package/dist/index.esm.js
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { t as e } from "./sidebar-DgVlWEfQ.js";
|
|
3
|
-
import { t } from "./content-x_2bnG7q.js";
|
|
4
|
-
import { n, t as r } from "./layout-BRE4zrjG.js";
|
|
5
|
-
import { ConnectedDocumentationSidebar as i } from "./components/documentation/connected-sidebar.esm.js";
|
|
6
|
-
import { t as a } from "./header-D59bdlay.js";
|
|
7
|
-
import { ConnectedDocumentationHeader as o } from "./components/documentation/connected-header.esm.js";
|
|
8
|
-
import { t as s } from "./content-mbVWCXX0.js";
|
|
9
|
-
import { t as c } from "./toc-BuFdWsti.js";
|
|
10
|
-
import { t as l } from "./content-CRXZ7aLX.js";
|
|
11
|
-
import { t as u } from "./content-DusAp8Q6.js";
|
|
12
|
-
import { t as d } from "./button-B1pw1TFm.js";
|
|
13
|
-
import { PageHeader as f } from "./components/documentation/page/header.esm.js";
|
|
14
|
-
import { t as p } from "./navigation-kP1-q7Ux.js";
|
|
15
|
-
import { n as m, r as h, t as g } from "./file-system-BtXBcLmT.js";
|
|
16
|
-
export { d as Button, o as ConnectedDocumentationHeader, i as ConnectedDocumentationSidebar, s as DocumentationContent, a as DocumentationHeader, r as DocumentationLayout, e as DocumentationSidebar, t as DocumentationSidebarContent, c as DocumentationToc, l as DocumentationTocContent, g as File, m as FileSystem, h as Folder, u as PageContent, f as PageHeader, p as PageNavigation, n as useDocumentationLayout };
|
package/dist/layout-BRE4zrjG.js
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { t as e } from "./clsx-CeX9s6vy.js";
|
|
2
|
-
import { createContext as t, useContext as n, useState as r } from "react";
|
|
3
|
-
import { jsx as i } from "react/jsx-runtime";
|
|
4
|
-
import './assets/layout.css';//#region ../styles/src/components/documentation/layout.module.css
|
|
5
|
-
var a = { default: "_default_1till_3" }, o = t(null);
|
|
6
|
-
function s() {
|
|
7
|
-
let e = n(o);
|
|
8
|
-
if (!e) throw Error("useDocumentationLayout must be used within DocumentationLayout");
|
|
9
|
-
return e;
|
|
10
|
-
}
|
|
11
|
-
function c({ children: t, className: n, ...s }) {
|
|
12
|
-
let [c, l] = r(!1);
|
|
13
|
-
return /* @__PURE__ */ i(o.Provider, {
|
|
14
|
-
value: {
|
|
15
|
-
isSidebarOpen: c,
|
|
16
|
-
toggleSidebar: () => l((e) => !e),
|
|
17
|
-
closeSidebar: () => l(!1)
|
|
18
|
-
},
|
|
19
|
-
children: /* @__PURE__ */ i("main", {
|
|
20
|
-
className: e(a.default, n),
|
|
21
|
-
...s,
|
|
22
|
-
children: t
|
|
23
|
-
})
|
|
24
|
-
});
|
|
25
|
-
}
|
|
26
|
-
//#endregion
|
|
27
|
-
export { s as n, c as t };
|
|
28
|
-
|
|
29
|
-
//# sourceMappingURL=layout-BRE4zrjG.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"layout-BRE4zrjG.js","names":[],"sources":["../../styles/src/components/documentation/layout.module.css","../src/components/documentation/layout.tsx"],"sourcesContent":["@import '../../variables.css';\n\n.default {\n color: var(--_sleetch-color-text);\n background-color: var(--_sleetch-color-background);\n display: flex;\n flex-direction: column;\n min-height: 100vh;\n}\n","import type { ReactNode, BaseHTMLAttributes } from 'react';\nimport { createContext, useContext, useState } from 'react';\nimport styles from '@sleetch/styles/components/documentation/layout.module.css';\nimport clsx from 'clsx';\n\nexport interface DocumentationLayoutProps extends BaseHTMLAttributes<HTMLDivElement> {}\n\ninterface LayoutContextType {\n isSidebarOpen: boolean;\n toggleSidebar: () => void;\n closeSidebar: () => void;\n}\n\nconst LayoutContext = createContext<LayoutContextType | null>(null);\n\nexport function useDocumentationLayout() {\n const context = useContext(LayoutContext);\n if (!context) {\n throw new Error('useDocumentationLayout must be used within DocumentationLayout');\n }\n return context;\n}\n\nexport function DocumentationLayout({ children, className, ...props }: DocumentationLayoutProps) {\n const [isSidebarOpen, setIsSidebarOpen] = useState(false);\n\n const toggleSidebar = () => setIsSidebarOpen((prev) => !prev);\n const closeSidebar = () => setIsSidebarOpen(false);\n\n return (\n <LayoutContext.Provider value={{ isSidebarOpen, toggleSidebar, closeSidebar }}>\n <main className={clsx(styles['default'], className)} {...props}>\n {children}\n </main>\n </LayoutContext.Provider>\n );\n}\n"],"mappings":";;;;yCCaM,IAAgB,EAAwC,IAAI;AAElE,SAAgB,IAAyB;CACvC,IAAM,IAAU,EAAW,CAAa;CACxC,IAAI,CAAC,GACH,MAAU,MAAM,gEAAgE;CAElF,OAAO;AACT;AAEA,SAAgB,EAAoB,EAAE,aAAU,cAAW,GAAG,KAAmC;CAC/F,IAAM,CAAC,GAAe,KAAoB,EAAS,EAAK;CAKxD,OACE,kBAAC,EAAc,UAAf;EAAwB,OAAO;GAAE;GAAe,qBAJtB,GAAkB,MAAS,CAAC,CAAI;GAIK,oBAHtC,EAAiB,EAAK;EAG6B;YAC1E,kBAAC,QAAD;GAAM,WAAW,EAAK,EAAO,SAAY,CAAS;GAAG,GAAI;GACtD;EACG,CAAA;CACgB,CAAA;AAE5B"}
|
package/dist/layout-D6mjobyq.cjs
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
require('./assets/layout.css');const e=require("./clsx-CPcBvw4Z.cjs");let t=require("react"),n=require("react/jsx-runtime");var r={default:`_default_1till_3`},i=(0,t.createContext)(null);function a(){let e=(0,t.useContext)(i);if(!e)throw Error(`useDocumentationLayout must be used within DocumentationLayout`);return e}function o({children:a,className:o,...s}){let[c,l]=(0,t.useState)(!1);return(0,n.jsx)(i.Provider,{value:{isSidebarOpen:c,toggleSidebar:()=>l(e=>!e),closeSidebar:()=>l(!1)},children:(0,n.jsx)(`main`,{className:e.t(r.default,o),...s,children:a})})}Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return a}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return o}});
|
|
2
|
-
//# sourceMappingURL=layout-D6mjobyq.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"layout-D6mjobyq.cjs","names":[],"sources":["../../styles/src/components/documentation/layout.module.css","../src/components/documentation/layout.tsx"],"sourcesContent":["@import '../../variables.css';\n\n.default {\n color: var(--_sleetch-color-text);\n background-color: var(--_sleetch-color-background);\n display: flex;\n flex-direction: column;\n min-height: 100vh;\n}\n","import type { ReactNode, BaseHTMLAttributes } from 'react';\nimport { createContext, useContext, useState } from 'react';\nimport styles from '@sleetch/styles/components/documentation/layout.module.css';\nimport clsx from 'clsx';\n\nexport interface DocumentationLayoutProps extends BaseHTMLAttributes<HTMLDivElement> {}\n\ninterface LayoutContextType {\n isSidebarOpen: boolean;\n toggleSidebar: () => void;\n closeSidebar: () => void;\n}\n\nconst LayoutContext = createContext<LayoutContextType | null>(null);\n\nexport function useDocumentationLayout() {\n const context = useContext(LayoutContext);\n if (!context) {\n throw new Error('useDocumentationLayout must be used within DocumentationLayout');\n }\n return context;\n}\n\nexport function DocumentationLayout({ children, className, ...props }: DocumentationLayoutProps) {\n const [isSidebarOpen, setIsSidebarOpen] = useState(false);\n\n const toggleSidebar = () => setIsSidebarOpen((prev) => !prev);\n const closeSidebar = () => setIsSidebarOpen(false);\n\n return (\n <LayoutContext.Provider value={{ isSidebarOpen, toggleSidebar, closeSidebar }}>\n <main className={clsx(styles['default'], className)} {...props}>\n {children}\n </main>\n </LayoutContext.Provider>\n );\n}\n"],"mappings":"gICaM,GAAA,EAAA,EAAA,cAAA,CAAwD,IAAI,EAElE,SAAgB,GAAyB,CACvC,IAAM,GAAA,EAAA,EAAA,WAAA,CAAqB,CAAa,EACxC,GAAI,CAAC,EACH,MAAU,MAAM,gEAAgE,EAElF,OAAO,CACT,CAEA,SAAgB,EAAoB,CAAE,WAAU,YAAW,GAAG,GAAmC,CAC/F,GAAM,CAAC,EAAe,IAAA,EAAA,EAAA,SAAA,CAA6B,EAAK,EAKxD,OACE,EAAA,EAAA,IAAA,CAAC,EAAc,SAAf,CAAwB,MAAO,CAAE,gBAAe,kBAJtB,EAAkB,GAAS,CAAC,CAAI,EAIK,iBAHtC,EAAiB,EAAK,CAG6B,YAC1E,EAAA,EAAA,IAAA,CAAC,OAAD,CAAM,UAAW,EAAA,EAAK,EAAO,QAAY,CAAS,EAAG,GAAI,EACtD,UACG,CAAA,CACgB,CAAA,CAE5B"}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
require('./assets/navigation.css');const e=require("./clsx-CPcBvw4Z.cjs");let t=require("react"),n=require("react/jsx-runtime");var r={navigation:`_navigation_fckni_3`,slot:`_slot_fckni_12`,"slot-end":`_slot-end_fckni_16`,card:`_card_fckni_20`,next:`_next_fckni_47`,previous:`_previous_fckni_52`,meta:`_meta_fckni_57`,chevron:`_chevron_fckni_65`,title:`_title_fckni_71`,description:`_description_fckni_78`},i=e=>e;function a(e){return e.children.find(e=>e.type===`data`)}function o(e){return e.children.find(e=>e.type===`page`&&e.index===!0)}function s(e){return e.type===`category`?a(e)?.frontmatter?.order??1/0:e.type===`page`?e.frontmatter.order??1/0:1/0}function c(e){return e.map((e,t)=>({node:e,index:t})).filter(({node:e})=>e.type!==`data`).sort((e,t)=>{let n=s(e.node)-s(t.node);return n===0?e.index-t.index:n}).map(({node:e})=>e)}function l(e){let t=c(e),n=[];for(let e of t){if(e.type===`page`){n.push(e);continue}if(e.type===`category`){let t=o(e);t&&n.push(t);let r=e.children.filter(e=>e.type!==`data`&&!(e.type===`page`&&e.index===!0));n.push(...l(r))}}return n}function u(){return(0,n.jsx)(`svg`,{viewBox:`0 0 24 24`,width:`16`,height:`16`,fill:`none`,stroke:`currentColor`,strokeWidth:`2.5`,strokeLinecap:`round`,strokeLinejoin:`round`,className:r.chevron,children:(0,n.jsx)(`polyline`,{points:`15 18 9 12 15 6`})})}function d(){return(0,n.jsx)(`svg`,{viewBox:`0 0 24 24`,width:`16`,height:`16`,fill:`none`,stroke:`currentColor`,strokeWidth:`2.5`,strokeLinecap:`round`,strokeLinejoin:`round`,className:r.chevron,children:(0,n.jsx)(`polyline`,{points:`9 18 15 12 9 6`})})}function f(e,t){return e&&e!==`No title.`?e:t}function p(e){return e&&e!==`No description.`?e:void 0}function m({node:t,direction:i,hrefBuilder:a}){let o=f(t.frontmatter.title,t.path),s=p(t.frontmatter.description);return(0,n.jsxs)(`a`,{href:a(t.path),className:e.t(r.card,r[i]),"data-direction":i,children:[(0,n.jsxs)(`span`,{className:r.meta,children:[i===`previous`&&(0,n.jsx)(u,{}),(0,n.jsx)(`span`,{className:r.title,children:o}),i===`next`&&(0,n.jsx)(d,{})]}),s&&(0,n.jsx)(`span`,{className:r.description,children:s})]})}function h({className:a,tree:o,currentPath:s,hrefBuilder:c=i,...u}){let{previous:d,next:f}=(0,t.useMemo)(()=>{let e=l(o),t=e.findIndex(e=>e.path===s);return t===-1?{previous:void 0,next:void 0}:{previous:e[t-1],next:e[t+1]}},[o,s]);return!d&&!f?null:(0,n.jsxs)(`nav`,{className:e.t(r.navigation,a),"aria-label":`Pagination`,...u,children:[(0,n.jsx)(`div`,{className:r.slot,children:d&&(0,n.jsx)(m,{node:d,direction:`previous`,hrefBuilder:c})}),(0,n.jsx)(`div`,{className:e.t(r.slot,r[`slot-end`]),children:f&&(0,n.jsx)(m,{node:f,direction:`next`,hrefBuilder:c})})]})}Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return h}});
|
|
2
|
-
//# sourceMappingURL=navigation-BdVu1Uh-.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"navigation-BdVu1Uh-.cjs","names":[],"sources":["../../styles/src/components/documentation/page/navigation.module.css","../src/components/documentation/page/navigation.tsx"],"sourcesContent":["@import '../../../variables.css';\n\n.navigation {\n display: grid;\n grid-template-columns: 1fr 1fr;\n gap: 1em;\n padding: var(--_sleetch-padding-root);\n padding-top: 0px;\n font-family: var(--_sleetch-font-base);\n}\n\n.slot {\n display: flex;\n}\n\n.slot-end {\n justify-content: flex-end;\n}\n\n.card {\n display: flex;\n flex-direction: column;\n gap: 0.25em;\n width: 100%;\n max-width: 320px;\n padding: 1em 1em;\n border-radius: var(--_sleetch-radius);\n border: var(--_sleetch-hr-height) solid var(--_sleetch-color-muted);\n color: var(--_sleetch-color-text);\n text-decoration: none;\n transition:\n border-color var(--_sleetch-transition-duration) var(--_sleetch-transition-timing),\n background-color var(--_sleetch-transition-duration) var(--_sleetch-transition-timing);\n}\n\n.card:hover,\n.card:focus-visible {\n border-color: var(--_sleetch-color-text-primary);\n background-color: color-mix(in srgb, var(--_sleetch-color-text-primary) 8%, var(--_sleetch-color-card));\n}\n\n.card:focus-visible {\n outline: 2px solid var(--_sleetch-color-text-primary);\n outline-offset: 2px;\n}\n\n.next {\n align-items: flex-end;\n text-align: right;\n}\n\n.previous {\n align-items: flex-start;\n text-align: left;\n}\n\n.meta {\n display: flex;\n align-items: center;\n gap: 0.3em;\n font-size: var(--_sleetch-font-size-tiny);\n color: var(--_sleetch-color-muted-foreground);\n}\n\n.chevron {\n flex-shrink: 0;\n width: 20px;\n height: 20px;\n}\n\n.title {\n font-size: var(--_sleetch-font-size-base);\n font-weight: var(--_sleetch-font-weight-heading);\n line-height: var(--_sleetch-line-height-heading);\n color: var(--_sleetch-color-text);\n}\n\n.description {\n font-size: var(--_sleetch-font-size-tiny);\n line-height: var(--_sleetch-line-height);\n color: var(--_sleetch-color-muted-foreground);\n overflow: hidden;\n}\n\n@media (min-width: 769px) and (max-width: 1024px) {\n .navigation {\n padding: 1.5em 2em;\n }\n}\n\n@media (max-width: 768px) {\n .card {\n max-width: 100%;\n }\n\n .navigation {\n grid-template-columns: 1fr;\n\n padding: 1em 1em;\n }\n\n .slot-end {\n justify-content: flex-start;\n }\n\n .next {\n align-items: flex-start;\n text-align: left;\n }\n}\n","/*\n AI Generated :(\n Needs more testing\n*/\n\nimport { useMemo, type BaseHTMLAttributes } from 'react';\nimport clsx from 'clsx';\nimport styles from '@sleetch/styles/components/documentation/page/navigation.module.css';\nimport type { tree_object } from '@sleetch/core/compiler';\n\ntype category_node = Extract<tree_object, { type: 'category' }>;\ntype page_node = Extract<tree_object, { type: 'page' }>;\ntype data_node = Extract<tree_object, { type: 'data' }>;\n\nexport interface DocumentationNavigationProps extends BaseHTMLAttributes<HTMLDivElement> {\n tree: tree_object[];\n currentPath: string;\n hrefBuilder?: (path: string) => string;\n}\n\nconst defaultHrefBuilder = (path: string) => path;\n\n/*\n Meme logique de tri/priorite que la sidebar (getCategoryData, getCategoryIndex,\n getOrder, sortNodes) pour garantir que l'ordre de navigation prev/next\n corresponde exactement a l'ordre affiche dans la sidebar.\n*/\n\nfunction getCategoryData(category: category_node): data_node | undefined {\n return category.children.find((c): c is data_node => c.type === 'data');\n}\n\nfunction getCategoryIndex(category: category_node): page_node | undefined {\n return category.children.find((c): c is page_node => c.type === 'page' && c.index === true);\n}\n\nfunction getOrder(node: tree_object): number {\n if (node.type === 'category') {\n const data = getCategoryData(node);\n return data?.frontmatter?.order ?? Number.POSITIVE_INFINITY;\n }\n if (node.type === 'page') {\n return (node.frontmatter as { order?: number }).order ?? Number.POSITIVE_INFINITY;\n }\n return Number.POSITIVE_INFINITY;\n}\n\nfunction sortNodes(nodes: tree_object[]): tree_object[] {\n return nodes\n .map((node, index) => ({ node, index }))\n .filter(({ node }) => node.type !== 'data')\n .sort((a, b) => {\n const diff = getOrder(a.node) - getOrder(b.node);\n return diff !== 0 ? diff : a.index - b.index;\n })\n .map(({ node }) => node);\n}\n\n/*\n Aplatit l'arbre en une liste ordonnee de pages navigables :\n - l'index d'une categorie arrive en premier (c'est le point d'entree),\n - suivi de ses enfants tries recursivement.\n*/\nfunction flattenPages(nodes: tree_object[]): page_node[] {\n const sorted = sortNodes(nodes);\n const result: page_node[] = [];\n\n for (const node of sorted) {\n if (node.type === 'page') {\n result.push(node);\n continue;\n }\n\n if (node.type === 'category') {\n const indexPage = getCategoryIndex(node);\n if (indexPage) result.push(indexPage);\n\n const rest = node.children.filter((c) => c.type !== 'data' && !(c.type === 'page' && c.index === true));\n result.push(...flattenPages(rest));\n }\n }\n\n return result;\n}\n\nfunction ChevronLeft() {\n return (\n <svg\n viewBox=\"0 0 24 24\"\n width=\"16\"\n height=\"16\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2.5\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n className={styles['chevron']}\n >\n <polyline points=\"15 18 9 12 15 6\" />\n </svg>\n );\n}\n\nfunction ChevronRight() {\n return (\n <svg\n viewBox=\"0 0 24 24\"\n width=\"16\"\n height=\"16\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2.5\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n className={styles['chevron']}\n >\n <polyline points=\"9 18 15 12 9 6\" />\n </svg>\n );\n}\n\nfunction resolveTitle(title: string, fallbackPath: string): string {\n return title && title !== 'No title.' ? title : fallbackPath;\n}\n\nfunction resolveDescription(description: string): string | undefined {\n return description && description !== 'No description.' ? description : undefined;\n}\n\ninterface NavigationCardProps {\n node: page_node;\n direction: 'previous' | 'next';\n hrefBuilder: (path: string) => string;\n}\n\nfunction NavigationCard({ node, direction, hrefBuilder }: NavigationCardProps) {\n const title = resolveTitle(node.frontmatter.title, node.path);\n const description = resolveDescription(node.frontmatter.description);\n\n return (\n <a href={hrefBuilder(node.path)} className={clsx(styles['card'], styles[direction])} data-direction={direction}>\n <span className={styles['meta']}>\n {direction === 'previous' && <ChevronLeft />}\n <span className={styles['title']}>{title}</span>\n {direction === 'next' && <ChevronRight />}\n </span>\n {description && <span className={styles['description']}>{description}</span>}\n </a>\n );\n}\n\nexport function PageNavigation({ className, tree, currentPath, hrefBuilder = defaultHrefBuilder, ...props }: DocumentationNavigationProps) {\n const { previous, next } = useMemo(() => {\n const pages = flattenPages(tree);\n const currentIndex = pages.findIndex((page) => page.path === currentPath);\n\n if (currentIndex === -1) {\n return { previous: undefined, next: undefined };\n }\n\n return {\n previous: pages[currentIndex - 1],\n next: pages[currentIndex + 1],\n };\n }, [tree, currentPath]);\n\n if (!previous && !next) return null;\n\n return (\n <nav className={clsx(styles['navigation'], className)} aria-label=\"Pagination\" {...props}>\n <div className={styles['slot']}>{previous && <NavigationCard node={previous} direction=\"previous\" hrefBuilder={hrefBuilder} />}</div>\n <div className={clsx(styles['slot'], styles['slot-end'])}>\n {next && <NavigationCard node={next} direction=\"next\" hrefBuilder={hrefBuilder} />}\n </div>\n </nav>\n );\n}\n"],"mappings":"oXCoBM,EAAsB,GAAiB,EAQ7C,SAAS,EAAgB,EAAgD,CACvE,OAAO,EAAS,SAAS,KAAM,GAAsB,EAAE,OAAS,MAAM,CACxE,CAEA,SAAS,EAAiB,EAAgD,CACxE,OAAO,EAAS,SAAS,KAAM,GAAsB,EAAE,OAAS,QAAU,EAAE,QAAU,EAAI,CAC5F,CAEA,SAAS,EAAS,EAA2B,CAQ3C,OAPI,EAAK,OAAS,WACH,EAAgB,CACt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B,CACF,EAAG,CAAC,EAAM,CAAW,CAAC,EAItB,MAFI,CAAC,GAAY,CAAC,EAAa,MAG7B,EAAA,EAAA,KAAA,CAAC,MAAD,CAAK,UAAW,EAAA,EAAK,EAAO,WAAe,CAAS,EAAG,aAAW,aAAa,GAAI,WAAnF,EACE,EAAA,EAAA,IAAA,CAAC,MAAD,CAAK,UAAW,EAAO,cAAU,IAAY,EAAA,EAAA,IAAA,CAAC,EAAD,CAAgB,KAAM,EAAU,UAAU,WAAwB,aAAc,CAAA,CAAO,CAAA,GACpI,EAAA,EAAA,IAAA,CAAC,MAAD,CAAK,UAAW,EAAA,EAAK,EAAO,KAAS,EAAO,WAAW,WACpD,IAAQ,EAAA,EAAA,IAAA,CAAC,EAAD,CAAgB,KAAM,EAAM,UAAU,OAAoB,aAAc,CAAA,CAC9E,CAAA,CACF,GAET"}
|
|
@@ -1,141 +0,0 @@
|
|
|
1
|
-
import { t as e } from "./clsx-CeX9s6vy.js";
|
|
2
|
-
import { useMemo as t } from "react";
|
|
3
|
-
import { jsx as n, jsxs as r } from "react/jsx-runtime";
|
|
4
|
-
import './assets/navigation.css';var i = {
|
|
5
|
-
navigation: "_navigation_fckni_3",
|
|
6
|
-
slot: "_slot_fckni_12",
|
|
7
|
-
"slot-end": "_slot-end_fckni_16",
|
|
8
|
-
card: "_card_fckni_20",
|
|
9
|
-
next: "_next_fckni_47",
|
|
10
|
-
previous: "_previous_fckni_52",
|
|
11
|
-
meta: "_meta_fckni_57",
|
|
12
|
-
chevron: "_chevron_fckni_65",
|
|
13
|
-
title: "_title_fckni_71",
|
|
14
|
-
description: "_description_fckni_78"
|
|
15
|
-
}, a = (e) => e;
|
|
16
|
-
function o(e) {
|
|
17
|
-
return e.children.find((e) => e.type === "data");
|
|
18
|
-
}
|
|
19
|
-
function s(e) {
|
|
20
|
-
return e.children.find((e) => e.type === "page" && e.index === !0);
|
|
21
|
-
}
|
|
22
|
-
function c(e) {
|
|
23
|
-
return e.type === "category" ? o(e)?.frontmatter?.order ?? Infinity : e.type === "page" ? e.frontmatter.order ?? Infinity : Infinity;
|
|
24
|
-
}
|
|
25
|
-
function l(e) {
|
|
26
|
-
return e.map((e, t) => ({
|
|
27
|
-
node: e,
|
|
28
|
-
index: t
|
|
29
|
-
})).filter(({ node: e }) => e.type !== "data").sort((e, t) => {
|
|
30
|
-
let n = c(e.node) - c(t.node);
|
|
31
|
-
return n === 0 ? e.index - t.index : n;
|
|
32
|
-
}).map(({ node: e }) => e);
|
|
33
|
-
}
|
|
34
|
-
function u(e) {
|
|
35
|
-
let t = l(e), n = [];
|
|
36
|
-
for (let e of t) {
|
|
37
|
-
if (e.type === "page") {
|
|
38
|
-
n.push(e);
|
|
39
|
-
continue;
|
|
40
|
-
}
|
|
41
|
-
if (e.type === "category") {
|
|
42
|
-
let t = s(e);
|
|
43
|
-
t && n.push(t);
|
|
44
|
-
let r = e.children.filter((e) => e.type !== "data" && !(e.type === "page" && e.index === !0));
|
|
45
|
-
n.push(...u(r));
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
return n;
|
|
49
|
-
}
|
|
50
|
-
function d() {
|
|
51
|
-
return /* @__PURE__ */ n("svg", {
|
|
52
|
-
viewBox: "0 0 24 24",
|
|
53
|
-
width: "16",
|
|
54
|
-
height: "16",
|
|
55
|
-
fill: "none",
|
|
56
|
-
stroke: "currentColor",
|
|
57
|
-
strokeWidth: "2.5",
|
|
58
|
-
strokeLinecap: "round",
|
|
59
|
-
strokeLinejoin: "round",
|
|
60
|
-
className: i.chevron,
|
|
61
|
-
children: /* @__PURE__ */ n("polyline", { points: "15 18 9 12 15 6" })
|
|
62
|
-
});
|
|
63
|
-
}
|
|
64
|
-
function f() {
|
|
65
|
-
return /* @__PURE__ */ n("svg", {
|
|
66
|
-
viewBox: "0 0 24 24",
|
|
67
|
-
width: "16",
|
|
68
|
-
height: "16",
|
|
69
|
-
fill: "none",
|
|
70
|
-
stroke: "currentColor",
|
|
71
|
-
strokeWidth: "2.5",
|
|
72
|
-
strokeLinecap: "round",
|
|
73
|
-
strokeLinejoin: "round",
|
|
74
|
-
className: i.chevron,
|
|
75
|
-
children: /* @__PURE__ */ n("polyline", { points: "9 18 15 12 9 6" })
|
|
76
|
-
});
|
|
77
|
-
}
|
|
78
|
-
function p(e, t) {
|
|
79
|
-
return e && e !== "No title." ? e : t;
|
|
80
|
-
}
|
|
81
|
-
function m(e) {
|
|
82
|
-
return e && e !== "No description." ? e : void 0;
|
|
83
|
-
}
|
|
84
|
-
function h({ node: t, direction: a, hrefBuilder: o }) {
|
|
85
|
-
let s = p(t.frontmatter.title, t.path), c = m(t.frontmatter.description);
|
|
86
|
-
return /* @__PURE__ */ r("a", {
|
|
87
|
-
href: o(t.path),
|
|
88
|
-
className: e(i.card, i[a]),
|
|
89
|
-
"data-direction": a,
|
|
90
|
-
children: [/* @__PURE__ */ r("span", {
|
|
91
|
-
className: i.meta,
|
|
92
|
-
children: [
|
|
93
|
-
a === "previous" && /* @__PURE__ */ n(d, {}),
|
|
94
|
-
/* @__PURE__ */ n("span", {
|
|
95
|
-
className: i.title,
|
|
96
|
-
children: s
|
|
97
|
-
}),
|
|
98
|
-
a === "next" && /* @__PURE__ */ n(f, {})
|
|
99
|
-
]
|
|
100
|
-
}), c && /* @__PURE__ */ n("span", {
|
|
101
|
-
className: i.description,
|
|
102
|
-
children: c
|
|
103
|
-
})]
|
|
104
|
-
});
|
|
105
|
-
}
|
|
106
|
-
function g({ className: o, tree: s, currentPath: c, hrefBuilder: l = a, ...d }) {
|
|
107
|
-
let { previous: f, next: p } = t(() => {
|
|
108
|
-
let e = u(s), t = e.findIndex((e) => e.path === c);
|
|
109
|
-
return t === -1 ? {
|
|
110
|
-
previous: void 0,
|
|
111
|
-
next: void 0
|
|
112
|
-
} : {
|
|
113
|
-
previous: e[t - 1],
|
|
114
|
-
next: e[t + 1]
|
|
115
|
-
};
|
|
116
|
-
}, [s, c]);
|
|
117
|
-
return !f && !p ? null : /* @__PURE__ */ r("nav", {
|
|
118
|
-
className: e(i.navigation, o),
|
|
119
|
-
"aria-label": "Pagination",
|
|
120
|
-
...d,
|
|
121
|
-
children: [/* @__PURE__ */ n("div", {
|
|
122
|
-
className: i.slot,
|
|
123
|
-
children: f && /* @__PURE__ */ n(h, {
|
|
124
|
-
node: f,
|
|
125
|
-
direction: "previous",
|
|
126
|
-
hrefBuilder: l
|
|
127
|
-
})
|
|
128
|
-
}), /* @__PURE__ */ n("div", {
|
|
129
|
-
className: e(i.slot, i["slot-end"]),
|
|
130
|
-
children: p && /* @__PURE__ */ n(h, {
|
|
131
|
-
node: p,
|
|
132
|
-
direction: "next",
|
|
133
|
-
hrefBuilder: l
|
|
134
|
-
})
|
|
135
|
-
})]
|
|
136
|
-
});
|
|
137
|
-
}
|
|
138
|
-
//#endregion
|
|
139
|
-
export { g as t };
|
|
140
|
-
|
|
141
|
-
//# sourceMappingURL=navigation-kP1-q7Ux.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"navigation-kP1-q7Ux.js","names":[],"sources":["../../styles/src/components/documentation/page/navigation.module.css","../src/components/documentation/page/navigation.tsx"],"sourcesContent":["@import '../../../variables.css';\n\n.navigation {\n display: grid;\n grid-template-columns: 1fr 1fr;\n gap: 1em;\n padding: var(--_sleetch-padding-root);\n padding-top: 0px;\n font-family: var(--_sleetch-font-base);\n}\n\n.slot {\n display: flex;\n}\n\n.slot-end {\n justify-content: flex-end;\n}\n\n.card {\n display: flex;\n flex-direction: column;\n gap: 0.25em;\n width: 100%;\n max-width: 320px;\n padding: 1em 1em;\n border-radius: var(--_sleetch-radius);\n border: var(--_sleetch-hr-height) solid var(--_sleetch-color-muted);\n color: var(--_sleetch-color-text);\n text-decoration: none;\n transition:\n border-color var(--_sleetch-transition-duration) var(--_sleetch-transition-timing),\n background-color var(--_sleetch-transition-duration) var(--_sleetch-transition-timing);\n}\n\n.card:hover,\n.card:focus-visible {\n border-color: var(--_sleetch-color-text-primary);\n background-color: color-mix(in srgb, var(--_sleetch-color-text-primary) 8%, var(--_sleetch-color-card));\n}\n\n.card:focus-visible {\n outline: 2px solid var(--_sleetch-color-text-primary);\n outline-offset: 2px;\n}\n\n.next {\n align-items: flex-end;\n text-align: right;\n}\n\n.previous {\n align-items: flex-start;\n text-align: left;\n}\n\n.meta {\n display: flex;\n align-items: center;\n gap: 0.3em;\n font-size: var(--_sleetch-font-size-tiny);\n color: var(--_sleetch-color-muted-foreground);\n}\n\n.chevron {\n flex-shrink: 0;\n width: 20px;\n height: 20px;\n}\n\n.title {\n font-size: var(--_sleetch-font-size-base);\n font-weight: var(--_sleetch-font-weight-heading);\n line-height: var(--_sleetch-line-height-heading);\n color: var(--_sleetch-color-text);\n}\n\n.description {\n font-size: var(--_sleetch-font-size-tiny);\n line-height: var(--_sleetch-line-height);\n color: var(--_sleetch-color-muted-foreground);\n overflow: hidden;\n}\n\n@media (min-width: 769px) and (max-width: 1024px) {\n .navigation {\n padding: 1.5em 2em;\n }\n}\n\n@media (max-width: 768px) {\n .card {\n max-width: 100%;\n }\n\n .navigation {\n grid-template-columns: 1fr;\n\n padding: 1em 1em;\n }\n\n .slot-end {\n justify-content: flex-start;\n }\n\n .next {\n align-items: flex-start;\n text-align: left;\n }\n}\n","/*\n AI Generated :(\n Needs more testing\n*/\n\nimport { useMemo, type BaseHTMLAttributes } from 'react';\nimport clsx from 'clsx';\nimport styles from '@sleetch/styles/components/documentation/page/navigation.module.css';\nimport type { tree_object } from '@sleetch/core/compiler';\n\ntype category_node = Extract<tree_object, { type: 'category' }>;\ntype page_node = Extract<tree_object, { type: 'page' }>;\ntype data_node = Extract<tree_object, { type: 'data' }>;\n\nexport interface DocumentationNavigationProps extends BaseHTMLAttributes<HTMLDivElement> {\n tree: tree_object[];\n currentPath: string;\n hrefBuilder?: (path: string) => string;\n}\n\nconst defaultHrefBuilder = (path: string) => path;\n\n/*\n Meme logique de tri/priorite que la sidebar (getCategoryData, getCategoryIndex,\n getOrder, sortNodes) pour garantir que l'ordre de navigation prev/next\n corresponde exactement a l'ordre affiche dans la sidebar.\n*/\n\nfunction getCategoryData(category: category_node): data_node | undefined {\n return category.children.find((c): c is data_node => c.type === 'data');\n}\n\nfunction getCategoryIndex(category: category_node): page_node | undefined {\n return category.children.find((c): c is page_node => c.type === 'page' && c.index === true);\n}\n\nfunction getOrder(node: tree_object): number {\n if (node.type === 'category') {\n const data = getCategoryData(node);\n return data?.frontmatter?.order ?? Number.POSITIVE_INFINITY;\n }\n if (node.type === 'page') {\n return (node.frontmatter as { order?: number }).order ?? Number.POSITIVE_INFINITY;\n }\n return Number.POSITIVE_INFINITY;\n}\n\nfunction sortNodes(nodes: tree_object[]): tree_object[] {\n return nodes\n .map((node, index) => ({ node, index }))\n .filter(({ node }) => node.type !== 'data')\n .sort((a, b) => {\n const diff = getOrder(a.node) - getOrder(b.node);\n return diff !== 0 ? diff : a.index - b.index;\n })\n .map(({ node }) => node);\n}\n\n/*\n Aplatit l'arbre en une liste ordonnee de pages navigables :\n - l'index d'une categorie arrive en premier (c'est le point d'entree),\n - suivi de ses enfants tries recursivement.\n*/\nfunction flattenPages(nodes: tree_object[]): page_node[] {\n const sorted = sortNodes(nodes);\n const result: page_node[] = [];\n\n for (const node of sorted) {\n if (node.type === 'page') {\n result.push(node);\n continue;\n }\n\n if (node.type === 'category') {\n const indexPage = getCategoryIndex(node);\n if (indexPage) result.push(indexPage);\n\n const rest = node.children.filter((c) => c.type !== 'data' && !(c.type === 'page' && c.index === true));\n result.push(...flattenPages(rest));\n }\n }\n\n return result;\n}\n\nfunction ChevronLeft() {\n return (\n <svg\n viewBox=\"0 0 24 24\"\n width=\"16\"\n height=\"16\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2.5\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n className={styles['chevron']}\n >\n <polyline points=\"15 18 9 12 15 6\" />\n </svg>\n );\n}\n\nfunction ChevronRight() {\n return (\n <svg\n viewBox=\"0 0 24 24\"\n width=\"16\"\n height=\"16\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2.5\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n className={styles['chevron']}\n >\n <polyline points=\"9 18 15 12 9 6\" />\n </svg>\n );\n}\n\nfunction resolveTitle(title: string, fallbackPath: string): string {\n return title && title !== 'No title.' ? title : fallbackPath;\n}\n\nfunction resolveDescription(description: string): string | undefined {\n return description && description !== 'No description.' ? description : undefined;\n}\n\ninterface NavigationCardProps {\n node: page_node;\n direction: 'previous' | 'next';\n hrefBuilder: (path: string) => string;\n}\n\nfunction NavigationCard({ node, direction, hrefBuilder }: NavigationCardProps) {\n const title = resolveTitle(node.frontmatter.title, node.path);\n const description = resolveDescription(node.frontmatter.description);\n\n return (\n <a href={hrefBuilder(node.path)} className={clsx(styles['card'], styles[direction])} data-direction={direction}>\n <span className={styles['meta']}>\n {direction === 'previous' && <ChevronLeft />}\n <span className={styles['title']}>{title}</span>\n {direction === 'next' && <ChevronRight />}\n </span>\n {description && <span className={styles['description']}>{description}</span>}\n </a>\n );\n}\n\nexport function PageNavigation({ className, tree, currentPath, hrefBuilder = defaultHrefBuilder, ...props }: DocumentationNavigationProps) {\n const { previous, next } = useMemo(() => {\n const pages = flattenPages(tree);\n const currentIndex = pages.findIndex((page) => page.path === currentPath);\n\n if (currentIndex === -1) {\n return { previous: undefined, next: undefined };\n }\n\n return {\n previous: pages[currentIndex - 1],\n next: pages[currentIndex + 1],\n };\n }, [tree, currentPath]);\n\n if (!previous && !next) return null;\n\n return (\n <nav className={clsx(styles['navigation'], className)} aria-label=\"Pagination\" {...props}>\n <div className={styles['slot']}>{previous && <NavigationCard node={previous} direction=\"previous\" hrefBuilder={hrefBuilder} />}</div>\n <div className={clsx(styles['slot'], styles['slot-end'])}>\n {next && <NavigationCard node={next} direction=\"next\" hrefBuilder={hrefBuilder} />}\n </div>\n </nav>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;GCoBM,KAAsB,MAAiB;AAQ7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M,KAAA;EAAU,IAGzC;GACL,UAAU,EAAM,IAAe;GAC/B,MAAM,EAAM,IAAe;EAC7B;CACF,GAAG,CAAC,GAAM,CAAW,CAAC;CAItB,OAFI,CAAC,KAAY,CAAC,IAAa,OAG7B,kBAAC,OAAD;EAAK,WAAW,EAAK,EAAO,YAAe,CAAS;EAAG,cAAW;EAAa,GAAI;YAAnF,CACE,kBAAC,OAAD;GAAK,WAAW,EAAO;aAAU,KAAY,kBAAC,GAAD;IAAgB,MAAM;IAAU,WAAU;IAAwB;GAAc,CAAA;EAAO,CAAA,GACpI,kBAAC,OAAD;GAAK,WAAW,EAAK,EAAO,MAAS,EAAO,WAAW;aACpD,KAAQ,kBAAC,GAAD;IAAgB,MAAM;IAAM,WAAU;IAAoB;GAAc,CAAA;EAC9E,CAAA,CACF;;AAET"}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
require('./assets/sidebar.css');const e=require("./clsx-CPcBvw4Z.cjs");let t=require("react"),n=require("react/jsx-runtime");var r={sidebar:`_sidebar_1370u_4`,overlay:`_overlay_1370u_36`,"sidebar-open":`_sidebar-open_1370u_58`,fadeIn:`_fadeIn_1370u_1`,nav:`_nav_1370u_92`,list:`_list_1370u_97`,item:`_item_1370u_106`,row:`_row_1370u_110`,link:`_link_1370u_115`,"category-label":`_category-label_1370u_116`,"category-link":`_category-link_1370u_150`,active:`_active_1370u_157`,toggle:`_toggle_1370u_168`,chevron:`_chevron_1370u_191`,"chevron-open":`_chevron-open_1370u_195`,icon:`_icon_1370u_199`,label:`_label_1370u_209`},i=e=>e,a=()=>null;function o({className:o,children:s,tree:c,currentPath:l,hrefBuilder:u=i,iconResolver:d=a,isOpen:f=!1,onClose:m,...h}){return(0,t.useEffect)(()=>(f?document.body.style.overflow=`hidden`:document.body.style.overflow=``,()=>{document.body.style.overflow=``}),[f]),(0,n.jsxs)(n.Fragment,{children:[f&&(0,n.jsx)(`div`,{className:r.overlay,onClick:m}),(0,n.jsxs)(`aside`,{className:e.t(r.sidebar,f&&r[`sidebar-open`],o),...h,children:[(0,n.jsx)(`nav`,{className:r.nav,children:(0,n.jsx)(p,{nodes:c,depth:1,currentPath:l,hrefBuilder:u,iconResolver:d,onLinkClick:m})}),s]})]})}function s(e){return e.children.find(e=>e.type===`data`)}function c(e){return e.children.find(e=>e.type===`page`&&e.index===!0)}function l(e){return e.type===`category`?s(e)?.frontmatter?.order??1/0:e.type===`page`?e.frontmatter.order??1/0:1/0}function u(e){return e.map((e,t)=>({node:e,index:t})).filter(({node:e})=>e.type!==`data`).sort((e,t)=>{let n=l(e.node)-l(t.node);return n===0?e.index-t.index:n}).map(({node:e})=>e)}function d(e,t){return e&&e!==`No title.`?e:t}function f({open:t}){return(0,n.jsx)(`svg`,{viewBox:`0 0 24 24`,width:`13`,height:`13`,fill:`none`,stroke:`currentColor`,strokeWidth:`2.5`,strokeLinecap:`round`,strokeLinejoin:`round`,className:e.t(r.chevron,t&&r[`chevron-open`]),children:(0,n.jsx)(`polyline`,{points:`9 6 15 12 9 18`})})}function p({nodes:i,depth:a,currentPath:o,hrefBuilder:s,iconResolver:c,onLinkClick:l}){let f=(0,t.useMemo)(()=>u(i),[i]);return(0,n.jsx)(`ul`,{className:r.list,"data-depth":a,children:f.map(t=>{if(t.type===`page`){if(t.index)return null;let i=t.path===o,u=c(t.frontmatter.icon);return(0,n.jsx)(`li`,{className:r.item,children:(0,n.jsxs)(`a`,{href:s(t.path),className:e.t(r.link,i&&r.active),style:{"--depth":a},onClick:l,children:[u&&(0,n.jsx)(`span`,{className:r.icon,children:u}),(0,n.jsx)(`span`,{className:r.label,children:d(t.frontmatter.title,t.path)})]})},t.path)}return t.type===`category`?(0,n.jsx)(m,{category:t,depth:a,currentPath:o,hrefBuilder:s,iconResolver:c,onLinkClick:l},t.path):null})})}function m({category:i,depth:a,currentPath:o,hrefBuilder:l,iconResolver:u,onLinkClick:m}){let h=c(i),g=s(i),_=g?.frontmatter?.title??(h?d(h.frontmatter.title,i.path):i.path),v=u(g?.frontmatter?.icon??h?.frontmatter?.icon),y=i.children.filter(e=>e.type!==`data`&&!(e.type===`page`&&e.index===!0)),b=y.length>0,x=h?h.path===o:!1,[S,C]=(0,t.useState)(!0);return(0,n.jsxs)(`li`,{className:r.item,children:[(0,n.jsxs)(`div`,{className:r.row,children:[h?(0,n.jsxs)(`a`,{href:l(i.path),className:e.t(r.link,r[`category-link`],x&&r.active),style:{"--depth":a},onClick:m,children:[v&&(0,n.jsx)(`span`,{className:r.icon,children:v}),(0,n.jsx)(`span`,{className:r.label,children:_})]}):(0,n.jsxs)(`button`,{type:`button`,className:e.t(r.link,r[`category-label`]),style:{"--depth":a},onClick:()=>b&&C(e=>!e),children:[v&&(0,n.jsx)(`span`,{className:r.icon,children:v}),(0,n.jsx)(`span`,{className:r.label,children:_})]}),b&&(0,n.jsx)(`button`,{type:`button`,className:r.toggle,"aria-label":S?`Collapse`:`Expand`,"aria-expanded":S,onClick:()=>C(e=>!e),children:(0,n.jsx)(f,{open:S})})]}),b&&S&&(0,n.jsx)(p,{nodes:y,depth:a+1,currentPath:o,hrefBuilder:l,iconResolver:u,onLinkClick:m})]})}Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return o}});
|
|
2
|
-
//# sourceMappingURL=sidebar-DGEZFbBi.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"sidebar-DGEZFbBi.cjs","names":[],"sources":["../../styles/src/components/documentation/sidebar/index.module.css","../src/components/documentation/sidebar/index.tsx"],"sourcesContent":["/* index.module.css */\n@import '../../../variables.css';\n\n.sidebar {\n min-width: var(--_sleetch-sidebar-width);\n height: calc(100vh - var(--_sleetch-header-height));\n position: sticky;\n top: var(--_sleetch-header-height);\n color: var(--_sleetch-color-text);\n padding: 4em 1.5em;\n border-right: 1px dashed var(--_sleetch-color-muted);\n display: flex;\n flex-direction: column;\n overflow-y: auto;\n scrollbar-width: thin;\n scrollbar-color: var(--_sleetch-color-muted) transparent;\n}\n\n.sidebar::-webkit-scrollbar {\n width: 6px;\n}\n\n.sidebar::-webkit-scrollbar-track {\n background: transparent;\n}\n\n.sidebar::-webkit-scrollbar-thumb {\n background-color: var(--_sleetch-color-muted);\n border-radius: 3px;\n}\n\n.sidebar::-webkit-scrollbar-thumb:hover {\n background-color: var(--_sleetch-color-muted-foreground);\n}\n\n.overlay {\n display: none;\n}\n\n@media (max-width: 768px) {\n .sidebar {\n position: fixed;\n top: var(--_sleetch-header-height);\n left: 0;\n bottom: 0;\n width: 280px;\n min-width: 280px;\n max-width: 85vw;\n z-index: 90;\n background-color: var(--_sleetch-color-background);\n transform: translateX(-100%);\n transition: transform 0.3s ease;\n padding: 2em 1.5em;\n border-right: 1px solid var(--_sleetch-color-muted);\n box-shadow: 2px 0 8px rgba(0, 0, 0, 0.3);\n }\n\n .sidebar-open {\n transform: translateX(0);\n }\n\n .overlay {\n display: block;\n position: fixed;\n top: var(--_sleetch-header-height);\n left: 0;\n right: 0;\n bottom: 0;\n background-color: rgba(0, 0, 0, 0.5);\n z-index: 89;\n backdrop-filter: blur(2px);\n animation: fadeIn 0.3s ease;\n }\n\n @keyframes fadeIn {\n from {\n opacity: 0;\n }\n to {\n opacity: 1;\n }\n }\n}\n\n@media (min-width: 769px) and (max-width: 1024px) {\n .sidebar {\n min-width: 260px;\n padding: 3em 1.2em;\n }\n}\n\n.nav {\n display: flex;\n flex-direction: column;\n}\n\n.list {\n list-style: none;\n margin: 0;\n padding: 0;\n display: flex;\n flex-direction: column;\n gap: 4px;\n}\n\n.item {\n min-width: 0;\n}\n\n.row {\n display: flex;\n align-items: center;\n}\n\n.link,\n.category-label {\n --depth: 1;\n flex: 1;\n display: flex;\n align-items: center;\n gap: 0.55em;\n width: 100%;\n min-width: 0;\n margin-left: -1px;\n padding-block: 0.4em;\n padding-left: calc(1em + (var(--depth) - 1) * 1em);\n padding-right: 0.5em;\n border: none;\n border-left: 3px solid transparent;\n background: none;\n font-family: var(--_sleetch-font-base);\n font-size: calc(1em - (var(--depth) - 1) * 0.03em);\n line-height: 1.3;\n text-align: left;\n color: var(--_sleetch-color-muted-foreground);\n text-decoration: none;\n cursor: pointer;\n transition:\n color var(--_sleetch-transition-duration) var(--_sleetch-transition-timing),\n border-color var(--_sleetch-transition-duration) var(--_sleetch-transition-timing),\n background-color var(--_sleetch-transition-duration) var(--_sleetch-transition-timing),\n transform var(--_sleetch-transition-duration) var(--_sleetch-transition-timing);\n}\n\n.link:hover,\n.category-label:hover {\n color: var(--_sleetch-color-text);\n}\n\n.category-link,\n.category-label {\n font-weight: var(--_sleetch-font-weight-heading);\n color: var(--_sleetch-color-text);\n padding-top: 0.5em;\n}\n\n.active {\n border-left-color: var(--_sleetch-color-text-primary);\n background: color-mix(in srgb, var(--_sleetch-color-text-underline) 35%, transparent);\n color: var(--_sleetch-color-text);\n transform: translateX(4px);\n}\n\n.active:hover {\n transform: translateX(6px);\n}\n\n.toggle {\n flex-shrink: 0;\n display: flex;\n align-items: center;\n justify-content: center;\n width: 1.7em;\n height: 1.7em;\n margin-right: 0.2em;\n background: none;\n border: none;\n border-radius: var(--_sleetch-radius);\n color: var(--_sleetch-color-muted-foreground);\n cursor: pointer;\n transition:\n background-color var(--_sleetch-transition-duration) var(--_sleetch-transition-timing),\n color var(--_sleetch-transition-duration) var(--_sleetch-transition-timing);\n}\n\n.toggle:hover {\n background-color: var(--_sleetch-color-card);\n color: var(--_sleetch-color-text);\n}\n\n.chevron {\n transition: transform var(--_sleetch-transition-duration) var(--_sleetch-transition-timing);\n}\n\n.chevron-open {\n transform: rotate(90deg);\n}\n\n.icon {\n flex-shrink: 0;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n width: 1.1em;\n height: 1.1em;\n opacity: 0.75;\n}\n\n.label {\n flex: 1;\n min-width: 0;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n","/*\n AI Generated :(\n Needs more testing\n*/\n\nimport type { BaseHTMLAttributes, ReactNode } from 'react';\nimport { useMemo, useState, useEffect } from 'react';\nimport clsx from 'clsx';\nimport styles from '@sleetch/styles/components/documentation/sidebar/index.module.css';\nimport type { tree_object } from '@sleetch/core/compiler';\n\nexport interface DocumentationSidebarProps extends BaseHTMLAttributes<HTMLBaseElement> {\n tree: tree_object[];\n currentPath?: string;\n hrefBuilder?: (path: string) => string;\n iconResolver?: (icon?: string) => ReactNode;\n isOpen?: boolean;\n onClose?: () => void;\n}\n\nconst defaultHrefBuilder = (path: string) => path;\nconst defaultIconResolver = (): ReactNode => null;\n\nexport function DocumentationSidebar({\n className,\n children,\n tree,\n currentPath,\n hrefBuilder = defaultHrefBuilder,\n iconResolver = defaultIconResolver,\n isOpen = false,\n onClose,\n ...props\n}: DocumentationSidebarProps) {\n useEffect(() => {\n if (isOpen) {\n document.body.style.overflow = 'hidden';\n } else {\n document.body.style.overflow = '';\n }\n return () => {\n document.body.style.overflow = '';\n };\n }, [isOpen]);\n\n return (\n <>\n {isOpen && <div className={styles['overlay']} onClick={onClose} />}\n <aside className={clsx(styles['sidebar'], isOpen && styles['sidebar-open'], className)} {...props}>\n <nav className={styles['nav']}>\n <SidebarTree nodes={tree} depth={1} currentPath={currentPath} hrefBuilder={hrefBuilder} iconResolver={iconResolver} onLinkClick={onClose} />\n </nav>\n {children}\n </aside>\n </>\n );\n}\n\ntype category_node = Extract<tree_object, { type: 'category' }>;\ntype page_node = Extract<tree_object, { type: 'page' }>;\ntype data_node = Extract<tree_object, { type: 'data' }>;\n\nfunction getCategoryData(category: category_node): data_node | undefined {\n return category.children.find((c): c is data_node => c.type === 'data');\n}\n\nfunction getCategoryIndex(category: category_node): page_node | undefined {\n return category.children.find((c): c is page_node => c.type === 'page' && c.index === true);\n}\n\nfunction getOrder(node: tree_object): number {\n if (node.type === 'category') {\n const data = getCategoryData(node);\n return data?.frontmatter?.order ?? Number.POSITIVE_INFINITY;\n }\n if (node.type === 'page') {\n return (node.frontmatter as { order?: number }).order ?? Number.POSITIVE_INFINITY;\n }\n return Number.POSITIVE_INFINITY;\n}\n\nfunction sortNodes(nodes: tree_object[]): tree_object[] {\n return nodes\n .map((node, index) => ({ node, index }))\n .filter(({ node }) => node.type !== 'data')\n .sort((a, b) => {\n const diff = getOrder(a.node) - getOrder(b.node);\n return diff !== 0 ? diff : a.index - b.index;\n })\n .map(({ node }) => node);\n}\n\nfunction resolveTitle(title: string, fallbackPath: string): string {\n return title && title !== 'No title.' ? title : fallbackPath;\n}\n\nfunction Chevron({ open }: { open: boolean }) {\n return (\n <svg\n viewBox=\"0 0 24 24\"\n width=\"13\"\n height=\"13\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2.5\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n className={clsx(styles['chevron'], open && styles['chevron-open'])}\n >\n <polyline points=\"9 6 15 12 9 18\" />\n </svg>\n );\n}\n\ninterface HrefContext {\n currentPath?: string;\n hrefBuilder: (path: string) => string;\n iconResolver: (icon?: string) => ReactNode;\n onLinkClick?: () => void;\n}\n\ninterface SidebarTreeProps extends HrefContext {\n nodes: tree_object[];\n depth: number;\n}\n\nfunction SidebarTree({ nodes, depth, currentPath, hrefBuilder, iconResolver, onLinkClick }: SidebarTreeProps) {\n const sorted = useMemo(() => sortNodes(nodes), [nodes]);\n\n return (\n <ul className={styles['list']} data-depth={depth}>\n {sorted.map((node) => {\n if (node.type === 'page') {\n if (node.index) return null;\n\n const isActive = node.path === currentPath;\n const icon = iconResolver(node.frontmatter.icon);\n\n return (\n <li key={node.path} className={styles['item']}>\n <a\n href={hrefBuilder(node.path)}\n className={clsx(styles['link'], isActive && styles['active'])}\n style={{ '--depth': depth } as React.CSSProperties}\n onClick={onLinkClick}\n >\n {icon && <span className={styles['icon']}>{icon}</span>}\n <span className={styles['label']}>{resolveTitle(node.frontmatter.title, node.path)}</span>\n </a>\n </li>\n );\n }\n\n if (node.type === 'category') {\n return (\n <CategoryItem\n key={node.path}\n category={node}\n depth={depth}\n currentPath={currentPath}\n hrefBuilder={hrefBuilder}\n iconResolver={iconResolver}\n onLinkClick={onLinkClick}\n />\n );\n }\n\n return null;\n })}\n </ul>\n );\n}\n\ninterface CategoryItemProps extends HrefContext {\n category: category_node;\n depth: number;\n}\n\nfunction CategoryItem({ category, depth, currentPath, hrefBuilder, iconResolver, onLinkClick }: CategoryItemProps) {\n const indexPage = getCategoryIndex(category);\n const data = getCategoryData(category);\n\n const title = data?.frontmatter?.title ?? (indexPage ? resolveTitle(indexPage.frontmatter.title, category.path) : category.path);\n\n const iconName = data?.frontmatter?.icon ?? indexPage?.frontmatter?.icon;\n const icon = iconResolver(iconName);\n\n const childNodes = category.children.filter((c) => c.type !== 'data' && !(c.type === 'page' && c.index === true));\n\n const hasChildren = childNodes.length > 0;\n const isIndexActive = indexPage ? indexPage.path === currentPath : false;\n\n const [open, setOpen] = useState(true);\n\n return (\n <li className={styles['item']}>\n <div className={styles['row']}>\n {indexPage ? (\n <a\n href={hrefBuilder(category.path)}\n className={clsx(styles['link'], styles['category-link'], isIndexActive && styles['active'])}\n style={{ '--depth': depth } as React.CSSProperties}\n onClick={onLinkClick}\n >\n {icon && <span className={styles['icon']}>{icon}</span>}\n <span className={styles['label']}>{title}</span>\n </a>\n ) : (\n <button\n type=\"button\"\n className={clsx(styles['link'], styles['category-label'])}\n style={{ '--depth': depth } as React.CSSProperties}\n onClick={() => hasChildren && setOpen((o) => !o)}\n >\n {icon && <span className={styles['icon']}>{icon}</span>}\n <span className={styles['label']}>{title}</span>\n </button>\n )}\n\n {hasChildren && (\n <button\n type=\"button\"\n className={styles['toggle']}\n aria-label={open ? 'Collapse' : 'Expand'}\n aria-expanded={open}\n onClick={() => setOpen((o) => !o)}\n >\n <Chevron open={open} />\n </button>\n )}\n </div>\n\n {hasChildren && open && (\n <SidebarTree\n nodes={childNodes}\n depth={depth + 1}\n currentPath={currentPath}\n hrefBuilder={hrefBuilder}\n iconResolver={iconResolver}\n onLinkClick={onLinkClick}\n />\n )}\n </li>\n );\n}\n"],"mappings":"8kBCoBM,EAAsB,GAAiB,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