@docusaurus/plugin-debug 2.0.0-beta.2 → 2.0.0-beta.20

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.
Files changed (40) hide show
  1. package/lib/index.d.ts +2 -2
  2. package/lib/index.js +13 -10
  3. package/lib/theme/DebugConfig/index.d.ts +8 -0
  4. package/lib/theme/DebugConfig/index.js +20 -0
  5. package/lib/theme/DebugContent/index.d.ts +9 -0
  6. package/lib/theme/DebugContent/index.js +34 -0
  7. package/lib/theme/DebugGlobalData/index.d.ts +8 -0
  8. package/lib/theme/DebugGlobalData/index.js +20 -0
  9. package/lib/theme/DebugJsonView/index.d.ts +9 -0
  10. package/lib/theme/DebugJsonView/index.js +35 -0
  11. package/lib/theme/DebugLayout/index.d.ts +10 -0
  12. package/lib/theme/DebugLayout/index.js +35 -0
  13. package/lib/theme/DebugLayout/styles.module.css +75 -0
  14. package/lib/theme/DebugRegistry/index.d.ts +8 -0
  15. package/lib/theme/DebugRegistry/index.js +25 -0
  16. package/lib/theme/DebugRegistry/styles.module.css +13 -0
  17. package/lib/theme/DebugRoutes/index.d.ts +8 -0
  18. package/lib/theme/DebugRoutes/index.js +28 -0
  19. package/lib/theme/DebugRoutes/styles.module.css +21 -0
  20. package/lib/theme/DebugSiteMetadata/index.d.ts +8 -0
  21. package/lib/theme/DebugSiteMetadata/index.js +35 -0
  22. package/lib/theme/DebugSiteMetadata/styles.module.css +26 -0
  23. package/package.json +13 -9
  24. package/src/index.ts +6 -3
  25. package/src/plugin-debug.d.ts +59 -0
  26. package/src/theme/DebugConfig/{index.js → index.tsx} +4 -6
  27. package/src/theme/DebugContent/index.tsx +77 -0
  28. package/src/theme/DebugGlobalData/{index.js → index.tsx} +4 -6
  29. package/src/theme/DebugJsonView/{index.js → index.tsx} +16 -14
  30. package/src/theme/DebugLayout/{index.js → index.tsx} +21 -16
  31. package/src/theme/DebugLayout/styles.module.css +1 -1
  32. package/src/theme/DebugRegistry/{index.js → index.tsx} +3 -5
  33. package/src/theme/DebugRegistry/styles.module.css +0 -5
  34. package/src/theme/DebugRoutes/{index.js → index.tsx} +4 -6
  35. package/src/theme/DebugRoutes/styles.module.css +0 -5
  36. package/src/theme/DebugSiteMetadata/{index.js → index.tsx} +9 -10
  37. package/src/theme/DebugSiteMetadata/styles.module.css +0 -5
  38. package/lib/.tsbuildinfo +0 -1
  39. package/src/theme/DebugContent/index.js +0 -70
  40. 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;
package/tsconfig.json DELETED
@@ -1,9 +0,0 @@
1
- {
2
- "extends": "../../tsconfig.json",
3
- "compilerOptions": {
4
- "incremental": true,
5
- "tsBuildInfoFile": "./lib/.tsbuildinfo",
6
- "rootDir": "src",
7
- "outDir": "lib"
8
- }
9
- }