diff --git a/src/components/navigation/sidebars/TOC.astro b/src/components/navigation/sidebars/TOC.astro index 2180001..e997f9d 100644 --- a/src/components/navigation/sidebars/TOC.astro +++ b/src/components/navigation/sidebars/TOC.astro @@ -1,7 +1,13 @@ --- import TableOfContents from "./toc"; import type { ConfigHeading, TypeTOC } from "./types.d.ts"; -import type { TypeData } from "@config/io/types"; +import type { + TypeData, + QuickshellFunction, + // QuickshellSignal, + // QuickshellVariant, + // QuickshellProps, +} from "@config/_types"; export interface Props { title?: string; @@ -15,7 +21,7 @@ const { title, headings, type, mobile } = Astro.props; const types: TypeTOC | null = type ? { properties: Object.keys(type.properties ?? {}), - functions: (type.functions ?? []).map(f => f.name), + functions: (type.functions ?? []).map((f:QuickshellFunction) => f.name), signals: Object.keys(type.signals ?? {}), variants: Object.keys(type.variants ?? {}), } diff --git a/src/components/navigation/sidebars/nav/SidebarWrapper.tsx b/src/components/navigation/sidebars/nav/SidebarWrapper.tsx index 00726f8..b8cb03e 100644 --- a/src/components/navigation/sidebars/nav/SidebarWrapper.tsx +++ b/src/components/navigation/sidebars/nav/SidebarWrapper.tsx @@ -32,6 +32,7 @@ const NavComponent: Component = props => { if ( isLink || !isInBody || + //@ts-expect-error (isInBody && !navRef.contains(event.target as Node)) ) { setOpen(false); diff --git a/src/components/navigation/sidebars/toc/i.tsx.bak b/src/components/navigation/sidebars/toc/i.tsx.bak deleted file mode 100644 index 49cd9fc..0000000 --- a/src/components/navigation/sidebars/toc/i.tsx.bak +++ /dev/null @@ -1,52 +0,0 @@ -import { createSignal, type Component } from "solid-js"; - -import { Article } from "@icons"; -import { Table } from "./Table"; -import type { - TOCProps, - TypeTOC, - ConfigHeading, -} from "../types"; -import { buildHierarchy } from "@config/io/helpers"; - -const TableOfContents: Component = props => { - const [open, setOpen] = createSignal(false); - const [typeProps] = createSignal( - props.type - ); - const [configProps] = createSignal< - ConfigHeading[] | undefined - >(props.config); - - function toggle(e: MouseEvent) { - e.preventDefault(); - setOpen(!open()); - } - - if (!props.mobile) { - return typeProps() ? ( - - ) : ( -
- ); - } - - return ( -
- ) : ( -
- )} - - - ); -}; - -export default TableOfContents; diff --git a/src/components/navigation/sidebars/toc/index.tsx b/src/components/navigation/sidebars/toc/index.tsx index d1a31e1..682d821 100644 --- a/src/components/navigation/sidebars/toc/index.tsx +++ b/src/components/navigation/sidebars/toc/index.tsx @@ -40,6 +40,7 @@ const TableOfContents: Component = props => { if ( isLink || !isInBody || + //@ts-expect-error (isInBody && !tocRef.contains(event.target as Node)) ) { setOpen(false); diff --git a/src/components/type/Functions.astro b/src/components/type/Functions.astro index 317e2c2..ccc3697 100644 --- a/src/components/type/Functions.astro +++ b/src/components/type/Functions.astro @@ -2,7 +2,7 @@ import type { QMLTypeLinkObject, QuickshellFunction, -} from "@config/io/types"; +} from "@config/_types"; import { getQMLTypeLink } from "@config/io/helpers"; import { Tag } from "@icons"; import TypeDetails from "./TypeDetails.astro"; diff --git a/src/components/type/Properties.astro b/src/components/type/Properties.astro index f655d0c..06374f9 100644 --- a/src/components/type/Properties.astro +++ b/src/components/type/Properties.astro @@ -3,7 +3,7 @@ import { getQMLTypeLink } from "@config/io/helpers"; import type { QMLTypeLinkObject, QuickshellProps, -} from "@config/io/types"; +} from "@config/_types"; import { Tag } from "@icons"; import TypeTitle from "./TypeTitle.astro"; diff --git a/src/components/type/Signals.astro b/src/components/type/Signals.astro index 20da416..e3318a1 100644 --- a/src/components/type/Signals.astro +++ b/src/components/type/Signals.astro @@ -1,6 +1,6 @@ --- import { getQMLTypeLink } from "@config/io/helpers"; -import type { QuickshellSignal } from "@config/io/types"; +import type { QuickshellSignal } from "@config/_types"; import { Tag } from "@icons"; import TypeDetails from "./TypeDetails.astro"; import TypeTitle from "./TypeTitle.astro"; diff --git a/src/components/type/Variants.astro b/src/components/type/Variants.astro index 0ffd168..4f1c869 100644 --- a/src/components/type/Variants.astro +++ b/src/components/type/Variants.astro @@ -1,5 +1,5 @@ --- -import type { QuickshellVariant } from "@config/io/types"; +import type { QuickshellVariant } from "@config/_types"; import TypeDetails from "./TypeDetails.astro"; import TypeTitle from "./TypeTitle.astro"; diff --git a/src/layouts/DocsLayout.astro b/src/layouts/DocsLayout.astro index eac019a..0563420 100644 --- a/src/layouts/DocsLayout.astro +++ b/src/layouts/DocsLayout.astro @@ -103,6 +103,7 @@ for (const segment of url) { // FIXME: need to make this work properly, or fold into the markdown processor let headings = document.getElementsByClassName("heading") if (headings.length > 0) { + //@ts-expect-error for (const heading of headings) { let button = heading.querySelector("h2") if (button) { diff --git a/src/pages/docs/[version]/guide/[...id].astro b/src/pages/docs/[version]/guide/[...id].astro index 54d2deb..c8c51be 100644 --- a/src/pages/docs/[version]/guide/[...id].astro +++ b/src/pages/docs/[version]/guide/[...id].astro @@ -2,7 +2,6 @@ import GuideLayout from "@layouts/GuideLayout.astro"; import { getVersionsData } from "@config/io/generateTypeData"; import { getGuideCollection } from "@config/io/guides"; -import { processMarkdown } from "@config/io/markdown"; import { render } from "astro:content"; @@ -26,11 +25,14 @@ export async function getStaticPaths() { return pages.flat(); } -const { version, page } = Astro.props; +const { page } = Astro.props; const { headings, Content } = await render(page); +// xnzf: version is decided before these pages get processed +// V // we can't use 'Content' because there isn't a way to pass in a version -const html = await processMarkdown(version.name, page.body!); + +// const html = await processMarkdown(version.name, page.body!); --- diff --git a/tsconfig.json b/tsconfig.json index cbe0a62..461afec 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,7 +1,9 @@ { "extends": "astro/tsconfigs/strict", "compilerOptions": { - "lib": ["es2016"], + "lib": [ + "es2023" + ], "plugins": [ { "name": "@astrojs/ts-plugin" @@ -12,16 +14,36 @@ "verbatimModuleSyntax": true, "baseUrl": ".", "paths": { - "@*": ["./*"], - "@/*": ["./src/*"], - "@config/*": ["./src/config/*"], - "@icons": ["./src/components/icons.tsx"], - "@icons/*": ["./src/icons/*"], - "@components/*": ["./src/components/*"], - "@layouts/*": ["./src/layouts/*"], - "@styles/*": ["./src/styles/*"], - "@_types": ["./src/config/_types/index.ts"], - "@_types/*": ["./src/config/_types/*"] + "@*": [ + "./*" + ], + "@/*": [ + "./src/*" + ], + "@config/*": [ + "./src/config/*" + ], + "@icons": [ + "./src/components/icons.tsx" + ], + "@icons/*": [ + "./src/icons/*" + ], + "@components/*": [ + "./src/components/*" + ], + "@layouts/*": [ + "./src/layouts/*" + ], + "@styles/*": [ + "./src/styles/*" + ], + "@_types": [ + "./src/config/_types/index.ts" + ], + "@_types/*": [ + "./src/config/_types/*" + ] } } }