@docusaurus/theme-classic 0.0.0-4632 → 0.0.0-4635
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/getSwizzleConfig.js +102 -0
- package/lib/index.js +8 -7
- package/lib-next/theme/Heading/index.js +0 -1
- package/lib-next/theme/Heading/styles.module.css +16 -0
- package/package.json +13 -13
- package/src/getSwizzleConfig.ts +101 -0
- package/src/index.ts +1 -17
- package/src/theme/Heading/index.tsx +0 -1
- package/src/theme/Heading/styles.module.css +16 -0
- package/lib-next/theme/Heading/styles.css +0 -22
- package/src/theme/Heading/styles.css +0 -22
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = getSwizzleConfig;
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
10
|
+
*
|
|
11
|
+
* This source code is licensed under the MIT license found in the
|
|
12
|
+
* LICENSE file in the root directory of this source tree.
|
|
13
|
+
*/
|
|
14
|
+
function getSwizzleConfig() {
|
|
15
|
+
return {
|
|
16
|
+
components: {
|
|
17
|
+
CodeBlock: {
|
|
18
|
+
actions: {
|
|
19
|
+
wrap: 'safe',
|
|
20
|
+
eject: 'safe'
|
|
21
|
+
},
|
|
22
|
+
description: 'The component used to render multi-line code blocks, generally used in Markdown files.'
|
|
23
|
+
},
|
|
24
|
+
DocSidebar: {
|
|
25
|
+
actions: {
|
|
26
|
+
wrap: 'safe',
|
|
27
|
+
eject: 'unsafe' // too much technical code in sidebar, not very safe atm
|
|
28
|
+
|
|
29
|
+
},
|
|
30
|
+
description: 'The sidebar component on docs pages'
|
|
31
|
+
},
|
|
32
|
+
Footer: {
|
|
33
|
+
actions: {
|
|
34
|
+
wrap: 'safe',
|
|
35
|
+
eject: 'unsafe' // TODO split footer into smaller parts
|
|
36
|
+
|
|
37
|
+
},
|
|
38
|
+
description: "The footer component of you site's layout"
|
|
39
|
+
},
|
|
40
|
+
NotFound: {
|
|
41
|
+
actions: {
|
|
42
|
+
wrap: 'safe',
|
|
43
|
+
eject: 'safe'
|
|
44
|
+
},
|
|
45
|
+
description: 'The global 404 page of your site, meant to be ejected and customized'
|
|
46
|
+
},
|
|
47
|
+
SearchBar: {
|
|
48
|
+
actions: {
|
|
49
|
+
wrap: 'safe',
|
|
50
|
+
eject: 'safe'
|
|
51
|
+
},
|
|
52
|
+
// TODO how to describe this one properly?
|
|
53
|
+
// By default it's an empty placeholder for the user to fill
|
|
54
|
+
description: 'The search bar component of your site, appearing in the navbar.'
|
|
55
|
+
},
|
|
56
|
+
IconArrow: {
|
|
57
|
+
actions: {
|
|
58
|
+
wrap: 'safe',
|
|
59
|
+
eject: 'safe'
|
|
60
|
+
},
|
|
61
|
+
description: 'The arrow icon component'
|
|
62
|
+
},
|
|
63
|
+
IconEdit: {
|
|
64
|
+
actions: {
|
|
65
|
+
wrap: 'safe',
|
|
66
|
+
eject: 'safe'
|
|
67
|
+
},
|
|
68
|
+
description: 'The edit icon component'
|
|
69
|
+
},
|
|
70
|
+
IconMenu: {
|
|
71
|
+
actions: {
|
|
72
|
+
wrap: 'safe',
|
|
73
|
+
eject: 'safe'
|
|
74
|
+
},
|
|
75
|
+
description: 'The menu icon component'
|
|
76
|
+
},
|
|
77
|
+
'prism-include-languages': {
|
|
78
|
+
actions: {
|
|
79
|
+
wrap: 'forbidden',
|
|
80
|
+
// not a component!
|
|
81
|
+
eject: 'safe'
|
|
82
|
+
},
|
|
83
|
+
description: 'The Prism languages to include for code block syntax highlighting. Meant to be ejected.'
|
|
84
|
+
},
|
|
85
|
+
MDXComponents: {
|
|
86
|
+
actions: {
|
|
87
|
+
wrap: 'forbidden',
|
|
88
|
+
/// TODO allow wrapping objects???
|
|
89
|
+
eject: 'safe'
|
|
90
|
+
},
|
|
91
|
+
description: 'The MDX components to use for rendering MDX files. Meant to be ejected.'
|
|
92
|
+
},
|
|
93
|
+
// TODO should probably not even appear here
|
|
94
|
+
'NavbarItem/utils': {
|
|
95
|
+
actions: {
|
|
96
|
+
wrap: 'forbidden',
|
|
97
|
+
eject: 'forbidden'
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
};
|
|
102
|
+
}
|
package/lib/index.js
CHANGED
|
@@ -5,7 +5,12 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.AnnouncementBarDismissStorageKey = void 0;
|
|
7
7
|
exports.default = docusaurusThemeClassic;
|
|
8
|
-
exports
|
|
8
|
+
Object.defineProperty(exports, "getSwizzleConfig", {
|
|
9
|
+
enumerable: true,
|
|
10
|
+
get: function () {
|
|
11
|
+
return _getSwizzleConfig.default;
|
|
12
|
+
}
|
|
13
|
+
});
|
|
9
14
|
Object.defineProperty(exports, "validateThemeConfig", {
|
|
10
15
|
enumerable: true,
|
|
11
16
|
get: function () {
|
|
@@ -23,6 +28,8 @@ var _rtlcss = _interopRequireDefault(require("rtlcss"));
|
|
|
23
28
|
|
|
24
29
|
var _themeTranslations = require("@docusaurus/theme-translations");
|
|
25
30
|
|
|
31
|
+
var _getSwizzleConfig = _interopRequireDefault(require("./getSwizzleConfig"));
|
|
32
|
+
|
|
26
33
|
var _validateThemeConfig = require("./validateThemeConfig");
|
|
27
34
|
|
|
28
35
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
@@ -214,10 +221,4 @@ ${announcementBar ? AnnouncementBarInlineJavaScript : ''}
|
|
|
214
221
|
}
|
|
215
222
|
|
|
216
223
|
};
|
|
217
|
-
}
|
|
218
|
-
|
|
219
|
-
const swizzleAllowedComponents = ['CodeBlock', 'DocSidebar', 'Footer', 'NotFound', 'SearchBar', 'IconArrow', 'IconEdit', 'IconMenu', 'hooks/useTheme', 'prism-include-languages'];
|
|
220
|
-
|
|
221
|
-
function getSwizzleComponentList() {
|
|
222
|
-
return swizzleAllowedComponents;
|
|
223
224
|
}
|
|
@@ -8,7 +8,6 @@ import React from 'react';
|
|
|
8
8
|
import clsx from 'clsx';
|
|
9
9
|
import {translate} from '@docusaurus/Translate';
|
|
10
10
|
import {useThemeConfig} from '@docusaurus/theme-common';
|
|
11
|
-
import './styles.css';
|
|
12
11
|
import styles from './styles.module.css';
|
|
13
12
|
|
|
14
13
|
function AnchorHeading({as: As, id, ...props}) {
|
|
@@ -17,3 +17,19 @@ See https://twitter.com/JoshWComeau/status/1332015868725891076
|
|
|
17
17
|
.anchorWithHideOnScrollNavbar {
|
|
18
18
|
scroll-margin-top: 0.5rem;
|
|
19
19
|
}
|
|
20
|
+
|
|
21
|
+
:global(.hash-link) {
|
|
22
|
+
opacity: 0;
|
|
23
|
+
padding-left: 0.5rem;
|
|
24
|
+
transition: opacity var(--ifm-transition-fast);
|
|
25
|
+
user-select: none;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
:global(.hash-link::before) {
|
|
29
|
+
content: '#';
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
:global(.hash-link:focus),
|
|
33
|
+
:global(*:hover > .hash-link) {
|
|
34
|
+
opacity: 1;
|
|
35
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@docusaurus/theme-classic",
|
|
3
|
-
"version": "0.0.0-
|
|
3
|
+
"version": "0.0.0-4635",
|
|
4
4
|
"description": "Classic theme for Docusaurus",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"types": "src/theme-classic.d.ts",
|
|
@@ -21,15 +21,15 @@
|
|
|
21
21
|
"format:lib-next": "prettier --config ../../.prettierrc --write \"lib-next/**/*.{js,ts,jsx,tsc}\""
|
|
22
22
|
},
|
|
23
23
|
"dependencies": {
|
|
24
|
-
"@docusaurus/core": "0.0.0-
|
|
25
|
-
"@docusaurus/plugin-content-blog": "0.0.0-
|
|
26
|
-
"@docusaurus/plugin-content-docs": "0.0.0-
|
|
27
|
-
"@docusaurus/plugin-content-pages": "0.0.0-
|
|
28
|
-
"@docusaurus/theme-common": "0.0.0-
|
|
29
|
-
"@docusaurus/theme-translations": "0.0.0-
|
|
30
|
-
"@docusaurus/utils": "0.0.0-
|
|
31
|
-
"@docusaurus/utils-common": "0.0.0-
|
|
32
|
-
"@docusaurus/utils-validation": "0.0.0-
|
|
24
|
+
"@docusaurus/core": "0.0.0-4635",
|
|
25
|
+
"@docusaurus/plugin-content-blog": "0.0.0-4635",
|
|
26
|
+
"@docusaurus/plugin-content-docs": "0.0.0-4635",
|
|
27
|
+
"@docusaurus/plugin-content-pages": "0.0.0-4635",
|
|
28
|
+
"@docusaurus/theme-common": "0.0.0-4635",
|
|
29
|
+
"@docusaurus/theme-translations": "0.0.0-4635",
|
|
30
|
+
"@docusaurus/utils": "0.0.0-4635",
|
|
31
|
+
"@docusaurus/utils-common": "0.0.0-4635",
|
|
32
|
+
"@docusaurus/utils-validation": "0.0.0-4635",
|
|
33
33
|
"@mdx-js/react": "^1.6.22",
|
|
34
34
|
"clsx": "^1.1.1",
|
|
35
35
|
"copy-text-to-clipboard": "^3.0.1",
|
|
@@ -42,8 +42,8 @@
|
|
|
42
42
|
"rtlcss": "^3.3.0"
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {
|
|
45
|
-
"@docusaurus/module-type-aliases": "0.0.0-
|
|
46
|
-
"@docusaurus/types": "0.0.0-
|
|
45
|
+
"@docusaurus/module-type-aliases": "0.0.0-4635",
|
|
46
|
+
"@docusaurus/types": "0.0.0-4635",
|
|
47
47
|
"@types/mdx-js__react": "^1.5.5",
|
|
48
48
|
"@types/prismjs": "^1.26.0",
|
|
49
49
|
"@types/rtlcss": "^3.1.2",
|
|
@@ -59,5 +59,5 @@
|
|
|
59
59
|
"engines": {
|
|
60
60
|
"node": ">=14"
|
|
61
61
|
},
|
|
62
|
-
"gitHead": "
|
|
62
|
+
"gitHead": "267eecbcba13dd00dd8b9a23bde16cfb2171ae7f"
|
|
63
63
|
}
|
|
@@ -0,0 +1,101 @@
|
|
|
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 type {SwizzleConfig} from '@docusaurus/types';
|
|
9
|
+
|
|
10
|
+
export default function getSwizzleConfig(): SwizzleConfig {
|
|
11
|
+
return {
|
|
12
|
+
components: {
|
|
13
|
+
CodeBlock: {
|
|
14
|
+
actions: {
|
|
15
|
+
wrap: 'safe',
|
|
16
|
+
eject: 'safe',
|
|
17
|
+
},
|
|
18
|
+
description:
|
|
19
|
+
'The component used to render multi-line code blocks, generally used in Markdown files.',
|
|
20
|
+
},
|
|
21
|
+
DocSidebar: {
|
|
22
|
+
actions: {
|
|
23
|
+
wrap: 'safe',
|
|
24
|
+
eject: 'unsafe', // too much technical code in sidebar, not very safe atm
|
|
25
|
+
},
|
|
26
|
+
description: 'The sidebar component on docs pages',
|
|
27
|
+
},
|
|
28
|
+
Footer: {
|
|
29
|
+
actions: {
|
|
30
|
+
wrap: 'safe',
|
|
31
|
+
eject: 'unsafe', // TODO split footer into smaller parts
|
|
32
|
+
},
|
|
33
|
+
description: "The footer component of you site's layout",
|
|
34
|
+
},
|
|
35
|
+
NotFound: {
|
|
36
|
+
actions: {
|
|
37
|
+
wrap: 'safe',
|
|
38
|
+
eject: 'safe',
|
|
39
|
+
},
|
|
40
|
+
description:
|
|
41
|
+
'The global 404 page of your site, meant to be ejected and customized',
|
|
42
|
+
},
|
|
43
|
+
SearchBar: {
|
|
44
|
+
actions: {
|
|
45
|
+
wrap: 'safe',
|
|
46
|
+
eject: 'safe',
|
|
47
|
+
},
|
|
48
|
+
// TODO how to describe this one properly?
|
|
49
|
+
// By default it's an empty placeholder for the user to fill
|
|
50
|
+
description:
|
|
51
|
+
'The search bar component of your site, appearing in the navbar.',
|
|
52
|
+
},
|
|
53
|
+
IconArrow: {
|
|
54
|
+
actions: {
|
|
55
|
+
wrap: 'safe',
|
|
56
|
+
eject: 'safe',
|
|
57
|
+
},
|
|
58
|
+
description: 'The arrow icon component',
|
|
59
|
+
},
|
|
60
|
+
IconEdit: {
|
|
61
|
+
actions: {
|
|
62
|
+
wrap: 'safe',
|
|
63
|
+
eject: 'safe',
|
|
64
|
+
},
|
|
65
|
+
description: 'The edit icon component',
|
|
66
|
+
},
|
|
67
|
+
IconMenu: {
|
|
68
|
+
actions: {
|
|
69
|
+
wrap: 'safe',
|
|
70
|
+
eject: 'safe',
|
|
71
|
+
},
|
|
72
|
+
description: 'The menu icon component',
|
|
73
|
+
},
|
|
74
|
+
|
|
75
|
+
'prism-include-languages': {
|
|
76
|
+
actions: {
|
|
77
|
+
wrap: 'forbidden', // not a component!
|
|
78
|
+
eject: 'safe',
|
|
79
|
+
},
|
|
80
|
+
description:
|
|
81
|
+
'The Prism languages to include for code block syntax highlighting. Meant to be ejected.',
|
|
82
|
+
},
|
|
83
|
+
MDXComponents: {
|
|
84
|
+
actions: {
|
|
85
|
+
wrap: 'forbidden', /// TODO allow wrapping objects???
|
|
86
|
+
eject: 'safe',
|
|
87
|
+
},
|
|
88
|
+
description:
|
|
89
|
+
'The MDX components to use for rendering MDX files. Meant to be ejected.',
|
|
90
|
+
},
|
|
91
|
+
|
|
92
|
+
// TODO should probably not even appear here
|
|
93
|
+
'NavbarItem/utils': {
|
|
94
|
+
actions: {
|
|
95
|
+
wrap: 'forbidden',
|
|
96
|
+
eject: 'forbidden',
|
|
97
|
+
},
|
|
98
|
+
},
|
|
99
|
+
},
|
|
100
|
+
};
|
|
101
|
+
}
|
package/src/index.ts
CHANGED
|
@@ -207,21 +207,5 @@ ${announcementBar ? AnnouncementBarInlineJavaScript : ''}
|
|
|
207
207
|
};
|
|
208
208
|
}
|
|
209
209
|
|
|
210
|
-
|
|
211
|
-
'CodeBlock',
|
|
212
|
-
'DocSidebar',
|
|
213
|
-
'Footer',
|
|
214
|
-
'NotFound',
|
|
215
|
-
'SearchBar',
|
|
216
|
-
'IconArrow',
|
|
217
|
-
'IconEdit',
|
|
218
|
-
'IconMenu',
|
|
219
|
-
'hooks/useTheme',
|
|
220
|
-
'prism-include-languages',
|
|
221
|
-
];
|
|
222
|
-
|
|
223
|
-
export function getSwizzleComponentList(): string[] {
|
|
224
|
-
return swizzleAllowedComponents;
|
|
225
|
-
}
|
|
226
|
-
|
|
210
|
+
export {default as getSwizzleConfig} from './getSwizzleConfig';
|
|
227
211
|
export {validateThemeConfig} from './validateThemeConfig';
|
|
@@ -11,7 +11,6 @@ import type {Props} from '@theme/Heading';
|
|
|
11
11
|
import {translate} from '@docusaurus/Translate';
|
|
12
12
|
import {useThemeConfig} from '@docusaurus/theme-common';
|
|
13
13
|
|
|
14
|
-
import './styles.css';
|
|
15
14
|
import styles from './styles.module.css';
|
|
16
15
|
|
|
17
16
|
function AnchorHeading({as: As, id, ...props}: Props) {
|
|
@@ -17,3 +17,19 @@ See https://twitter.com/JoshWComeau/status/1332015868725891076
|
|
|
17
17
|
.anchorWithHideOnScrollNavbar {
|
|
18
18
|
scroll-margin-top: 0.5rem;
|
|
19
19
|
}
|
|
20
|
+
|
|
21
|
+
:global(.hash-link) {
|
|
22
|
+
opacity: 0;
|
|
23
|
+
padding-left: 0.5rem;
|
|
24
|
+
transition: opacity var(--ifm-transition-fast);
|
|
25
|
+
user-select: none;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
:global(.hash-link::before) {
|
|
29
|
+
content: '#';
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
:global(.hash-link:focus),
|
|
33
|
+
:global(*:hover > .hash-link) {
|
|
34
|
+
opacity: 1;
|
|
35
|
+
}
|
|
@@ -1,22 +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
|
-
.hash-link {
|
|
9
|
-
opacity: 0;
|
|
10
|
-
padding-left: 0.5rem;
|
|
11
|
-
transition: opacity var(--ifm-transition-fast);
|
|
12
|
-
user-select: none;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
.hash-link::before {
|
|
16
|
-
content: '#';
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
.hash-link:focus,
|
|
20
|
-
*:hover > .hash-link {
|
|
21
|
-
opacity: 1;
|
|
22
|
-
}
|
|
@@ -1,22 +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
|
-
.hash-link {
|
|
9
|
-
opacity: 0;
|
|
10
|
-
padding-left: 0.5rem;
|
|
11
|
-
transition: opacity var(--ifm-transition-fast);
|
|
12
|
-
user-select: none;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
.hash-link::before {
|
|
16
|
-
content: '#';
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
.hash-link:focus,
|
|
20
|
-
*:hover > .hash-link {
|
|
21
|
-
opacity: 1;
|
|
22
|
-
}
|