@docusaurus/core 0.0.0-4735 → 0.0.0-4738
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/client/App.js +4 -0
- package/lib/client/SiteMetadataDefaults.d.ts +8 -0
- package/lib/client/SiteMetadataDefaults.js +19 -0
- package/lib/client/exports/ComponentCreator.js +1 -1
- package/lib/client/exports/Link.d.ts +1 -1
- package/lib/client/theme-fallback/Error/index.js +5 -1
- package/lib/client/theme-fallback/Layout/index.d.ts +1 -1
- package/lib/client/theme-fallback/Layout/index.js +2 -17
- package/lib/client/theme-fallback/NotFound/index.js +11 -5
- package/lib/client/theme-fallback/Root/index.d.ts +4 -4
- package/lib/client/theme-fallback/SiteMetadata/index.d.ts +8 -0
- package/lib/client/theme-fallback/SiteMetadata/index.js +10 -0
- package/package.json +10 -10
package/lib/client/App.js
CHANGED
|
@@ -11,7 +11,9 @@ import { BrowserContextProvider } from './exports/browserContext';
|
|
|
11
11
|
import { DocusaurusContextProvider } from './exports/docusaurusContext';
|
|
12
12
|
import PendingNavigation from './PendingNavigation';
|
|
13
13
|
import BaseUrlIssueBanner from './baseUrlIssueBanner/BaseUrlIssueBanner';
|
|
14
|
+
import SiteMetadataDefaults from './SiteMetadataDefaults';
|
|
14
15
|
import Root from '@theme/Root';
|
|
16
|
+
import SiteMetadata from '@theme/SiteMetadata';
|
|
15
17
|
import './client-lifecycles-dispatcher';
|
|
16
18
|
// TODO, quick fix for CSS insertion order
|
|
17
19
|
import ErrorBoundary from '@docusaurus/ErrorBoundary';
|
|
@@ -21,6 +23,8 @@ export default function App() {
|
|
|
21
23
|
<DocusaurusContextProvider>
|
|
22
24
|
<BrowserContextProvider>
|
|
23
25
|
<Root>
|
|
26
|
+
<SiteMetadataDefaults />
|
|
27
|
+
<SiteMetadata />
|
|
24
28
|
<BaseUrlIssueBanner />
|
|
25
29
|
<PendingNavigation routes={routes} delay={1000}>
|
|
26
30
|
{renderRoutes(routes)}
|
|
@@ -0,0 +1,8 @@
|
|
|
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
|
+
/// <reference types="react" />
|
|
8
|
+
export default function SiteMetadataDefaults(): JSX.Element;
|
|
@@ -0,0 +1,19 @@
|
|
|
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
|
+
import React from 'react';
|
|
8
|
+
import Head from '@docusaurus/Head';
|
|
9
|
+
import useDocusaurusContext from '@docusaurus/useDocusaurusContext';
|
|
10
|
+
import useBaseUrl from '@docusaurus/useBaseUrl';
|
|
11
|
+
export default function SiteMetadataDefaults() {
|
|
12
|
+
const { siteConfig: { favicon, tagline, title }, i18n: { currentLocale, localeConfigs }, } = useDocusaurusContext();
|
|
13
|
+
const faviconUrl = useBaseUrl(favicon);
|
|
14
|
+
const { htmlLang, direction: htmlDir } = localeConfigs[currentLocale];
|
|
15
|
+
return (<Head defaultTitle={`${title}${tagline ? ` · ${tagline}` : ''}`}>
|
|
16
|
+
<html lang={htmlLang} dir={htmlDir}/>
|
|
17
|
+
{favicon && <link rel="icon" href={faviconUrl}/>}
|
|
18
|
+
</Head>);
|
|
19
|
+
}
|
|
@@ -85,7 +85,7 @@ export default function ComponentCreator(path, hash) {
|
|
|
85
85
|
/* eslint-enable no-underscore-dangle */
|
|
86
86
|
// Is there any way to put this RouteContextProvider upper in the tree?
|
|
87
87
|
return (<RouteContextProvider value={routeContextModule}>
|
|
88
|
-
<Component {...loadedModules} {...props}
|
|
88
|
+
<Component {...loadedModules} {...props}/>
|
|
89
89
|
</RouteContextProvider>);
|
|
90
90
|
},
|
|
91
91
|
});
|
|
@@ -19,5 +19,5 @@ declare const _default: React.ForwardRefExoticComponent<Pick<Partial<import("rea
|
|
|
19
19
|
readonly href?: string | undefined;
|
|
20
20
|
readonly autoAddBaseUrl?: boolean | undefined;
|
|
21
21
|
readonly 'data-noBrokenLinkCheck'?: boolean | undefined;
|
|
22
|
-
}, "children" | "replace" | "slot" | "style" | "title" | "location" | "component" | "exact" | "sensitive" | "strict" | "id" | "dir" | "rel" | "href" | "key" | "type" | "isNavLink" | "className" | "to" | "innerRef" | "download" | "hrefLang" | "media" | "ping" | "target" | "referrerPolicy" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "draggable" | "hidden" | "
|
|
22
|
+
}, "children" | "replace" | "slot" | "style" | "title" | "location" | "component" | "exact" | "sensitive" | "strict" | "id" | "lang" | "dir" | "rel" | "href" | "key" | "type" | "isNavLink" | "className" | "to" | "innerRef" | "download" | "hrefLang" | "media" | "ping" | "target" | "referrerPolicy" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "draggable" | "hidden" | "placeholder" | "spellCheck" | "tabIndex" | "translate" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "color" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "activeClassName" | "activeStyle" | "isActive" | "data-noBrokenLinkCheck" | "autoAddBaseUrl"> & React.RefAttributes<HTMLAnchorElement>>;
|
|
23
23
|
export default _default;
|
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
import React from 'react';
|
|
8
8
|
import Layout from '@theme/Layout';
|
|
9
9
|
import ErrorBoundary from '@docusaurus/ErrorBoundary';
|
|
10
|
+
import Head from '@docusaurus/Head';
|
|
10
11
|
function ErrorDisplay({ error, tryAgain }) {
|
|
11
12
|
return (<div style={{
|
|
12
13
|
display: 'flex',
|
|
@@ -32,7 +33,10 @@ export default function Error({ error, tryAgain }) {
|
|
|
32
33
|
// Note: we display the original error here, not the error that we
|
|
33
34
|
// captured in this extra error boundary
|
|
34
35
|
fallback={() => <ErrorDisplay error={error} tryAgain={tryAgain}/>}>
|
|
35
|
-
<
|
|
36
|
+
<Head>
|
|
37
|
+
<title>Page Error</title>
|
|
38
|
+
</Head>
|
|
39
|
+
<Layout>
|
|
36
40
|
<ErrorDisplay error={error} tryAgain={tryAgain}/>
|
|
37
41
|
</Layout>
|
|
38
42
|
</ErrorBoundary>);
|
|
@@ -7,4 +7,4 @@
|
|
|
7
7
|
/// <reference types="@docusaurus/module-type-aliases" />
|
|
8
8
|
/// <reference types="react" />
|
|
9
9
|
import type { Props } from '@theme/Layout';
|
|
10
|
-
export default function Layout({ children
|
|
10
|
+
export default function Layout({ children }: Props): JSX.Element;
|
|
@@ -5,21 +5,6 @@
|
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*/
|
|
7
7
|
import React from 'react';
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
import useBaseUrl from '@docusaurus/useBaseUrl';
|
|
11
|
-
export default function Layout({ children, title, description, }) {
|
|
12
|
-
const context = useDocusaurusContext();
|
|
13
|
-
const { siteConfig } = context;
|
|
14
|
-
const { favicon, tagline, title: defaultTitle } = siteConfig;
|
|
15
|
-
const faviconUrl = useBaseUrl(favicon);
|
|
16
|
-
return (<>
|
|
17
|
-
<Head defaultTitle={`${defaultTitle}${tagline ? ` · ${tagline}` : ''}`}>
|
|
18
|
-
{title && <title>{`${title} · ${tagline}`}</title>}
|
|
19
|
-
{favicon && <link rel="icon" href={faviconUrl}/>}
|
|
20
|
-
{description && <meta name="description" content={description}/>}
|
|
21
|
-
{description && (<meta property="og:description" content={description}/>)}
|
|
22
|
-
</Head>
|
|
23
|
-
{children}
|
|
24
|
-
</>);
|
|
8
|
+
export default function Layout({ children }) {
|
|
9
|
+
return <>{children}</>;
|
|
25
10
|
}
|
|
@@ -6,16 +6,22 @@
|
|
|
6
6
|
*/
|
|
7
7
|
import React from 'react';
|
|
8
8
|
import Layout from '@theme/Layout';
|
|
9
|
+
import Head from '@docusaurus/Head';
|
|
9
10
|
export default function NotFound() {
|
|
10
|
-
return (
|
|
11
|
-
<
|
|
11
|
+
return (<>
|
|
12
|
+
<Head>
|
|
13
|
+
<title>Page Not Found</title>
|
|
14
|
+
</Head>
|
|
15
|
+
<Layout>
|
|
16
|
+
<div style={{
|
|
12
17
|
display: 'flex',
|
|
13
18
|
justifyContent: 'center',
|
|
14
19
|
alignItems: 'center',
|
|
15
20
|
height: '50vh',
|
|
16
21
|
fontSize: '20px',
|
|
17
22
|
}}>
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
23
|
+
<h1>Oops, page not found </h1>
|
|
24
|
+
</div>
|
|
25
|
+
</Layout>
|
|
26
|
+
</>);
|
|
21
27
|
}
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* This source code is licensed under the MIT license found in the
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*/
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
}): JSX.Element;
|
|
7
|
+
/// <reference types="@docusaurus/module-type-aliases" />
|
|
8
|
+
/// <reference types="react" />
|
|
9
|
+
import type { Props } from '@theme/Root';
|
|
10
|
+
export default function Root({ children }: Props): JSX.Element;
|
|
@@ -0,0 +1,8 @@
|
|
|
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
|
+
/// <reference types="react" />
|
|
8
|
+
export default function SiteMetadata(): JSX.Element | null;
|
|
@@ -0,0 +1,10 @@
|
|
|
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
|
+
// To be implemented by the theme with <Head>
|
|
8
|
+
export default function SiteMetadata() {
|
|
9
|
+
return null;
|
|
10
|
+
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@docusaurus/core",
|
|
3
3
|
"description": "Easy to Maintain Open Source Documentation Websites",
|
|
4
|
-
"version": "0.0.0-
|
|
4
|
+
"version": "0.0.0-4738",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"publishConfig": {
|
|
7
7
|
"access": "public"
|
|
@@ -41,13 +41,13 @@
|
|
|
41
41
|
"@babel/runtime": "^7.17.7",
|
|
42
42
|
"@babel/runtime-corejs3": "^7.17.7",
|
|
43
43
|
"@babel/traverse": "^7.17.3",
|
|
44
|
-
"@docusaurus/cssnano-preset": "0.0.0-
|
|
45
|
-
"@docusaurus/logger": "0.0.0-
|
|
46
|
-
"@docusaurus/mdx-loader": "0.0.0-
|
|
44
|
+
"@docusaurus/cssnano-preset": "0.0.0-4738",
|
|
45
|
+
"@docusaurus/logger": "0.0.0-4738",
|
|
46
|
+
"@docusaurus/mdx-loader": "0.0.0-4738",
|
|
47
47
|
"@docusaurus/react-loadable": "5.5.2",
|
|
48
|
-
"@docusaurus/utils": "0.0.0-
|
|
49
|
-
"@docusaurus/utils-common": "0.0.0-
|
|
50
|
-
"@docusaurus/utils-validation": "0.0.0-
|
|
48
|
+
"@docusaurus/utils": "0.0.0-4738",
|
|
49
|
+
"@docusaurus/utils-common": "0.0.0-4738",
|
|
50
|
+
"@docusaurus/utils-validation": "0.0.0-4738",
|
|
51
51
|
"@slorber/static-site-generator-webpack-plugin": "^4.0.1",
|
|
52
52
|
"@svgr/webpack": "^6.2.1",
|
|
53
53
|
"autoprefixer": "^10.4.2",
|
|
@@ -106,8 +106,8 @@
|
|
|
106
106
|
"webpackbar": "^5.0.2"
|
|
107
107
|
},
|
|
108
108
|
"devDependencies": {
|
|
109
|
-
"@docusaurus/module-type-aliases": "0.0.0-
|
|
110
|
-
"@docusaurus/types": "0.0.0-
|
|
109
|
+
"@docusaurus/module-type-aliases": "0.0.0-4738",
|
|
110
|
+
"@docusaurus/types": "0.0.0-4738",
|
|
111
111
|
"@types/detect-port": "^1.3.2",
|
|
112
112
|
"@types/nprogress": "^0.2.0",
|
|
113
113
|
"@types/react-dom": "^17.0.13",
|
|
@@ -128,5 +128,5 @@
|
|
|
128
128
|
"engines": {
|
|
129
129
|
"node": ">=14"
|
|
130
130
|
},
|
|
131
|
-
"gitHead": "
|
|
131
|
+
"gitHead": "a9c78632ceba2532982c6b12e97de11b055e6c45"
|
|
132
132
|
}
|