This commit is contained in:
2024-03-22 03:47:51 +05:30
parent 8bcf3d211e
commit 89819f6fe2
28440 changed files with 3211033 additions and 2 deletions

21
node_modules/@docusaurus/plugin-debug/LICENSE generated vendored Normal file
View File

@@ -0,0 +1,21 @@
MIT License
Copyright (c) Facebook, Inc. and its affiliates.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

7
node_modules/@docusaurus/plugin-debug/README.md generated vendored Normal file
View File

@@ -0,0 +1,7 @@
# `@docusaurus/plugin-debug`
Debug plugin for Docusaurus.
## Usage
See [plugin-debug documentation](https://docusaurus.io/docs/api/plugins/@docusaurus/plugin-debug).

8
node_modules/@docusaurus/plugin-debug/lib/index.d.ts generated vendored Normal file
View File

@@ -0,0 +1,8 @@
/**
* 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 { LoadContext, Plugin } from '@docusaurus/types';
export default function pluginDebug({ siteConfig: { baseUrl }, generatedFilesDir, }: LoadContext): Plugin<undefined>;

79
node_modules/@docusaurus/plugin-debug/lib/index.js generated vendored Normal file
View File

@@ -0,0 +1,79 @@
"use strict";
/**
* 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.
*/
Object.defineProperty(exports, "__esModule", { value: true });
const tslib_1 = require("tslib");
const path_1 = tslib_1.__importDefault(require("path"));
const utils_1 = require("@docusaurus/utils");
function pluginDebug({ siteConfig: { baseUrl }, generatedFilesDir, }) {
const pluginDataDirRoot = path_1.default.join(generatedFilesDir, 'docusaurus-plugin-debug');
const aliasedSource = (source) => `~debug/${(0, utils_1.posixPath)(path_1.default.relative(pluginDataDirRoot, source))}`;
return {
name: 'docusaurus-plugin-debug',
getThemePath() {
return '../lib/theme';
},
getTypeScriptThemePath() {
return '../src/theme';
},
async contentLoaded({ actions: { createData, addRoute }, allContent }) {
const allContentPath = await createData(
// Note that this created data path must be in sync with
// metadataPath provided to mdx-loader.
`${(0, utils_1.docuHash)('docusaurus-debug-allContent')}.json`, JSON.stringify(allContent, null, 2));
// Home is config (duplicate for now)
addRoute({
path: (0, utils_1.normalizeUrl)([baseUrl, '__docusaurus/debug']),
component: '@theme/DebugConfig',
exact: true,
});
addRoute({
path: (0, utils_1.normalizeUrl)([baseUrl, '__docusaurus/debug/config']),
component: '@theme/DebugConfig',
exact: true,
});
addRoute({
path: (0, utils_1.normalizeUrl)([baseUrl, '__docusaurus/debug/metadata']),
component: '@theme/DebugSiteMetadata',
exact: true,
});
addRoute({
path: (0, utils_1.normalizeUrl)([baseUrl, '__docusaurus/debug/registry']),
component: '@theme/DebugRegistry',
exact: true,
});
addRoute({
path: (0, utils_1.normalizeUrl)([baseUrl, '__docusaurus/debug/routes']),
component: '@theme/DebugRoutes',
exact: true,
});
addRoute({
path: (0, utils_1.normalizeUrl)([baseUrl, '__docusaurus/debug/content']),
component: '@theme/DebugContent',
exact: true,
modules: {
allContent: aliasedSource(allContentPath),
},
});
addRoute({
path: (0, utils_1.normalizeUrl)([baseUrl, '__docusaurus/debug/globalData']),
component: '@theme/DebugGlobalData',
exact: true,
});
},
configureWebpack() {
return {
resolve: {
alias: {
'~debug': pluginDataDirRoot,
},
},
};
},
};
}
exports.default = pluginDebug;

View File

@@ -0,0 +1,8 @@
/**
* 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.
*/
/// <reference types="react" />
export default function DebugMetadata(): JSX.Element;

View File

@@ -0,0 +1,19 @@
/**
* 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 useDocusaurusContext from '@docusaurus/useDocusaurusContext';
import DebugLayout from '@theme/DebugLayout';
import DebugJsonView from '@theme/DebugJsonView';
export default function DebugMetadata() {
const {siteConfig} = useDocusaurusContext();
return (
<DebugLayout>
<h2>Site config</h2>
<DebugJsonView src={siteConfig} collapseDepth={3} />
</DebugLayout>
);
}

View File

@@ -0,0 +1,9 @@
/**
* 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.
*/
/// <reference types="react" />
import type { Props } from '@theme/DebugContent';
export default function DebugContent({ allContent }: Props): JSX.Element;

View File

@@ -0,0 +1,59 @@
/**
* 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 DebugLayout from '@theme/DebugLayout';
import DebugJsonView from '@theme/DebugJsonView';
function PluginInstanceContent({pluginId, pluginInstanceContent}) {
return (
<section style={{marginBottom: 30}}>
<code>{pluginId}</code>
<DebugJsonView src={pluginInstanceContent} collapseDepth={2} />
</section>
);
}
function PluginContent({pluginName, pluginContent}) {
return (
<section style={{marginBottom: 60}}>
<h3>{pluginName}</h3>
<div>
{Object.entries(pluginContent)
// Filter plugin instances with no content
.filter(([, pluginInstanceContent]) => !!pluginInstanceContent)
.map(([pluginId, pluginInstanceContent]) => (
<PluginInstanceContent
key={pluginId}
pluginId={pluginId}
pluginInstanceContent={pluginInstanceContent}
/>
))}
</div>
</section>
);
}
export default function DebugContent({allContent}) {
return (
<DebugLayout>
<h2>Plugin content</h2>
<div>
{Object.entries(allContent)
// Filter plugins with no content
.filter(([, pluginContent]) =>
Object.values(pluginContent).some(
(instanceContent) => !!instanceContent,
),
)
.map(([pluginName, pluginContent]) => (
<PluginContent
key={pluginName}
pluginName={pluginName}
pluginContent={pluginContent}
/>
))}
</div>
</DebugLayout>
);
}

View File

@@ -0,0 +1,8 @@
/**
* 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.
*/
/// <reference types="react" />
export default function DebugMetadata(): JSX.Element;

View File

@@ -0,0 +1,19 @@
/**
* 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 useGlobalData from '@docusaurus/useGlobalData';
import DebugLayout from '@theme/DebugLayout';
import DebugJsonView from '@theme/DebugJsonView';
export default function DebugMetadata() {
const globalData = useGlobalData();
return (
<DebugLayout>
<h2>Global data</h2>
<DebugJsonView src={globalData} collapseDepth={3} />
</DebugLayout>
);
}

View File

@@ -0,0 +1,9 @@
/**
* 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.
*/
/// <reference types="react" />
import type { Props } from '@theme/DebugJsonView';
export default function DebugJsonView({ src, collapseDepth, }: Props): JSX.Element;

View File

@@ -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 React from 'react';
import {JsonView} from 'react-json-view-lite';
import styles from './styles.module.css';
const paraisoStyles = {
container: styles.containerParaiso,
basicChildStyle: styles.basicElementParaiso,
label: styles.labelParaiso,
nullValue: styles.nullValueParaiso,
undefinedValue: styles.undefinedValueParaiso,
stringValue: styles.stringValueParaiso,
booleanValue: styles.booleanValueParaiso,
numberValue: styles.numberValueParaiso,
otherValue: styles.otherValueParaiso,
punctuation: styles.punctuationParaiso,
collapseIcon: styles.collapseIconParaiso,
expandIcon: styles.expandIconParaiso,
collapsedContent: styles.collapseContentParaiso,
};
export default function DebugJsonView({src, collapseDepth}) {
return (
<JsonView
data={src}
shouldExpandNode={(idx, value) => {
if (Array.isArray(value)) {
return value.length < 5;
}
return collapseDepth !== undefined && idx < collapseDepth;
}}
style={paraisoStyles}
/>
);
}

View File

@@ -0,0 +1,101 @@
/**
* 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.
*/
.containerParaiso {
font-family: monospace;
cursor: default;
background-color: rgb(41 42 43);
position: relative;
margin-top: 10px;
padding: 10px;
border-radius: 4px;
font-size: 13px;
}
.basicElementParaiso {
color: white;
padding: 3px 5px 3px 20px;
border-left: 1px solid rgb(79 66 76);
}
.labelParaiso {
color: rgb(231 233 219);
letter-spacing: 0.5px;
margin-right: 3px;
}
.nullValueParaiso {
display: inline-block;
color: rgb(254 196 24);
font-size: 11px;
font-weight: bold;
background-color: rgb(79 66 76);
padding: 1px 2px;
border-radius: 3px;
text-transform: uppercase;
}
.undefinedValueParaiso {
color: rgb(141 134 135);
}
.stringValueParaiso {
color: rgb(249 155 21);
}
.booleanValueParaiso {
color: rgb(129 91 164);
}
.numberValueParaiso {
color: rgb(233 107 168);
}
.otherValueParaiso {
color: white;
}
.punctuationParaiso {
color: white;
}
.expandIconParaiso {
display: inline-block;
color: rgb(129 91 164);
font-size: 22px;
vertical-align: baseline;
margin-right: 3px;
line-height: 10px;
}
.collapseIconParaiso::after {
content: '\25BE';
}
.collapseIconParaiso {
display: inline-block;
color: rgb(6 182 239);
font-size: 22px;
vertical-align: baseline;
margin-right: 3px;
line-height: 10px;
}
.expandIconParaiso::after {
content: '\25B8';
}
.collapseContentParaiso {
color: rgb(249 155 21);
font-size: 18px;
line-height: 10px;
cursor: pointer;
}
.collapseContentParaiso::after {
content: '...';
}

View File

@@ -0,0 +1,10 @@
/**
* 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 ReactNode } from 'react';
export default function DebugLayout({ children, }: {
children: ReactNode;
}): JSX.Element;

View File

@@ -0,0 +1,53 @@
/**
* 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 Head from '@docusaurus/Head';
import Link from '@docusaurus/Link';
import styles from './styles.module.css';
function DebugNavLink({to, children}) {
return (
<Link
className={styles.navlink}
isNavLink
to={to}
exact
activeStyle={{
backgroundColor: '#363739',
}}>
{children}
</Link>
);
}
export default function DebugLayout({children}) {
return (
<>
<Head>
<html lang="en" />
<title>Docusaurus debug panel</title>
<meta name="robots" content="noindex" />
</Head>
<div>
<nav className={styles.nav}>
<DebugNavLink to="/__docusaurus/debug">Config</DebugNavLink>
<DebugNavLink to="/__docusaurus/debug/metadata">
Metadata
</DebugNavLink>
<DebugNavLink to="/__docusaurus/debug/registry">
Registry
</DebugNavLink>
<DebugNavLink to="/__docusaurus/debug/routes">Routes</DebugNavLink>
<DebugNavLink to="/__docusaurus/debug/content">Content</DebugNavLink>
<DebugNavLink to="/__docusaurus/debug/globalData">
Global data
</DebugNavLink>
</nav>
<main className={styles.container}>{children}</main>
</div>
</>
);
}

View File

@@ -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.
*/
.container {
padding: 20px;
padding-top: 80px;
overflow-x: hidden;
background-color: #18191a;
color: white;
min-height: 100vh;
}
.container code {
color: white;
background-color: #444950;
}
.nav {
position: fixed;
display: flex;
justify-content: space-evenly;
align-items: center;
height: 3.75rem;
background-color: #242526;
width: 100%;
z-index: 1;
}
.navlink {
color: white;
font-weight: 500;
font-size: clamp(12px, 4vw, 16px);
text-align: center;
border-radius: 4px;
padding: 6px;
}
.navlink:hover {
text-decoration: none;
background-color: #292a2b;
}
.active {
background-color: #363739;
}
@media screen and (min-width: 800px) {
.nav {
flex-direction: column;
justify-content: flex-start;
align-items: center;
height: 100vh;
width: 200px;
float: left;
background-color: #18191a;
border-right: 1px solid #606770;
padding-top: 20px;
}
.navlink {
width: 80%;
margin-top: 20px;
text-align: left;
}
.container {
padding-top: 40px;
float: right;
width: calc(100% - 200px);
}
}

View File

@@ -0,0 +1,8 @@
/**
* 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.
*/
/// <reference types="react" />
export default function DebugRegistry(): JSX.Element;

View File

@@ -0,0 +1,29 @@
/**
* 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 registry from '@generated/registry';
import DebugLayout from '@theme/DebugLayout';
import styles from './styles.module.css';
export default function DebugRegistry() {
return (
<DebugLayout>
<h2>Registry</h2>
<ul className="clean-list">
{Object.values(registry).map(([, aliasedPath, resolved]) => (
<li key={aliasedPath} className={styles.listItem}>
<div style={{marginBottom: '10px'}}>
Aliased Path: <code>{aliasedPath}</code>
</div>
<div>
Resolved Path: <code>{resolved}</code>
</div>
</li>
))}
</ul>
</DebugLayout>
);
}

View File

@@ -0,0 +1,13 @@
/**
* 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.
*/
.listItem {
background-color: #242526;
padding: 10px;
border-radius: 4px;
margin-bottom: 20px;
}

View File

@@ -0,0 +1,8 @@
/**
* 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.
*/
/// <reference types="react" />
export default function DebugRoutes(): JSX.Element;

View File

@@ -0,0 +1,36 @@
/**
* 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 routes from '@generated/routes';
import DebugLayout from '@theme/DebugLayout';
import DebugJsonView from '@theme/DebugJsonView';
import styles from './styles.module.css';
export default function DebugRoutes() {
return (
<DebugLayout>
<h2>Routes</h2>
<ul className="clean-list">
{routes.map(({path, exact, routes: childRoutes}) => (
<li key={path} className={styles.listItem}>
<div className={styles.route}>
<code className={styles.routeName}>{path}</code>
</div>
<div>
Is exact: <code>{String(Boolean(exact))}</code>
</div>
{childRoutes && (
<div>
Child Routes:
<DebugJsonView src={childRoutes} />
</div>
)}
</li>
))}
</ul>
</DebugLayout>
);
}

View File

@@ -0,0 +1,21 @@
/**
* 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.
*/
.listItem {
background-color: #242526;
padding: 10px;
border-radius: 4px;
margin-bottom: 20px;
}
.route {
margin-bottom: 10px;
}
.routeName {
color: #e06b6b;
}

View File

@@ -0,0 +1,8 @@
/**
* 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.
*/
/// <reference types="react" />
export default function DebugMetadata(): JSX.Element;

View File

@@ -0,0 +1,42 @@
/**
* 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 useDocusaurusContext from '@docusaurus/useDocusaurusContext';
import DebugLayout from '@theme/DebugLayout';
import styles from './styles.module.css';
export default function DebugMetadata() {
const {siteMetadata} = useDocusaurusContext();
return (
<DebugLayout>
<h2>Site Metadata</h2>
<div>
Docusaurus Version: <code>{siteMetadata.docusaurusVersion}</code>
</div>
<div>
Site Version:{' '}
<code>{siteMetadata.siteVersion ?? 'No version specified'}</code>
</div>
<h3 className={styles.sectionTitle}>Plugins and themes</h3>
<ul className="clean-list">
{Object.entries(siteMetadata.pluginVersions).map(
([name, versionInformation]) => (
<li key={name} className={styles.listItem}>
{versionInformation.type === 'package' &&
versionInformation.version && (
<div className={styles.version}>
<code>{versionInformation.version}</code>
</div>
)}
<div className={styles.name}>{name}</div>
<div>Type: {versionInformation.type}</div>
</li>
),
)}
</ul>
</DebugLayout>
);
}

View File

@@ -0,0 +1,26 @@
/**
* 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.
*/
.sectionTitle {
margin-top: 20px;
}
.listItem {
background-color: #242526;
padding: 10px;
border-radius: 4px;
margin-bottom: 20px;
}
.version {
float: right;
}
.name {
font-weight: 800;
color: #e06b6b;
}

38
node_modules/@docusaurus/plugin-debug/package.json generated vendored Normal file
View File

@@ -0,0 +1,38 @@
{
"name": "@docusaurus/plugin-debug",
"version": "3.1.1",
"description": "Debug plugin for Docusaurus.",
"main": "lib/index.js",
"types": "src/plugin-debug.d.ts",
"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"
},
"publishConfig": {
"access": "public"
},
"repository": {
"type": "git",
"url": "https://github.com/facebook/docusaurus.git",
"directory": "packages/docusaurus-plugin-debug"
},
"license": "MIT",
"dependencies": {
"@docusaurus/core": "3.1.1",
"@docusaurus/types": "3.1.1",
"@docusaurus/utils": "3.1.1",
"fs-extra": "^11.1.1",
"react-json-view-lite": "^1.2.0",
"tslib": "^2.6.0"
},
"peerDependencies": {
"react": "^18.0.0",
"react-dom": "^18.0.0"
},
"engines": {
"node": ">=18.0"
},
"gitHead": "8017f6a6776ba1bd7065e630a52fe2c2654e2f1b"
}

98
node_modules/@docusaurus/plugin-debug/src/index.ts generated vendored Normal file
View File

@@ -0,0 +1,98 @@
/**
* 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 path from 'path';
import {docuHash, normalizeUrl, posixPath} from '@docusaurus/utils';
import type {LoadContext, Plugin} from '@docusaurus/types';
export default function pluginDebug({
siteConfig: {baseUrl},
generatedFilesDir,
}: LoadContext): Plugin<undefined> {
const pluginDataDirRoot = path.join(
generatedFilesDir,
'docusaurus-plugin-debug',
);
const aliasedSource = (source: string) =>
`~debug/${posixPath(path.relative(pluginDataDirRoot, source))}`;
return {
name: 'docusaurus-plugin-debug',
getThemePath() {
return '../lib/theme';
},
getTypeScriptThemePath() {
return '../src/theme';
},
async contentLoaded({actions: {createData, addRoute}, allContent}) {
const allContentPath = await createData(
// Note that this created data path must be in sync with
// metadataPath provided to mdx-loader.
`${docuHash('docusaurus-debug-allContent')}.json`,
JSON.stringify(allContent, null, 2),
);
// Home is config (duplicate for now)
addRoute({
path: normalizeUrl([baseUrl, '__docusaurus/debug']),
component: '@theme/DebugConfig',
exact: true,
});
addRoute({
path: normalizeUrl([baseUrl, '__docusaurus/debug/config']),
component: '@theme/DebugConfig',
exact: true,
});
addRoute({
path: normalizeUrl([baseUrl, '__docusaurus/debug/metadata']),
component: '@theme/DebugSiteMetadata',
exact: true,
});
addRoute({
path: normalizeUrl([baseUrl, '__docusaurus/debug/registry']),
component: '@theme/DebugRegistry',
exact: true,
});
addRoute({
path: normalizeUrl([baseUrl, '__docusaurus/debug/routes']),
component: '@theme/DebugRoutes',
exact: true,
});
addRoute({
path: normalizeUrl([baseUrl, '__docusaurus/debug/content']),
component: '@theme/DebugContent',
exact: true,
modules: {
allContent: aliasedSource(allContentPath),
},
});
addRoute({
path: normalizeUrl([baseUrl, '__docusaurus/debug/globalData']),
component: '@theme/DebugGlobalData',
exact: true,
});
},
configureWebpack() {
return {
resolve: {
alias: {
'~debug': pluginDataDirRoot,
},
},
};
},
};
}

View File

@@ -0,0 +1,59 @@
/**
* 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.
*/
/// <reference types="@docusaurus/module-type-aliases" />
declare module '@docusaurus/plugin-debug' {
import type {LoadContext, Plugin} from '@docusaurus/types';
export default function pluginDebug(context: LoadContext): Plugin<undefined>;
}
declare module '@theme/DebugConfig' {
export default function DebugMetadata(): JSX.Element;
}
declare module '@theme/DebugContent' {
import type {AllContent} from '@docusaurus/types';
export interface Props {
readonly allContent: AllContent;
}
export default function DebugContent(props: Props): JSX.Element;
}
declare module '@theme/DebugGlobalData' {
export default function DebugGlobalData(): JSX.Element;
}
declare module '@theme/DebugJsonView' {
export interface Props {
readonly src: unknown;
readonly collapseDepth?: number;
}
export default function DebugJsonView(props: Props): JSX.Element;
}
declare module '@theme/DebugLayout' {
import type {ReactNode} from 'react';
export default function DebugLayout(props: {
children: ReactNode;
}): JSX.Element;
}
declare module '@theme/DebugRegistry' {
export default function DebugRegistry(): JSX.Element;
}
declare module '@theme/DebugRoutes' {
export default function DebugRoutes(): JSX.Element;
}
declare module '@theme/DebugSiteMetadata' {
export default function DebugSiteMetadata(): JSX.Element;
}

View File

@@ -0,0 +1,21 @@
/**
* 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 useDocusaurusContext from '@docusaurus/useDocusaurusContext';
import DebugLayout from '@theme/DebugLayout';
import DebugJsonView from '@theme/DebugJsonView';
export default function DebugMetadata(): JSX.Element {
const {siteConfig} = useDocusaurusContext();
return (
<DebugLayout>
<h2>Site config</h2>
<DebugJsonView src={siteConfig} collapseDepth={3} />
</DebugLayout>
);
}

View File

@@ -0,0 +1,77 @@
/**
* 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 DebugLayout from '@theme/DebugLayout';
import DebugJsonView from '@theme/DebugJsonView';
import type {Props} from '@theme/DebugContent';
function PluginInstanceContent({
pluginId,
pluginInstanceContent,
}: {
pluginId: string;
pluginInstanceContent: unknown;
}) {
return (
<section style={{marginBottom: 30}}>
<code>{pluginId}</code>
<DebugJsonView src={pluginInstanceContent} collapseDepth={2} />
</section>
);
}
function PluginContent({
pluginName,
pluginContent,
}: {
pluginName: string;
pluginContent: {[pluginId: string]: unknown};
}) {
return (
<section style={{marginBottom: 60}}>
<h3>{pluginName}</h3>
<div>
{Object.entries(pluginContent)
// Filter plugin instances with no content
.filter(([, pluginInstanceContent]) => !!pluginInstanceContent)
.map(([pluginId, pluginInstanceContent]) => (
<PluginInstanceContent
key={pluginId}
pluginId={pluginId}
pluginInstanceContent={pluginInstanceContent}
/>
))}
</div>
</section>
);
}
export default function DebugContent({allContent}: Props): JSX.Element {
return (
<DebugLayout>
<h2>Plugin content</h2>
<div>
{Object.entries(allContent)
// Filter plugins with no content
.filter(([, pluginContent]) =>
Object.values(pluginContent).some(
(instanceContent) => !!instanceContent,
),
)
.map(([pluginName, pluginContent]) => (
<PluginContent
key={pluginName}
pluginName={pluginName}
pluginContent={pluginContent}
/>
))}
</div>
</DebugLayout>
);
}

View File

@@ -0,0 +1,21 @@
/**
* 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 useGlobalData from '@docusaurus/useGlobalData';
import DebugLayout from '@theme/DebugLayout';
import DebugJsonView from '@theme/DebugJsonView';
export default function DebugMetadata(): JSX.Element {
const globalData = useGlobalData();
return (
<DebugLayout>
<h2>Global data</h2>
<DebugJsonView src={globalData} collapseDepth={3} />
</DebugLayout>
);
}

View File

@@ -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 React from 'react';
import {JsonView} from 'react-json-view-lite';
import type {Props} from '@theme/DebugJsonView';
import styles from './styles.module.css';
const paraisoStyles = {
container: styles.containerParaiso!,
basicChildStyle: styles.basicElementParaiso!,
label: styles.labelParaiso!,
nullValue: styles.nullValueParaiso!,
undefinedValue: styles.undefinedValueParaiso!,
stringValue: styles.stringValueParaiso!,
booleanValue: styles.booleanValueParaiso!,
numberValue: styles.numberValueParaiso!,
otherValue: styles.otherValueParaiso!,
punctuation: styles.punctuationParaiso!,
collapseIcon: styles.collapseIconParaiso!,
expandIcon: styles.expandIconParaiso!,
collapsedContent: styles.collapseContentParaiso!,
};
export default function DebugJsonView({
src,
collapseDepth,
}: Props): JSX.Element {
return (
<JsonView
data={src as object}
shouldExpandNode={(idx, value) => {
if (Array.isArray(value)) {
return value.length < 5;
}
return collapseDepth !== undefined && idx < collapseDepth;
}}
style={paraisoStyles}
/>
);
}

View File

@@ -0,0 +1,101 @@
/**
* 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.
*/
.containerParaiso {
font-family: monospace;
cursor: default;
background-color: rgb(41 42 43);
position: relative;
margin-top: 10px;
padding: 10px;
border-radius: 4px;
font-size: 13px;
}
.basicElementParaiso {
color: white;
padding: 3px 5px 3px 20px;
border-left: 1px solid rgb(79 66 76);
}
.labelParaiso {
color: rgb(231 233 219);
letter-spacing: 0.5px;
margin-right: 3px;
}
.nullValueParaiso {
display: inline-block;
color: rgb(254 196 24);
font-size: 11px;
font-weight: bold;
background-color: rgb(79 66 76);
padding: 1px 2px;
border-radius: 3px;
text-transform: uppercase;
}
.undefinedValueParaiso {
color: rgb(141 134 135);
}
.stringValueParaiso {
color: rgb(249 155 21);
}
.booleanValueParaiso {
color: rgb(129 91 164);
}
.numberValueParaiso {
color: rgb(233 107 168);
}
.otherValueParaiso {
color: white;
}
.punctuationParaiso {
color: white;
}
.expandIconParaiso {
display: inline-block;
color: rgb(129 91 164);
font-size: 22px;
vertical-align: baseline;
margin-right: 3px;
line-height: 10px;
}
.collapseIconParaiso::after {
content: '\25BE';
}
.collapseIconParaiso {
display: inline-block;
color: rgb(6 182 239);
font-size: 22px;
vertical-align: baseline;
margin-right: 3px;
line-height: 10px;
}
.expandIconParaiso::after {
content: '\25B8';
}
.collapseContentParaiso {
color: rgb(249 155 21);
font-size: 18px;
line-height: 10px;
cursor: pointer;
}
.collapseContentParaiso::after {
content: '...';
}

View File

@@ -0,0 +1,60 @@
/**
* 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, {type ReactNode} from 'react';
import Head from '@docusaurus/Head';
import Link from '@docusaurus/Link';
import styles from './styles.module.css';
function DebugNavLink({to, children}: {to: string; children: ReactNode}) {
return (
<Link
className={styles.navlink}
isNavLink
to={to}
exact
activeStyle={{
backgroundColor: '#363739',
}}>
{children}
</Link>
);
}
export default function DebugLayout({
children,
}: {
children: ReactNode;
}): JSX.Element {
return (
<>
<Head>
<html lang="en" />
<title>Docusaurus debug panel</title>
<meta name="robots" content="noindex" />
</Head>
<div>
<nav className={styles.nav}>
<DebugNavLink to="/__docusaurus/debug">Config</DebugNavLink>
<DebugNavLink to="/__docusaurus/debug/metadata">
Metadata
</DebugNavLink>
<DebugNavLink to="/__docusaurus/debug/registry">
Registry
</DebugNavLink>
<DebugNavLink to="/__docusaurus/debug/routes">Routes</DebugNavLink>
<DebugNavLink to="/__docusaurus/debug/content">Content</DebugNavLink>
<DebugNavLink to="/__docusaurus/debug/globalData">
Global data
</DebugNavLink>
</nav>
<main className={styles.container}>{children}</main>
</div>
</>
);
}

View File

@@ -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.
*/
.container {
padding: 20px;
padding-top: 80px;
overflow-x: hidden;
background-color: #18191a;
color: white;
min-height: 100vh;
}
.container code {
color: white;
background-color: #444950;
}
.nav {
position: fixed;
display: flex;
justify-content: space-evenly;
align-items: center;
height: 3.75rem;
background-color: #242526;
width: 100%;
z-index: 1;
}
.navlink {
color: white;
font-weight: 500;
font-size: clamp(12px, 4vw, 16px);
text-align: center;
border-radius: 4px;
padding: 6px;
}
.navlink:hover {
text-decoration: none;
background-color: #292a2b;
}
.active {
background-color: #363739;
}
@media screen and (min-width: 800px) {
.nav {
flex-direction: column;
justify-content: flex-start;
align-items: center;
height: 100vh;
width: 200px;
float: left;
background-color: #18191a;
border-right: 1px solid #606770;
padding-top: 20px;
}
.navlink {
width: 80%;
margin-top: 20px;
text-align: left;
}
.container {
padding-top: 40px;
float: right;
width: calc(100% - 200px);
}
}

View File

@@ -0,0 +1,31 @@
/**
* 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 registry from '@generated/registry';
import DebugLayout from '@theme/DebugLayout';
import styles from './styles.module.css';
export default function DebugRegistry(): JSX.Element {
return (
<DebugLayout>
<h2>Registry</h2>
<ul className="clean-list">
{Object.values(registry).map(([, aliasedPath, resolved]) => (
<li key={aliasedPath} className={styles.listItem}>
<div style={{marginBottom: '10px'}}>
Aliased Path: <code>{aliasedPath}</code>
</div>
<div>
Resolved Path: <code>{resolved}</code>
</div>
</li>
))}
</ul>
</DebugLayout>
);
}

View File

@@ -0,0 +1,13 @@
/**
* 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.
*/
.listItem {
background-color: #242526;
padding: 10px;
border-radius: 4px;
margin-bottom: 20px;
}

View File

@@ -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 React from 'react';
import routes from '@generated/routes';
import DebugLayout from '@theme/DebugLayout';
import DebugJsonView from '@theme/DebugJsonView';
import styles from './styles.module.css';
export default function DebugRoutes(): JSX.Element {
return (
<DebugLayout>
<h2>Routes</h2>
<ul className="clean-list">
{routes.map(({path, exact, routes: childRoutes}) => (
<li key={path} className={styles.listItem}>
<div className={styles.route}>
<code className={styles.routeName}>{path}</code>
</div>
<div>
Is exact: <code>{String(Boolean(exact))}</code>
</div>
{childRoutes && (
<div>
Child Routes:
<DebugJsonView src={childRoutes} />
</div>
)}
</li>
))}
</ul>
</DebugLayout>
);
}

View File

@@ -0,0 +1,21 @@
/**
* 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.
*/
.listItem {
background-color: #242526;
padding: 10px;
border-radius: 4px;
margin-bottom: 20px;
}
.route {
margin-bottom: 10px;
}
.routeName {
color: #e06b6b;
}

View File

@@ -0,0 +1,44 @@
/**
* 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 useDocusaurusContext from '@docusaurus/useDocusaurusContext';
import DebugLayout from '@theme/DebugLayout';
import styles from './styles.module.css';
export default function DebugMetadata(): JSX.Element {
const {siteMetadata} = useDocusaurusContext();
return (
<DebugLayout>
<h2>Site Metadata</h2>
<div>
Docusaurus Version: <code>{siteMetadata.docusaurusVersion}</code>
</div>
<div>
Site Version:{' '}
<code>{siteMetadata.siteVersion ?? 'No version specified'}</code>
</div>
<h3 className={styles.sectionTitle}>Plugins and themes</h3>
<ul className="clean-list">
{Object.entries(siteMetadata.pluginVersions).map(
([name, versionInformation]) => (
<li key={name} className={styles.listItem}>
{versionInformation.type === 'package' &&
versionInformation.version && (
<div className={styles.version}>
<code>{versionInformation.version}</code>
</div>
)}
<div className={styles.name}>{name}</div>
<div>Type: {versionInformation.type}</div>
</li>
),
)}
</ul>
</DebugLayout>
);
}

View File

@@ -0,0 +1,26 @@
/**
* 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.
*/
.sectionTitle {
margin-top: 20px;
}
.listItem {
background-color: #242526;
padding: 10px;
border-radius: 4px;
margin-bottom: 20px;
}
.version {
float: right;
}
.name {
font-weight: 800;
color: #e06b6b;
}