diff --git a/docs/.eslintrc.json b/docs/.eslintrc.json deleted file mode 100644 index 3f47543412..0000000000 --- a/docs/.eslintrc.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "rules": { - "import/extensions": 0 - } -} diff --git a/docs/.gitignore b/docs/.gitignore index 649c9b9df2..ca662e8710 100644 --- a/docs/.gitignore +++ b/docs/.gitignore @@ -1,45 +1,31 @@ -# See https://help.github.com/articles/ignoring-files/ for more about ignoring files. - -# dependencies +# deps /node_modules -/.pnp -.pnp.js -.yarn/install-state.gz -# testing -/coverage +# generated content +.source -# next.js +# test & build +/coverage /.next/ /out/ - -# production /build +*.tsbuildinfo # misc .DS_Store *.pem - -# debug +/.pnp +.pnp.js npm-debug.log* yarn-debug.log* yarn-error.log* -# local env files +# others .env*.local - -# vercel .vercel - -# typescript -*.tsbuildinfo next-env.d.ts - -# database -*.db - # Sentry Config File .env.sentry-build-plugin + /content/examples/*/* -/components/example/generated/ -/.source/ \ No newline at end of file +/components/example/generated/ \ No newline at end of file diff --git a/docs/app/(auth)/layout.tsx b/docs/app/(auth)/layout.tsx new file mode 100644 index 0000000000..715e32a774 --- /dev/null +++ b/docs/app/(auth)/layout.tsx @@ -0,0 +1,10 @@ +import { HomeLayout } from "@/components/fumadocs/layout/home"; +import { baseOptions } from "@/lib/layout.shared"; + +export default function Layout({ children }: { children: React.ReactNode }) { + return ( + +
{children}
+
+ ); +} diff --git a/docs/app/(auth)/signin/page.tsx b/docs/app/(auth)/signin/page.tsx new file mode 100644 index 0000000000..b21d007847 --- /dev/null +++ b/docs/app/(auth)/signin/page.tsx @@ -0,0 +1,18 @@ +import AuthenticationPage from "@/components/AuthenticationPage"; +import { getFullMetadata } from "@/lib/getFullMetadata"; +import { Suspense } from "react"; + +export const metadata = getFullMetadata({ + title: "Sign In", + path: "/signin", +}); + +// Suspense + imported AuthenticationPage because AuthenticationPage is a client component +// https://nextjs.org/docs/app/api-reference/functions/use-search-params#static-rendering +export default function Page() { + return ( + + + + ); +} diff --git a/docs/app/(auth)/signin/password/page.tsx b/docs/app/(auth)/signin/password/page.tsx new file mode 100644 index 0000000000..d998c4db48 --- /dev/null +++ b/docs/app/(auth)/signin/password/page.tsx @@ -0,0 +1,17 @@ +import AuthenticationPage from "@/components/AuthenticationPage"; +import { Metadata } from "next"; +import { Suspense } from "react"; + +export const metadata: Metadata = { + title: "Password Login", +}; + +// Suspense + imported AuthenticationPage because AuthenticationPage is a client component +// https://nextjs.org/docs/app/api-reference/functions/use-search-params#static-rendering +export default function Page() { + return ( + + + + ); +} diff --git a/docs/app/(auth)/signup/page.tsx b/docs/app/(auth)/signup/page.tsx new file mode 100644 index 0000000000..04aceaa07a --- /dev/null +++ b/docs/app/(auth)/signup/page.tsx @@ -0,0 +1,18 @@ +import AuthenticationPage from "@/components/AuthenticationPage"; +import { getFullMetadata } from "@/lib/getFullMetadata"; +import { Suspense } from "react"; + +export const metadata = getFullMetadata({ + title: "Sign Up", + path: "/signup", +}); + +// Suspense + imported AuthenticationPage because AuthenticationPage is a client component +// https://nextjs.org/docs/app/api-reference/functions/use-search-params#static-rendering +export default function Page() { + return ( + + + + ); +} diff --git a/docs/app/(home)/community/Community.tsx b/docs/app/(home)/community/Community.tsx index f17a69c923..8cf5cb935f 100644 --- a/docs/app/(home)/community/Community.tsx +++ b/docs/app/(home)/community/Community.tsx @@ -1,8 +1,8 @@ -import { FC } from "react"; -import { Contributors } from "@/app/(home)/community/Contributors"; -import { Section } from "@/components/Section"; -import { Sponsors } from "@/app/(home)/community/Sponsors"; import { SectionIntro } from "@/components/Headings"; +import { Section } from "@/components/Section"; +import { FC } from "react"; +import { Contributors } from "./Contributors"; +import { Sponsors } from "./Sponsors"; export const Community: FC = () => (
diff --git a/docs/app/(home)/community/Contributors.tsx b/docs/app/(home)/community/Contributors.tsx index 0b15e9c90e..7ad56be9d8 100644 --- a/docs/app/(home)/community/Contributors.tsx +++ b/docs/app/(home)/community/Contributors.tsx @@ -1,9 +1,9 @@ +import { FadeIn } from "@/components/FadeIn"; +import { SectionSubHeader } from "@/components/Headings"; import Image from "next/image"; import Link from "next/link"; import { RiDiscordFill, RiGithubFill } from "react-icons/ri"; -import { SectionSubHeader } from "@/components/Headings"; -import { JoinButton } from "@/app/(home)/community/JoinButton"; -import { FadeIn } from "@/components/FadeIn"; +import { JoinButton } from "./JoinButton"; // TODO: Use GitHub API function fetchContributors(): { username: string; avatarUrl: string }[] { diff --git a/docs/app/(home)/community/Sponsors.tsx b/docs/app/(home)/community/Sponsors.tsx index 1dcf1cbb05..b01a749266 100644 --- a/docs/app/(home)/community/Sponsors.tsx +++ b/docs/app/(home)/community/Sponsors.tsx @@ -1,9 +1,6 @@ -import { - SponsorCard, - SponsorCardProps, -} from "@/app/(home)/community/SponsorCard"; import { FadeIn } from "@/components/FadeIn"; import { SectionSubHeader } from "@/components/Headings"; +import { SponsorCard, SponsorCardProps } from "./SponsorCard"; import agree from "@/public/img/sponsors/agree.png"; import atuin from "@/public/img/sponsors/atuin.png"; diff --git a/docs/app/(home)/error.tsx b/docs/app/(home)/error.tsx new file mode 100644 index 0000000000..e9d74decf7 --- /dev/null +++ b/docs/app/(home)/error.tsx @@ -0,0 +1,34 @@ +"use client"; // Error boundaries must be Client Components + +import * as Sentry from "@sentry/nextjs"; +import { DocsBody } from "fumadocs-ui/layouts/docs/page"; +import { useEffect } from "react"; + +export default function Error({ + error, + reset, +}: { + error: Error & { digest?: string }; + reset: () => void; +}) { + useEffect(() => { + Sentry.captureException(error, { + tags: { type: "react-render", source: "home" }, + }); + }, [error]); + + return ( +
+ +

Whoops. What the blocks!?

+
+ We encountered an error trying to show this page. If this keeps + occuring, an issue can be filed on GitHub at{" "} + + https://github.com/TypeCellOS/BlockNote/issues + +
+
+
+ ); +} diff --git a/docs/app/(home)/faq/FAQ.tsx b/docs/app/(home)/faq/FAQ.tsx index d6a724587e..873184a783 100644 --- a/docs/app/(home)/faq/FAQ.tsx +++ b/docs/app/(home)/faq/FAQ.tsx @@ -27,8 +27,8 @@ const faqs = [ <> 100% of BlockNote is open source. We offer consultancy, support services and commercial licenses for specific XL packages to help sustain - BlockNote. Explore our pricing page for more - details. + BlockNote. Explore our pricing page for + more details. ), }, diff --git a/docs/app/(home)/hero/Hero.tsx b/docs/app/(home)/hero/Hero.tsx index 69bf537563..bd7c890476 100644 --- a/docs/app/(home)/hero/Hero.tsx +++ b/docs/app/(home)/hero/Hero.tsx @@ -1,7 +1,7 @@ -import { Section } from "@/components/Section"; -import { Text } from "@/app/(home)/hero/Text"; -import { Demo } from "@/app/(home)/hero/Demo"; import { FadeIn } from "@/components/FadeIn"; +import { Section } from "@/components/Section"; +import { Demo } from "./Demo"; +import { Text } from "./Text"; import "./styles.css"; diff --git a/docs/app/(home)/layout.tsx b/docs/app/(home)/layout.tsx index 1cdb476017..be4a00255b 100644 --- a/docs/app/(home)/layout.tsx +++ b/docs/app/(home)/layout.tsx @@ -1,32 +1,6 @@ -import type { ReactNode } from "react"; -import { HomeLayout } from "fumadocs-ui/layouts/home"; -import { baseOptions } from "@/app/layout.config"; -import { Footer } from "@/components/Footer"; -import * as Sentry from "@sentry/nextjs"; +import { HomeLayout } from "@/components/fumadocs/layout/home"; +import { baseOptions } from "@/lib/layout.shared"; -export default function Layout({ children }: { children: ReactNode }) { - return ( - <> - - - We encountered an error trying to show this page. Please report - this to us on GitHub at{" "} - - https://github.com/TypeCellOS/BlockNote/issues - - - } - beforeCapture={(scope) => { - scope.setTag("type", "react-render"); - scope.setTag("page", "home"); - }} - > - {children} - - -