chore: remove mermaid, use static SVG (#28083)

This commit is contained in:
Kevin Grüneberg
2024-07-19 18:36:00 +08:00
committed by GitHub
parent 3601bb52f5
commit 14e29dc0a0
10 changed files with 24 additions and 958 deletions

View File

@@ -1,2 +0,0 @@
import { Mermaid } from 'mdx-mermaid/lib/Mermaid'
export default Mermaid

View File

@@ -1,13 +0,0 @@
'use client'
import { Suspense, lazy } from 'react'
const MermaidHeavy = lazy(() => import('./Mermaid'))
export function Mermaid(props) {
return (
<Suspense>
<MermaidHeavy {...props} />
</Suspense>
)
}

View File

@@ -77,7 +77,6 @@ import { AppleSecretGenerator } from './AppleSecretGenerator'
import { AuthSmsProviderConfig } from './AuthSmsProviderConfig'
import { Extensions } from './Extensions'
import { JwtGenerator } from './JwtGenerator'
import { Mermaid } from './Mermaid'
import { RealtimeLimitsEstimator } from './RealtimeLimitsEstimator'
const components = {
@@ -146,7 +145,6 @@ const components = {
JwtGenerator,
KotlinProjectSetup,
Link,
Mermaid,
MigrationWarnings,
NavData,
OAuthPkceFlow,

View File

@@ -34,16 +34,13 @@ Supabase Auth provides:
Below is a flow chart illustrating how these APIs work together to enable MFA features in your app.
<Mermaid
chart={`
graph TD;
InitS((Setup flow)) --> SAAL1[/Session is AAL1/] --> Enroll[Enroll API] --> ShowQR[Show QR code] --> Scan([User: Scan QR code in authenticator]) --> Enter([User: Enter code]) --> Verify[Challenge + Verify API] --> Check{{Is code correct?}}
Check -->|Yes| AAL2[/Upgrade to AAL2/] --> Done((Done))
Check -->|No| Enter
InitA((Login flow)) --> SignIn([User: Sign-in]) --> AAL1[/Upgrade to AAL1/] --> ListFactors[List Factors API]
ListFactors -->|1 or more factors| OpenAuth([User: Open authenticator]) --> Enter
ListFactors -->|0 factors| Setup[[Setup flow]]
`}
<Image
alt="Diagram showing the flow of Multi-Factor authentication"
src={{
light: '/docs/img/guides/auth-mfa/auth-mfa-flow.svg',
dark: '/docs/img/guides/auth-mfa/auth-mfa-flow.svg',
}}
containerClassName="max-w-[700px]"
/>
These sets of APIs let you control the MFA experience that works for you. You can create flows where MFA is optional, mandatory for all, or only specific groups of users.

View File

@@ -26,7 +26,6 @@ import {
SocialProviderSettingsSupabase,
SocialProviderSetup,
} from '~/components/MDX/partials'
import { Mermaid } from '~/components/Mermaid'
import { NavData } from '~/components/NavData'
import { ProjectConfigVariables } from '~/components/ProjectConfigVariables'
import { RealtimeLimitsEstimator } from '~/components/RealtimeLimitsEstimator'
@@ -62,7 +61,6 @@ const components = {
JwtGenerator,
KotlinProjectSetup,
Link,
Mermaid,
MigrationWarnings,
NavData,
OAuthPkceFlow,

View File

@@ -62,17 +62,7 @@ const nextConfig = {
transform: 'lodash/{{member}}',
},
},
transpilePackages: [
'ui',
'ui-patterns',
'common',
'mermaid',
'mdx-mermaid',
'dayjs',
'shared-data',
'api-types',
'icons',
],
transpilePackages: ['ui', 'ui-patterns', 'common', 'dayjs', 'shared-data', 'api-types', 'icons'],
/**
* The SQL to REST API translator relies on libpg-query, which packages a
* native Node.js module that wraps the Postgres query parser.

View File

@@ -54,8 +54,6 @@
"mdast-util-mdx": "^2.0.0",
"mdast-util-to-markdown": "^1.5.0",
"mdast-util-to-string": "^3.1.1",
"mdx-mermaid": "^2.0.0",
"mermaid": "^10.0.2",
"micromark-extension-mdxjs": "^1.0.0",
"next": "^14.2.3",
"next-mdx-remote": "^4.4.1",

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 23 KiB

View File

@@ -0,0 +1,7 @@
graph TD;
InitS((Setup flow)) --> SAAL1[/Session is AAL1/] --> Enroll[Enroll API] --> ShowQR[Show QR code] --> Scan([User: Scan QR code in authenticator]) --> Enter([User: Enter code]) --> Verify[Challenge + Verify API] --> Check{{Is code correct?}}
Check -->|Yes| AAL2[/Upgrade to AAL2/] --> Done((Done))
Check -->|No| Enter
InitA((Login flow)) --> SignIn([User: Sign-in]) --> AAL1[/Upgrade to AAL1/] --> ListFactors[List Factors API]
ListFactors -->|1 or more factors| OpenAuth([User: Open authenticator]) --> Enter
ListFactors -->|0 factors| Setup[[Setup flow]]

924
package-lock.json generated

File diff suppressed because it is too large Load Diff