The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.
TypeScript aialternativeauthdatabasedenoembeddingsexamplefirebasenextjsoauth2pgvectorpostgispostgrespostgresqlpostgrestrealtimesupabasevectorswebsockets
Fix ButtonCard component, fix Default layout
Terry Suttona0e7532e335a
diff --git a/apps/temp-docs/_supabase_js/release-notes.md b/apps/temp-docs/_supabase_js/release-notes.mdindex 715215f2197..d77cf283abc 100644--- a/apps/temp-docs/_supabase_js/release-notes.md+++ b/apps/temp-docs/_supabase_js/release-notes.md@@ -82,7 +82,9 @@ Previously `nullsFirst` defaults to `false` , meaning `null`s are ordered last.Storage key name in the Auth library has changed to include project reference which means that existing websites that had their JWT expiry set to a longer time could find their users logged out with this upgrade.```jsx-const defaultStorageKey = `sb-${new URL(this.authUrl).hostname.split('.')[0]}-auth-token`+const defaultStorageKey = `sb-${+ new URL(this.authUrl).hostname.split('.')[0]+}-auth-token````### New Auth Typesdiff --git a/apps/temp-docs/_supabase_js/working-with-types.md b/apps/temp-docs/_supabase_js/working-with-types.mdindex cb564843bba..519650ed995 100644--- a/apps/temp-docs/_supabase_js/working-with-types.md+++ b/apps/temp-docs/_supabase_js/working-with-types.md@@ -43,7 +43,10 @@ You can enrich the supabase client with the types you generated with Supabase.import { createClient } from '@supabase/supabase-js'import { Database } from 'lib/database.types'-const supabase = createClient<Database>(process.env.SUPABASE_URL, process.env.SUPABASE_ANON_KEY)+const supabase = createClient<Database>(+ process.env.SUPABASE_URL,+ process.env.SUPABASE_ANON_KEY+)```## Type hintsdiff --git a/apps/temp-docs/components/ButtonCard.tsx b/apps/temp-docs/components/ButtonCard.tsxnew file mode 100644index 00000000000..bc6febc0895--- /dev/null+++ b/apps/temp-docs/components/ButtonCard.tsx@@ -0,0 +1,35 @@+import React from 'react'+import Link from 'next/link'++export default function ButtonCard({+ children,+ icon,+ title,+ description,+ to,+ layout = 'vertical',+}) {+ return (+ <Link href={to}>+ <a className={['button-card h-full pb-4 block', `button-card--${layout}`].join(' ')}>+ {children ? (+ children+ ) : (+ <div+ className={`button-card__inner p-4 gap-1 flex ${+ layout === 'vertical' ? 'flex-col' : 'items-center'+ }`}+ >+ {icon && typeof icon == 'string' ? (+ <img className="m-0" src={icon} width={24} alt={title} />+ ) : (+ icon+ )}+ <h3 className="mt-0">{title}</h3>+ <p>{description}</p>+ </div>+ )}+ </a>+ </Link>+ )+}diff --git a/apps/temp-docs/components/index.tsx b/apps/temp-docs/components/index.tsxindex 4bdef882a0a..ee81b013e5c 100644--- a/apps/temp-docs/components/index.tsx+++ b/apps/temp-docs/components/index.tsx@@ -4,9 +4,11 @@ import { Tabs } from 'ui'import Sponsor from './Sponsor'import SponsorsWrapper from './SponsorsWrapper'import CodeBlock from './CodeBlock/CodeBlock'+import ButtonCard from './ButtonCard'import AuthProviders from './AuthProviders'const components = {+ ButtonCard,// LinkCard,// LinkCardsWrapper,// SponsorsWrapper,diff --git a/apps/temp-docs/docs/reference.mdx b/apps/temp-docs/docs/reference.mdxnew file mode 100644index 00000000000..964db906199--- /dev/null+++ b/apps/temp-docs/docs/reference.mdx@@ -0,0 +1,69 @@+---+id: reference+title: Reference Documentation+sidebar_label: Reference Documentation+hide_table_of_contents: true+---++import ButtonCard from '../components/ButtonCard'++Reference documentation for the official Supabase client libraries, APIs, and tools.++<div class="container p-0">+ <div class="grid grid-cols-2 gap-3">+ <div class="w-1/2 border">+ <ButtonCard+ icon={"/img/libraries/javascript-icon.svg"}+ to={"/reference/javascript"}+ title="JavaScript"+ description="JavaScript and TypeScript documentation."+ />+ </div>+ <div class="w-1/2 border">+ <ButtonCard+ icon={"/img/libraries/dart-icon.svg"}+ to={"/reference/dart"}+ title="Flutter"+ description="Flutter and Dart documentation."+ />+ </div>+ <div class="w-1/2 border">+ <ButtonCard icon={"/img/libraries/cli-icon.svg"}+ to={"/reference/cli"}+ title="Supabase CLI"+ description="Tools for developing your Supabase projects locally."+ />+ </div>+ <div class="w-1/2 border">+ <ButtonCard icon={"/img/libraries/api-icon.svg"}+ to={"/reference/api"}+ title="Supabase API"+ description="Manage your Supabase organizations and projects." />+ </div>++ </div>+</div>++## Self-hosting++Reference documentation for self-hosting Supabase features.++<div class="container">+ <div class="grid grid-cols-2 gap-3">+ <div class="w-1/2 border">+ <ButtonCard+ to={'/reference/auth'}+ title={'Auth Server'}+ description=" JSON Web Token (JWT)-based API for managing users and issuing access tokens."+ />+ </div>+ <div class="w-1/2 border">+ <ButtonCard+ to={'/reference/storage'}+ title={'Storage'}+ description="S3-compatible object storage service that integrates with Postgres."+ />+ </div>++ </div>+</div>diff --git a/apps/temp-docs/layouts/Default.tsx b/apps/temp-docs/layouts/Default.tsxindex 5cc68a2bcb3..30c595403e7 100644--- a/apps/temp-docs/layouts/Default.tsx+++ b/apps/temp-docs/layouts/Default.tsx@@ -11,14 +11,12 @@ const Layout = ({menuItems,currentPage,}: {- meta: { title: string; description: string }+ meta: { title: string; description: string; hide_table_of_contents?: boolean }children: JSX.Elementtoc?: anymenuItems: anycurrentPage: string}) => {- const theme = 'okaidia'- console.log('Layout')useEffect(() => {const key = localStorage.getItem('supabaseDarkMode')if (!key) {@@ -52,13 +50,16 @@ const Layout = ({<NavBar currentPage={currentPage} /><div className="flex w-full flex-row"><SideBar menuItems={menuItems} />- <div className="docs-width grid grid-cols-12 gap-4 justify-between p-4 pb-8">- <div className="col-span-8 p-4">- <article className="prose dark:prose-dark dark:bg-scale-200 width-full">+ <div className="docs-width grid grid-cols-12 gap-4 justify-between p-4 pb-8 w-full">+ <div+ className={`${meta?.hide_table_of_contents ? 'col-span-12' : 'col-span-8'} py-4 px-8`}+ >+ <h1 className="text-5xl">{meta?.title}</h1>+ <article className="prose dark:prose-dark dark:bg-scale-200 width-full mt-8">{children}</article></div>- {toc && (+ {toc && !meta?.hide_table_of_contents && (<div className="prose border-scale-400 dark:bg-scale-200 thin-scrollbar table-of-contents-height col-span-4 border-l px-4"><h5>On this page</h5><ul className="list-none pl-2 text-[0.8rem]">diff --git a/apps/temp-docs/layouts/Guide.tsx b/apps/temp-docs/layouts/Guide.tsxindex b21b00b38dd..933553c8bd5 100644--- a/apps/temp-docs/layouts/Guide.tsx+++ b/apps/temp-docs/layouts/Guide.tsx@@ -10,8 +10,6 @@ export default function ContentsLayout({ context }: any) {const { asPath } = useRouter()const page = getPageType(asPath)- console.log('page', page)-return (<><NextSeo {...context.meta} />diff --git a/apps/temp-docs/public/img/libraries/api-icon.svg b/apps/temp-docs/public/img/libraries/api-icon.svgnew file mode 100644index 00000000000..6a7a3b6f546--- /dev/null+++ b/apps/temp-docs/public/img/libraries/api-icon.svg@@ -0,0 +1,10 @@+<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">+<path d="M2.90505 9.96863L2.86164 10.1H3H3.50831H3.58216L3.60388 10.0294L3.95891 8.87576H5.23411L5.58337 10.029L5.60488 10.1H5.67908H6.20532H6.34368L6.30027 9.96863L4.97868 5.96863L4.956 5.9H4.88372H4.3216H4.24932L4.22665 5.96863L2.90505 9.96863ZM6.90432 10V10.1H7.00432H7.50066H7.60066V10V8.51212H8.20631C8.65031 8.51212 9.03737 8.41078 9.31538 8.18787C9.59687 7.96216 9.75349 7.62229 9.75349 7.17576C9.75349 6.71213 9.59886 6.38448 9.31384 6.17743C9.03519 5.97499 8.64795 5.9 8.20631 5.9H7.00432H6.90432V6V10ZM10.4482 10V10.1H10.5482H13H13.1V10V9.5697V9.4697H13H12.1252V6.52424H13H13.1V6.42424V6V5.9H13H10.5482H10.4482V6V6.42424V6.52424H10.5482H11.4229V9.4697H10.5482H10.4482V9.5697V10ZM4.29168 7.78672C4.39865 7.43789 4.49846 7.09986 4.59668 6.74715C4.6949 7.09987 4.79471 7.4379 4.90169 7.78674C4.90171 7.78679 4.90173 7.78684 4.90174 7.7869L5.04796 8.2697H4.1454L4.29162 7.7869C4.29164 7.78684 4.29166 7.78678 4.29168 7.78672ZM7.60066 7.9V6.50606H8.14053C8.4771 6.50606 8.70435 6.55348 8.84667 6.65432C8.98042 6.74908 9.05715 6.90485 9.05715 7.17576C9.05715 7.44087 8.9815 7.61339 8.84418 7.7235C8.70208 7.83742 8.47535 7.9 8.14053 7.9H7.60066Z" fill="#1FDD85" stroke="#1FDD85" stroke-width="0.2"/>+<rect x="0.75" y="0.75" width="14.5" height="14.5" rx="3.25" stroke="url(#paint0_linear_790_16297)" stroke-width="1.5"/>+<defs>+<linearGradient id="paint0_linear_790_16297" x1="8" y1="0" x2="8" y2="16" gradientUnits="userSpaceOnUse">+<stop stop-color="#00E97C"/>+<stop offset="1" stop-color="#3FCF8E"/>+</linearGradient>+</defs>+</svg>diff --git a/apps/temp-docs/public/img/libraries/cli-icon.svg b/apps/temp-docs/public/img/libraries/cli-icon.svgnew file mode 100644index 00000000000..6b2ea2fc2b2--- /dev/null+++ b/apps/temp-docs/public/img/libraries/cli-icon.svg@@ -0,0 +1,19 @@+<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">+<rect x="0.75" y="0.75" width="14.5" height="14.5" rx="3.25" stroke="url(#paint0_linear_790_16290)" stroke-width="1.5"/>+<path d="M4.14286 4.35714L7 6.5L4.14286 8.64286" stroke="url(#paint1_linear_790_16290)" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>+<path d="M8.14285 8.64286L11 8.64286" stroke="url(#paint2_linear_790_16290)" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>+<defs>+<linearGradient id="paint0_linear_790_16290" x1="8" y1="0" x2="8" y2="16" gradientUnits="userSpaceOnUse">+<stop stop-color="#00E97C"/>+<stop offset="1" stop-color="#3FCF8E"/>+</linearGradient>+<linearGradient id="paint1_linear_790_16290" x1="5.57143" y1="5.78571" x2="4.56128" y2="6.79587" gradientUnits="userSpaceOnUse">+<stop stop-color="#1BDF84"/>+<stop offset="1" stop-color="#00E97C"/>+</linearGradient>+<linearGradient id="paint2_linear_790_16290" x1="9.57143" y1="5.78571" x2="8.56128" y2="6.79587" gradientUnits="userSpaceOnUse">+<stop stop-color="#1BDF84"/>+<stop offset="1" stop-color="#00E97C"/>+</linearGradient>+</defs>+</svg>diff --git a/apps/temp-docs/styles/main.scss b/apps/temp-docs/styles/main.scssindex 871ca5146db..d3598f7ea14 100644--- a/apps/temp-docs/styles/main.scss+++ b/apps/temp-docs/styles/main.scss@@ -577,3 +577,93 @@ code[class*='language-'],pre[class*='language-'] {text-shadow: none !important;}++// Spec doc specifics ported from docusaurus+// @TODO these should be converted to Tailwind classes+.method-list-group {+ list-style: none;+ padding: 0;+ margin: 0;+}+.method-list-group li {+ border-top: 1px solid var(--custom-border-color);+ padding-top: 12px;+}+.method-list-group li:last-child {+ border-bottom: 1px solid var(--custom-border-color);+}++.method-list-title-isChild {+ font-family: var(--custom-font-size-xs);+ & h5 {+ font-weight: 200;+ }+}++h4.method-list-item-label {+ display: flex;+ align-items: center;+ gap: 0.5rem;+}++h4.method-list-item-label .method-list-item-label-name {+ font-family: var(--ifm-font-family-monospace);+ font-weight: 700;+ font-size: var(--custom-font-size-sm);+ color: var(--ifm-font-color-base);+ padding: var(--ifm-code-padding-vertical) 0;+}++h4.method-list-item-label .method-list-item-label-badge {+ overflow-wrap: anywhere;+ font-family: var(--ifm-font-family-monospace);+ color: var(--ifm-font-color-base);+ font-size: var(--custom-font-size-xs);+ padding: 0 5px;+ font-weight: 300;+ padding: var(--ifm-code-padding-vertical) var(--ifm-code-padding-horizontal);+}+h4.method-list-item-label .method-list-item-validation {+ font-family: var(--ifm-font-family-monospace);+ font-size: var(--custom-font-size-xs);+ font-weight: 300;+ display: flex;+ flex-wrap: wrap;+ gap: 6px;++ code {+ padding: 1px 6px;+ border-radius: 4px;+ background-color: var(--custom-background-color-diff-1);+ color: var(--ifm-font-color-base);+ }+}++.method-list-item-description p {+ color: var(--custom-content-color-light);+ font-size: var(--custom-font-size-sm);+}++.method-list-group .method-list-group {+ border: 1px solid var(--custom-border-color);+ border-radius: 8px;+ margin-bottom: 20px;+ max-width: 600px;+}+.method-list-group .method-list-group li {+ padding: 12px;+ border-bottom: none;+}+.method-list-title {+ margin: 0;+ padding: 6px 12px;+}+.method-list-group .method-list-group li div,+.method-list-group .method-list-group li h4,+.method-list-group .method-list-group li p {+ padding: 0;+ margin: 0;+}+.method-list-group .method-list-group li h4 {+ margin-bottom: 4px;+}