@docusaurus/theme-classic 4.0.0-canary-6913 → 4.0.0-canary-6920
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.
|
@@ -5,25 +5,35 @@
|
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*/
|
|
7
7
|
import Translate from '@docusaurus/Translate';
|
|
8
|
-
import {
|
|
8
|
+
import {
|
|
9
|
+
ErrorBoundaryError,
|
|
10
|
+
ErrorBoundaryTryAgainButton,
|
|
11
|
+
} from '@docusaurus/theme-common';
|
|
9
12
|
import Heading from '@theme/Heading';
|
|
10
|
-
export default function ErrorPageContent({
|
|
11
|
-
|
|
13
|
+
export default function ErrorPageContent({error, tryAgain}) {
|
|
14
|
+
return (
|
|
15
|
+
<main className="container margin-vert--xl">
|
|
12
16
|
<div className="row">
|
|
13
17
|
<div className="col col--6 col--offset-3">
|
|
14
18
|
<Heading as="h1" className="hero__title">
|
|
15
|
-
<Translate
|
|
19
|
+
<Translate
|
|
20
|
+
id="theme.ErrorPageContent.title"
|
|
21
|
+
description="The title of the fallback page when the page crashed">
|
|
16
22
|
This page crashed.
|
|
17
23
|
</Translate>
|
|
18
24
|
</Heading>
|
|
19
25
|
<div className="margin-vert--lg">
|
|
20
|
-
<ErrorBoundaryTryAgainButton
|
|
26
|
+
<ErrorBoundaryTryAgainButton
|
|
27
|
+
onClick={tryAgain}
|
|
28
|
+
className="button button--primary shadow--lw"
|
|
29
|
+
/>
|
|
21
30
|
</div>
|
|
22
31
|
<hr />
|
|
23
32
|
<div className="margin-vert--md">
|
|
24
|
-
<ErrorBoundaryError error={error}/>
|
|
33
|
+
<ErrorBoundaryError error={error} />
|
|
25
34
|
</div>
|
|
26
35
|
</div>
|
|
27
36
|
</div>
|
|
28
|
-
</main>
|
|
37
|
+
</main>
|
|
38
|
+
);
|
|
29
39
|
}
|
package/lib/theme/Mermaid.js
CHANGED
|
@@ -10,4 +10,4 @@
|
|
|
10
10
|
// Yet we declare it there so that we can register it in MDX
|
|
11
11
|
// TODO later the mermaid theme should be able to register its MDX component
|
|
12
12
|
// see https://github.com/facebook/docusaurus/pull/7490#issuecomment-1279117288
|
|
13
|
-
export {
|
|
13
|
+
export {default} from '@docusaurus/Noop';
|
package/lib/theme/SearchBar.js
CHANGED
|
@@ -8,4 +8,4 @@
|
|
|
8
8
|
// If you swizzled this, it is your responsibility to provide an implementation
|
|
9
9
|
// Tip: swizzle the SearchBar from the Algolia theme for inspiration:
|
|
10
10
|
// npm run swizzle @docusaurus/theme-search-algolia SearchBar
|
|
11
|
-
export {
|
|
11
|
+
export {default} from '@docusaurus/Noop';
|
|
@@ -6,27 +6,29 @@
|
|
|
6
6
|
*/
|
|
7
7
|
import siteConfig from '@generated/docusaurus.config';
|
|
8
8
|
export default function prismIncludeLanguages(PrismObject) {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
require(`prismjs/components/prism-${lang}`);
|
|
26
|
-
});
|
|
27
|
-
// Clean up and eventually restore former globalThis.Prism object (if any)
|
|
28
|
-
delete globalThis.Prism;
|
|
29
|
-
if (typeof PrismBefore !== 'undefined') {
|
|
30
|
-
globalThis.Prism = PrismObject;
|
|
9
|
+
const {
|
|
10
|
+
themeConfig: {prism},
|
|
11
|
+
} = siteConfig;
|
|
12
|
+
const {additionalLanguages} = prism;
|
|
13
|
+
// Prism components work on the Prism instance on the window, while prism-
|
|
14
|
+
// react-renderer uses its own Prism instance. We temporarily mount the
|
|
15
|
+
// instance onto window, import components to enhance it, then remove it to
|
|
16
|
+
// avoid polluting global namespace.
|
|
17
|
+
// You can mutate PrismObject: registering plugins, deleting languages... As
|
|
18
|
+
// long as you don't re-assign it
|
|
19
|
+
const PrismBefore = globalThis.Prism;
|
|
20
|
+
globalThis.Prism = PrismObject;
|
|
21
|
+
additionalLanguages.forEach((lang) => {
|
|
22
|
+
if (lang === 'php') {
|
|
23
|
+
// eslint-disable-next-line @typescript-eslint/no-require-imports
|
|
24
|
+
require('prismjs/components/prism-markup-templating.js');
|
|
31
25
|
}
|
|
26
|
+
// eslint-disable-next-line @typescript-eslint/no-require-imports
|
|
27
|
+
require(`prismjs/components/prism-${lang}`);
|
|
28
|
+
});
|
|
29
|
+
// Clean up and eventually restore former globalThis.Prism object (if any)
|
|
30
|
+
delete globalThis.Prism;
|
|
31
|
+
if (typeof PrismBefore !== 'undefined') {
|
|
32
|
+
globalThis.Prism = PrismObject;
|
|
33
|
+
}
|
|
32
34
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@docusaurus/theme-classic",
|
|
3
|
-
"version": "4.0.0-canary-
|
|
3
|
+
"version": "4.0.0-canary-6920",
|
|
4
4
|
"description": "Classic theme for Docusaurus",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"types": "src/theme-classic.d.ts",
|
|
@@ -14,24 +14,24 @@
|
|
|
14
14
|
},
|
|
15
15
|
"license": "MIT",
|
|
16
16
|
"scripts": {
|
|
17
|
-
"build": "tsc --build && copy-untyped-files &&
|
|
17
|
+
"build": "tsc --build && copy-untyped-files && format-gitignored-files \"lib/theme/**/*.js\"",
|
|
18
18
|
"watch": "run-p -c copy:watch build:watch",
|
|
19
19
|
"build:watch": "tsc --build --watch",
|
|
20
20
|
"copy:watch": "copy-untyped-files --watch"
|
|
21
21
|
},
|
|
22
22
|
"dependencies": {
|
|
23
|
-
"@docusaurus/core": "4.0.0-canary-
|
|
24
|
-
"@docusaurus/mdx-loader": "4.0.0-canary-
|
|
25
|
-
"@docusaurus/module-type-aliases": "4.0.0-canary-
|
|
26
|
-
"@docusaurus/plugin-content-blog": "4.0.0-canary-
|
|
27
|
-
"@docusaurus/plugin-content-docs": "4.0.0-canary-
|
|
28
|
-
"@docusaurus/plugin-content-pages": "4.0.0-canary-
|
|
29
|
-
"@docusaurus/theme-common": "4.0.0-canary-
|
|
30
|
-
"@docusaurus/theme-translations": "4.0.0-canary-
|
|
31
|
-
"@docusaurus/types": "4.0.0-canary-
|
|
32
|
-
"@docusaurus/utils": "4.0.0-canary-
|
|
33
|
-
"@docusaurus/utils-common": "4.0.0-canary-
|
|
34
|
-
"@docusaurus/utils-validation": "4.0.0-canary-
|
|
23
|
+
"@docusaurus/core": "4.0.0-canary-6920",
|
|
24
|
+
"@docusaurus/mdx-loader": "4.0.0-canary-6920",
|
|
25
|
+
"@docusaurus/module-type-aliases": "4.0.0-canary-6920",
|
|
26
|
+
"@docusaurus/plugin-content-blog": "4.0.0-canary-6920",
|
|
27
|
+
"@docusaurus/plugin-content-docs": "4.0.0-canary-6920",
|
|
28
|
+
"@docusaurus/plugin-content-pages": "4.0.0-canary-6920",
|
|
29
|
+
"@docusaurus/theme-common": "4.0.0-canary-6920",
|
|
30
|
+
"@docusaurus/theme-translations": "4.0.0-canary-6920",
|
|
31
|
+
"@docusaurus/types": "4.0.0-canary-6920",
|
|
32
|
+
"@docusaurus/utils": "4.0.0-canary-6920",
|
|
33
|
+
"@docusaurus/utils-common": "4.0.0-canary-6920",
|
|
34
|
+
"@docusaurus/utils-validation": "4.0.0-canary-6920",
|
|
35
35
|
"@mdx-js/react": "^3.1.1",
|
|
36
36
|
"clsx": "^2.1.1",
|
|
37
37
|
"copy-text-to-clipboard": "^3.2.2",
|
|
@@ -58,5 +58,5 @@
|
|
|
58
58
|
"engines": {
|
|
59
59
|
"node": ">=24.21"
|
|
60
60
|
},
|
|
61
|
-
"gitHead": "
|
|
61
|
+
"gitHead": "ac8fb402a42d544a64148417a93c375edc88e15a"
|
|
62
62
|
}
|