@azerion/bunosaurus-plugin-debug 0.0.0-stage → 4.0.0-canary-6927
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +6 -2
- package/lib/index.d.ts +8 -0
- package/lib/index.js +62 -0
- package/lib/theme/DebugConfig/index.d.ts +8 -0
- package/lib/theme/DebugConfig/index.js +18 -0
- package/lib/theme/DebugContent/index.d.ts +9 -0
- package/lib/theme/DebugContent/index.js +58 -0
- package/lib/theme/DebugGlobalData/index.d.ts +8 -0
- package/lib/theme/DebugGlobalData/index.js +18 -0
- package/lib/theme/DebugJsonView/index.d.ts +9 -0
- package/lib/theme/DebugJsonView/index.js +40 -0
- package/lib/theme/DebugJsonView/styles.module.css +110 -0
- package/lib/theme/DebugLayout/index.d.ts +10 -0
- package/lib/theme/DebugLayout/index.js +52 -0
- package/lib/theme/DebugLayout/styles.module.css +75 -0
- package/lib/theme/DebugRegistry/index.d.ts +8 -0
- package/lib/theme/DebugRegistry/index.js +28 -0
- package/lib/theme/DebugRegistry/styles.module.css +13 -0
- package/lib/theme/DebugRoutes/index.d.ts +8 -0
- package/lib/theme/DebugRoutes/index.js +35 -0
- package/lib/theme/DebugRoutes/styles.module.css +21 -0
- package/lib/theme/DebugSiteMetadata/index.d.ts +8 -0
- package/lib/theme/DebugSiteMetadata/index.js +41 -0
- package/lib/theme/DebugSiteMetadata/styles.module.css +26 -0
- package/package.json +35 -4
- package/src/index.ts +72 -0
- package/src/plugin-debug.d.ts +70 -0
- package/src/theme/DebugConfig/index.tsx +21 -0
- package/src/theme/DebugContent/index.tsx +77 -0
- package/src/theme/DebugGlobalData/index.tsx +21 -0
- package/src/theme/DebugJsonView/index.tsx +50 -0
- package/src/theme/DebugJsonView/styles.module.css +110 -0
- package/src/theme/DebugLayout/index.tsx +60 -0
- package/src/theme/DebugLayout/styles.module.css +75 -0
- package/src/theme/DebugRegistry/index.tsx +31 -0
- package/src/theme/DebugRegistry/styles.module.css +13 -0
- package/src/theme/DebugRoutes/index.tsx +38 -0
- package/src/theme/DebugRoutes/styles.module.css +21 -0
- package/src/theme/DebugSiteMetadata/index.tsx +44 -0
- package/src/theme/DebugSiteMetadata/styles.module.css +26 -0
package/README.md
CHANGED
|
@@ -1,3 +1,7 @@
|
|
|
1
|
-
#
|
|
1
|
+
# `@docusaurus/plugin-debug`
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Debug plugin for Docusaurus.
|
|
4
|
+
|
|
5
|
+
## Usage
|
|
6
|
+
|
|
7
|
+
See [plugin-debug documentation](https://docusaurus.io/docs/api/plugins/@docusaurus/plugin-debug).
|
package/lib/index.d.ts
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/
|
|
7
|
+
import type { LoadContext, Plugin } from '@docusaurus/types';
|
|
8
|
+
export default function pluginDebug({ siteConfig: { baseUrl }, }: LoadContext): Plugin<undefined>;
|
package/lib/index.js
ADDED
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
4
|
+
*
|
|
5
|
+
* This source code is licensed under the MIT license found in the
|
|
6
|
+
* LICENSE file in the root directory of this source tree.
|
|
7
|
+
*/
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.default = pluginDebug;
|
|
10
|
+
const utils_1 = require("@docusaurus/utils");
|
|
11
|
+
function pluginDebug({ siteConfig: { baseUrl }, }) {
|
|
12
|
+
return {
|
|
13
|
+
name: 'docusaurus-plugin-debug',
|
|
14
|
+
getThemePath() {
|
|
15
|
+
return '../lib/theme';
|
|
16
|
+
},
|
|
17
|
+
getTypeScriptThemePath() {
|
|
18
|
+
return '../src/theme';
|
|
19
|
+
},
|
|
20
|
+
async allContentLoaded({ actions: { addRoute }, allContent }) {
|
|
21
|
+
// Home is config (duplicate for now)
|
|
22
|
+
addRoute({
|
|
23
|
+
path: (0, utils_1.normalizeUrl)([baseUrl, '__docusaurus/debug']),
|
|
24
|
+
component: '@theme/DebugConfig',
|
|
25
|
+
exact: true,
|
|
26
|
+
});
|
|
27
|
+
addRoute({
|
|
28
|
+
path: (0, utils_1.normalizeUrl)([baseUrl, '__docusaurus/debug/config']),
|
|
29
|
+
component: '@theme/DebugConfig',
|
|
30
|
+
exact: true,
|
|
31
|
+
});
|
|
32
|
+
addRoute({
|
|
33
|
+
path: (0, utils_1.normalizeUrl)([baseUrl, '__docusaurus/debug/metadata']),
|
|
34
|
+
component: '@theme/DebugSiteMetadata',
|
|
35
|
+
exact: true,
|
|
36
|
+
});
|
|
37
|
+
addRoute({
|
|
38
|
+
path: (0, utils_1.normalizeUrl)([baseUrl, '__docusaurus/debug/registry']),
|
|
39
|
+
component: '@theme/DebugRegistry',
|
|
40
|
+
exact: true,
|
|
41
|
+
});
|
|
42
|
+
addRoute({
|
|
43
|
+
path: (0, utils_1.normalizeUrl)([baseUrl, '__docusaurus/debug/routes']),
|
|
44
|
+
component: '@theme/DebugRoutes',
|
|
45
|
+
exact: true,
|
|
46
|
+
});
|
|
47
|
+
addRoute({
|
|
48
|
+
path: (0, utils_1.normalizeUrl)([baseUrl, '__docusaurus/debug/content']),
|
|
49
|
+
component: '@theme/DebugContent',
|
|
50
|
+
exact: true,
|
|
51
|
+
props: {
|
|
52
|
+
allContent,
|
|
53
|
+
},
|
|
54
|
+
});
|
|
55
|
+
addRoute({
|
|
56
|
+
path: (0, utils_1.normalizeUrl)([baseUrl, '__docusaurus/debug/globalData']),
|
|
57
|
+
component: '@theme/DebugGlobalData',
|
|
58
|
+
exact: true,
|
|
59
|
+
});
|
|
60
|
+
},
|
|
61
|
+
};
|
|
62
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/
|
|
7
|
+
import type { ReactNode } from 'react';
|
|
8
|
+
export default function DebugMetadata(): ReactNode;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/
|
|
7
|
+
import useDocusaurusContext from '@docusaurus/useDocusaurusContext';
|
|
8
|
+
import DebugLayout from '@theme/DebugLayout';
|
|
9
|
+
import DebugJsonView from '@theme/DebugJsonView';
|
|
10
|
+
export default function DebugMetadata() {
|
|
11
|
+
const {siteConfig} = useDocusaurusContext();
|
|
12
|
+
return (
|
|
13
|
+
<DebugLayout>
|
|
14
|
+
<h2>Site config</h2>
|
|
15
|
+
<DebugJsonView src={siteConfig} collapseDepth={3} />
|
|
16
|
+
</DebugLayout>
|
|
17
|
+
);
|
|
18
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/
|
|
7
|
+
import type { ReactNode } from 'react';
|
|
8
|
+
import type { Props } from '@theme/DebugContent';
|
|
9
|
+
export default function DebugContent({ allContent }: Props): ReactNode;
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/
|
|
7
|
+
import DebugLayout from '@theme/DebugLayout';
|
|
8
|
+
import DebugJsonView from '@theme/DebugJsonView';
|
|
9
|
+
function PluginInstanceContent({pluginId, pluginInstanceContent}) {
|
|
10
|
+
return (
|
|
11
|
+
<section style={{marginBottom: 30}}>
|
|
12
|
+
<code>{pluginId}</code>
|
|
13
|
+
<DebugJsonView src={pluginInstanceContent} collapseDepth={2} />
|
|
14
|
+
</section>
|
|
15
|
+
);
|
|
16
|
+
}
|
|
17
|
+
function PluginContent({pluginName, pluginContent}) {
|
|
18
|
+
return (
|
|
19
|
+
<section style={{marginBottom: 60}}>
|
|
20
|
+
<h3>{pluginName}</h3>
|
|
21
|
+
<div>
|
|
22
|
+
{Object.entries(pluginContent)
|
|
23
|
+
// Filter plugin instances with no content
|
|
24
|
+
.filter(([, pluginInstanceContent]) => !!pluginInstanceContent)
|
|
25
|
+
.map(([pluginId, pluginInstanceContent]) => (
|
|
26
|
+
<PluginInstanceContent
|
|
27
|
+
key={pluginId}
|
|
28
|
+
pluginId={pluginId}
|
|
29
|
+
pluginInstanceContent={pluginInstanceContent}
|
|
30
|
+
/>
|
|
31
|
+
))}
|
|
32
|
+
</div>
|
|
33
|
+
</section>
|
|
34
|
+
);
|
|
35
|
+
}
|
|
36
|
+
export default function DebugContent({allContent}) {
|
|
37
|
+
return (
|
|
38
|
+
<DebugLayout>
|
|
39
|
+
<h2>Plugin content</h2>
|
|
40
|
+
<div>
|
|
41
|
+
{Object.entries(allContent)
|
|
42
|
+
// Filter plugins with no content
|
|
43
|
+
.filter(([, pluginContent]) =>
|
|
44
|
+
Object.values(pluginContent).some(
|
|
45
|
+
(instanceContent) => !!instanceContent,
|
|
46
|
+
),
|
|
47
|
+
)
|
|
48
|
+
.map(([pluginName, pluginContent]) => (
|
|
49
|
+
<PluginContent
|
|
50
|
+
key={pluginName}
|
|
51
|
+
pluginName={pluginName}
|
|
52
|
+
pluginContent={pluginContent}
|
|
53
|
+
/>
|
|
54
|
+
))}
|
|
55
|
+
</div>
|
|
56
|
+
</DebugLayout>
|
|
57
|
+
);
|
|
58
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/
|
|
7
|
+
import type { ReactNode } from 'react';
|
|
8
|
+
export default function DebugMetadata(): ReactNode;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/
|
|
7
|
+
import useGlobalData from '@docusaurus/useGlobalData';
|
|
8
|
+
import DebugLayout from '@theme/DebugLayout';
|
|
9
|
+
import DebugJsonView from '@theme/DebugJsonView';
|
|
10
|
+
export default function DebugMetadata() {
|
|
11
|
+
const globalData = useGlobalData();
|
|
12
|
+
return (
|
|
13
|
+
<DebugLayout>
|
|
14
|
+
<h2>Global data</h2>
|
|
15
|
+
<DebugJsonView src={globalData} collapseDepth={3} />
|
|
16
|
+
</DebugLayout>
|
|
17
|
+
);
|
|
18
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/
|
|
7
|
+
import type { ReactNode } from 'react';
|
|
8
|
+
import type { Props } from '@theme/DebugJsonView';
|
|
9
|
+
export default function DebugJsonView({ src, collapseDepth }: Props): ReactNode;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/
|
|
7
|
+
import {JsonView, defaultStyles} from 'react-json-view-lite';
|
|
8
|
+
import styles from './styles.module.css';
|
|
9
|
+
const paraisoStyles = {
|
|
10
|
+
clickableLabel: defaultStyles.clickableLabel,
|
|
11
|
+
noQuotesForStringValues: false,
|
|
12
|
+
container: styles.containerParaiso,
|
|
13
|
+
basicChildStyle: styles.basicElementParaiso,
|
|
14
|
+
label: styles.labelParaiso,
|
|
15
|
+
nullValue: styles.nullValueParaiso,
|
|
16
|
+
undefinedValue: styles.undefinedValueParaiso,
|
|
17
|
+
stringValue: styles.stringValueParaiso,
|
|
18
|
+
booleanValue: styles.booleanValueParaiso,
|
|
19
|
+
numberValue: styles.numberValueParaiso,
|
|
20
|
+
otherValue: styles.otherValueParaiso,
|
|
21
|
+
punctuation: styles.punctuationParaiso,
|
|
22
|
+
collapseIcon: styles.collapseIconParaiso,
|
|
23
|
+
expandIcon: styles.expandIconParaiso,
|
|
24
|
+
collapsedContent: styles.collapseContentParaiso,
|
|
25
|
+
childFieldsContainer: styles.childFieldsContainerParaiso,
|
|
26
|
+
};
|
|
27
|
+
export default function DebugJsonView({src, collapseDepth}) {
|
|
28
|
+
return (
|
|
29
|
+
<JsonView
|
|
30
|
+
data={src}
|
|
31
|
+
shouldExpandNode={(idx, value) => {
|
|
32
|
+
if (Array.isArray(value)) {
|
|
33
|
+
return value.length < 5;
|
|
34
|
+
}
|
|
35
|
+
return collapseDepth !== undefined && idx < collapseDepth;
|
|
36
|
+
}}
|
|
37
|
+
style={paraisoStyles}
|
|
38
|
+
/>
|
|
39
|
+
);
|
|
40
|
+
}
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
.containerParaiso {
|
|
9
|
+
font-family: monospace;
|
|
10
|
+
cursor: default;
|
|
11
|
+
background-color: rgb(41 42 43);
|
|
12
|
+
position: relative;
|
|
13
|
+
margin-top: 10px;
|
|
14
|
+
padding: 10px;
|
|
15
|
+
border-radius: 4px;
|
|
16
|
+
font-size: 13px;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
.basicElementParaiso {
|
|
20
|
+
color: white;
|
|
21
|
+
padding: 3px 5px 3px 20px;
|
|
22
|
+
border-left: 1px solid rgb(79 66 76);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
.labelParaiso {
|
|
26
|
+
color: rgb(231 233 219);
|
|
27
|
+
letter-spacing: 0.5px;
|
|
28
|
+
margin-right: 3px;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
.nullValueParaiso {
|
|
32
|
+
display: inline-block;
|
|
33
|
+
color: rgb(254 196 24);
|
|
34
|
+
font-size: 11px;
|
|
35
|
+
font-weight: bold;
|
|
36
|
+
background-color: rgb(79 66 76);
|
|
37
|
+
padding: 1px 2px;
|
|
38
|
+
border-radius: 3px;
|
|
39
|
+
text-transform: uppercase;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.undefinedValueParaiso {
|
|
43
|
+
color: rgb(141 134 135);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
.stringValueParaiso {
|
|
47
|
+
color: rgb(249 155 21);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
.booleanValueParaiso {
|
|
51
|
+
color: rgb(129 91 164);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
.numberValueParaiso {
|
|
55
|
+
color: rgb(233 107 168);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
.otherValueParaiso {
|
|
59
|
+
color: white;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
.punctuationParaiso {
|
|
63
|
+
color: white;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
.expandIconParaiso {
|
|
67
|
+
display: inline-block;
|
|
68
|
+
color: rgb(129 91 164);
|
|
69
|
+
font-size: 22px;
|
|
70
|
+
vertical-align: baseline;
|
|
71
|
+
margin-right: 3px;
|
|
72
|
+
line-height: 10px;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
.collapseIconParaiso::after {
|
|
76
|
+
content: '\25BE';
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
.collapseIconParaiso {
|
|
80
|
+
display: inline-block;
|
|
81
|
+
color: rgb(6 182 239);
|
|
82
|
+
font-size: 22px;
|
|
83
|
+
vertical-align: baseline;
|
|
84
|
+
margin-right: 3px;
|
|
85
|
+
line-height: 10px;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
.expandIconParaiso::after {
|
|
89
|
+
content: '\25B8';
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
.collapseContentParaiso {
|
|
93
|
+
color: rgb(249 155 21);
|
|
94
|
+
font-size: 18px;
|
|
95
|
+
line-height: 10px;
|
|
96
|
+
cursor: pointer;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
.collapseContentParaiso::after {
|
|
100
|
+
content: '...';
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
/*
|
|
104
|
+
Overrides default ul style from Infima
|
|
105
|
+
See https://github.com/AnyRoad/react-json-view-lite/issues/38
|
|
106
|
+
*/
|
|
107
|
+
.childFieldsContainerParaiso {
|
|
108
|
+
margin: 0;
|
|
109
|
+
padding: 0;
|
|
110
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/
|
|
7
|
+
import type { ReactNode } from 'react';
|
|
8
|
+
export default function DebugLayout({ children, }: {
|
|
9
|
+
children: ReactNode;
|
|
10
|
+
}): ReactNode;
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/
|
|
7
|
+
import Head from '@docusaurus/Head';
|
|
8
|
+
import Link from '@docusaurus/Link';
|
|
9
|
+
import styles from './styles.module.css';
|
|
10
|
+
function DebugNavLink({to, children}) {
|
|
11
|
+
return (
|
|
12
|
+
<Link
|
|
13
|
+
className={styles.navlink}
|
|
14
|
+
isNavLink
|
|
15
|
+
to={to}
|
|
16
|
+
exact
|
|
17
|
+
activeStyle={{
|
|
18
|
+
backgroundColor: '#363739',
|
|
19
|
+
}}>
|
|
20
|
+
{children}
|
|
21
|
+
</Link>
|
|
22
|
+
);
|
|
23
|
+
}
|
|
24
|
+
export default function DebugLayout({children}) {
|
|
25
|
+
return (
|
|
26
|
+
<>
|
|
27
|
+
<Head>
|
|
28
|
+
<html lang="en" />
|
|
29
|
+
<title>Docusaurus debug panel</title>
|
|
30
|
+
<meta name="robots" content="noindex" />
|
|
31
|
+
</Head>
|
|
32
|
+
|
|
33
|
+
<div>
|
|
34
|
+
<nav className={styles.nav}>
|
|
35
|
+
<DebugNavLink to="/__docusaurus/debug">Config</DebugNavLink>
|
|
36
|
+
<DebugNavLink to="/__docusaurus/debug/metadata">
|
|
37
|
+
Metadata
|
|
38
|
+
</DebugNavLink>
|
|
39
|
+
<DebugNavLink to="/__docusaurus/debug/registry">
|
|
40
|
+
Registry
|
|
41
|
+
</DebugNavLink>
|
|
42
|
+
<DebugNavLink to="/__docusaurus/debug/routes">Routes</DebugNavLink>
|
|
43
|
+
<DebugNavLink to="/__docusaurus/debug/content">Content</DebugNavLink>
|
|
44
|
+
<DebugNavLink to="/__docusaurus/debug/globalData">
|
|
45
|
+
Global data
|
|
46
|
+
</DebugNavLink>
|
|
47
|
+
</nav>
|
|
48
|
+
<main className={styles.container}>{children}</main>
|
|
49
|
+
</div>
|
|
50
|
+
</>
|
|
51
|
+
);
|
|
52
|
+
}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
.container {
|
|
9
|
+
padding: 20px;
|
|
10
|
+
padding-top: 80px;
|
|
11
|
+
overflow-x: hidden;
|
|
12
|
+
background-color: #18191a;
|
|
13
|
+
color: white;
|
|
14
|
+
min-height: 100vh;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.container code {
|
|
18
|
+
color: white;
|
|
19
|
+
background-color: #444950;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.nav {
|
|
23
|
+
position: fixed;
|
|
24
|
+
display: flex;
|
|
25
|
+
justify-content: space-evenly;
|
|
26
|
+
align-items: center;
|
|
27
|
+
height: 3.75rem;
|
|
28
|
+
background-color: #242526;
|
|
29
|
+
width: 100%;
|
|
30
|
+
z-index: 1;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.navlink {
|
|
34
|
+
color: white;
|
|
35
|
+
font-weight: 500;
|
|
36
|
+
font-size: clamp(12px, 4vw, 16px);
|
|
37
|
+
text-align: center;
|
|
38
|
+
border-radius: 4px;
|
|
39
|
+
padding: 6px;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.navlink:hover {
|
|
43
|
+
text-decoration: none;
|
|
44
|
+
background-color: #292a2b;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
.active {
|
|
48
|
+
background-color: #363739;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
@media screen and (width >= 800px) {
|
|
52
|
+
.nav {
|
|
53
|
+
flex-direction: column;
|
|
54
|
+
justify-content: flex-start;
|
|
55
|
+
align-items: center;
|
|
56
|
+
height: 100vh;
|
|
57
|
+
width: 200px;
|
|
58
|
+
float: left;
|
|
59
|
+
background-color: #18191a;
|
|
60
|
+
border-right: 1px solid #606770;
|
|
61
|
+
padding-top: 20px;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
.navlink {
|
|
65
|
+
width: 80%;
|
|
66
|
+
margin-top: 20px;
|
|
67
|
+
text-align: left;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
.container {
|
|
71
|
+
padding-top: 40px;
|
|
72
|
+
float: right;
|
|
73
|
+
width: calc(100% - 200px);
|
|
74
|
+
}
|
|
75
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/
|
|
7
|
+
import type { ReactNode } from 'react';
|
|
8
|
+
export default function DebugRegistry(): ReactNode;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/
|
|
7
|
+
import registry from '@generated/registry';
|
|
8
|
+
import DebugLayout from '@theme/DebugLayout';
|
|
9
|
+
import styles from './styles.module.css';
|
|
10
|
+
export default function DebugRegistry() {
|
|
11
|
+
return (
|
|
12
|
+
<DebugLayout>
|
|
13
|
+
<h2>Registry</h2>
|
|
14
|
+
<ul className="clean-list">
|
|
15
|
+
{Object.entries(registry).map(([chunkName, [, aliasedPath]]) => (
|
|
16
|
+
<li key={chunkName} className={styles.listItem}>
|
|
17
|
+
<div style={{marginBottom: '10px'}}>
|
|
18
|
+
Chunk Name: <code>{chunkName}</code>
|
|
19
|
+
</div>
|
|
20
|
+
<div>
|
|
21
|
+
Aliased Path: <code>{aliasedPath}</code>
|
|
22
|
+
</div>
|
|
23
|
+
</li>
|
|
24
|
+
))}
|
|
25
|
+
</ul>
|
|
26
|
+
</DebugLayout>
|
|
27
|
+
);
|
|
28
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
.listItem {
|
|
9
|
+
background-color: #242526;
|
|
10
|
+
padding: 10px;
|
|
11
|
+
border-radius: 4px;
|
|
12
|
+
margin-bottom: 20px;
|
|
13
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/
|
|
7
|
+
import type { ReactNode } from 'react';
|
|
8
|
+
export default function DebugRoutes(): ReactNode;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/
|
|
7
|
+
import routes from '@generated/routes';
|
|
8
|
+
import DebugLayout from '@theme/DebugLayout';
|
|
9
|
+
import DebugJsonView from '@theme/DebugJsonView';
|
|
10
|
+
import styles from './styles.module.css';
|
|
11
|
+
export default function DebugRoutes() {
|
|
12
|
+
return (
|
|
13
|
+
<DebugLayout>
|
|
14
|
+
<h2>Routes</h2>
|
|
15
|
+
<ul className="clean-list">
|
|
16
|
+
{routes.map(({path, exact, routes: childRoutes}) => (
|
|
17
|
+
<li key={path} className={styles.listItem}>
|
|
18
|
+
<div className={styles.route}>
|
|
19
|
+
<code className={styles.routeName}>{path}</code>
|
|
20
|
+
</div>
|
|
21
|
+
<div>
|
|
22
|
+
Is exact: <code>{String(Boolean(exact))}</code>
|
|
23
|
+
</div>
|
|
24
|
+
{childRoutes && (
|
|
25
|
+
<div>
|
|
26
|
+
Child Routes:
|
|
27
|
+
<DebugJsonView src={childRoutes} />
|
|
28
|
+
</div>
|
|
29
|
+
)}
|
|
30
|
+
</li>
|
|
31
|
+
))}
|
|
32
|
+
</ul>
|
|
33
|
+
</DebugLayout>
|
|
34
|
+
);
|
|
35
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
.listItem {
|
|
9
|
+
background-color: #242526;
|
|
10
|
+
padding: 10px;
|
|
11
|
+
border-radius: 4px;
|
|
12
|
+
margin-bottom: 20px;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.route {
|
|
16
|
+
margin-bottom: 10px;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
.routeName {
|
|
20
|
+
color: #e06b6b;
|
|
21
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/
|
|
7
|
+
import type { ReactNode } from 'react';
|
|
8
|
+
export default function DebugMetadata(): ReactNode;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/
|
|
7
|
+
import useDocusaurusContext from '@docusaurus/useDocusaurusContext';
|
|
8
|
+
import DebugLayout from '@theme/DebugLayout';
|
|
9
|
+
import styles from './styles.module.css';
|
|
10
|
+
export default function DebugMetadata() {
|
|
11
|
+
const {siteMetadata} = useDocusaurusContext();
|
|
12
|
+
return (
|
|
13
|
+
<DebugLayout>
|
|
14
|
+
<h2>Site Metadata</h2>
|
|
15
|
+
<div>
|
|
16
|
+
Docusaurus Version: <code>{siteMetadata.docusaurusVersion}</code>
|
|
17
|
+
</div>
|
|
18
|
+
<div>
|
|
19
|
+
Site Version:{' '}
|
|
20
|
+
<code>{siteMetadata.siteVersion ?? 'No version specified'}</code>
|
|
21
|
+
</div>
|
|
22
|
+
<h3 className={styles.sectionTitle}>Plugins and themes</h3>
|
|
23
|
+
<ul className="clean-list">
|
|
24
|
+
{Object.entries(siteMetadata.pluginVersions).map(
|
|
25
|
+
([name, versionInformation]) => (
|
|
26
|
+
<li key={name} className={styles.listItem}>
|
|
27
|
+
{versionInformation.type === 'package' &&
|
|
28
|
+
versionInformation.version && (
|
|
29
|
+
<div className={styles.version}>
|
|
30
|
+
<code>{versionInformation.version}</code>
|
|
31
|
+
</div>
|
|
32
|
+
)}
|
|
33
|
+
<div className={styles.name}>{name}</div>
|
|
34
|
+
<div>Type: {versionInformation.type}</div>
|
|
35
|
+
</li>
|
|
36
|
+
),
|
|
37
|
+
)}
|
|
38
|
+
</ul>
|
|
39
|
+
</DebugLayout>
|
|
40
|
+
);
|
|
41
|
+
}
|