diff --git a/apps/website/next.config.js b/apps/website/next.config.js index dd9313fde..68ebb93bf 100644 --- a/apps/website/next.config.js +++ b/apps/website/next.config.js @@ -23,6 +23,7 @@ export default withBundleAnalyzer({ }, images: { dangerouslyAllowSVG: true, - contentSecurityPolicy: "default-src 'self'; script-src 'none'; frame-src 'none'; sandbox;", + contentDispositionType: 'attachment', + contentSecurityPolicy: "default-src 'self'; frame-src 'none'; sandbox;", }, }); diff --git a/apps/website/src/app/docs/packages/[package]/[version]/[item]/loading.tsx b/apps/website/src/app/docs/packages/[package]/[version]/[item]/loading.tsx new file mode 100644 index 000000000..bde40d687 --- /dev/null +++ b/apps/website/src/app/docs/packages/[package]/[version]/[item]/loading.tsx @@ -0,0 +1 @@ +export { default } from '~/app/loading'; diff --git a/apps/website/src/app/docs/packages/[package]/[version]/loading.tsx b/apps/website/src/app/docs/packages/[package]/[version]/loading.tsx new file mode 100644 index 000000000..bde40d687 --- /dev/null +++ b/apps/website/src/app/docs/packages/[package]/[version]/loading.tsx @@ -0,0 +1 @@ +export { default } from '~/app/loading'; diff --git a/apps/website/src/app/docs/packages/[package]/loading.tsx b/apps/website/src/app/docs/packages/[package]/loading.tsx new file mode 100644 index 000000000..bde40d687 --- /dev/null +++ b/apps/website/src/app/docs/packages/[package]/loading.tsx @@ -0,0 +1 @@ +export { default } from '~/app/loading'; diff --git a/apps/website/src/app/docs/packages/loading.tsx b/apps/website/src/app/docs/packages/loading.tsx new file mode 100644 index 000000000..bde40d687 --- /dev/null +++ b/apps/website/src/app/docs/packages/loading.tsx @@ -0,0 +1 @@ +export { default } from '~/app/loading'; diff --git a/apps/website/src/app/docs/packages/page.tsx b/apps/website/src/app/docs/packages/page.tsx index be810680c..933890cb7 100644 --- a/apps/website/src/app/docs/packages/page.tsx +++ b/apps/website/src/app/docs/packages/page.tsx @@ -10,7 +10,7 @@ export const runtime: ServerRuntime = 'edge'; export default function Page() { return ( -
+

Select a package:

+ {children} diff --git a/apps/website/src/app/loading.tsx b/apps/website/src/app/loading.tsx new file mode 100644 index 000000000..c7af01dbe --- /dev/null +++ b/apps/website/src/app/loading.tsx @@ -0,0 +1,20 @@ +export default function Loading() { + return ( +
+ + + + +
Loading...
+
+ ); +} diff --git a/apps/website/src/app/not-found.tsx b/apps/website/src/app/not-found.tsx index 07232c348..5ff2fb78a 100644 --- a/apps/website/src/app/not-found.tsx +++ b/apps/website/src/app/not-found.tsx @@ -1,23 +1,16 @@ -// import Head from 'next/head'; import Link from 'next/link'; export default function NotFound() { return ( - <> - {/* - discord.js | 404 - - */} -
-

404

-

Not found.

- - Take me back - -
- +
+

404

+

Not found.

+ + Take me back + +
); } diff --git a/apps/website/src/app/page.tsx b/apps/website/src/app/page.tsx index 5240e7617..0e4462b35 100644 --- a/apps/website/src/app/page.tsx +++ b/apps/website/src/app/page.tsx @@ -1,13 +1,13 @@ import { FiExternalLink } from '@react-icons/all-files/fi/FiExternalLink'; import Image from 'next/image'; import Link from 'next/link'; -import vercelLogo from '../assets/powered-by-vercel.svg'; +import vercelLogo from '~/assets/powered-by-vercel.svg'; import { SyntaxHighlighter } from '~/components/SyntaxHighlighter'; import { CODE_EXAMPLE } from '~/util/constants'; export default function Page() { return ( -
+
diff --git a/apps/website/src/assets/fonts/Inter.ttf b/apps/website/src/assets/fonts/Inter.ttf deleted file mode 100644 index 1cb674b74..000000000 Binary files a/apps/website/src/assets/fonts/Inter.ttf and /dev/null differ diff --git a/apps/website/src/components/Footer.tsx b/apps/website/src/components/Footer.tsx index 7f9d75801..3ccca0a12 100644 --- a/apps/website/src/components/Footer.tsx +++ b/apps/website/src/components/Footer.tsx @@ -13,7 +13,12 @@ export default function Footer() { target="_blank" title="Vercel" > - Vercel + Vercel
diff --git a/apps/website/src/components/OverloadSwitcher.tsx b/apps/website/src/components/OverloadSwitcher.tsx index 2a7e6ee54..6629706ef 100644 --- a/apps/website/src/components/OverloadSwitcher.tsx +++ b/apps/website/src/components/OverloadSwitcher.tsx @@ -2,7 +2,7 @@ import { VscChevronDown } from '@react-icons/all-files/vsc/VscChevronDown'; import { VscVersions } from '@react-icons/all-files/vsc/VscVersions'; -import { Menu, MenuButton, MenuItem, useMenuState } from 'ariakit'; +import { Menu, MenuButton, MenuItem, useMenuState } from 'ariakit/menu'; import type { PropsWithChildren, ReactNode } from 'react'; import { useState } from 'react'; diff --git a/apps/website/src/components/VersionSelect.tsx b/apps/website/src/components/VersionSelect.tsx index 84be682c7..6fadee30b 100644 --- a/apps/website/src/components/VersionSelect.tsx +++ b/apps/website/src/components/VersionSelect.tsx @@ -1,3 +1,5 @@ +'use client'; + import { VscChevronDown } from '@react-icons/all-files/vsc/VscChevronDown'; import { VscVersions } from '@react-icons/all-files/vsc/VscVersions'; import { Menu, MenuButton, MenuItem, useMenuState } from 'ariakit/menu'; diff --git a/apps/website/src/components/documentation/section/ConstructorSection.tsx b/apps/website/src/components/documentation/section/ConstructorSection.tsx index 702e39082..600db28a8 100644 --- a/apps/website/src/components/documentation/section/ConstructorSection.tsx +++ b/apps/website/src/components/documentation/section/ConstructorSection.tsx @@ -1,9 +1,9 @@ import type { ApiConstructor } from '@microsoft/api-extractor-model'; import { VscSymbolMethod } from '@react-icons/all-files/vsc/VscSymbolMethod'; import { useCallback } from 'react'; +import { ParameterTable } from '../../ParameterTable'; import { TSDoc } from '../tsdoc/TSDoc'; import { DocumentationSection } from './DocumentationSection'; -import { ParameterTable } from '~/components/ParameterTable'; export function ConstructorSection({ item }: { item: ApiConstructor }) { const getShorthandName = useCallback( diff --git a/apps/website/src/components/documentation/section/MethodsSection.tsx b/apps/website/src/components/documentation/section/MethodsSection.tsx index fd8df4a5a..55ce16bbf 100644 --- a/apps/website/src/components/documentation/section/MethodsSection.tsx +++ b/apps/website/src/components/documentation/section/MethodsSection.tsx @@ -8,8 +8,8 @@ import type { import { ApiItemKind } from '@microsoft/api-extractor-model'; import { VscSymbolMethod } from '@react-icons/all-files/vsc/VscSymbolMethod'; import { useMemo, Fragment } from 'react'; +import { Method } from '../../model/method/Method'; import { DocumentationSection } from './DocumentationSection'; -import { Method } from '~/components/model/method/Method'; import { resolveMembers } from '~/util/members'; function isMethodLike(item: ApiItem): item is ApiMethod | ApiMethodSignature { diff --git a/apps/website/src/components/documentation/section/ParametersSection.tsx b/apps/website/src/components/documentation/section/ParametersSection.tsx index 7d9dcd600..183fe8c71 100644 --- a/apps/website/src/components/documentation/section/ParametersSection.tsx +++ b/apps/website/src/components/documentation/section/ParametersSection.tsx @@ -1,7 +1,7 @@ import type { ApiParameterListMixin } from '@microsoft/api-extractor-model'; import { VscSymbolParameter } from '@react-icons/all-files/vsc/VscSymbolParameter'; +import { ParameterTable } from '../../ParameterTable'; import { DocumentationSection } from './DocumentationSection'; -import { ParameterTable } from '~/components/ParameterTable'; export function ParameterSection({ item }: { item: ApiParameterListMixin }) { return ( diff --git a/apps/website/src/components/documentation/section/PropertiesSection.tsx b/apps/website/src/components/documentation/section/PropertiesSection.tsx index 98e84c2ae..57a84765c 100644 --- a/apps/website/src/components/documentation/section/PropertiesSection.tsx +++ b/apps/website/src/components/documentation/section/PropertiesSection.tsx @@ -1,7 +1,7 @@ import type { ApiItemContainerMixin } from '@microsoft/api-extractor-model'; import { VscSymbolProperty } from '@react-icons/all-files/vsc/VscSymbolProperty'; +import { PropertyList } from '../../PropertyList'; import { DocumentationSection } from './DocumentationSection'; -import { PropertyList } from '~/components/PropertyList'; export function PropertiesSection({ item }: { item: ApiItemContainerMixin }) { return ( diff --git a/apps/website/src/components/documentation/section/TypeParametersSection.tsx b/apps/website/src/components/documentation/section/TypeParametersSection.tsx index 183df81df..afa94f13d 100644 --- a/apps/website/src/components/documentation/section/TypeParametersSection.tsx +++ b/apps/website/src/components/documentation/section/TypeParametersSection.tsx @@ -1,7 +1,7 @@ import type { ApiTypeParameterListMixin } from '@microsoft/api-extractor-model'; import { VscSymbolParameter } from '@react-icons/all-files/vsc/VscSymbolParameter'; +import { TypeParamTable } from '../../TypeParamTable'; import { DocumentationSection } from './DocumentationSection'; -import { TypeParamTable } from '~/components/TypeParamTable'; export function TypeParameterSection({ item }: { item: ApiTypeParameterListMixin }) { return ( diff --git a/apps/website/src/components/documentation/tsdoc/TSDoc.tsx b/apps/website/src/components/documentation/tsdoc/TSDoc.tsx index ccd9a09b3..b461fcdf3 100644 --- a/apps/website/src/components/documentation/tsdoc/TSDoc.tsx +++ b/apps/website/src/components/documentation/tsdoc/TSDoc.tsx @@ -3,10 +3,10 @@ import type { DocComment, DocFencedCode, DocLinkTag, DocNode, DocNodeContainer, import { DocNodeKind, StandardTags } from '@microsoft/tsdoc'; import Link from 'next/link'; import { Fragment, useCallback, type ReactNode } from 'react'; +import { ItemLink } from '../../ItemLink'; import { SyntaxHighlighter } from '../../SyntaxHighlighter'; import { resolveItemURI } from '../util'; import { DeprecatedBlock, ExampleBlock, RemarksBlock, SeeBlock } from './BlockComment'; -import { ItemLink } from '~/components/ItemLink'; export function TSDoc({ item, tsdoc }: { item: ApiItem; tsdoc: DocNode }): JSX.Element { const createNode = useCallback( diff --git a/apps/website/src/components/model/enum/Enum.tsx b/apps/website/src/components/model/enum/Enum.tsx index e7a395c0b..73730ec25 100644 --- a/apps/website/src/components/model/enum/Enum.tsx +++ b/apps/website/src/components/model/enum/Enum.tsx @@ -1,11 +1,11 @@ import type { ApiEnum } from '@microsoft/api-extractor-model'; import { VscSymbolEnum } from '@react-icons/all-files/vsc/VscSymbolEnum'; +import { Panel } from '../../Panel'; import { Documentation } from '../../documentation/Documentation'; +import { ObjectHeader } from '../../documentation/ObjectHeader'; +import { DocumentationSection } from '../../documentation/section/DocumentationSection'; +import { SummarySection } from '../../documentation/section/SummarySection'; import { EnumMember } from './EnumMember'; -import { Panel } from '~/components/Panel'; -import { ObjectHeader } from '~/components/documentation/ObjectHeader'; -import { DocumentationSection } from '~/components/documentation/section/DocumentationSection'; -import { SummarySection } from '~/components/documentation/section/SummarySection'; export function Enum({ item }: { item: ApiEnum }) { return ( diff --git a/apps/website/src/components/model/enum/EnumMember.tsx b/apps/website/src/components/model/enum/EnumMember.tsx index 55c4e5214..80291ac64 100644 --- a/apps/website/src/components/model/enum/EnumMember.tsx +++ b/apps/website/src/components/model/enum/EnumMember.tsx @@ -1,8 +1,8 @@ import type { ApiEnumMember } from '@microsoft/api-extractor-model'; -import { Anchor } from '~/components/Anchor'; -import { NameText } from '~/components/NameText'; -import { SignatureText } from '~/components/SignatureText'; -import { TSDoc } from '~/components/documentation/tsdoc/TSDoc'; +import { Anchor } from '../../Anchor'; +import { NameText } from '../../NameText'; +import { SignatureText } from '../../SignatureText'; +import { TSDoc } from '../../documentation/tsdoc/TSDoc'; export function EnumMember({ member }: { member: ApiEnumMember }) { return ( diff --git a/apps/website/src/components/model/function/Function.tsx b/apps/website/src/components/model/function/Function.tsx index c5449a124..ebf9d4904 100644 --- a/apps/website/src/components/model/function/Function.tsx +++ b/apps/website/src/components/model/function/Function.tsx @@ -1,7 +1,7 @@ import type { ApiFunction } from '@microsoft/api-extractor-model'; import dynamic from 'next/dynamic'; +import { Header } from '../../documentation/Header'; import { FunctionBody } from './FunctionBody'; -import { Header } from '~/components/documentation/Header'; const OverloadSwitcher = dynamic(async () => import('../../OverloadSwitcher')); diff --git a/apps/website/src/components/model/function/FunctionBody.tsx b/apps/website/src/components/model/function/FunctionBody.tsx index 2c89dcfd8..0b10e67c4 100644 --- a/apps/website/src/components/model/function/FunctionBody.tsx +++ b/apps/website/src/components/model/function/FunctionBody.tsx @@ -1,9 +1,9 @@ import type { ApiFunction } from '@microsoft/api-extractor-model'; -import { SyntaxHighlighter } from '~/components/SyntaxHighlighter'; -import { Documentation } from '~/components/documentation/Documentation'; -import { ParameterSection } from '~/components/documentation/section/ParametersSection'; -import { SummarySection } from '~/components/documentation/section/SummarySection'; -import { TypeParameterSection } from '~/components/documentation/section/TypeParametersSection'; +import { SyntaxHighlighter } from '../../SyntaxHighlighter'; +import { Documentation } from '../../documentation/Documentation'; +import { ParameterSection } from '../../documentation/section/ParametersSection'; +import { SummarySection } from '../../documentation/section/SummarySection'; +import { TypeParameterSection } from '../../documentation/section/TypeParametersSection'; export interface FunctionBodyProps { mergedSiblingCount: number; diff --git a/apps/website/src/components/model/method/MethodDocumentation.tsx b/apps/website/src/components/model/method/MethodDocumentation.tsx index bf75419e1..3c0354b7d 100644 --- a/apps/website/src/components/model/method/MethodDocumentation.tsx +++ b/apps/website/src/components/model/method/MethodDocumentation.tsx @@ -4,18 +4,16 @@ import type { ApiMethod, ApiMethodSignature, } from '@microsoft/api-extractor-model'; -import type { DocSection } from '@microsoft/tsdoc'; -import { InheritanceText } from '~/components/InheritanceText'; -import { ParameterTable } from '~/components/ParameterTable'; -import { TSDoc } from '~/components/documentation/tsdoc/TSDoc'; +import { InheritanceText } from '../../InheritanceText'; +import { ParameterTable } from '../../ParameterTable'; +import { TSDoc } from '../../documentation/tsdoc/TSDoc'; export interface MethodDocumentationProps { - fallbackSummary?: DocSection; inheritedFrom?: (ApiDeclaredItem & ApiItemContainerMixin) | undefined; method: ApiMethod | ApiMethodSignature; } -export function MethodDocumentation({ method, fallbackSummary, inheritedFrom }: MethodDocumentationProps) { +export function MethodDocumentation({ method, inheritedFrom }: MethodDocumentationProps) { const parent = method.parent as ApiDeclaredItem; if (!(method.tsdocComment?.summarySection || method.parameters.length > 0)) { diff --git a/apps/website/src/styles/main.css b/apps/website/src/styles/main.css index cd775bbf2..a9e7296d8 100644 --- a/apps/website/src/styles/main.css +++ b/apps/website/src/styles/main.css @@ -30,5 +30,5 @@ pre { } code { - font-family: 'JetBrains Mono', monospace !important; + font-family: var(--font-mono); } diff --git a/apps/website/src/util/fonts.ts b/apps/website/src/util/fonts.ts index 8b44fcafa..d60a63379 100644 --- a/apps/website/src/util/fonts.ts +++ b/apps/website/src/util/fonts.ts @@ -1,7 +1,13 @@ -import localFont from 'next/font/local'; +import { Inter, JetBrains_Mono } from 'next/font/google'; -export const inter = localFont({ - src: '../assets/fonts/Inter.ttf', - variable: '--font-inter', +export const inter = Inter({ + subsets: ['latin'], display: 'swap', + variable: '--font-inter', +}); + +export const jetBrainsMono = JetBrains_Mono({ + subsets: ['latin'], + display: 'swap', + variable: '--font-mono', }); diff --git a/unocss.config.ts b/unocss.config.ts index 55b601c4f..859e539a6 100644 --- a/unocss.config.ts +++ b/unocss.config.ts @@ -16,6 +16,10 @@ export default defineConfig({ 900: '#020208', }, }, + fontFamily: { + sans: ['var(--font-inter)'], + mono: ['var(--font-mono)'], + }, }, presets: [ presetUno({ dark: 'class' }),