diff --git a/packages/docusaurus-mdx-loader/package.json b/packages/docusaurus-mdx-loader/package.json index 5da0d4ecfae2..6d4a223338ea 100644 --- a/packages/docusaurus-mdx-loader/package.json +++ b/packages/docusaurus-mdx-loader/package.json @@ -40,6 +40,7 @@ "@docusaurus/types": "^3.0.0-alpha.0", "@types/escape-html": "^1.0.2", "@types/mdast": "^3.0.10", + "@types/mermaid": "^8.2.9", "@types/stringify-object": "^3.3.1", "@types/unist": "^2.0.6", "rehype-stringify": "^8.0.0", diff --git a/packages/docusaurus-mdx-loader/src/loader.ts b/packages/docusaurus-mdx-loader/src/loader.ts index 3d6747771d71..12ac0e192fda 100644 --- a/packages/docusaurus-mdx-loader/src/loader.ts +++ b/packages/docusaurus-mdx-loader/src/loader.ts @@ -22,8 +22,10 @@ import toc from './remark/toc'; import unwrapMdxCodeBlocks from './remark/unwrapMdxCodeBlocks'; import transformImage from './remark/transformImage'; import transformLinks from './remark/transformLinks'; +import mermaid from './remark/mermaid'; import transformAdmonitions from './remark/admonitions'; +import type {MarkdownConfig} from '@docusaurus/types'; import type {LoaderContext} from 'webpack'; import type {Processor, Plugin} from 'unified'; import type {AdmonitionOptions} from './remark/admonitions'; @@ -61,6 +63,7 @@ export type MDXOptions = { }; export type Options = Partial & { + markdownConfig: MarkdownConfig; staticDirs: string[]; siteDir: string; isMDXPartial?: (filePath: string) => boolean; @@ -71,7 +74,6 @@ export type Options = Partial & { frontMatter: {[key: string]: unknown}; metadata: {[key: string]: unknown}; }) => {[key: string]: unknown}; - filepath: string; }; /** @@ -171,6 +173,7 @@ export async function mdxLoader( ...(reqOptions.beforeDefaultRemarkPlugins ?? []), ...getAdmonitionsPlugins(reqOptions.admonitions ?? false), ...DEFAULT_OPTIONS.remarkPlugins, + ...(reqOptions.markdownConfig.mermaid ? [mermaid] : []), [ transformImage, { diff --git a/packages/docusaurus-mdx-loader/src/remark/mermaid/__tests__/__snapshots__/index.test.ts.snap b/packages/docusaurus-mdx-loader/src/remark/mermaid/__tests__/__snapshots__/index.test.ts.snap new file mode 100644 index 000000000000..157f963ccdb3 --- /dev/null +++ b/packages/docusaurus-mdx-loader/src/remark/mermaid/__tests__/__snapshots__/index.test.ts.snap @@ -0,0 +1,51 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`mermaid remark plugin does nothing if there's no mermaid code block 1`] = ` +" + + +const layoutProps = { + +}; +const MDXLayout = "wrapper" +export default function MDXContent({ + components, + ...props +}) { + return +

{\`Heading 1\`}

+

{\`No Mermaid diagram :(\`}

+
{\`this is not mermaid
+\`}
+
; +} + +; +MDXContent.isMDXComponent = true;" +`; + +exports[`mermaid remark plugin works for basic mermaid code blocks 1`] = ` +" + + +const layoutProps = { + +}; +const MDXLayout = "wrapper" +export default function MDXContent({ + components, + ...props +}) { + return +

{\`Heading 1\`}

+ B;/n A-->C;/n B-->D;/n C-->D;" + }}> +
; +} + +; +MDXContent.isMDXComponent = true;" +`; diff --git a/packages/docusaurus-mdx-loader/src/remark/mermaid/__tests__/index.test.ts b/packages/docusaurus-mdx-loader/src/remark/mermaid/__tests__/index.test.ts new file mode 100644 index 000000000000..e61272955427 --- /dev/null +++ b/packages/docusaurus-mdx-loader/src/remark/mermaid/__tests__/index.test.ts @@ -0,0 +1,46 @@ +/** + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +import {createCompiler} from '@mdx-js/mdx'; +import mermaid from '..'; + +describe('mermaid remark plugin', () => { + function createTestCompiler() { + return createCompiler({ + remarkPlugins: [mermaid], + }); + } + + it("does nothing if there's no mermaid code block", async () => { + const mdxCompiler = createTestCompiler(); + const result = await mdxCompiler.process( + `# Heading 1 + +No Mermaid diagram :( + +\`\`\`js +this is not mermaid +\`\`\` +`, + ); + expect(result.contents).toMatchSnapshot(); + }); + + it('works for basic mermaid code blocks', async () => { + const mdxCompiler = createTestCompiler(); + const result = await mdxCompiler.process(`# Heading 1 + +\`\`\`mermaid +graph TD; + A-->B; + A-->C; + B-->D; + C-->D; +\`\`\``); + expect(result.contents).toMatchSnapshot(); + }); +}); diff --git a/packages/docusaurus-mdx-loader/src/remark/mermaid/index.ts b/packages/docusaurus-mdx-loader/src/remark/mermaid/index.ts new file mode 100644 index 000000000000..d0b6232cdfad --- /dev/null +++ b/packages/docusaurus-mdx-loader/src/remark/mermaid/index.ts @@ -0,0 +1,32 @@ +/** + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +import visit from 'unist-util-visit'; +import type {Transformer} from 'unified'; +import type {Code} from 'mdast'; + +// TODO: this plugin shouldn't be in the core MDX loader +// After we allow plugins to provide Remark/Rehype plugins (see +// https://github.com/facebook/docusaurus/issues/6370), this should be provided +// by theme-mermaid itself +export default function plugin(): Transformer { + return (root) => { + visit(root, 'code', (node: Code, index, parent) => { + if (node.lang === 'mermaid') { + parent!.children.splice(index, 1, { + type: 'mermaidCodeBlock', + data: { + hName: 'mermaid', + hProperties: { + value: node.value, + }, + }, + }); + } + }); + }; +} diff --git a/packages/docusaurus-plugin-content-blog/src/index.ts b/packages/docusaurus-plugin-content-blog/src/index.ts index 315c87e6a792..51bdf7516c32 100644 --- a/packages/docusaurus-plugin-content-blog/src/index.ts +++ b/packages/docusaurus-plugin-content-blog/src/index.ts @@ -455,6 +455,7 @@ export default async function pluginContentBlog( (author) => author.imageURL, ), }), + markdownConfig: siteConfig.markdown, }, }, { diff --git a/packages/docusaurus-plugin-content-docs/src/index.ts b/packages/docusaurus-plugin-content-docs/src/index.ts index 69bb8077aa7d..74eac5d38afe 100644 --- a/packages/docusaurus-plugin-content-docs/src/index.ts +++ b/packages/docusaurus-plugin-content-docs/src/index.ts @@ -288,6 +288,7 @@ export default async function pluginContentDocs( }) => ({ image: frontMatter.image, }), + markdownConfig: siteConfig.markdown, }, }, { diff --git a/packages/docusaurus-plugin-content-pages/src/index.ts b/packages/docusaurus-plugin-content-pages/src/index.ts index bf6b0c73041b..c3c51b883283 100644 --- a/packages/docusaurus-plugin-content-pages/src/index.ts +++ b/packages/docusaurus-plugin-content-pages/src/index.ts @@ -211,6 +211,7 @@ export default function pluginContentPages( `${docuHash(aliasedSource)}.json`, ); }, + markdownConfig: siteConfig.markdown, }, }, { diff --git a/packages/docusaurus-theme-classic/src/theme-classic.d.ts b/packages/docusaurus-theme-classic/src/theme-classic.d.ts index 39799fb78d43..2e89d14c8ddd 100644 --- a/packages/docusaurus-theme-classic/src/theme-classic.d.ts +++ b/packages/docusaurus-theme-classic/src/theme-classic.d.ts @@ -897,6 +897,7 @@ declare module '@theme/MDXComponents' { import type MDXUl from '@theme/MDXComponents/Ul'; import type MDXImg from '@theme/MDXComponents/Img'; import type Admonition from '@theme/Admonition'; + import type Mermaid from '@theme/Mermaid'; export type MDXComponentsObject = { readonly head: typeof MDXHead; @@ -913,6 +914,7 @@ declare module '@theme/MDXComponents' { readonly h5: (props: ComponentProps<'h5'>) => JSX.Element; readonly h6: (props: ComponentProps<'h6'>) => JSX.Element; readonly admonition: typeof Admonition; + readonly mermaid: typeof Mermaid; // eslint-disable-next-line @typescript-eslint/no-explicit-any [tagName: string]: ComponentType; }; @@ -1221,6 +1223,14 @@ declare module '@theme/SearchBar' { export default function SearchBar(): JSX.Element; } +declare module '@theme/Mermaid' { + export interface Props { + value: string; + } + + export default function Mermaid(props: Props): JSX.Element; +} + declare module '@theme/TabItem' { import type {ReactNode} from 'react'; diff --git a/packages/docusaurus-theme-classic/src/theme/MDXComponents/index.tsx b/packages/docusaurus-theme-classic/src/theme/MDXComponents/index.tsx index 8b6141f5e2bc..13931951950a 100644 --- a/packages/docusaurus-theme-classic/src/theme/MDXComponents/index.tsx +++ b/packages/docusaurus-theme-classic/src/theme/MDXComponents/index.tsx @@ -15,6 +15,7 @@ import MDXHeading from '@theme/MDXComponents/Heading'; import MDXUl from '@theme/MDXComponents/Ul'; import MDXImg from '@theme/MDXComponents/Img'; import Admonition from '@theme/Admonition'; +import Mermaid from '@theme/Mermaid'; import type {MDXComponentsObject} from '@theme/MDXComponents'; @@ -33,6 +34,7 @@ const MDXComponents: MDXComponentsObject = { h5: (props) => , h6: (props) => , admonition: Admonition, + mermaid: Mermaid, }; export default MDXComponents; diff --git a/packages/docusaurus-theme-classic/src/theme/Mermaid.tsx b/packages/docusaurus-theme-classic/src/theme/Mermaid.tsx new file mode 100644 index 000000000000..1c326bb04fb6 --- /dev/null +++ b/packages/docusaurus-theme-classic/src/theme/Mermaid.tsx @@ -0,0 +1,16 @@ +/** + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +// This component is meant to be implemented by a Mermaid renderer theme +// It is notable created to be overridden by docusaurus-theme-mermaid + +// By default, the classic theme does not provide any Mermaid implementation +// Yet we declare it there so that we can register it in MDX +// TODO later the mermaid theme should be able to register its MDX component +// see https://github.com/facebook/docusaurus/pull/7490#issuecomment-1279117288 + +export {default} from '@docusaurus/Noop'; diff --git a/packages/docusaurus-theme-mermaid/.npmignore b/packages/docusaurus-theme-mermaid/.npmignore new file mode 100644 index 000000000000..03c9ae1e1b54 --- /dev/null +++ b/packages/docusaurus-theme-mermaid/.npmignore @@ -0,0 +1,3 @@ +.tsbuildinfo* +tsconfig* +__tests__ diff --git a/packages/docusaurus-theme-mermaid/README.md b/packages/docusaurus-theme-mermaid/README.md new file mode 100644 index 000000000000..ec903286aad8 --- /dev/null +++ b/packages/docusaurus-theme-mermaid/README.md @@ -0,0 +1,21 @@ +# Docusaurus Theme Mermaid + +The mermaid components for Docusaurus. + +## Installation + +Add `docusaurus/theme-mermaid` to your package: + +```bash +npm i @docusaurus/theme-mermaid +# or +yarn add @docusaurus/theme-mermaid +``` + +## Swizzling components + +```bash +$ npm swizzle @docusaurus/theme-mermaid [component name] +``` + +All components used by this theme can be found [here](https://github.com/facebook/docusaurus/tree/main/packages/docusaurus-theme-mermaid/src/theme) diff --git a/packages/docusaurus-theme-mermaid/package.json b/packages/docusaurus-theme-mermaid/package.json new file mode 100644 index 000000000000..e42f81e712a7 --- /dev/null +++ b/packages/docusaurus-theme-mermaid/package.json @@ -0,0 +1,57 @@ +{ + "name": "@docusaurus/theme-mermaid", + "version": "3.0.0-alpha.0", + "description": "Mermaid components for Docusaurus.", + "main": "lib/index.js", + "types": "src/theme-mermaid.d.ts", + "sideEffects": false, + "exports": { + "./lib/*": "./lib/*", + "./src/*": "./src/*", + "./client": { + "type": "./lib/client/index.d.ts", + "default": "./lib/client/index.js" + }, + ".": { + "types": "./src/theme-mermaid.d.ts", + "default": "./lib/index.js" + } + }, + "publishConfig": { + "access": "public" + }, + "repository": { + "type": "git", + "url": "https://github.com/facebook/docusaurus.git", + "directory": "packages/docusaurus-theme-mermaid" + }, + "license": "MIT", + "scripts": { + "build": "tsc --build && node ../../admin/scripts/copyUntypedFiles.js && prettier --config ../../.prettierrc --write \"lib/theme/**/*.js\"", + "watch": "run-p -c copy:watch build:watch", + "build:watch": "tsc --build --watch", + "copy:watch": "node ../../admin/scripts/copyUntypedFiles.js --watch" + }, + "dependencies": { + "@docusaurus/core": "^3.0.0-alpha.0", + "@docusaurus/module-type-aliases": "^3.0.0-alpha.0", + "@docusaurus/theme-common": "^3.0.0-alpha.0", + "@docusaurus/types": "^3.0.0-alpha.0", + "@docusaurus/utils-validation": "^3.0.0-alpha.0", + "@mdx-js/react": "^1.6.22", + "mermaid": "^9.1.1", + "tslib": "^2.4.0" + }, + "devDependencies": { + "@types/mdx-js__react": "^1.5.5", + "@types/mermaid": "^8.2.9", + "react-test-renderer": "^17.0.2" + }, + "peerDependencies": { + "react": "^16.8.4 || ^17.0.0", + "react-dom": "^16.8.4 || ^17.0.0" + }, + "engines": { + "node": ">=16.14" + } +} diff --git a/packages/docusaurus-theme-mermaid/src/__tests__/validateThemeConfig.test.ts b/packages/docusaurus-theme-mermaid/src/__tests__/validateThemeConfig.test.ts new file mode 100644 index 000000000000..dc71a9c49c25 --- /dev/null +++ b/packages/docusaurus-theme-mermaid/src/__tests__/validateThemeConfig.test.ts @@ -0,0 +1,75 @@ +/** + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +import { + validateThemeConfig, + DEFAULT_THEME_CONFIG, +} from '../validateThemeConfig'; +import type {Joi} from '@docusaurus/utils-validation'; +import type {ThemeConfig, UserThemeConfig} from '@docusaurus/theme-mermaid'; + +function testValidateThemeConfig(themeConfig: UserThemeConfig) { + function validate( + schema: Joi.ObjectSchema, + cfg: UserThemeConfig, + ) { + const {value, error} = schema.validate(cfg, { + convert: false, + }); + if (error) { + throw error; + } + return value; + } + + return validateThemeConfig({validate, themeConfig}); +} + +describe('validateThemeConfig', () => { + it('undefined config', () => { + const mermaid = undefined; + expect(testValidateThemeConfig({mermaid})).toEqual(DEFAULT_THEME_CONFIG); + }); + + it('nonexistent config', () => { + expect(testValidateThemeConfig({})).toEqual(DEFAULT_THEME_CONFIG); + }); + + it('empty config', () => { + const mermaid = {}; + expect(testValidateThemeConfig({mermaid})).toEqual(DEFAULT_THEME_CONFIG); + }); + + it('theme', () => { + const mermaid = { + theme: { + light: 'light', + dark: 'dark', + }, + }; + expect(testValidateThemeConfig({mermaid})).toEqual({ + mermaid: { + ...DEFAULT_THEME_CONFIG.mermaid, + ...mermaid, + }, + }); + }); + + it('mermaid options', () => { + const mermaid = { + options: { + fontFamily: 'Ariel', + }, + }; + expect(testValidateThemeConfig({mermaid})).toEqual({ + mermaid: { + ...DEFAULT_THEME_CONFIG.mermaid, + ...mermaid, + }, + }); + }); +}); diff --git a/packages/docusaurus-theme-mermaid/src/client/index.ts b/packages/docusaurus-theme-mermaid/src/client/index.ts new file mode 100644 index 000000000000..e432d6a81a99 --- /dev/null +++ b/packages/docusaurus-theme-mermaid/src/client/index.ts @@ -0,0 +1,78 @@ +/** + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +import {useMemo} from 'react'; +import {useColorMode, useThemeConfig} from '@docusaurus/theme-common'; +import mermaid from 'mermaid'; +import type mermaidAPI from 'mermaid/mermaidAPI'; +import type {ThemeConfig} from '@docusaurus/theme-mermaid'; + +// Stable className to allow users to easily target with CSS +export const MermaidContainerClassName = 'docusaurus-mermaid-container'; + +export function useMermaidThemeConfig(): ThemeConfig['mermaid'] { + return (useThemeConfig() as unknown as ThemeConfig).mermaid; +} + +export function useMermaidConfig(): mermaidAPI.Config { + const {colorMode} = useColorMode(); + const mermaidThemeConfig = useMermaidThemeConfig(); + + const theme = mermaidThemeConfig.theme[colorMode]; + const {options} = mermaidThemeConfig; + + return useMemo( + () => ({startOnLoad: false, ...options, theme}), + [theme, options], + ); +} + +export function useMermaidSvg( + txt: string, + mermaidConfigParam?: mermaidAPI.Config, +): string { + /* + For flexibility, we allow the hook to receive a custom Mermaid config + The user could inject a modified version of the default config for example + */ + const defaultMermaidConfig = useMermaidConfig(); + const mermaidConfig = mermaidConfigParam ?? defaultMermaidConfig; + + return useMemo(() => { + /* + Mermaid API is really weird :s + It is a big mutable singleton with multiple config levels + Note: most recent API type definitions are missing + + There are 2 kind of configs: + + - siteConfig: some kind of global/protected shared config + you can only set with "initialize" + + - config/currentConfig + the config the renderer will use + it is reset to siteConfig before each render + but it can be altered by the mermaid txt content itself through directives + + To use a new mermaid config (on colorMode change for example) we should + update siteConfig, and it can only be done with initialize() + */ + mermaid.mermaidAPI.initialize(mermaidConfig); + + /* + Random client-only id, we don't care much about it + But mermaid want an id so... + */ + const mermaidId = `mermaid-svg-${Math.round(Math.random() * 10000000)}`; + + /* + Not even documented: mermaid.render returns the svg string + Using the documented form is un-necessary + */ + return mermaid.render(mermaidId, txt); + }, [txt, mermaidConfig]); +} diff --git a/packages/docusaurus-theme-mermaid/src/index.ts b/packages/docusaurus-theme-mermaid/src/index.ts new file mode 100644 index 000000000000..82b1636c598d --- /dev/null +++ b/packages/docusaurus-theme-mermaid/src/index.ts @@ -0,0 +1,23 @@ +/** + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +import type {Plugin} from '@docusaurus/types'; + +export default function themeMermaid(): Plugin { + return { + name: 'docusaurus-theme-mermaid', + + getThemePath() { + return '../lib/theme'; + }, + getTypeScriptThemePath() { + return '../src/theme'; + }, + }; +} + +export {validateThemeConfig} from './validateThemeConfig'; diff --git a/packages/docusaurus-theme-mermaid/src/theme-mermaid.d.ts b/packages/docusaurus-theme-mermaid/src/theme-mermaid.d.ts new file mode 100644 index 000000000000..9b605341a517 --- /dev/null +++ b/packages/docusaurus-theme-mermaid/src/theme-mermaid.d.ts @@ -0,0 +1,35 @@ +/** + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +/// + +declare module '@docusaurus/theme-mermaid' { + import type {DeepPartial} from 'utility-types'; + import type mermaidAPI from 'mermaid/mermaidAPI'; + import type {Plugin} from '@docusaurus/types'; + + export type ThemeConfig = { + mermaid: { + theme: { + light: mermaidAPI.Theme; + dark: mermaidAPI.Theme; + }; + options: mermaidAPI.Config; + }; + }; + export type UserThemeConfig = DeepPartial; + + export default function themeMermaid(): Plugin; +} + +declare module '@theme/Mermaid' { + export interface Props { + value: string; + } + + export default function Mermaid(props: Props): JSX.Element; +} diff --git a/packages/docusaurus-theme-mermaid/src/theme/Mermaid/index.tsx b/packages/docusaurus-theme-mermaid/src/theme/Mermaid/index.tsx new file mode 100644 index 000000000000..26a882e6ddaf --- /dev/null +++ b/packages/docusaurus-theme-mermaid/src/theme/Mermaid/index.tsx @@ -0,0 +1,32 @@ +/** + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +import React from 'react'; +import BrowserOnly from '@docusaurus/BrowserOnly'; +import { + MermaidContainerClassName, + useMermaidSvg, +} from '@docusaurus/theme-mermaid/client'; + +import type {Props} from '@theme/Mermaid'; + +import styles from './styles.module.css'; + +function MermaidDiagram({value}: Props): JSX.Element { + const svg = useMermaidSvg(value); + return ( +
+ ); +} + +export default function Mermaid(props: Props): JSX.Element { + return {() => }; +} diff --git a/packages/docusaurus-theme-mermaid/src/theme/Mermaid/styles.module.css b/packages/docusaurus-theme-mermaid/src/theme/Mermaid/styles.module.css new file mode 100644 index 000000000000..fa19d80d927e --- /dev/null +++ b/packages/docusaurus-theme-mermaid/src/theme/Mermaid/styles.module.css @@ -0,0 +1,14 @@ +/** + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +.container { + max-width: 100%; +} + +.container > svg { + max-width: 100%; +} diff --git a/packages/docusaurus-theme-mermaid/src/validateThemeConfig.ts b/packages/docusaurus-theme-mermaid/src/validateThemeConfig.ts new file mode 100644 index 000000000000..c68201f225dd --- /dev/null +++ b/packages/docusaurus-theme-mermaid/src/validateThemeConfig.ts @@ -0,0 +1,38 @@ +/** + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +import {Joi} from '@docusaurus/utils-validation'; +import type {ThemeConfig} from '@docusaurus/theme-mermaid'; +import type mermaidAPI from 'mermaid/mermaidAPI'; +import type {ThemeConfigValidationContext} from '@docusaurus/types'; + +export const DEFAULT_THEME_CONFIG: ThemeConfig = { + mermaid: { + theme: { + dark: 'dark' as mermaidAPI.Theme, + light: 'default' as mermaidAPI.Theme, + }, + options: {}, + }, +}; + +export const Schema = Joi.object({ + mermaid: Joi.object({ + theme: Joi.object({ + dark: Joi.string().default(DEFAULT_THEME_CONFIG.mermaid.theme.dark), + light: Joi.string().default(DEFAULT_THEME_CONFIG.mermaid.theme.light), + }).default(DEFAULT_THEME_CONFIG.mermaid.theme), + options: Joi.object().default(DEFAULT_THEME_CONFIG.mermaid.options), + }).default(DEFAULT_THEME_CONFIG.mermaid), +}); + +export function validateThemeConfig({ + validate, + themeConfig, +}: ThemeConfigValidationContext): ThemeConfig { + return validate(Schema, themeConfig); +} diff --git a/packages/docusaurus-theme-mermaid/tsconfig.client.json b/packages/docusaurus-theme-mermaid/tsconfig.client.json new file mode 100644 index 000000000000..1f0c48f14b25 --- /dev/null +++ b/packages/docusaurus-theme-mermaid/tsconfig.client.json @@ -0,0 +1,15 @@ +{ + "extends": "../../tsconfig.json", + "compilerOptions": { + "noEmit": false, + "composite": true, + "incremental": true, + "tsBuildInfoFile": "./lib/.tsbuildinfo-client", + "rootDir": "src", + "outDir": "lib", + "module": "esnext", + "target": "esnext" + }, + "include": ["src/theme", "src/*.d.ts"], + "exclude": ["**/__tests__/**"] +} diff --git a/packages/docusaurus-theme-mermaid/tsconfig.json b/packages/docusaurus-theme-mermaid/tsconfig.json new file mode 100644 index 000000000000..7c1bb85ac462 --- /dev/null +++ b/packages/docusaurus-theme-mermaid/tsconfig.json @@ -0,0 +1,14 @@ +{ + "extends": "../../tsconfig.json", + "references": [{"path": "./tsconfig.client.json"}], + "compilerOptions": { + "noEmit": false, + "incremental": true, + "tsBuildInfoFile": "./lib/.tsbuildinfo", + "module": "commonjs", + "rootDir": "src", + "outDir": "lib" + }, + "include": ["src"], + "exclude": ["src/theme", "**/__tests__/**"] +} diff --git a/packages/docusaurus-types/src/config.d.ts b/packages/docusaurus-types/src/config.d.ts index 8421b480f897..fa8fe1a190ea 100644 --- a/packages/docusaurus-types/src/config.d.ts +++ b/packages/docusaurus-types/src/config.d.ts @@ -16,6 +16,20 @@ export type ThemeConfig = { [key: string]: unknown; }; +export type MarkdownConfig = { + /** + * Allow mermaid language code blocks to be rendered into Mermaid diagrams: + * + * - `true`: code blocks with language mermaid will be rendered. + * - `false` | `undefined` (default): code blocks with language mermaid + * will be left as code blocks. + * + * @see https://docusaurus.io/docs/markdown-features/diagrams/ + * @default false + */ + mermaid?: boolean; +}; + /** * Docusaurus config, after validation/normalization. */ @@ -277,6 +291,8 @@ export type DocusaurusConfig = { */ jsLoader: 'babel' | ((isServer: boolean) => RuleSetRule); }; + /** Markdown-related options. */ + markdown: MarkdownConfig; }; /** diff --git a/packages/docusaurus-types/src/index.d.ts b/packages/docusaurus-types/src/index.d.ts index 305d96857075..afb737e96b48 100644 --- a/packages/docusaurus-types/src/index.d.ts +++ b/packages/docusaurus-types/src/index.d.ts @@ -8,6 +8,7 @@ export { ReportingSeverity, ThemeConfig, + MarkdownConfig, DocusaurusConfig, Config, } from './config'; diff --git a/packages/docusaurus/src/server/__tests__/__snapshots__/config.test.ts.snap b/packages/docusaurus/src/server/__tests__/__snapshots__/config.test.ts.snap index d652255eb773..9ba1e01a4cdd 100644 --- a/packages/docusaurus/src/server/__tests__/__snapshots__/config.test.ts.snap +++ b/packages/docusaurus/src/server/__tests__/__snapshots__/config.test.ts.snap @@ -16,6 +16,9 @@ exports[`loadSiteConfig website with .cjs siteConfig 1`] = ` ], "path": "i18n", }, + "markdown": { + "mermaid": false, + }, "noIndex": false, "onBrokenLinks": "throw", "onBrokenMarkdownLinks": "warn", @@ -54,6 +57,9 @@ exports[`loadSiteConfig website with valid async config 1`] = ` ], "path": "i18n", }, + "markdown": { + "mermaid": false, + }, "noIndex": false, "onBrokenLinks": "throw", "onBrokenMarkdownLinks": "warn", @@ -94,6 +100,9 @@ exports[`loadSiteConfig website with valid async config creator function 1`] = ` ], "path": "i18n", }, + "markdown": { + "mermaid": false, + }, "noIndex": false, "onBrokenLinks": "throw", "onBrokenMarkdownLinks": "warn", @@ -134,6 +143,9 @@ exports[`loadSiteConfig website with valid config creator function 1`] = ` ], "path": "i18n", }, + "markdown": { + "mermaid": false, + }, "noIndex": false, "onBrokenLinks": "throw", "onBrokenMarkdownLinks": "warn", @@ -177,6 +189,9 @@ exports[`loadSiteConfig website with valid siteConfig 1`] = ` ], "path": "i18n", }, + "markdown": { + "mermaid": false, + }, "noIndex": false, "onBrokenLinks": "throw", "onBrokenMarkdownLinks": "warn", diff --git a/packages/docusaurus/src/server/__tests__/__snapshots__/index.test.ts.snap b/packages/docusaurus/src/server/__tests__/__snapshots__/index.test.ts.snap index e613a20e360c..0894af65eec3 100644 --- a/packages/docusaurus/src/server/__tests__/__snapshots__/index.test.ts.snap +++ b/packages/docusaurus/src/server/__tests__/__snapshots__/index.test.ts.snap @@ -90,6 +90,9 @@ exports[`load loads props for site with custom i18n path 1`] = ` ], "path": "i18n", }, + "markdown": { + "mermaid": false, + }, "noIndex": false, "onBrokenLinks": "throw", "onBrokenMarkdownLinks": "warn", diff --git a/packages/docusaurus/src/server/__tests__/configValidation.test.ts b/packages/docusaurus/src/server/__tests__/configValidation.test.ts index a99a93b66efc..81ed54f70ef8 100644 --- a/packages/docusaurus/src/server/__tests__/configValidation.test.ts +++ b/packages/docusaurus/src/server/__tests__/configValidation.test.ts @@ -10,7 +10,8 @@ import { DEFAULT_CONFIG, validateConfig, } from '../configValidation'; -import type {Config} from '@docusaurus/types'; +import type {Config, DocusaurusConfig} from '@docusaurus/types'; +import type {DeepPartial} from 'utility-types'; const baseConfig = { baseUrl: '/', @@ -18,7 +19,7 @@ const baseConfig = { url: 'https://mysite.com', } as Config; -const normalizeConfig = (config: Partial) => +const normalizeConfig = (config: DeepPartial) => validateConfig({...baseConfig, ...config}, 'docusaurus.config.js'); describe('normalizeConfig', () => { @@ -57,6 +58,9 @@ describe('normalizeConfig', () => { crossorigin: 'anonymous', }, ], + markdown: { + mermaid: true, + }, }; const normalizedConfig = normalizeConfig(userConfig); expect(normalizedConfig).toEqual(userConfig); @@ -466,3 +470,44 @@ describe('config warning and error', () => { ); }); }); + +describe('markdown', () => { + it('accepts undefined object', () => { + expect( + normalizeConfig({ + markdown: undefined, + }), + ).toEqual(expect.objectContaining({markdown: DEFAULT_CONFIG.markdown})); + }); + + it('accepts empty object', () => { + expect( + normalizeConfig({ + markdown: {}, + }), + ).toEqual(expect.objectContaining({markdown: DEFAULT_CONFIG.markdown})); + }); + + it('accepts valid markdown object', () => { + const markdown: DocusaurusConfig['markdown'] = { + mermaid: true, + }; + expect( + normalizeConfig({ + markdown, + }), + ).toEqual(expect.objectContaining({markdown})); + }); + + it('throw for null object', () => { + expect(() => { + normalizeConfig({ + // @ts-expect-error: test + markdown: null, + }); + }).toThrowErrorMatchingInlineSnapshot(` + ""markdown" must be of type object + " + `); + }); +}); diff --git a/packages/docusaurus/src/server/configValidation.ts b/packages/docusaurus/src/server/configValidation.ts index ec520a90a5b2..09246c3e1e88 100644 --- a/packages/docusaurus/src/server/configValidation.ts +++ b/packages/docusaurus/src/server/configValidation.ts @@ -44,6 +44,7 @@ export const DEFAULT_CONFIG: Pick< | 'tagline' | 'baseUrlIssueBanner' | 'staticDirectories' + | 'markdown' > = { i18n: DEFAULT_I18N_CONFIG, onBrokenLinks: 'throw', @@ -63,6 +64,9 @@ export const DEFAULT_CONFIG: Pick< tagline: '', baseUrlIssueBanner: true, staticDirectories: [DEFAULT_STATIC_DIR_NAME], + markdown: { + mermaid: false, + }, }; function createPluginSchema(theme: boolean) { @@ -262,6 +266,9 @@ export const ConfigSchema = Joi.object({ .try(Joi.string().equal('babel'), Joi.function()) .optional(), }).optional(), + markdown: Joi.object({ + mermaid: Joi.boolean().default(DEFAULT_CONFIG.markdown.mermaid), + }).default(DEFAULT_CONFIG.markdown), }).messages({ 'docusaurus.configValidationWarning': 'Docusaurus config validation warning. Field {#label}: {#warningMessage}', diff --git a/packages/docusaurus/src/server/plugins/synthetic.ts b/packages/docusaurus/src/server/plugins/synthetic.ts index 0ce1b75f0ed1..36a2d09f4bce 100644 --- a/packages/docusaurus/src/server/plugins/synthetic.ts +++ b/packages/docusaurus/src/server/plugins/synthetic.ts @@ -8,6 +8,7 @@ import path from 'path'; import type {RuleSetRule} from 'webpack'; import type {HtmlTagObject, LoadedPlugin, LoadContext} from '@docusaurus/types'; +import type {Options as MDXLoaderOptions} from '@docusaurus/mdx-loader'; /** * Make a synthetic plugin to: @@ -96,7 +97,7 @@ export function createMDXFallbackPlugin({ return isMDXRule ? (rule.include as string[]) : []; }); } - const mdxLoaderOptions = { + const mdxLoaderOptions: MDXLoaderOptions = { admonitions: true, staticDirs: siteConfig.staticDirectories.map((dir) => path.resolve(siteDir, dir), @@ -106,6 +107,7 @@ export function createMDXFallbackPlugin({ isMDXPartial: () => true, // External MDX files might have front matter, just disable the warning isMDXPartialFrontMatterWarningDisabled: true, + markdownConfig: siteConfig.markdown, }; return { diff --git a/project-words.txt b/project-words.txt index 1a9af6034410..094e9896a651 100644 --- a/project-words.txt +++ b/project-words.txt @@ -105,8 +105,10 @@ formik fouc froms funboxteam +gantt gabrielcsapo getopts +gitgraph gitpod globbing globby @@ -281,6 +283,7 @@ refactorings regexes rehype reponame +reqs requireindex retrocompatibility retrocompatible @@ -368,6 +371,7 @@ urlset userland vannicatte vercel +verifymethod vetter vfile vicenti diff --git a/website/_dogfooding/_pages tests/diagrams.mdx b/website/_dogfooding/_pages tests/diagrams.mdx new file mode 100644 index 000000000000..c759be77a886 --- /dev/null +++ b/website/_dogfooding/_pages tests/diagrams.mdx @@ -0,0 +1,316 @@ +# Diagram Examples + +## Sequence Diagram + +```mermaid +sequenceDiagram + participant Alice + participant Bob + Alice->>John: Hello John, how are you? + loop Health check + John->>John: Fight against hypochondria + end + Note right of John: Rational thoughts
prevail! + John-->>Alice: Great! + John->>Bob: How about you? + Bob-->>John: Jolly good! +``` + +## Sequence Diagram (forest theme directive) + +It is possible to override default config locally with Mermaid text directives such as: + +``` +%%{init: { "theme": "forest" } }%% +``` + +```mermaid +%%{init: { "theme": "forest" } }%% + +sequenceDiagram + participant Alice + participant Bob + Alice->>John: Hello John, how are you? + loop Health check + John->>John: Fight against hypochondria + end + Note right of John: Rational thoughts
prevail! + John-->>Alice: Great! + John->>Bob: How about you? + Bob-->>John: Jolly good! +``` + +## Gantt Chart + +```mermaid +gantt +dateFormat YYYY-MM-DD +title Adding GANTT diagram to mermaid +excludes weekdays 2014-01-10 + +section A section +Completed task :done, des1, 2014-01-06,2014-01-08 +Active task :active, des2, 2014-01-09, 3d +Future task : des3, after des2, 5d +Future task2 : des4, after des3, 5d +``` + +## Flow Chart + +```mermaid +flowchart TD + A[Start] --> B{Is it?} + B -->|Yes| C[OK] + C --> D[Rethink] + D --> B + B ---->|No| E[End] +``` + +## Class Diagram + +```mermaid + classDiagram + Animal <|-- Duck + Animal <|-- Fish + Animal <|-- Zebra + Animal : +int age + Animal : +String gender + Animal: +isMammal() + Animal: +mate() + class Duck{ + +String beakColor + +swim() + +quack() + } + class Fish{ + -int sizeInFeet + -canEat() + } + class Zebra{ + +bool is_wild + +run() + } +``` + +## State Diagram + +```mermaid +stateDiagram-v2 + [*] --> Active + + state Active { + [*] --> NumLockOff + NumLockOff --> NumLockOn : EvNumLockPressed + NumLockOn --> NumLockOff : EvNumLockPressed + -- + [*] --> CapsLockOff + CapsLockOff --> CapsLockOn : EvCapsLockPressed + CapsLockOn --> CapsLockOff : EvCapsLockPressed + -- + [*] --> ScrollLockOff + ScrollLockOff --> ScrollLockOn : EvScrollLockPressed + ScrollLockOn --> ScrollLockOff : EvScrollLockPressed + } +``` + +## Entity Relationship Diagram + +```mermaid +erDiagram + CAR ||--o{ NAMED-DRIVER : allows + CAR { + string registrationNumber + string make + string model + } + PERSON ||--o{ NAMED-DRIVER : is + PERSON { + string firstName + string lastName + int age + } +``` + +## User Journey + +```mermaid +journey + title My working day + section Go to work + Make tea: 5: Me + Go upstairs: 3: Me + Do work: 1: Me, Cat + section Go home + Go downstairs: 5: Me + Sit down: 5: Me +``` + +:::note + +If there's too much space above it's due to a [Mermaid bug](https://github.com/mermaid-js/mermaid/issues/3501) + +::: + +## Pie Chart + +```mermaid +pie showData + title Key elements in Product X + "Calcium" : 42.96 + "Potassium" : 50.05 + "Magnesium" : 10.01 + "Iron" : 5 +``` + +## Requirement Diagram + +```mermaid + requirementDiagram + + requirement test_req { + id: 1 + text: the test text. + risk: high + verifymethod: test + } + + functionalRequirement test_req2 { + id: 1.1 + text: the second test text. + risk: low + verifymethod: inspection + } + + performanceRequirement test_req3 { + id: 1.2 + text: the third test text. + risk: medium + verifymethod: demonstration + } + + interfaceRequirement test_req4 { + id: 1.2.1 + text: the fourth test text. + risk: medium + verifymethod: analysis + } + + physicalRequirement test_req5 { + id: 1.2.2 + text: the fifth test text. + risk: medium + verifymethod: analysis + } + + designConstraint test_req6 { + id: 1.2.3 + text: the sixth test text. + risk: medium + verifymethod: analysis + } + + element test_entity { + type: simulation + } + + element test_entity2 { + type: word doc + docRef: reqs/test_entity + } + + element test_entity3 { + type: "test suite" + docRef: github.com/all_the_tests + } + + + test_entity - satisfies -> test_req2 + test_req - traces -> test_req2 + test_req - contains -> test_req3 + test_req3 - contains -> test_req4 + test_req4 - derives -> test_req5 + test_req5 - refines -> test_req6 + test_entity3 - verifies -> test_req5 + test_req <- copies - test_entity2 +``` + +## Gitgraph (Git) Diagram + +```mermaid +%%{init: { 'logLevel': 'debug', 'theme': 'base' } }%% + gitGraph + commit + branch hotfix + checkout hotfix + commit + branch develop + checkout develop + commit id:"ash" tag:"abc" + branch featureB + checkout featureB + commit type:HIGHLIGHT + checkout main + checkout hotfix + commit type:NORMAL + checkout develop + commit type:REVERSE + checkout featureB + commit + checkout main + merge hotfix + checkout featureB + commit + checkout develop + branch featureA + commit + checkout develop + merge hotfix + checkout featureA + commit + checkout featureB + commit + checkout develop + merge featureA + branch release + checkout release + commit + checkout main + commit + checkout release + merge main + checkout develop + merge release +``` + +## Mermaid in tabs + +````mdx-code-block +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + + + + +The following mermaid diagram is shown: + +```mermaid +graph LR + a ---> c(10) + b ---> c(10) +``` + + + + + +This mermaid diagram is not displayed: + +```mermaid +graph LR + d ---> z(42) + e ---> z(42) +``` + + + +```` diff --git a/website/_dogfooding/_pages tests/index.md b/website/_dogfooding/_pages tests/index.md index e8bb7fdc7df4..7d5713078f83 100644 --- a/website/_dogfooding/_pages tests/index.md +++ b/website/_dogfooding/_pages tests/index.md @@ -27,6 +27,7 @@ import Readme from "../README.md" - [Asset linking tests](/tests/pages/markdown-tests) - [General Markdown tests](/tests/pages/markdownPageTests) - [TOC tests](/tests/pages/page-toc-tests) +- [Diagram tests](/tests/pages/diagrams) - [Tabs tests](/tests/pages/tabs-tests) - [z-index tests](/tests/pages/z-index-tests) - [Head metadata tests](/tests/pages/head-metadata) diff --git a/website/community/2-resources.md b/website/community/2-resources.md index 3915de568865..10d354017431 100644 --- a/website/community/2-resources.md +++ b/website/community/2-resources.md @@ -44,7 +44,6 @@ See the showcase - [docusaurus-plugin-module-alias](https://github.com/atomicpages/docusaurus-plugin-module-alias) - A Docusaurus v2 plugin for quickly aliasing local modules - [docusaurus-protobuffet](https://github.com/protobuffet/docusaurus-protobuffet) - Docusaurus toolset for Protobuf contract documentation - [docusaurus-prince-pdf](https://github.com/signcl/docusaurus-prince-pdf) - Generate PDF with PrinceXML for better font subsetting and ToC features. Support Docusaurus v2 sites -- [mdx-mermaid](https://github.com/sjwall/mdx-mermaid) - A Docusaurus v2 compatible MDX plugin for displaying [Mermaid](https://mermaid-js.github.io/mermaid) diagrams - [redocusaurus](https://github.com/rohit-gohri/redocusaurus) - A Docusaurus preset for integrating OpenAPI documentation into your docs with [Redoc](https://github.com/redocly/redoc) - [plugin-image-zoom](https://github.com/flexanalytics/plugin-image-zoom) - An Image Zoom plugin for Docusaurus 2 - [docusaurus-plugin-typedoc](https://github.com/tgreyuk/typedoc-plugin-markdown/tree/master/packages/docusaurus-plugin-typedoc) - A Docusaurus 2 plugin to build documentation with [TypeDoc](https://typedoc.org/) diff --git a/website/docs/guides/markdown-features/markdown-features-diagrams.mdx b/website/docs/guides/markdown-features/markdown-features-diagrams.mdx new file mode 100644 index 000000000000..ae59efe5b464 --- /dev/null +++ b/website/docs/guides/markdown-features/markdown-features-diagrams.mdx @@ -0,0 +1,85 @@ +--- +id: diagrams +title: Diagrams +description: Writing diagrams with Mermaid +slug: /markdown-features/diagrams +--- + +# Diagrams + +Diagrams can be rendered using [Mermaid](https://mermaid-js.github.io/mermaid/) in a code block. + +## Installation {#installation} + +```bash npm2yarn +npm install --save @docusaurus/theme-mermaid +``` + +Enable Mermaid functionality by adding plugin `@docusaurus/theme-mermaid` and setting `markdown.mermaid` to `true` in your `docusaurus.config.js`. + +```js title="docusaurus.config.js" +module.exports = { + markdown: { + mermaid: true, + }, + themes: ['@docusaurus/theme-mermaid'], +}; +``` + +## Usage {#usage} + +Add a code block with language `mermaid`: + +````md title="Example Mermaid diagram" +```mermaid +graph TD; + A-->B; + A-->C; + B-->D; + C-->D; +``` +```` + +```mermaid +graph TD; + A-->B; + A-->C; + B-->D; + C-->D; +``` + +See the [Mermaid syntax documentation](https://mermaid-js.github.io/mermaid/#/./n00b-syntaxReference) for more information on the Mermaid syntax. + +## Theming {#theming} + +The diagram dark and light themes can be changed by setting `mermaid.theme` values in the `themeConfig` in your `docusaurus.config.js`. You can set themes for both light and dark mode. + +```js title="docusaurus.config.js" +module.exports = { + themeConfig: { + mermaid: { + theme: {light: 'neutral', dark: 'forest'}, + }, + }, +}; +``` + +See the [Mermaid theme documentation](https://mermaid-js.github.io/mermaid/#/theming) for more information on theming Mermaid diagrams. + +## Mermaid Config {#configuration} + +Options in `mermaid.mermaidOptions` will be passed directly to `mermaid.initialize`: + +```js title="docusaurus.config.js" +module.exports = { + themeConfig: { + mermaid: { + mermaidOptions: { + maxTextSize: 50, + }, + }, + }, +}; +``` + +See the [Mermaid configuration documentation](https://mermaid-js.github.io/mermaid/#/./Setup?id=configuration) for the available config options. diff --git a/website/docusaurus.config.js b/website/docusaurus.config.js index be64b54a4234..9c7a02b52663 100644 --- a/website/docusaurus.config.js +++ b/website/docusaurus.config.js @@ -118,6 +118,9 @@ const config = { }, }), }, + markdown: { + mermaid: true, + }, onBrokenLinks: 'throw', onBrokenMarkdownLinks: 'warn', favicon: 'img/docusaurus.ico', @@ -280,6 +283,7 @@ const config = { ], }, ], + '@docusaurus/theme-mermaid', ...dogfoodingPluginInstances, ], presets: [ diff --git a/website/package.json b/website/package.json index e6cb8d49e4c1..6879abdb7c9e 100644 --- a/website/package.json +++ b/website/package.json @@ -45,6 +45,7 @@ "@docusaurus/remark-plugin-npm2yarn": "^3.0.0-alpha.0", "@docusaurus/theme-classic": "^3.0.0-alpha.0", "@docusaurus/theme-common": "^3.0.0-alpha.0", + "@docusaurus/theme-mermaid": "^3.0.0-alpha.0", "@docusaurus/theme-live-codeblock": "^3.0.0-alpha.0", "@docusaurus/utils": "^3.0.0-alpha.0", "@docusaurus/utils-common": "^3.0.0-alpha.0", diff --git a/website/sidebars.js b/website/sidebars.js index aa139632d171..a5be9b42a915 100644 --- a/website/sidebars.js +++ b/website/sidebars.js @@ -82,6 +82,7 @@ const sidebars = { 'guides/markdown-features/links', 'guides/markdown-features/plugins', 'guides/markdown-features/math-equations', + 'guides/markdown-features/diagrams', 'guides/markdown-features/head-metadata', ], }, diff --git a/yarn.lock b/yarn.lock index a6527cb9f2a7..68c6a526c52c 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1250,6 +1250,11 @@ resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39" integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw== +"@braintree/sanitize-url@^6.0.0": + version "6.0.0" + resolved "https://registry.yarnpkg.com/@braintree/sanitize-url/-/sanitize-url-6.0.0.tgz#fe364f025ba74f6de6c837a84ef44bdb1d61e68f" + integrity sha512-mgmE7XBYY/21erpzhexk4Cj1cyTQ9LzvnTxtzM17BJ7ERMNE6W72mQRo0I1Ud8eFJ+RVVIcBNhLFZ3GX4XFz5w== + "@colors/colors@1.5.0": version "1.5.0" resolved "https://registry.yarnpkg.com/@colors/colors/-/colors-1.5.0.tgz#bb504579c1cae923e6576a4f5da43d25f97bdbd9" @@ -3649,6 +3654,11 @@ dependencies: "@types/react" "*" +"@types/mermaid@^8.2.9": + version "8.2.9" + resolved "https://registry.yarnpkg.com/@types/mermaid/-/mermaid-8.2.9.tgz#1844505dcffcd47703e94628a6200583d35c2c76" + integrity sha512-f1i8fNoVFVJXedk+R7GcEk4KoOWzWAU3CzFqlVw1qWKktfsataBERezCz1pOdKy8Ec02ZdPQXGM7NU2lPHABYQ== + "@types/micromatch@^4.0.2": version "4.0.2" resolved "https://registry.yarnpkg.com/@types/micromatch/-/micromatch-4.0.2.tgz#ce29c8b166a73bf980a5727b1e4a4d099965151d" @@ -5666,21 +5676,21 @@ command-exists-promise@^2.0.2: resolved "https://registry.yarnpkg.com/command-exists-promise/-/command-exists-promise-2.0.2.tgz#7beecc4b218299f3c61fa69a4047aa0b36a64a99" integrity sha512-T6PB6vdFrwnHXg/I0kivM3DqaCGZLjjYSOe0a5WgFKcz1sOnmOeIjnhQPXVXX3QjVbLyTJ85lJkX6lUpukTzaA== -commander@^2.20.0: +commander@2, commander@^2.20.0: version "2.20.3" resolved "https://registry.yarnpkg.com/commander/-/commander-2.20.3.tgz#fd485e84c03eb4881c20722ba48035e8531aeb33" integrity sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ== +commander@7, commander@^7.2.0: + version "7.2.0" + resolved "https://registry.yarnpkg.com/commander/-/commander-7.2.0.tgz#a36cb57d0b501ce108e4d20559a150a391d97ab7" + integrity sha512-QrWXB+ZQSVPmIWIhtEO9H+gwHaMGYiF5ChvoJ+K9ZGHG/sVsa6yiesAD1GC/x46sET00Xlwo1u49RVVVzvcSkw== + commander@^5.0.0, commander@^5.1.0: version "5.1.0" resolved "https://registry.yarnpkg.com/commander/-/commander-5.1.0.tgz#46abbd1652f8e059bddaef99bbdcb2ad9cf179ae" integrity sha512-P0CysNDQ7rtVw4QIQtm+MRxV66vKFSvlsQvGYXZWR3qFU0jlMKHZZZgw8e+8DSah4UDKMqnknRDQz+xuQXQ/Zg== -commander@^7.2.0: - version "7.2.0" - resolved "https://registry.yarnpkg.com/commander/-/commander-7.2.0.tgz#a36cb57d0b501ce108e4d20559a150a391d97ab7" - integrity sha512-QrWXB+ZQSVPmIWIhtEO9H+gwHaMGYiF5ChvoJ+K9ZGHG/sVsa6yiesAD1GC/x46sET00Xlwo1u49RVVVzvcSkw== - commander@^8.0.0, commander@^8.3.0: version "8.3.0" resolved "https://registry.yarnpkg.com/commander/-/commander-8.3.0.tgz#4837ea1b2da67b9c616a67afbb0fafee567bca66" @@ -6305,6 +6315,516 @@ csstype@^3.0.2: resolved "https://registry.yarnpkg.com/csstype/-/csstype-3.1.0.tgz#4ddcac3718d787cf9df0d1b7d15033925c8f29f2" integrity sha512-uX1KG+x9h5hIJsaKR9xHUeUraxf8IODOwq9JLNPq6BwB04a/xgpq3rcx47l5BZu5zBPlgD342tdke3Hom/nJRA== +d3-array@1, d3-array@^1.1.1, d3-array@^1.2.0: + version "1.2.4" + resolved "https://registry.yarnpkg.com/d3-array/-/d3-array-1.2.4.tgz#635ce4d5eea759f6f605863dbcfc30edc737f71f" + integrity sha512-KHW6M86R+FUPYGb3R5XiYjXPq7VzwxZ22buHhAEVG5ztoEcZZMLov530mmccaqA1GghZArjQV46fuc8kUqhhHw== + +"d3-array@2 - 3", "d3-array@2.10.0 - 3", "d3-array@2.5.0 - 3", d3-array@3, d3-array@^3.2.0: + version "3.2.0" + resolved "https://registry.yarnpkg.com/d3-array/-/d3-array-3.2.0.tgz#15bf96cd9b7333e02eb8de8053d78962eafcff14" + integrity sha512-3yXFQo0oG3QCxbF06rMPFyGRMGJNS7NvsV1+2joOjbBE+9xvWQ8+GcMJAjRCzw06zQ3/arXeJgbPYcjUCuC+3g== + dependencies: + internmap "1 - 2" + +d3-axis@1: + version "1.0.12" + resolved "https://registry.yarnpkg.com/d3-axis/-/d3-axis-1.0.12.tgz#cdf20ba210cfbb43795af33756886fb3638daac9" + integrity sha512-ejINPfPSNdGFKEOAtnBtdkpr24c4d4jsei6Lg98mxf424ivoDP2956/5HDpIAtmHo85lqT4pruy+zEgvRUBqaQ== + +d3-axis@3: + version "3.0.0" + resolved "https://registry.yarnpkg.com/d3-axis/-/d3-axis-3.0.0.tgz#c42a4a13e8131d637b745fc2973824cfeaf93322" + integrity sha512-IH5tgjV4jE/GhHkRV0HiVYPDtvfjHQlQfJHs0usq7M30XcSBvOotpmH1IgkcXsO/5gEQZD43B//fc7SRT5S+xw== + +d3-brush@1: + version "1.1.6" + resolved "https://registry.yarnpkg.com/d3-brush/-/d3-brush-1.1.6.tgz#b0a22c7372cabec128bdddf9bddc058592f89e9b" + integrity sha512-7RW+w7HfMCPyZLifTz/UnJmI5kdkXtpCbombUSs8xniAyo0vIbrDzDwUJB6eJOgl9u5DQOt2TQlYumxzD1SvYA== + dependencies: + d3-dispatch "1" + d3-drag "1" + d3-interpolate "1" + d3-selection "1" + d3-transition "1" + +d3-brush@3: + version "3.0.0" + resolved "https://registry.yarnpkg.com/d3-brush/-/d3-brush-3.0.0.tgz#6f767c4ed8dcb79de7ede3e1c0f89e63ef64d31c" + integrity sha512-ALnjWlVYkXsVIGlOsuWH1+3udkYFI48Ljihfnh8FZPF2QS9o+PzGLBslO0PjzVoHLZ2KCVgAM8NVkXPJB2aNnQ== + dependencies: + d3-dispatch "1 - 3" + d3-drag "2 - 3" + d3-interpolate "1 - 3" + d3-selection "3" + d3-transition "3" + +d3-chord@1: + version "1.0.6" + resolved "https://registry.yarnpkg.com/d3-chord/-/d3-chord-1.0.6.tgz#309157e3f2db2c752f0280fedd35f2067ccbb15f" + integrity sha512-JXA2Dro1Fxw9rJe33Uv+Ckr5IrAa74TlfDEhE/jfLOaXegMQFQTAgAw9WnZL8+HxVBRXaRGCkrNU7pJeylRIuA== + dependencies: + d3-array "1" + d3-path "1" + +d3-chord@3: + version "3.0.1" + resolved "https://registry.yarnpkg.com/d3-chord/-/d3-chord-3.0.1.tgz#d156d61f485fce8327e6abf339cb41d8cbba6966" + integrity sha512-VE5S6TNa+j8msksl7HwjxMHDM2yNK3XCkusIlpX5kwauBfXuyLAtNg9jCp/iHH61tgI4sb6R/EIMWCqEIdjT/g== + dependencies: + d3-path "1 - 3" + +d3-collection@1: + version "1.0.7" + resolved "https://registry.yarnpkg.com/d3-collection/-/d3-collection-1.0.7.tgz#349bd2aa9977db071091c13144d5e4f16b5b310e" + integrity sha512-ii0/r5f4sjKNTfh84Di+DpztYwqKhEyUlKoPrzUFfeSkWxjW49xU2QzO9qrPrNkpdI0XJkfzvmTu8V2Zylln6A== + +d3-color@1: + version "1.4.1" + resolved "https://registry.yarnpkg.com/d3-color/-/d3-color-1.4.1.tgz#c52002bf8846ada4424d55d97982fef26eb3bc8a" + integrity sha512-p2sTHSLCJI2QKunbGb7ocOh7DgTAn8IrLx21QRc/BSnodXM4sv6aLQlnfpvehFMLZEfBc6g9pH9SWQccFYfJ9Q== + +"d3-color@1 - 3", d3-color@3: + version "3.1.0" + resolved "https://registry.yarnpkg.com/d3-color/-/d3-color-3.1.0.tgz#395b2833dfac71507f12ac2f7af23bf819de24e2" + integrity sha512-zg/chbXyeBtMQ1LbD/WSoW2DpC3I0mpmPdW+ynRTj/x2DAWYrIY7qeZIHidozwV24m4iavr15lNwIwLxRmOxhA== + +d3-contour@1: + version "1.3.2" + resolved "https://registry.yarnpkg.com/d3-contour/-/d3-contour-1.3.2.tgz#652aacd500d2264cb3423cee10db69f6f59bead3" + integrity sha512-hoPp4K/rJCu0ladiH6zmJUEz6+u3lgR+GSm/QdM2BBvDraU39Vr7YdDCicJcxP1z8i9B/2dJLgDC1NcvlF8WCg== + dependencies: + d3-array "^1.1.1" + +d3-contour@4: + version "4.0.0" + resolved "https://registry.yarnpkg.com/d3-contour/-/d3-contour-4.0.0.tgz#5a1337c6da0d528479acdb5db54bc81a0ff2ec6b" + integrity sha512-7aQo0QHUTu/Ko3cP9YK9yUTxtoDEiDGwnBHyLxG5M4vqlBkO/uixMRele3nfsfj6UXOcuReVpVXzAboGraYIJw== + dependencies: + d3-array "^3.2.0" + +d3-delaunay@6: + version "6.0.2" + resolved "https://registry.yarnpkg.com/d3-delaunay/-/d3-delaunay-6.0.2.tgz#7fd3717ad0eade2fc9939f4260acfb503f984e92" + integrity sha512-IMLNldruDQScrcfT+MWnazhHbDJhcRJyOEBAJfwQnHle1RPh6WDuLvxNArUju2VSMSUuKlY5BGHRJ2cYyoFLQQ== + dependencies: + delaunator "5" + +d3-dispatch@1: + version "1.0.6" + resolved "https://registry.yarnpkg.com/d3-dispatch/-/d3-dispatch-1.0.6.tgz#00d37bcee4dd8cd97729dd893a0ac29caaba5d58" + integrity sha512-fVjoElzjhCEy+Hbn8KygnmMS7Or0a9sI2UzGwoB7cCtvI1XpVN9GpoYlnb3xt2YV66oXYb1fLJ8GMvP4hdU1RA== + +"d3-dispatch@1 - 3", d3-dispatch@3: + version "3.0.1" + resolved "https://registry.yarnpkg.com/d3-dispatch/-/d3-dispatch-3.0.1.tgz#5fc75284e9c2375c36c839411a0cf550cbfc4d5e" + integrity sha512-rzUyPU/S7rwUflMyLc1ETDeBj0NRuHKKAcvukozwhshr6g6c5d8zh4c2gQjY2bZ0dXeGLWc1PF174P2tVvKhfg== + +d3-drag@1: + version "1.2.5" + resolved "https://registry.yarnpkg.com/d3-drag/-/d3-drag-1.2.5.tgz#2537f451acd39d31406677b7dc77c82f7d988f70" + integrity sha512-rD1ohlkKQwMZYkQlYVCrSFxsWPzI97+W+PaEIBNTMxRuxz9RF0Hi5nJWHGVJ3Om9d2fRTe1yOBINJyy/ahV95w== + dependencies: + d3-dispatch "1" + d3-selection "1" + +"d3-drag@2 - 3", d3-drag@3: + version "3.0.0" + resolved "https://registry.yarnpkg.com/d3-drag/-/d3-drag-3.0.0.tgz#994aae9cd23c719f53b5e10e3a0a6108c69607ba" + integrity sha512-pWbUJLdETVA8lQNJecMxoXfH6x+mO2UQo8rSmZ+QqxcbyA3hfeprFgIT//HW2nlHChWeIIMwS2Fq+gEARkhTkg== + dependencies: + d3-dispatch "1 - 3" + d3-selection "3" + +d3-dsv@1: + version "1.2.0" + resolved "https://registry.yarnpkg.com/d3-dsv/-/d3-dsv-1.2.0.tgz#9d5f75c3a5f8abd611f74d3f5847b0d4338b885c" + integrity sha512-9yVlqvZcSOMhCYzniHE7EVUws7Fa1zgw+/EAV2BxJoG3ME19V6BQFBwI855XQDsxyOuG7NibqRMTtiF/Qup46g== + dependencies: + commander "2" + iconv-lite "0.4" + rw "1" + +"d3-dsv@1 - 3", d3-dsv@3: + version "3.0.1" + resolved "https://registry.yarnpkg.com/d3-dsv/-/d3-dsv-3.0.1.tgz#c63af978f4d6a0d084a52a673922be2160789b73" + integrity sha512-UG6OvdI5afDIFP9w4G0mNq50dSOsXHJaRE8arAS5o9ApWnIElp8GZw1Dun8vP8OyHOZ/QJUKUJwxiiCCnUwm+Q== + dependencies: + commander "7" + iconv-lite "0.6" + rw "1" + +d3-ease@1: + version "1.0.7" + resolved "https://registry.yarnpkg.com/d3-ease/-/d3-ease-1.0.7.tgz#9a834890ef8b8ae8c558b2fe55bd57f5993b85e2" + integrity sha512-lx14ZPYkhNx0s/2HX5sLFUI3mbasHjSSpwO/KaaNACweVwxUruKyWVcb293wMv1RqTPZyZ8kSZ2NogUZNcLOFQ== + +"d3-ease@1 - 3", d3-ease@3: + version "3.0.1" + resolved "https://registry.yarnpkg.com/d3-ease/-/d3-ease-3.0.1.tgz#9658ac38a2140d59d346160f1f6c30fda0bd12f4" + integrity sha512-wR/XK3D3XcLIZwpbvQwQ5fK+8Ykds1ip7A2Txe0yxncXSdq1L9skcG7blcedkOX+ZcgxGAmLX1FrRGbADwzi0w== + +d3-fetch@1: + version "1.2.0" + resolved "https://registry.yarnpkg.com/d3-fetch/-/d3-fetch-1.2.0.tgz#15ce2ecfc41b092b1db50abd2c552c2316cf7fc7" + integrity sha512-yC78NBVcd2zFAyR/HnUiBS7Lf6inSCoWcSxFfw8FYL7ydiqe80SazNwoffcqOfs95XaLo7yebsmQqDKSsXUtvA== + dependencies: + d3-dsv "1" + +d3-fetch@3: + version "3.0.1" + resolved "https://registry.yarnpkg.com/d3-fetch/-/d3-fetch-3.0.1.tgz#83141bff9856a0edb5e38de89cdcfe63d0a60a22" + integrity sha512-kpkQIM20n3oLVBKGg6oHrUchHM3xODkTzjMoj7aWQFq5QEM+R6E4WkzT5+tojDY7yjez8KgCBRoj4aEr99Fdqw== + dependencies: + d3-dsv "1 - 3" + +d3-force@1: + version "1.2.1" + resolved "https://registry.yarnpkg.com/d3-force/-/d3-force-1.2.1.tgz#fd29a5d1ff181c9e7f0669e4bd72bdb0e914ec0b" + integrity sha512-HHvehyaiUlVo5CxBJ0yF/xny4xoaxFxDnBXNvNcfW9adORGZfyNF1dj6DGLKyk4Yh3brP/1h3rnDzdIAwL08zg== + dependencies: + d3-collection "1" + d3-dispatch "1" + d3-quadtree "1" + d3-timer "1" + +d3-force@3: + version "3.0.0" + resolved "https://registry.yarnpkg.com/d3-force/-/d3-force-3.0.0.tgz#3e2ba1a61e70888fe3d9194e30d6d14eece155c4" + integrity sha512-zxV/SsA+U4yte8051P4ECydjD/S+qeYtnaIyAs9tgHCqfguma/aAQDjo85A9Z6EKhBirHRJHXIgJUlffT4wdLg== + dependencies: + d3-dispatch "1 - 3" + d3-quadtree "1 - 3" + d3-timer "1 - 3" + +d3-format@1: + version "1.4.5" + resolved "https://registry.yarnpkg.com/d3-format/-/d3-format-1.4.5.tgz#374f2ba1320e3717eb74a9356c67daee17a7edb4" + integrity sha512-J0piedu6Z8iB6TbIGfZgDzfXxUFN3qQRMofy2oPdXzQibYGqPB/9iMcxr/TGalU+2RsyDO+U4f33id8tbnSRMQ== + +"d3-format@1 - 3", d3-format@3: + version "3.1.0" + resolved "https://registry.yarnpkg.com/d3-format/-/d3-format-3.1.0.tgz#9260e23a28ea5cb109e93b21a06e24e2ebd55641" + integrity sha512-YyUI6AEuY/Wpt8KWLgZHsIU86atmikuoOmCfommt0LYHiQSPjvX2AcFc38PX0CBpr2RCyZhjex+NS/LPOv6YqA== + +d3-geo@1: + version "1.12.1" + resolved "https://registry.yarnpkg.com/d3-geo/-/d3-geo-1.12.1.tgz#7fc2ab7414b72e59fbcbd603e80d9adc029b035f" + integrity sha512-XG4d1c/UJSEX9NfU02KwBL6BYPj8YKHxgBEw5om2ZnTRSbIcego6dhHwcxuSR3clxh0EpE38os1DVPOmnYtTPg== + dependencies: + d3-array "1" + +d3-geo@3: + version "3.0.1" + resolved "https://registry.yarnpkg.com/d3-geo/-/d3-geo-3.0.1.tgz#4f92362fd8685d93e3b1fae0fd97dc8980b1ed7e" + integrity sha512-Wt23xBych5tSy9IYAM1FR2rWIBFWa52B/oF/GYe5zbdHrg08FU8+BuI6X4PvTwPDdqdAdq04fuWJpELtsaEjeA== + dependencies: + d3-array "2.5.0 - 3" + +d3-hierarchy@1: + version "1.1.9" + resolved "https://registry.yarnpkg.com/d3-hierarchy/-/d3-hierarchy-1.1.9.tgz#2f6bee24caaea43f8dc37545fa01628559647a83" + integrity sha512-j8tPxlqh1srJHAtxfvOUwKNYJkQuBFdM1+JAUfq6xqH5eAqf93L7oG1NVqDa4CpFZNvnNKtCYEUC8KY9yEn9lQ== + +d3-hierarchy@3: + version "3.1.2" + resolved "https://registry.yarnpkg.com/d3-hierarchy/-/d3-hierarchy-3.1.2.tgz#b01cd42c1eed3d46db77a5966cf726f8c09160c6" + integrity sha512-FX/9frcub54beBdugHjDCdikxThEqjnR93Qt7PvQTOHxyiNCAlvMrHhclk3cD5VeAaq9fxmfRp+CnWw9rEMBuA== + +d3-interpolate@1: + version "1.4.0" + resolved "https://registry.yarnpkg.com/d3-interpolate/-/d3-interpolate-1.4.0.tgz#526e79e2d80daa383f9e0c1c1c7dcc0f0583e987" + integrity sha512-V9znK0zc3jOPV4VD2zZn0sDhZU3WAE2bmlxdIwwQPPzPjvyLkd8B3JUVdS1IDUFDkWZ72c9qnv1GK2ZagTZ8EA== + dependencies: + d3-color "1" + +"d3-interpolate@1 - 3", "d3-interpolate@1.2.0 - 3", d3-interpolate@3: + version "3.0.1" + resolved "https://registry.yarnpkg.com/d3-interpolate/-/d3-interpolate-3.0.1.tgz#3c47aa5b32c5b3dfb56ef3fd4342078a632b400d" + integrity sha512-3bYs1rOD33uo8aqJfKP3JWPAibgw8Zm2+L9vBKEHJ2Rg+viTR7o5Mmv5mZcieN+FRYaAOWX5SJATX6k1PWz72g== + dependencies: + d3-color "1 - 3" + +d3-path@1: + version "1.0.9" + resolved "https://registry.yarnpkg.com/d3-path/-/d3-path-1.0.9.tgz#48c050bb1fe8c262493a8caf5524e3e9591701cf" + integrity sha512-VLaYcn81dtHVTjEHd8B+pbe9yHWpXKZUC87PzoFmsFrJqgFwDe/qxfp5MlfsfM1V5E/iVt0MmEbWQ7FVIXh/bg== + +"d3-path@1 - 3", d3-path@3: + version "3.0.1" + resolved "https://registry.yarnpkg.com/d3-path/-/d3-path-3.0.1.tgz#f09dec0aaffd770b7995f1a399152bf93052321e" + integrity sha512-gq6gZom9AFZby0YLduxT1qmrp4xpBA1YZr19OI717WIdKE2OM5ETq5qrHLb301IgxhLwcuxvGZVLeeWc/k1I6w== + +d3-polygon@1: + version "1.0.6" + resolved "https://registry.yarnpkg.com/d3-polygon/-/d3-polygon-1.0.6.tgz#0bf8cb8180a6dc107f518ddf7975e12abbfbd38e" + integrity sha512-k+RF7WvI08PC8reEoXa/w2nSg5AUMTi+peBD9cmFc+0ixHfbs4QmxxkarVal1IkVkgxVuk9JSHhJURHiyHKAuQ== + +d3-polygon@3: + version "3.0.1" + resolved "https://registry.yarnpkg.com/d3-polygon/-/d3-polygon-3.0.1.tgz#0b45d3dd1c48a29c8e057e6135693ec80bf16398" + integrity sha512-3vbA7vXYwfe1SYhED++fPUQlWSYTTGmFmQiany/gdbiWgU/iEyQzyymwL9SkJjFFuCS4902BSzewVGsHHmHtXg== + +d3-quadtree@1: + version "1.0.7" + resolved "https://registry.yarnpkg.com/d3-quadtree/-/d3-quadtree-1.0.7.tgz#ca8b84df7bb53763fe3c2f24bd435137f4e53135" + integrity sha512-RKPAeXnkC59IDGD0Wu5mANy0Q2V28L+fNe65pOCXVdVuTJS3WPKaJlFHer32Rbh9gIo9qMuJXio8ra4+YmIymA== + +"d3-quadtree@1 - 3", d3-quadtree@3: + version "3.0.1" + resolved "https://registry.yarnpkg.com/d3-quadtree/-/d3-quadtree-3.0.1.tgz#6dca3e8be2b393c9a9d514dabbd80a92deef1a4f" + integrity sha512-04xDrxQTDTCFwP5H6hRhsRcb9xxv2RzkcsygFzmkSIOJy3PeRJP7sNk3VRIbKXcog561P9oU0/rVH6vDROAgUw== + +d3-random@1: + version "1.1.2" + resolved "https://registry.yarnpkg.com/d3-random/-/d3-random-1.1.2.tgz#2833be7c124360bf9e2d3fd4f33847cfe6cab291" + integrity sha512-6AK5BNpIFqP+cx/sreKzNjWbwZQCSUatxq+pPRmFIQaWuoD+NrbVWw7YWpHiXpCQ/NanKdtGDuB+VQcZDaEmYQ== + +d3-random@3: + version "3.0.1" + resolved "https://registry.yarnpkg.com/d3-random/-/d3-random-3.0.1.tgz#d4926378d333d9c0bfd1e6fa0194d30aebaa20f4" + integrity sha512-FXMe9GfxTxqd5D6jFsQ+DJ8BJS4E/fT5mqqdjovykEB2oFbTMDVdg1MGFxfQW+FBOGoB++k8swBrgwSHT1cUXQ== + +d3-scale-chromatic@1: + version "1.5.0" + resolved "https://registry.yarnpkg.com/d3-scale-chromatic/-/d3-scale-chromatic-1.5.0.tgz#54e333fc78212f439b14641fb55801dd81135a98" + integrity sha512-ACcL46DYImpRFMBcpk9HhtIyC7bTBR4fNOPxwVSl0LfulDAwyiHyPOTqcDG1+t5d4P9W7t/2NAuWu59aKko/cg== + dependencies: + d3-color "1" + d3-interpolate "1" + +d3-scale-chromatic@3: + version "3.0.0" + resolved "https://registry.yarnpkg.com/d3-scale-chromatic/-/d3-scale-chromatic-3.0.0.tgz#15b4ceb8ca2bb0dcb6d1a641ee03d59c3b62376a" + integrity sha512-Lx9thtxAKrO2Pq6OO2Ua474opeziKr279P/TKZsMAhYyNDD3EnCffdbgeSYN5O7m2ByQsxtuP2CSDczNUIZ22g== + dependencies: + d3-color "1 - 3" + d3-interpolate "1 - 3" + +d3-scale@2: + version "2.2.2" + resolved "https://registry.yarnpkg.com/d3-scale/-/d3-scale-2.2.2.tgz#4e880e0b2745acaaddd3ede26a9e908a9e17b81f" + integrity sha512-LbeEvGgIb8UMcAa0EATLNX0lelKWGYDQiPdHj+gLblGVhGLyNbaCn3EvrJf0A3Y/uOOU5aD6MTh5ZFCdEwGiCw== + dependencies: + d3-array "^1.2.0" + d3-collection "1" + d3-format "1" + d3-interpolate "1" + d3-time "1" + d3-time-format "2" + +d3-scale@4: + version "4.0.2" + resolved "https://registry.yarnpkg.com/d3-scale/-/d3-scale-4.0.2.tgz#82b38e8e8ff7080764f8dcec77bd4be393689396" + integrity sha512-GZW464g1SH7ag3Y7hXjf8RoUuAFIqklOAq3MRl4OaWabTFJY9PN/E1YklhXLh+OQ3fM9yS2nOkCoS+WLZ6kvxQ== + dependencies: + d3-array "2.10.0 - 3" + d3-format "1 - 3" + d3-interpolate "1.2.0 - 3" + d3-time "2.1.1 - 3" + d3-time-format "2 - 4" + +d3-selection@1, d3-selection@^1.1.0: + version "1.4.2" + resolved "https://registry.yarnpkg.com/d3-selection/-/d3-selection-1.4.2.tgz#dcaa49522c0dbf32d6c1858afc26b6094555bc5c" + integrity sha512-SJ0BqYihzOjDnnlfyeHT0e30k0K1+5sR3d5fNueCNeuhZTnGw4M4o8mqJchSwgKMXCNFo+e2VTChiSJ0vYtXkg== + +"d3-selection@2 - 3", d3-selection@3: + version "3.0.0" + resolved "https://registry.yarnpkg.com/d3-selection/-/d3-selection-3.0.0.tgz#c25338207efa72cc5b9bd1458a1a41901f1e1b31" + integrity sha512-fmTRWbNMmsmWq6xJV8D19U/gw/bwrHfNXxrIN+HfZgnzqTHp9jOmKMhsTUjXOJnZOdZY9Q28y4yebKzqDKlxlQ== + +d3-shape@1: + version "1.3.7" + resolved "https://registry.yarnpkg.com/d3-shape/-/d3-shape-1.3.7.tgz#df63801be07bc986bc54f63789b4fe502992b5d7" + integrity sha512-EUkvKjqPFUAZyOlhY5gzCxCeI0Aep04LwIRpsZ/mLFelJiUfnK56jo5JMDSE7yyP2kLSb6LtF+S5chMk7uqPqw== + dependencies: + d3-path "1" + +d3-shape@3: + version "3.1.0" + resolved "https://registry.yarnpkg.com/d3-shape/-/d3-shape-3.1.0.tgz#c8a495652d83ea6f524e482fca57aa3f8bc32556" + integrity sha512-tGDh1Muf8kWjEDT/LswZJ8WF85yDZLvVJpYU9Nq+8+yW1Z5enxrmXOhTArlkaElU+CTn0OTVNli+/i+HP45QEQ== + dependencies: + d3-path "1 - 3" + +d3-time-format@2: + version "2.3.0" + resolved "https://registry.yarnpkg.com/d3-time-format/-/d3-time-format-2.3.0.tgz#107bdc028667788a8924ba040faf1fbccd5a7850" + integrity sha512-guv6b2H37s2Uq/GefleCDtbe0XZAuy7Wa49VGkPVPMfLL9qObgBST3lEHJBMUp8S7NdLQAGIvr2KXk8Hc98iKQ== + dependencies: + d3-time "1" + +"d3-time-format@2 - 4", d3-time-format@4: + version "4.1.0" + resolved "https://registry.yarnpkg.com/d3-time-format/-/d3-time-format-4.1.0.tgz#7ab5257a5041d11ecb4fe70a5c7d16a195bb408a" + integrity sha512-dJxPBlzC7NugB2PDLwo9Q8JiTR3M3e4/XANkreKSUxF8vvXKqm1Yfq4Q5dl8budlunRVlUUaDUgFt7eA8D6NLg== + dependencies: + d3-time "1 - 3" + +d3-time@1: + version "1.1.0" + resolved "https://registry.yarnpkg.com/d3-time/-/d3-time-1.1.0.tgz#b1e19d307dae9c900b7e5b25ffc5dcc249a8a0f1" + integrity sha512-Xh0isrZ5rPYYdqhAVk8VLnMEidhz5aP7htAADH6MfzgmmicPkTo8LhkLxci61/lCB7n7UmE3bN0leRt+qvkLxA== + +"d3-time@1 - 3", "d3-time@2.1.1 - 3", d3-time@3: + version "3.0.0" + resolved "https://registry.yarnpkg.com/d3-time/-/d3-time-3.0.0.tgz#65972cb98ae2d4954ef5c932e8704061335d4975" + integrity sha512-zmV3lRnlaLI08y9IMRXSDshQb5Nj77smnfpnd2LrBa/2K281Jijactokeak14QacHs/kKq0AQ121nidNYlarbQ== + dependencies: + d3-array "2 - 3" + +d3-timer@1: + version "1.0.10" + resolved "https://registry.yarnpkg.com/d3-timer/-/d3-timer-1.0.10.tgz#dfe76b8a91748831b13b6d9c793ffbd508dd9de5" + integrity sha512-B1JDm0XDaQC+uvo4DT79H0XmBskgS3l6Ve+1SBCfxgmtIb1AVrPIoqd+nPSv+loMX8szQ0sVUhGngL7D5QPiXw== + +"d3-timer@1 - 3", d3-timer@3: + version "3.0.1" + resolved "https://registry.yarnpkg.com/d3-timer/-/d3-timer-3.0.1.tgz#6284d2a2708285b1abb7e201eda4380af35e63b0" + integrity sha512-ndfJ/JxxMd3nw31uyKoY2naivF+r29V+Lc0svZxe1JvvIRmi8hUsrMvdOwgS1o6uBHmiz91geQ0ylPP0aj1VUA== + +d3-transition@1: + version "1.3.2" + resolved "https://registry.yarnpkg.com/d3-transition/-/d3-transition-1.3.2.tgz#a98ef2151be8d8600543434c1ca80140ae23b398" + integrity sha512-sc0gRU4PFqZ47lPVHloMn9tlPcv8jxgOQg+0zjhfZXMQuvppjG6YuwdMBE0TuqCZjeJkLecku/l9R0JPcRhaDA== + dependencies: + d3-color "1" + d3-dispatch "1" + d3-ease "1" + d3-interpolate "1" + d3-selection "^1.1.0" + d3-timer "1" + +"d3-transition@2 - 3", d3-transition@3: + version "3.0.1" + resolved "https://registry.yarnpkg.com/d3-transition/-/d3-transition-3.0.1.tgz#6869fdde1448868077fdd5989200cb61b2a1645f" + integrity sha512-ApKvfjsSR6tg06xrL434C0WydLr7JewBB3V+/39RMHsaXTOG0zmt/OAXeng5M5LBm0ojmxJrpomQVZ1aPvBL4w== + dependencies: + d3-color "1 - 3" + d3-dispatch "1 - 3" + d3-ease "1 - 3" + d3-interpolate "1 - 3" + d3-timer "1 - 3" + +d3-voronoi@1: + version "1.1.4" + resolved "https://registry.yarnpkg.com/d3-voronoi/-/d3-voronoi-1.1.4.tgz#dd3c78d7653d2bb359284ae478645d95944c8297" + integrity sha512-dArJ32hchFsrQ8uMiTBLq256MpnZjeuBtdHpaDlYuQyjU0CVzCJl/BVW+SkszaAeH95D/8gxqAhgx0ouAWAfRg== + +d3-zoom@1: + version "1.8.3" + resolved "https://registry.yarnpkg.com/d3-zoom/-/d3-zoom-1.8.3.tgz#b6a3dbe738c7763121cd05b8a7795ffe17f4fc0a" + integrity sha512-VoLXTK4wvy1a0JpH2Il+F2CiOhVu7VRXWF5M/LroMIh3/zBAC3WAt7QoIvPibOavVo20hN6/37vwAsdBejLyKQ== + dependencies: + d3-dispatch "1" + d3-drag "1" + d3-interpolate "1" + d3-selection "1" + d3-transition "1" + +d3-zoom@3: + version "3.0.0" + resolved "https://registry.yarnpkg.com/d3-zoom/-/d3-zoom-3.0.0.tgz#d13f4165c73217ffeaa54295cd6969b3e7aee8f3" + integrity sha512-b8AmV3kfQaqWAuacbPuNbL6vahnOJflOhexLzMMNLga62+/nh0JzvJ0aO/5a5MVgUFGS7Hu1P9P03o3fJkDCyw== + dependencies: + d3-dispatch "1 - 3" + d3-drag "2 - 3" + d3-interpolate "1 - 3" + d3-selection "2 - 3" + d3-transition "2 - 3" + +d3@^5.14: + version "5.16.0" + resolved "https://registry.yarnpkg.com/d3/-/d3-5.16.0.tgz#9c5e8d3b56403c79d4ed42fbd62f6113f199c877" + integrity sha512-4PL5hHaHwX4m7Zr1UapXW23apo6pexCgdetdJ5kTmADpG/7T9Gkxw0M0tf/pjoB63ezCCm0u5UaFYy2aMt0Mcw== + dependencies: + d3-array "1" + d3-axis "1" + d3-brush "1" + d3-chord "1" + d3-collection "1" + d3-color "1" + d3-contour "1" + d3-dispatch "1" + d3-drag "1" + d3-dsv "1" + d3-ease "1" + d3-fetch "1" + d3-force "1" + d3-format "1" + d3-geo "1" + d3-hierarchy "1" + d3-interpolate "1" + d3-path "1" + d3-polygon "1" + d3-quadtree "1" + d3-random "1" + d3-scale "2" + d3-scale-chromatic "1" + d3-selection "1" + d3-shape "1" + d3-time "1" + d3-time-format "2" + d3-timer "1" + d3-transition "1" + d3-voronoi "1" + d3-zoom "1" + +d3@^7.0.0: + version "7.6.1" + resolved "https://registry.yarnpkg.com/d3/-/d3-7.6.1.tgz#b21af9563485ed472802f8c611cc43be6c37c40c" + integrity sha512-txMTdIHFbcpLx+8a0IFhZsbp+PfBBPt8yfbmukZTQFroKuFqIwqswF0qE5JXWefylaAVpSXFoKm3yP+jpNLFLw== + dependencies: + d3-array "3" + d3-axis "3" + d3-brush "3" + d3-chord "3" + d3-color "3" + d3-contour "4" + d3-delaunay "6" + d3-dispatch "3" + d3-drag "3" + d3-dsv "3" + d3-ease "3" + d3-fetch "3" + d3-force "3" + d3-format "3" + d3-geo "3" + d3-hierarchy "3" + d3-interpolate "3" + d3-path "3" + d3-polygon "3" + d3-quadtree "3" + d3-random "3" + d3-scale "4" + d3-scale-chromatic "3" + d3-selection "3" + d3-shape "3" + d3-time "3" + d3-time-format "4" + d3-timer "3" + d3-transition "3" + d3-zoom "3" + +dagre-d3@^0.6.4: + version "0.6.4" + resolved "https://registry.yarnpkg.com/dagre-d3/-/dagre-d3-0.6.4.tgz#0728d5ce7f177ca2337df141ceb60fbe6eeb7b29" + integrity sha512-e/6jXeCP7/ptlAM48clmX4xTZc5Ek6T6kagS7Oz2HrYSdqcLZFLqpAfh7ldbZRFfxCZVyh61NEPR08UQRVxJzQ== + dependencies: + d3 "^5.14" + dagre "^0.8.5" + graphlib "^2.1.8" + lodash "^4.17.15" + +dagre@^0.8.5: + version "0.8.5" + resolved "https://registry.yarnpkg.com/dagre/-/dagre-0.8.5.tgz#ba30b0055dac12b6c1fcc247817442777d06afee" + integrity sha512-/aTqmnRta7x7MCCpExk7HQL2O4owCT2h8NT//9I1OQ9vt29Pa0BzSAkR5lwFUcQ7491yVi/3CXU9jQ5o0Mn2Sw== + dependencies: + graphlib "^2.1.8" + lodash "^4.17.15" + damerau-levenshtein@^1.0.8: version "1.0.8" resolved "https://registry.yarnpkg.com/damerau-levenshtein/-/damerau-levenshtein-1.0.8.tgz#b43d286ccbd36bc5b2f7ed41caf2d0aba1f8a6e7" @@ -6490,6 +7010,13 @@ del@^6.1.1: rimraf "^3.0.2" slash "^3.0.0" +delaunator@5: + version "5.0.0" + resolved "https://registry.yarnpkg.com/delaunator/-/delaunator-5.0.0.tgz#60f052b28bd91c9b4566850ebf7756efe821d81b" + integrity sha512-AyLvtyJdbv/U1GkiS6gUUzclRoAY4Gs75qkMygJJhU75LW4DNuSF2RMzpxs9jw9Oz1BobHjTdkG3zdP55VxAqw== + dependencies: + robust-predicates "^3.0.0" + delayed-stream@~1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/delayed-stream/-/delayed-stream-1.0.0.tgz#df3ae199acadfb7d440aaae0b29e2272b24ec619" @@ -6673,6 +7200,11 @@ domhandler@^5.0.1, domhandler@^5.0.2, domhandler@^5.0.3: dependencies: domelementtype "^2.3.0" +dompurify@2.4.0: + version "2.4.0" + resolved "https://registry.yarnpkg.com/dompurify/-/dompurify-2.4.0.tgz#c9c88390f024c2823332615c9e20a453cf3825dd" + integrity sha512-Be9tbQMZds4a3C6xTmz68NlMfeONA//4dOavl/1rNw50E+/QO0KVpbcU0PcaW0nsQxurXls9ZocqFxk8R2mWEA== + domutils@^2.5.2, domutils@^2.8.0: version "2.8.0" resolved "https://registry.yarnpkg.com/domutils/-/domutils-2.8.0.tgz#4437def5db6e2d1f5d6ee859bd95ca7d02048135" @@ -8103,6 +8635,13 @@ grapheme-splitter@^1.0.4: resolved "https://registry.yarnpkg.com/grapheme-splitter/-/grapheme-splitter-1.0.4.tgz#9cf3a665c6247479896834af35cf1dbb4400767e" integrity sha512-bzh50DW9kTPM00T8y4o8vQg89Di9oLJVLW/KaOGIXJWP/iqCN6WKYkbNOF04vFLJhwcpYUh9ydh/+5vpOqV4YQ== +graphlib@^2.1.8: + version "2.1.8" + resolved "https://registry.yarnpkg.com/graphlib/-/graphlib-2.1.8.tgz#5761d414737870084c92ec7b5dbcb0592c9d35da" + integrity sha512-jcLLfkpoVGmH7/InMC/1hIvOPSUh38oJtGhvrOFGzioE1DZ+0YW16RgmOJhHiuWTvGiJQ9Z1Ik43JvkRPRvE+A== + dependencies: + lodash "^4.17.15" + gray-matter@^4.0.3: version "4.0.3" resolved "https://registry.yarnpkg.com/gray-matter/-/gray-matter-4.0.3.tgz#e893c064825de73ea1f5f7d88c7a9f7274288798" @@ -8628,14 +9167,14 @@ husky@^8.0.1: resolved "https://registry.yarnpkg.com/husky/-/husky-8.0.1.tgz#511cb3e57de3e3190514ae49ed50f6bc3f50b3e9" integrity sha512-xs7/chUH/CKdOCs7Zy0Aev9e/dKOMZf3K1Az1nar3tzlv0jfqnYtu235bstsWTmXOR0EfINrPa97yy4Lz6RiKw== -iconv-lite@0.4.24, iconv-lite@^0.4.24: +iconv-lite@0.4, iconv-lite@0.4.24, iconv-lite@^0.4.24: version "0.4.24" resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.24.tgz#2022b4b25fbddc21d2f524974a474aafe733908b" integrity sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA== dependencies: safer-buffer ">= 2.1.2 < 3" -iconv-lite@0.6.3, iconv-lite@^0.6.2: +iconv-lite@0.6, iconv-lite@0.6.3, iconv-lite@^0.6.2: version "0.6.3" resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.6.3.tgz#a52f80bf38da1952eb5c681790719871a1a72501" integrity sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw== @@ -8803,6 +9342,11 @@ internal-slot@^1.0.3: has "^1.0.3" side-channel "^1.0.4" +"internmap@1 - 2": + version "2.0.3" + resolved "https://registry.yarnpkg.com/internmap/-/internmap-2.0.3.tgz#6685f23755e43c524e251d29cbc97248e3061009" + integrity sha512-5Hh7Y1wQbvY5ooGgPbDaL5iYLAPzMTUrjMulskHLH6wnv/A+1q5rgEaiuqEjB+oxGXIVZs1FF+R/KPN3ZSQYYg== + interpret@^1.0.0: version "1.4.0" resolved "https://registry.yarnpkg.com/interpret/-/interpret-1.4.0.tgz#665ab8bc4da27a774a40584e812e3e0fa45b1a1e" @@ -9944,6 +10488,11 @@ keyv@^3.0.0: dependencies: json-buffer "3.0.0" +khroma@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/khroma/-/khroma-2.0.0.tgz#7577de98aed9f36c7a474c4d453d94c0d6c6588b" + integrity sha512-2J8rDNlQWbtiNYThZRvmMv5yt44ZakX+Tz5ZIp/mN1pt4snn+m030Va5Z4v8xA0cQFDXBwO/8i42xL4QPsVk3g== + kind-of@^3.0.2, kind-of@^3.0.3, kind-of@^3.2.0: version "3.2.2" resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-3.2.2.tgz#31ea21a734bab9bbb0f32466d893aea51e4a3c64" @@ -10558,6 +11107,21 @@ merge2@^1.3.0, merge2@^1.4.1: resolved "https://registry.yarnpkg.com/merge2/-/merge2-1.4.1.tgz#4368892f885e907455a6fd7dc55c0c9d404990ae" integrity sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg== +mermaid@^9.1.1: + version "9.1.7" + resolved "https://registry.yarnpkg.com/mermaid/-/mermaid-9.1.7.tgz#e24de9b2d36c8cb25a09d72ffce966941b24bd6e" + integrity sha512-MRVHXy5FLjnUQUG7YS3UN9jEN6FXCJbFCXVGJQjVIbiR6Vhw0j/6pLIjqsiah9xoHmQU6DEaKOvB3S1g/1nBPA== + dependencies: + "@braintree/sanitize-url" "^6.0.0" + d3 "^7.0.0" + dagre "^0.8.5" + dagre-d3 "^0.6.4" + dompurify "2.4.0" + graphlib "^2.1.8" + khroma "^2.0.0" + moment-mini "2.24.0" + stylis "^4.0.10" + methods@~1.1.2: version "1.1.2" resolved "https://registry.yarnpkg.com/methods/-/methods-1.1.2.tgz#5529a4d67654134edcc5266656835b0f851afcee" @@ -10833,6 +11397,11 @@ modify-values@^1.0.0: resolved "https://registry.yarnpkg.com/modify-values/-/modify-values-1.0.1.tgz#b3939fa605546474e3e3e3c63d64bd43b4ee6022" integrity sha512-xV2bxeN6F7oYjZWTe/YPAy6MN2M+sL4u/Rlm2AHCIVGfo2p1yGmBHQ6vHehl4bRTZBdHu3TSkWdYgkwpYzAGSw== +moment-mini@2.24.0: + version "2.24.0" + resolved "https://registry.yarnpkg.com/moment-mini/-/moment-mini-2.24.0.tgz#fa68d98f7fe93ae65bf1262f6abb5fb6983d8d18" + integrity sha512-9ARkWHBs+6YJIvrIp0Ik5tyTTtP9PoV0Ssu2Ocq5y9v8+NOOpWiRshAp8c4rZVWTOe+157on/5G+zj5pwIQFEQ== + mrmime@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/mrmime/-/mrmime-1.0.1.tgz#5f90c825fad4bdd41dc914eff5d1a8cfdaf24f27" @@ -13336,6 +13905,11 @@ rimraf@~2.6.2: dependencies: glob "^7.1.3" +robust-predicates@^3.0.0: + version "3.0.1" + resolved "https://registry.yarnpkg.com/robust-predicates/-/robust-predicates-3.0.1.tgz#ecde075044f7f30118682bd9fb3f123109577f9a" + integrity sha512-ndEIpszUHiG4HtDsQLeIuMvRsDnn8c8rYStabochtUeCvfuvNptb5TUbVD68LRAILPX7p9nqQGh4xJgn3EHS/g== + rollup-plugin-terser@^7.0.0: version "7.0.2" resolved "https://registry.yarnpkg.com/rollup-plugin-terser/-/rollup-plugin-terser-7.0.2.tgz#e8fbba4869981b2dc35ae7e8a502d5c6c04d324d" @@ -13380,6 +13954,11 @@ run-parallel@^1.1.9: dependencies: queue-microtask "^1.2.2" +rw@1: + version "1.3.3" + resolved "https://registry.yarnpkg.com/rw/-/rw-1.3.3.tgz#3f862dfa91ab766b14885ef4d01124bfda074fb4" + integrity sha512-PdhdWy89SiZogBLaw42zdeqtRJ//zFd2PgQavcICDUgJT5oW10QCRKbJ6bg4r0/UY2M6BWd5tkxuGFRvCkgfHQ== + rxjs@^7.5.4, rxjs@^7.5.5: version "7.5.6" resolved "https://registry.yarnpkg.com/rxjs/-/rxjs-7.5.6.tgz#0446577557862afd6903517ce7cae79ecb9662bc" @@ -14332,6 +14911,11 @@ stylelint@^14.11.0: v8-compile-cache "^2.3.0" write-file-atomic "^4.0.2" +stylis@^4.0.10: + version "4.1.2" + resolved "https://registry.yarnpkg.com/stylis/-/stylis-4.1.2.tgz#870b3c1c2275f51b702bb3da9e94eedad87bba41" + integrity sha512-Nn2CCrG2ZaFziDxaZPN43CXqn+j7tcdjPFCkRBkFue8QYXC2HdEwnw5TCBo4yQZ2WxKYeSi0fdoOrtEqgDrXbA== + supports-color@^5.3.0: version "5.5.0" resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-5.5.0.tgz#e2e69a44ac8772f78a1ec0b35b689df6530efc8f"