@docusaurus/plugin-debug 2.0.0-beta.15d451942 → 2.0.0-beta.18
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/lib/index.d.ts +1 -1
- package/lib/index.js +13 -10
- package/lib/theme/DebugConfig/index.d.ts +8 -0
- package/lib/theme/DebugConfig/index.js +20 -0
- package/lib/theme/DebugContent/index.d.ts +9 -0
- package/lib/theme/DebugContent/index.js +34 -0
- package/lib/theme/DebugGlobalData/index.d.ts +8 -0
- package/lib/theme/DebugGlobalData/index.js +20 -0
- package/lib/theme/DebugJsonView/index.d.ts +9 -0
- package/lib/theme/DebugJsonView/index.js +35 -0
- package/lib/theme/DebugLayout/index.d.ts +10 -0
- package/lib/theme/DebugLayout/index.js +34 -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 +25 -0
- package/lib/theme/DebugRegistry/styles.module.css +18 -0
- package/lib/theme/DebugRoutes/index.d.ts +8 -0
- package/lib/theme/DebugRoutes/index.js +28 -0
- package/lib/theme/DebugRoutes/styles.module.css +26 -0
- package/lib/theme/DebugSiteMetadata/index.d.ts +8 -0
- package/lib/theme/DebugSiteMetadata/index.js +35 -0
- package/lib/theme/DebugSiteMetadata/styles.module.css +31 -0
- package/package.json +13 -9
- package/src/index.ts +5 -2
- package/src/plugin-debug.d.ts +53 -0
- package/src/theme/DebugConfig/{index.js → index.tsx} +4 -6
- package/src/theme/DebugContent/index.tsx +77 -0
- package/src/theme/DebugGlobalData/{index.js → index.tsx} +4 -6
- package/src/theme/DebugJsonView/{index.js → index.tsx} +15 -13
- package/src/theme/DebugLayout/{index.js → index.tsx} +20 -16
- package/src/theme/DebugLayout/styles.module.css +1 -1
- package/src/theme/DebugRegistry/{index.js → index.tsx} +2 -4
- package/src/theme/DebugRoutes/{index.js → index.tsx} +3 -5
- package/src/theme/DebugRoutes/styles.module.css +1 -1
- package/src/theme/DebugSiteMetadata/{index.js → index.tsx} +8 -9
- package/lib/.tsbuildinfo +0 -3939
- package/src/theme/DebugContent/index.js +0 -70
- package/tsconfig.json +0 -9
|
@@ -1,70 +0,0 @@
|
|
|
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
|
-
import React from 'react';
|
|
9
|
-
|
|
10
|
-
import DebugLayout from '../DebugLayout';
|
|
11
|
-
import DebugJsonView from '../DebugJsonView';
|
|
12
|
-
|
|
13
|
-
const PluginInstanceContent = ({pluginId, pluginInstanceContent}) => (
|
|
14
|
-
<section style={{marginBottom: 30}}>
|
|
15
|
-
<code>{pluginId}</code>
|
|
16
|
-
<DebugJsonView src={pluginInstanceContent} collapseDepth="2" />
|
|
17
|
-
</section>
|
|
18
|
-
);
|
|
19
|
-
|
|
20
|
-
const PluginContent = ({pluginName, pluginContent}) => {
|
|
21
|
-
return (
|
|
22
|
-
<section style={{marginBottom: 60}}>
|
|
23
|
-
<h3>{pluginName}</h3>
|
|
24
|
-
<div>
|
|
25
|
-
{Object.entries(pluginContent)
|
|
26
|
-
// filter plugin instances with no content
|
|
27
|
-
.filter(
|
|
28
|
-
([_pluginId, pluginInstanceContent]) => !!pluginInstanceContent,
|
|
29
|
-
)
|
|
30
|
-
.map(([pluginId, pluginInstanceContent]) => {
|
|
31
|
-
return (
|
|
32
|
-
<PluginInstanceContent
|
|
33
|
-
key={pluginId}
|
|
34
|
-
pluginId={pluginId}
|
|
35
|
-
pluginInstanceContent={pluginInstanceContent}
|
|
36
|
-
/>
|
|
37
|
-
);
|
|
38
|
-
})}
|
|
39
|
-
</div>
|
|
40
|
-
</section>
|
|
41
|
-
);
|
|
42
|
-
};
|
|
43
|
-
|
|
44
|
-
function DebugContent({allContent}) {
|
|
45
|
-
return (
|
|
46
|
-
<DebugLayout>
|
|
47
|
-
<h2>Plugin content</h2>
|
|
48
|
-
<div>
|
|
49
|
-
{Object.entries(allContent)
|
|
50
|
-
// filter plugins with no content
|
|
51
|
-
.filter(([_pluginName, pluginContent]) =>
|
|
52
|
-
Object.values(pluginContent).some(
|
|
53
|
-
(instanceContent) => !!instanceContent,
|
|
54
|
-
),
|
|
55
|
-
)
|
|
56
|
-
.map(([pluginName, pluginContent]) => {
|
|
57
|
-
return (
|
|
58
|
-
<PluginContent
|
|
59
|
-
key={pluginName}
|
|
60
|
-
pluginName={pluginName}
|
|
61
|
-
pluginContent={pluginContent}
|
|
62
|
-
/>
|
|
63
|
-
);
|
|
64
|
-
})}
|
|
65
|
-
</div>
|
|
66
|
-
</DebugLayout>
|
|
67
|
-
);
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
export default DebugContent;
|