@docusaurus/theme-classic 2.4.1 → 3.0.0-beta.0
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 +107 -8
- package/lib/index.js +20 -6
- package/lib/nprogress.d.ts +1 -1
- package/lib/options.js +6 -2
- package/lib/theme/Admonition/Icon/Danger.d.ts +9 -0
- package/lib/theme/Admonition/Icon/Danger.js +17 -0
- package/lib/theme/Admonition/Icon/Info.d.ts +9 -0
- package/lib/theme/Admonition/Icon/Info.js +17 -0
- package/lib/theme/Admonition/Icon/Note.d.ts +9 -0
- package/lib/theme/Admonition/Icon/Note.js +17 -0
- package/lib/theme/Admonition/Icon/Tip.d.ts +9 -0
- package/lib/theme/Admonition/Icon/Tip.js +17 -0
- package/lib/theme/Admonition/Icon/Warning.d.ts +9 -0
- package/lib/theme/Admonition/Icon/Warning.js +17 -0
- package/lib/theme/Admonition/Layout/index.d.ts +9 -0
- package/lib/theme/Admonition/Layout/index.js +45 -0
- package/lib/theme/Admonition/{styles.module.css → Layout/styles.module.css} +4 -0
- package/lib/theme/Admonition/Type/Caution.d.ts +9 -0
- package/lib/theme/Admonition/Type/Caution.js +34 -0
- package/lib/theme/Admonition/Type/Danger.d.ts +9 -0
- package/lib/theme/Admonition/Type/Danger.js +32 -0
- package/lib/theme/Admonition/Type/Info.d.ts +9 -0
- package/lib/theme/Admonition/Type/Info.js +32 -0
- package/lib/theme/Admonition/Type/Note.d.ts +9 -0
- package/lib/theme/Admonition/Type/Note.js +32 -0
- package/lib/theme/Admonition/Type/Tip.d.ts +9 -0
- package/lib/theme/Admonition/Type/Tip.js +32 -0
- package/lib/theme/Admonition/Type/Warning.d.ts +9 -0
- package/lib/theme/Admonition/Type/Warning.js +32 -0
- package/lib/theme/Admonition/Types.d.ts +12 -0
- package/lib/theme/Admonition/Types.js +33 -0
- package/lib/theme/Admonition/index.d.ts +1 -1
- package/lib/theme/Admonition/index.js +12 -171
- package/lib/theme/BlogArchivePage/index.js +7 -2
- package/lib/theme/BlogLayout/index.js +1 -1
- package/lib/theme/BlogPostItem/Container/index.js +12 -3
- package/lib/theme/BlogPostItem/Header/Author/index.js +6 -1
- package/lib/theme/BlogPostPage/index.js +3 -1
- package/lib/theme/BlogSidebar/Desktop/index.js +3 -1
- package/lib/theme/BlogSidebar/Mobile/index.js +3 -1
- package/lib/theme/BlogTagsListPage/index.js +2 -1
- package/lib/theme/BlogTagsPostsPage/index.js +4 -2
- package/lib/theme/CodeBlock/Content/String.js +9 -2
- package/lib/theme/CodeBlock/CopyButton/index.js +0 -1
- package/lib/theme/DocBreadcrumbs/index.js +6 -2
- package/lib/theme/DocCard/index.js +8 -4
- package/lib/theme/DocItem/Layout/index.js +5 -0
- package/lib/theme/DocItem/index.js +1 -1
- package/lib/theme/{DocPage → DocRoot}/Layout/Main/index.d.ts +2 -2
- package/lib/theme/{DocPage → DocRoot}/Layout/Main/index.js +1 -1
- package/lib/theme/{DocPage → DocRoot}/Layout/Sidebar/ExpandButton/index.d.ts +2 -2
- package/lib/theme/{DocPage → DocRoot}/Layout/Sidebar/ExpandButton/index.js +1 -1
- package/lib/theme/{DocPage → DocRoot}/Layout/Sidebar/index.d.ts +2 -2
- package/lib/theme/{DocPage → DocRoot}/Layout/Sidebar/index.js +2 -2
- package/lib/theme/{DocPage → DocRoot}/Layout/index.d.ts +2 -2
- package/lib/theme/{DocPage → DocRoot}/Layout/index.js +9 -10
- package/lib/theme/{DocPage → DocRoot}/Layout/styles.module.css +1 -2
- package/lib/theme/{DocPage → DocRoot}/index.d.ts +2 -2
- package/lib/theme/DocRoot/index.js +31 -0
- package/lib/theme/DocSidebar/Desktop/index.d.ts +1 -1
- package/lib/theme/DocSidebar/Mobile/index.d.ts +1 -1
- package/lib/theme/DocSidebarItem/Category/index.js +24 -13
- package/lib/theme/DocSidebarItems/index.js +6 -4
- package/lib/theme/DocTagDocListPage/index.d.ts +1 -1
- package/lib/theme/DocTagDocListPage/index.js +53 -39
- package/lib/theme/DocTagsListPage/index.d.ts +1 -1
- package/lib/theme/DocTagsListPage/index.js +26 -17
- package/lib/theme/DocVersionRoot/index.d.ts +10 -0
- package/lib/theme/DocVersionRoot/index.js +46 -0
- package/lib/theme/DocsRoot/index.d.ts +10 -0
- package/lib/theme/DocsRoot/index.js +18 -0
- package/lib/theme/EditThisPage/index.js +3 -6
- package/lib/theme/ErrorPageContent.js +3 -2
- package/lib/theme/MDXComponents/Code.js +2 -36
- package/lib/theme/MDXComponents/Details.js +1 -1
- package/lib/theme/MDXComponents/Pre.d.ts +2 -2
- package/lib/theme/MDXComponents/Pre.js +4 -11
- package/lib/theme/MDXComponents/Ul/index.js +4 -0
- package/lib/theme/MDXComponents/index.js +4 -3
- package/lib/theme/MDXPage/index.js +16 -4
- package/lib/theme/NavbarItem/DocNavbarItem.js +4 -3
- package/lib/theme/NavbarItem/LocaleDropdownNavbarItem/index.d.ts +1 -1
- package/lib/theme/NavbarItem/LocaleDropdownNavbarItem/index.js +2 -1
- package/lib/theme/NotFound/Content/index.d.ts +9 -0
- package/lib/theme/NotFound/Content/index.js +42 -0
- package/lib/theme/{NotFound.d.ts → NotFound/index.d.ts} +1 -1
- package/lib/theme/NotFound/index.js +25 -0
- package/lib/theme/SiteMetadata/index.js +30 -3
- package/lib/theme/TOCItems/Tree.js +3 -4
- package/lib/theme/Tabs/index.js +4 -2
- package/lib/theme/TagsListByLetter/index.js +4 -1
- package/lib/theme/ThemedImage/index.js +8 -24
- package/lib/theme/{MDXComponents/Head.d.ts → Unlisted/index.d.ts} +2 -2
- package/lib/theme/Unlisted/index.js +38 -0
- package/package.json +26 -26
- package/src/getSwizzleConfig.ts +116 -9
- package/src/index.ts +21 -6
- package/src/nprogress.ts +2 -1
- package/src/options.ts +7 -2
- package/src/theme/Admonition/Icon/Danger.tsx +20 -0
- package/src/theme/Admonition/Icon/Info.tsx +20 -0
- package/src/theme/Admonition/Icon/Note.tsx +20 -0
- package/src/theme/Admonition/Icon/Tip.tsx +20 -0
- package/src/theme/Admonition/Icon/Warning.tsx +20 -0
- package/src/theme/Admonition/Layout/index.tsx +57 -0
- package/src/theme/Admonition/{styles.module.css → Layout/styles.module.css} +4 -0
- package/src/theme/Admonition/Type/Caution.tsx +39 -0
- package/src/theme/Admonition/Type/Danger.tsx +37 -0
- package/src/theme/Admonition/Type/Info.tsx +37 -0
- package/src/theme/Admonition/Type/Note.tsx +37 -0
- package/src/theme/Admonition/Type/Tip.tsx +37 -0
- package/src/theme/Admonition/Type/Warning.tsx +37 -0
- package/src/theme/Admonition/Types.tsx +38 -0
- package/src/theme/Admonition/index.tsx +13 -194
- package/src/theme/BlogArchivePage/index.tsx +7 -2
- package/src/theme/BlogLayout/index.tsx +1 -1
- package/src/theme/BlogPostItem/Container/index.tsx +12 -3
- package/src/theme/BlogPostItem/Header/Author/index.tsx +6 -1
- package/src/theme/BlogPostPage/index.tsx +3 -1
- package/src/theme/BlogSidebar/Desktop/index.tsx +3 -1
- package/src/theme/BlogSidebar/Mobile/index.tsx +3 -1
- package/src/theme/BlogTagsListPage/index.tsx +2 -1
- package/src/theme/BlogTagsPostsPage/index.tsx +4 -2
- package/src/theme/CodeBlock/Content/String.tsx +11 -2
- package/src/theme/CodeBlock/CopyButton/index.tsx +0 -1
- package/src/theme/DocBreadcrumbs/index.tsx +6 -2
- package/src/theme/DocCard/index.tsx +11 -6
- package/src/theme/DocItem/Layout/index.tsx +5 -0
- package/src/theme/DocItem/index.tsx +1 -1
- package/src/theme/{DocPage → DocRoot}/Layout/Main/index.tsx +2 -2
- package/src/theme/{DocPage → DocRoot}/Layout/Sidebar/ExpandButton/index.tsx +2 -2
- package/src/theme/{DocPage → DocRoot}/Layout/Sidebar/index.tsx +3 -3
- package/src/theme/{DocPage → DocRoot}/Layout/index.tsx +10 -11
- package/src/theme/{DocPage → DocRoot}/Layout/styles.module.css +1 -2
- package/src/theme/DocRoot/index.tsx +34 -0
- package/src/theme/DocSidebarItem/Category/index.tsx +25 -12
- package/src/theme/DocSidebarItems/index.tsx +6 -4
- package/src/theme/DocTagDocListPage/index.tsx +60 -39
- package/src/theme/DocTagsListPage/index.tsx +33 -17
- package/src/theme/DocVersionRoot/index.tsx +51 -0
- package/src/theme/DocsRoot/index.tsx +22 -0
- package/src/theme/EditThisPage/index.tsx +3 -6
- package/src/theme/ErrorPageContent.tsx +3 -2
- package/src/theme/MDXComponents/Code.tsx +2 -39
- package/src/theme/MDXComponents/Details.tsx +1 -2
- package/src/theme/MDXComponents/Pre.tsx +5 -13
- package/src/theme/MDXComponents/Ul/index.tsx +5 -1
- package/src/theme/MDXComponents/index.tsx +11 -10
- package/src/theme/MDXPage/index.tsx +16 -4
- package/src/theme/NavbarItem/DocNavbarItem.tsx +4 -3
- package/src/theme/NavbarItem/LocaleDropdownNavbarItem/index.tsx +2 -1
- package/src/theme/NotFound/Content/index.tsx +45 -0
- package/src/theme/NotFound/index.tsx +27 -0
- package/src/theme/SiteMetadata/index.tsx +36 -3
- package/src/theme/SkipToContent/index.tsx +0 -1
- package/src/theme/TOCItems/Tree.tsx +3 -4
- package/src/theme/Tabs/index.tsx +4 -2
- package/src/theme/TagsListByLetter/index.tsx +4 -2
- package/src/theme/ThemedImage/index.tsx +8 -31
- package/src/theme/Unlisted/index.tsx +42 -0
- package/src/theme/prism-include-languages.ts +2 -1
- package/src/theme-classic.d.ts +146 -21
- package/lib/theme/DocPage/index.js +0 -67
- package/lib/theme/MDXComponents/Head.js +0 -23
- package/lib/theme/NotFound.js +0 -52
- package/src/theme/DocPage/index.tsx +0 -71
- package/src/theme/MDXComponents/Head.tsx +0 -29
- package/src/theme/NotFound.tsx +0 -54
- /package/lib/theme/{DocPage → DocRoot}/Layout/Main/styles.module.css +0 -0
- /package/lib/theme/{DocPage → DocRoot}/Layout/Sidebar/ExpandButton/styles.module.css +0 -0
- /package/lib/theme/{DocPage → DocRoot}/Layout/Sidebar/styles.module.css +0 -0
- /package/src/theme/{DocPage → DocRoot}/Layout/Main/styles.module.css +0 -0
- /package/src/theme/{DocPage → DocRoot}/Layout/Sidebar/ExpandButton/styles.module.css +0 -0
- /package/src/theme/{DocPage → DocRoot}/Layout/Sidebar/styles.module.css +0 -0
package/src/getSwizzleConfig.ts
CHANGED
|
@@ -12,6 +12,121 @@ import type {SwizzleConfig} from '@docusaurus/types';
|
|
|
12
12
|
export default function getSwizzleConfig(): SwizzleConfig {
|
|
13
13
|
return {
|
|
14
14
|
components: {
|
|
15
|
+
'Admonition/Icon': {
|
|
16
|
+
actions: {
|
|
17
|
+
eject: 'safe',
|
|
18
|
+
wrap: 'forbidden', // Can't wrap a folder
|
|
19
|
+
},
|
|
20
|
+
description: 'The folder containing all admonition icons',
|
|
21
|
+
},
|
|
22
|
+
'Admonition/Icon/Danger': {
|
|
23
|
+
actions: {
|
|
24
|
+
eject: 'safe',
|
|
25
|
+
wrap: 'safe',
|
|
26
|
+
},
|
|
27
|
+
description: 'The admonition danger icon',
|
|
28
|
+
},
|
|
29
|
+
'Admonition/Icon/Info': {
|
|
30
|
+
actions: {
|
|
31
|
+
eject: 'safe',
|
|
32
|
+
wrap: 'safe',
|
|
33
|
+
},
|
|
34
|
+
description: 'The admonition info icon',
|
|
35
|
+
},
|
|
36
|
+
'Admonition/Icon/Note': {
|
|
37
|
+
actions: {
|
|
38
|
+
eject: 'safe',
|
|
39
|
+
wrap: 'safe',
|
|
40
|
+
},
|
|
41
|
+
description: 'The admonition note icon',
|
|
42
|
+
},
|
|
43
|
+
'Admonition/Icon/Tip': {
|
|
44
|
+
actions: {
|
|
45
|
+
eject: 'safe',
|
|
46
|
+
wrap: 'safe',
|
|
47
|
+
},
|
|
48
|
+
description: 'The admonition tip icon',
|
|
49
|
+
},
|
|
50
|
+
'Admonition/Icon/Warning': {
|
|
51
|
+
actions: {
|
|
52
|
+
eject: 'safe',
|
|
53
|
+
wrap: 'safe',
|
|
54
|
+
},
|
|
55
|
+
description: 'The admonition warning icon',
|
|
56
|
+
},
|
|
57
|
+
'Admonition/Layout': {
|
|
58
|
+
actions: {
|
|
59
|
+
eject: 'safe',
|
|
60
|
+
wrap: 'safe',
|
|
61
|
+
},
|
|
62
|
+
description:
|
|
63
|
+
'The standard admonition layout applied to all default admonition types',
|
|
64
|
+
},
|
|
65
|
+
'Admonition/Type': {
|
|
66
|
+
actions: {
|
|
67
|
+
eject: 'safe',
|
|
68
|
+
wrap: 'forbidden',
|
|
69
|
+
},
|
|
70
|
+
description:
|
|
71
|
+
'The folder containing all the admonition type components.',
|
|
72
|
+
},
|
|
73
|
+
'Admonition/Type/Caution': {
|
|
74
|
+
actions: {
|
|
75
|
+
eject: 'safe',
|
|
76
|
+
wrap: 'safe',
|
|
77
|
+
},
|
|
78
|
+
description:
|
|
79
|
+
'The component responsible for rendering a :::caution admonition type',
|
|
80
|
+
},
|
|
81
|
+
'Admonition/Type/Danger': {
|
|
82
|
+
actions: {
|
|
83
|
+
eject: 'safe',
|
|
84
|
+
wrap: 'safe',
|
|
85
|
+
},
|
|
86
|
+
description:
|
|
87
|
+
'The component responsible for rendering a :::danger admonition type',
|
|
88
|
+
},
|
|
89
|
+
'Admonition/Type/Info': {
|
|
90
|
+
actions: {
|
|
91
|
+
eject: 'safe',
|
|
92
|
+
wrap: 'safe',
|
|
93
|
+
},
|
|
94
|
+
description:
|
|
95
|
+
'The component responsible for rendering a :::info admonition type',
|
|
96
|
+
},
|
|
97
|
+
'Admonition/Type/Note': {
|
|
98
|
+
actions: {
|
|
99
|
+
eject: 'safe',
|
|
100
|
+
wrap: 'safe',
|
|
101
|
+
},
|
|
102
|
+
description:
|
|
103
|
+
'The component responsible for rendering a :::note admonition type',
|
|
104
|
+
},
|
|
105
|
+
'Admonition/Type/Tip': {
|
|
106
|
+
actions: {
|
|
107
|
+
eject: 'safe',
|
|
108
|
+
wrap: 'safe',
|
|
109
|
+
},
|
|
110
|
+
description:
|
|
111
|
+
'The component responsible for rendering a :::tip admonition type',
|
|
112
|
+
},
|
|
113
|
+
'Admonition/Type/Warning': {
|
|
114
|
+
actions: {
|
|
115
|
+
eject: 'safe',
|
|
116
|
+
wrap: 'safe',
|
|
117
|
+
},
|
|
118
|
+
description:
|
|
119
|
+
'The component responsible for rendering a :::warning admonition type',
|
|
120
|
+
},
|
|
121
|
+
'Admonition/Types': {
|
|
122
|
+
actions: {
|
|
123
|
+
eject: 'safe',
|
|
124
|
+
// TODO the swizzle CLI should provide a way to wrap such objects
|
|
125
|
+
wrap: 'forbidden',
|
|
126
|
+
},
|
|
127
|
+
description:
|
|
128
|
+
'The object mapping admonition type to a React component.\nUse it to add custom admonition type components, or replace existing ones.\nCan be ejected or wrapped (only manually, see our documentation).',
|
|
129
|
+
},
|
|
15
130
|
CodeBlock: {
|
|
16
131
|
actions: {
|
|
17
132
|
eject: 'safe',
|
|
@@ -75,7 +190,7 @@ export default function getSwizzleConfig(): SwizzleConfig {
|
|
|
75
190
|
eject: 'safe',
|
|
76
191
|
wrap: 'safe',
|
|
77
192
|
},
|
|
78
|
-
description: "The footer component of
|
|
193
|
+
description: "The footer component of your site's layout",
|
|
79
194
|
},
|
|
80
195
|
'Footer/Copyright': {
|
|
81
196
|
actions: {
|
|
@@ -205,14 +320,6 @@ export default function getSwizzleConfig(): SwizzleConfig {
|
|
|
205
320
|
},
|
|
206
321
|
description: 'The component used to render <details> tags in MDX',
|
|
207
322
|
},
|
|
208
|
-
'MDXComponents/Head': {
|
|
209
|
-
actions: {
|
|
210
|
-
eject: 'forbidden',
|
|
211
|
-
wrap: 'forbidden',
|
|
212
|
-
},
|
|
213
|
-
description:
|
|
214
|
-
'Technical component used to assign metadata (generally for SEO purpose) to the current MDX document',
|
|
215
|
-
},
|
|
216
323
|
'MDXComponents/Heading': {
|
|
217
324
|
actions: {
|
|
218
325
|
eject: 'safe',
|
package/src/index.ts
CHANGED
|
@@ -26,7 +26,10 @@ const ContextReplacementPlugin = requireFromDocusaurusCore(
|
|
|
26
26
|
// Need to be inlined to prevent dark mode FOUC
|
|
27
27
|
// Make sure the key is the same as the one in `/theme/hooks/useTheme.js`
|
|
28
28
|
const ThemeStorageKey = 'theme';
|
|
29
|
+
// Support for ?docusaurus-theme=dark
|
|
29
30
|
const ThemeQueryStringKey = 'docusaurus-theme';
|
|
31
|
+
// Support for ?docusaurus-data-mode=embed&docusaurus-data-myAttr=42
|
|
32
|
+
const DataQueryStringPrefixKey = 'docusaurus-data-';
|
|
30
33
|
|
|
31
34
|
const noFlashColorMode = ({
|
|
32
35
|
defaultMode,
|
|
@@ -42,19 +45,15 @@ const noFlashColorMode = ({
|
|
|
42
45
|
}
|
|
43
46
|
|
|
44
47
|
function getQueryStringTheme() {
|
|
45
|
-
var theme = null;
|
|
46
48
|
try {
|
|
47
|
-
|
|
49
|
+
return new URLSearchParams(window.location.search).get('${ThemeQueryStringKey}')
|
|
48
50
|
} catch(e) {}
|
|
49
|
-
return theme;
|
|
50
51
|
}
|
|
51
52
|
|
|
52
53
|
function getStoredTheme() {
|
|
53
|
-
var theme = null;
|
|
54
54
|
try {
|
|
55
|
-
|
|
55
|
+
return localStorage.getItem('${ThemeStorageKey}');
|
|
56
56
|
} catch (err) {}
|
|
57
|
-
return theme;
|
|
58
57
|
}
|
|
59
58
|
|
|
60
59
|
var initialTheme = getQueryStringTheme() || getStoredTheme();
|
|
@@ -77,6 +76,21 @@ const noFlashColorMode = ({
|
|
|
77
76
|
}
|
|
78
77
|
})();`;
|
|
79
78
|
|
|
79
|
+
/* language=js */
|
|
80
|
+
const DataAttributeQueryStringInlineJavaScript = `
|
|
81
|
+
(function() {
|
|
82
|
+
try {
|
|
83
|
+
const entries = new URLSearchParams(window.location.search).entries();
|
|
84
|
+
for (var [searchKey, value] of entries) {
|
|
85
|
+
if (searchKey.startsWith('${DataQueryStringPrefixKey}')) {
|
|
86
|
+
var key = searchKey.replace('${DataQueryStringPrefixKey}',"data-")
|
|
87
|
+
document.documentElement.setAttribute(key, value);
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
} catch(e) {}
|
|
91
|
+
})();
|
|
92
|
+
`;
|
|
93
|
+
|
|
80
94
|
// Duplicated constant. Unfortunately we can't import it from theme-common, as
|
|
81
95
|
// we need to support older nodejs versions without ESM support
|
|
82
96
|
// TODO: import from theme-common once we only support Node.js with ESM support
|
|
@@ -205,6 +219,7 @@ export default function themeClassic(
|
|
|
205
219
|
tagName: 'script',
|
|
206
220
|
innerHTML: `
|
|
207
221
|
${noFlashColorMode(colorMode)}
|
|
222
|
+
${DataAttributeQueryStringInlineJavaScript}
|
|
208
223
|
${announcementBar ? AnnouncementBarInlineJavaScript : ''}
|
|
209
224
|
`,
|
|
210
225
|
},
|
package/src/nprogress.ts
CHANGED
package/src/options.ts
CHANGED
|
@@ -200,6 +200,7 @@ const LocaleDropdownNavbarItemSchema = NavbarItemBaseSchema.append({
|
|
|
200
200
|
type: Joi.string().equal('localeDropdown').required(),
|
|
201
201
|
dropdownItemsBefore: Joi.array().items(DropdownSubitemSchema).default([]),
|
|
202
202
|
dropdownItemsAfter: Joi.array().items(DropdownSubitemSchema).default([]),
|
|
203
|
+
queryString: Joi.string(),
|
|
203
204
|
});
|
|
204
205
|
|
|
205
206
|
const SearchItemSchema = Joi.object({
|
|
@@ -312,6 +313,10 @@ const LogoSchema = Joi.object({
|
|
|
312
313
|
className: Joi.string(),
|
|
313
314
|
});
|
|
314
315
|
|
|
316
|
+
// Normalize prism language to lowercase
|
|
317
|
+
// See https://github.com/facebook/docusaurus/issues/9012
|
|
318
|
+
const PrismLanguage = Joi.string().custom((val) => val.toLowerCase());
|
|
319
|
+
|
|
315
320
|
export const ThemeConfigSchema = Joi.object<ThemeConfig>({
|
|
316
321
|
// TODO temporary (@alpha-58)
|
|
317
322
|
// @ts-expect-error: forbidden
|
|
@@ -384,9 +389,9 @@ export const ThemeConfigSchema = Joi.object<ThemeConfig>({
|
|
|
384
389
|
plain: Joi.alternatives().try(Joi.array(), Joi.object()).required(),
|
|
385
390
|
styles: Joi.alternatives().try(Joi.array(), Joi.object()).required(),
|
|
386
391
|
}),
|
|
387
|
-
defaultLanguage:
|
|
392
|
+
defaultLanguage: PrismLanguage,
|
|
388
393
|
additionalLanguages: Joi.array()
|
|
389
|
-
.items(
|
|
394
|
+
.items(PrismLanguage)
|
|
390
395
|
.default(DEFAULT_CONFIG.prism.additionalLanguages),
|
|
391
396
|
magicComments: Joi.array()
|
|
392
397
|
.items(
|
|
@@ -0,0 +1,20 @@
|
|
|
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
|
+
import type {Props} from '@theme/Admonition/Icon/Danger';
|
|
10
|
+
|
|
11
|
+
export default function AdmonitionIconDanger(props: Props): JSX.Element {
|
|
12
|
+
return (
|
|
13
|
+
<svg viewBox="0 0 12 16" {...props}>
|
|
14
|
+
<path
|
|
15
|
+
fillRule="evenodd"
|
|
16
|
+
d="M5.05.31c.81 2.17.41 3.38-.52 4.31C3.55 5.67 1.98 6.45.9 7.98c-1.45 2.05-1.7 6.53 3.53 7.7-2.2-1.16-2.67-4.52-.3-6.61-.61 2.03.53 3.33 1.94 2.86 1.39-.47 2.3.53 2.27 1.67-.02.78-.31 1.44-1.13 1.81 3.42-.59 4.78-3.42 4.78-5.56 0-2.84-2.53-3.22-1.25-5.61-1.52.13-2.03 1.13-1.89 2.75.09 1.08-1.02 1.8-1.86 1.33-.67-.41-.66-1.19-.06-1.78C8.18 5.31 8.68 2.45 5.05.32L5.03.3l.02.01z"
|
|
17
|
+
/>
|
|
18
|
+
</svg>
|
|
19
|
+
);
|
|
20
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
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
|
+
import type {Props} from '@theme/Admonition/Icon/Info';
|
|
10
|
+
|
|
11
|
+
export default function AdmonitionIconInfo(props: Props): JSX.Element {
|
|
12
|
+
return (
|
|
13
|
+
<svg viewBox="0 0 14 16" {...props}>
|
|
14
|
+
<path
|
|
15
|
+
fillRule="evenodd"
|
|
16
|
+
d="M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"
|
|
17
|
+
/>
|
|
18
|
+
</svg>
|
|
19
|
+
);
|
|
20
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
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
|
+
import type {Props} from '@theme/Admonition/Icon/Note';
|
|
10
|
+
|
|
11
|
+
export default function AdmonitionIconNote(props: Props): JSX.Element {
|
|
12
|
+
return (
|
|
13
|
+
<svg viewBox="0 0 14 16" {...props}>
|
|
14
|
+
<path
|
|
15
|
+
fillRule="evenodd"
|
|
16
|
+
d="M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"
|
|
17
|
+
/>
|
|
18
|
+
</svg>
|
|
19
|
+
);
|
|
20
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
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
|
+
import type {Props} from '@theme/Admonition/Icon/Tip';
|
|
10
|
+
|
|
11
|
+
export default function AdmonitionIconTip(props: Props): JSX.Element {
|
|
12
|
+
return (
|
|
13
|
+
<svg viewBox="0 0 12 16" {...props}>
|
|
14
|
+
<path
|
|
15
|
+
fillRule="evenodd"
|
|
16
|
+
d="M6.5 0C3.48 0 1 2.19 1 5c0 .92.55 2.25 1 3 1.34 2.25 1.78 2.78 2 4v1h5v-1c.22-1.22.66-1.75 2-4 .45-.75 1-2.08 1-3 0-2.81-2.48-5-5.5-5zm3.64 7.48c-.25.44-.47.8-.67 1.11-.86 1.41-1.25 2.06-1.45 3.23-.02.05-.02.11-.02.17H5c0-.06 0-.13-.02-.17-.2-1.17-.59-1.83-1.45-3.23-.2-.31-.42-.67-.67-1.11C2.44 6.78 2 5.65 2 5c0-2.2 2.02-4 4.5-4 1.22 0 2.36.42 3.22 1.19C10.55 2.94 11 3.94 11 5c0 .66-.44 1.78-.86 2.48zM4 14h5c-.23 1.14-1.3 2-2.5 2s-2.27-.86-2.5-2z"
|
|
17
|
+
/>
|
|
18
|
+
</svg>
|
|
19
|
+
);
|
|
20
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
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
|
+
import type {Props} from '@theme/Admonition/Icon/Warning';
|
|
10
|
+
|
|
11
|
+
export default function AdmonitionIconCaution(props: Props): JSX.Element {
|
|
12
|
+
return (
|
|
13
|
+
<svg viewBox="0 0 16 16" {...props}>
|
|
14
|
+
<path
|
|
15
|
+
fillRule="evenodd"
|
|
16
|
+
d="M8.893 1.5c-.183-.31-.52-.5-.887-.5s-.703.19-.886.5L.138 13.499a.98.98 0 0 0 0 1.001c.193.31.53.501.886.501h13.964c.367 0 .704-.19.877-.5a1.03 1.03 0 0 0 .01-1.002L8.893 1.5zm.133 11.497H6.987v-2.003h2.039v2.003zm0-3.004H6.987V5.987h2.039v4.006z"
|
|
17
|
+
/>
|
|
18
|
+
</svg>
|
|
19
|
+
);
|
|
20
|
+
}
|
|
@@ -0,0 +1,57 @@
|
|
|
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, {type ReactNode} from 'react';
|
|
9
|
+
import clsx from 'clsx';
|
|
10
|
+
import {ThemeClassNames} from '@docusaurus/theme-common';
|
|
11
|
+
|
|
12
|
+
import type {Props} from '@theme/Admonition/Layout';
|
|
13
|
+
|
|
14
|
+
import styles from './styles.module.css';
|
|
15
|
+
|
|
16
|
+
function AdmonitionContainer({
|
|
17
|
+
type,
|
|
18
|
+
className,
|
|
19
|
+
children,
|
|
20
|
+
}: Pick<Props, 'type' | 'className'> & {children: ReactNode}) {
|
|
21
|
+
return (
|
|
22
|
+
<div
|
|
23
|
+
className={clsx(
|
|
24
|
+
ThemeClassNames.common.admonition,
|
|
25
|
+
ThemeClassNames.common.admonitionType(type),
|
|
26
|
+
styles.admonition,
|
|
27
|
+
className,
|
|
28
|
+
)}>
|
|
29
|
+
{children}
|
|
30
|
+
</div>
|
|
31
|
+
);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
function AdmonitionHeading({icon, title}: Pick<Props, 'icon' | 'title'>) {
|
|
35
|
+
return (
|
|
36
|
+
<div className={styles.admonitionHeading}>
|
|
37
|
+
<span className={styles.admonitionIcon}>{icon}</span>
|
|
38
|
+
{title}
|
|
39
|
+
</div>
|
|
40
|
+
);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
function AdmonitionContent({children}: Pick<Props, 'children'>) {
|
|
44
|
+
return children ? (
|
|
45
|
+
<div className={styles.admonitionContent}>{children}</div>
|
|
46
|
+
) : null;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export default function AdmonitionLayout(props: Props): JSX.Element {
|
|
50
|
+
const {type, icon, title, children, className} = props;
|
|
51
|
+
return (
|
|
52
|
+
<AdmonitionContainer type={type} className={className}>
|
|
53
|
+
<AdmonitionHeading title={title} icon={icon} />
|
|
54
|
+
<AdmonitionContent>{children}</AdmonitionContent>
|
|
55
|
+
</AdmonitionContainer>
|
|
56
|
+
);
|
|
57
|
+
}
|
|
@@ -13,6 +13,10 @@
|
|
|
13
13
|
font: var(--ifm-heading-font-weight) var(--ifm-h5-font-size) /
|
|
14
14
|
var(--ifm-heading-line-height) var(--ifm-heading-font-family);
|
|
15
15
|
text-transform: uppercase;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
/* Heading alone without content (does not handle fragment content) */
|
|
19
|
+
.admonitionHeading:not(:last-child) {
|
|
16
20
|
margin-bottom: 0.3rem;
|
|
17
21
|
}
|
|
18
22
|
|
|
@@ -0,0 +1,39 @@
|
|
|
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
|
+
import clsx from 'clsx';
|
|
10
|
+
import Translate from '@docusaurus/Translate';
|
|
11
|
+
import type {Props} from '@theme/Admonition/Type/Caution';
|
|
12
|
+
import AdmonitionLayout from '@theme/Admonition/Layout';
|
|
13
|
+
import IconWarning from '@theme/Admonition/Icon/Warning';
|
|
14
|
+
|
|
15
|
+
const infimaClassName = 'alert alert--warning';
|
|
16
|
+
|
|
17
|
+
const defaultProps = {
|
|
18
|
+
icon: <IconWarning />,
|
|
19
|
+
title: (
|
|
20
|
+
<Translate
|
|
21
|
+
id="theme.admonition.caution"
|
|
22
|
+
description="The default label used for the Caution admonition (:::caution)">
|
|
23
|
+
caution
|
|
24
|
+
</Translate>
|
|
25
|
+
),
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
// TODO remove before v4: Caution replaced by Warning
|
|
29
|
+
// see https://github.com/facebook/docusaurus/issues/7558
|
|
30
|
+
export default function AdmonitionTypeCaution(props: Props): JSX.Element {
|
|
31
|
+
return (
|
|
32
|
+
<AdmonitionLayout
|
|
33
|
+
{...defaultProps}
|
|
34
|
+
{...props}
|
|
35
|
+
className={clsx(infimaClassName, props.className)}>
|
|
36
|
+
{props.children}
|
|
37
|
+
</AdmonitionLayout>
|
|
38
|
+
);
|
|
39
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
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
|
+
import clsx from 'clsx';
|
|
10
|
+
import Translate from '@docusaurus/Translate';
|
|
11
|
+
import type {Props} from '@theme/Admonition/Type/Danger';
|
|
12
|
+
import AdmonitionLayout from '@theme/Admonition/Layout';
|
|
13
|
+
import IconDanger from '@theme/Admonition/Icon/Danger';
|
|
14
|
+
|
|
15
|
+
const infimaClassName = 'alert alert--danger';
|
|
16
|
+
|
|
17
|
+
const defaultProps = {
|
|
18
|
+
icon: <IconDanger />,
|
|
19
|
+
title: (
|
|
20
|
+
<Translate
|
|
21
|
+
id="theme.admonition.danger"
|
|
22
|
+
description="The default label used for the Danger admonition (:::danger)">
|
|
23
|
+
danger
|
|
24
|
+
</Translate>
|
|
25
|
+
),
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
export default function AdmonitionTypeDanger(props: Props): JSX.Element {
|
|
29
|
+
return (
|
|
30
|
+
<AdmonitionLayout
|
|
31
|
+
{...defaultProps}
|
|
32
|
+
{...props}
|
|
33
|
+
className={clsx(infimaClassName, props.className)}>
|
|
34
|
+
{props.children}
|
|
35
|
+
</AdmonitionLayout>
|
|
36
|
+
);
|
|
37
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
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
|
+
import clsx from 'clsx';
|
|
10
|
+
import Translate from '@docusaurus/Translate';
|
|
11
|
+
import type {Props} from '@theme/Admonition/Type/Info';
|
|
12
|
+
import AdmonitionLayout from '@theme/Admonition/Layout';
|
|
13
|
+
import IconInfo from '@theme/Admonition/Icon/Info';
|
|
14
|
+
|
|
15
|
+
const infimaClassName = 'alert alert--info';
|
|
16
|
+
|
|
17
|
+
const defaultProps = {
|
|
18
|
+
icon: <IconInfo />,
|
|
19
|
+
title: (
|
|
20
|
+
<Translate
|
|
21
|
+
id="theme.admonition.info"
|
|
22
|
+
description="The default label used for the Info admonition (:::info)">
|
|
23
|
+
info
|
|
24
|
+
</Translate>
|
|
25
|
+
),
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
export default function AdmonitionTypeInfo(props: Props): JSX.Element {
|
|
29
|
+
return (
|
|
30
|
+
<AdmonitionLayout
|
|
31
|
+
{...defaultProps}
|
|
32
|
+
{...props}
|
|
33
|
+
className={clsx(infimaClassName, props.className)}>
|
|
34
|
+
{props.children}
|
|
35
|
+
</AdmonitionLayout>
|
|
36
|
+
);
|
|
37
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
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
|
+
import clsx from 'clsx';
|
|
10
|
+
import Translate from '@docusaurus/Translate';
|
|
11
|
+
import type {Props} from '@theme/Admonition/Type/Note';
|
|
12
|
+
import AdmonitionLayout from '@theme/Admonition/Layout';
|
|
13
|
+
import IconNote from '@theme/Admonition/Icon/Note';
|
|
14
|
+
|
|
15
|
+
const infimaClassName = 'alert alert--secondary';
|
|
16
|
+
|
|
17
|
+
const defaultProps = {
|
|
18
|
+
icon: <IconNote />,
|
|
19
|
+
title: (
|
|
20
|
+
<Translate
|
|
21
|
+
id="theme.admonition.note"
|
|
22
|
+
description="The default label used for the Note admonition (:::note)">
|
|
23
|
+
note
|
|
24
|
+
</Translate>
|
|
25
|
+
),
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
export default function AdmonitionTypeNote(props: Props): JSX.Element {
|
|
29
|
+
return (
|
|
30
|
+
<AdmonitionLayout
|
|
31
|
+
{...defaultProps}
|
|
32
|
+
{...props}
|
|
33
|
+
className={clsx(infimaClassName, props.className)}>
|
|
34
|
+
{props.children}
|
|
35
|
+
</AdmonitionLayout>
|
|
36
|
+
);
|
|
37
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
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
|
+
import clsx from 'clsx';
|
|
10
|
+
import Translate from '@docusaurus/Translate';
|
|
11
|
+
import type {Props} from '@theme/Admonition/Type/Tip';
|
|
12
|
+
import AdmonitionLayout from '@theme/Admonition/Layout';
|
|
13
|
+
import IconTip from '@theme/Admonition/Icon/Tip';
|
|
14
|
+
|
|
15
|
+
const infimaClassName = 'alert alert--success';
|
|
16
|
+
|
|
17
|
+
const defaultProps = {
|
|
18
|
+
icon: <IconTip />,
|
|
19
|
+
title: (
|
|
20
|
+
<Translate
|
|
21
|
+
id="theme.admonition.tip"
|
|
22
|
+
description="The default label used for the Tip admonition (:::tip)">
|
|
23
|
+
tip
|
|
24
|
+
</Translate>
|
|
25
|
+
),
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
export default function AdmonitionTypeTip(props: Props): JSX.Element {
|
|
29
|
+
return (
|
|
30
|
+
<AdmonitionLayout
|
|
31
|
+
{...defaultProps}
|
|
32
|
+
{...props}
|
|
33
|
+
className={clsx(infimaClassName, props.className)}>
|
|
34
|
+
{props.children}
|
|
35
|
+
</AdmonitionLayout>
|
|
36
|
+
);
|
|
37
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
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
|
+
import clsx from 'clsx';
|
|
10
|
+
import Translate from '@docusaurus/Translate';
|
|
11
|
+
import type {Props} from '@theme/Admonition/Type/Warning';
|
|
12
|
+
import AdmonitionLayout from '@theme/Admonition/Layout';
|
|
13
|
+
import IconWarning from '@theme/Admonition/Icon/Warning';
|
|
14
|
+
|
|
15
|
+
const infimaClassName = 'alert alert--warning';
|
|
16
|
+
|
|
17
|
+
const defaultProps = {
|
|
18
|
+
icon: <IconWarning />,
|
|
19
|
+
title: (
|
|
20
|
+
<Translate
|
|
21
|
+
id="theme.admonition.warning"
|
|
22
|
+
description="The default label used for the Warning admonition (:::warning)">
|
|
23
|
+
warning
|
|
24
|
+
</Translate>
|
|
25
|
+
),
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
export default function AdmonitionTypeWarning(props: Props): JSX.Element {
|
|
29
|
+
return (
|
|
30
|
+
<AdmonitionLayout
|
|
31
|
+
{...defaultProps}
|
|
32
|
+
{...props}
|
|
33
|
+
className={clsx(infimaClassName, props.className)}>
|
|
34
|
+
{props.children}
|
|
35
|
+
</AdmonitionLayout>
|
|
36
|
+
);
|
|
37
|
+
}
|