@docusaurus/core 0.0.0-4919 → 0.0.0-4924
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/bin/docusaurus.mjs +18 -67
- package/lib/client/App.d.ts +1 -1
- package/lib/client/App.js +2 -2
- package/lib/client/ClientLifecyclesDispatcher.d.ts +16 -0
- package/lib/client/ClientLifecyclesDispatcher.js +34 -0
- package/lib/client/PendingNavigation.d.ts +1 -6
- package/lib/client/PendingNavigation.js +17 -40
- package/lib/commands/build.d.ts +1 -1
- package/lib/commands/build.js +1 -1
- package/lib/commands/clear.d.ts +1 -1
- package/lib/commands/clear.js +1 -1
- package/lib/commands/deploy.d.ts +1 -1
- package/lib/commands/deploy.js +1 -1
- package/lib/commands/serve.d.ts +1 -1
- package/lib/commands/serve.js +4 -2
- package/lib/commands/writeHeadingIds.d.ts +1 -1
- package/lib/commands/writeTranslations.d.ts +2 -2
- package/package.json +10 -12
- package/lib/client/clientLifecyclesDispatcher.d.ts +0 -9
- package/lib/client/clientLifecyclesDispatcher.js +0 -23
- package/lib/client/nprogress.css +0 -36
package/bin/docusaurus.mjs
CHANGED
|
@@ -54,14 +54,8 @@ cli
|
|
|
54
54
|
'--no-minify',
|
|
55
55
|
'build website without minimizing JS bundles (default: false)',
|
|
56
56
|
)
|
|
57
|
-
.action(async (siteDir,
|
|
58
|
-
build(await resolveDir(siteDir),
|
|
59
|
-
bundleAnalyzer,
|
|
60
|
-
outDir,
|
|
61
|
-
config,
|
|
62
|
-
locale,
|
|
63
|
-
minify,
|
|
64
|
-
});
|
|
57
|
+
.action(async (siteDir, options) => {
|
|
58
|
+
build(await resolveDir(siteDir), options);
|
|
65
59
|
});
|
|
66
60
|
|
|
67
61
|
cli
|
|
@@ -86,9 +80,9 @@ cli
|
|
|
86
80
|
'copy TypeScript theme files when possible (default: false)',
|
|
87
81
|
)
|
|
88
82
|
.option('--danger', 'enable swizzle for unsafe component of themes')
|
|
89
|
-
.action(async (themeName, componentName, siteDir, options) =>
|
|
90
|
-
swizzle(await resolveDir(siteDir), themeName, componentName, options)
|
|
91
|
-
|
|
83
|
+
.action(async (themeName, componentName, siteDir, options) =>
|
|
84
|
+
swizzle(await resolveDir(siteDir), themeName, componentName, options),
|
|
85
|
+
);
|
|
92
86
|
|
|
93
87
|
cli
|
|
94
88
|
.command('deploy [siteDir]')
|
|
@@ -109,13 +103,9 @@ cli
|
|
|
109
103
|
'--skip-build',
|
|
110
104
|
'skip building website before deploy it (default: false)',
|
|
111
105
|
)
|
|
112
|
-
.action(async (siteDir,
|
|
113
|
-
deploy(await resolveDir(siteDir),
|
|
114
|
-
|
|
115
|
-
config,
|
|
116
|
-
skipBuild,
|
|
117
|
-
});
|
|
118
|
-
});
|
|
106
|
+
.action(async (siteDir, options) =>
|
|
107
|
+
deploy(await resolveDir(siteDir), options),
|
|
108
|
+
);
|
|
119
109
|
|
|
120
110
|
cli
|
|
121
111
|
.command('start [siteDir]')
|
|
@@ -136,18 +126,8 @@ cli
|
|
|
136
126
|
'--poll [interval]',
|
|
137
127
|
'use polling rather than watching for reload (default: false). Can specify a poll interval in milliseconds',
|
|
138
128
|
)
|
|
139
|
-
.action(
|
|
140
|
-
|
|
141
|
-
start(await resolveDir(siteDir), {
|
|
142
|
-
port,
|
|
143
|
-
host,
|
|
144
|
-
locale,
|
|
145
|
-
config,
|
|
146
|
-
hotOnly,
|
|
147
|
-
open,
|
|
148
|
-
poll,
|
|
149
|
-
});
|
|
150
|
-
},
|
|
129
|
+
.action(async (siteDir, options) =>
|
|
130
|
+
start(await resolveDir(siteDir), options),
|
|
151
131
|
);
|
|
152
132
|
|
|
153
133
|
cli
|
|
@@ -164,44 +144,25 @@ cli
|
|
|
164
144
|
.option('-p, --port <port>', 'use specified port (default: 3000)')
|
|
165
145
|
.option('--build', 'build website before serving (default: false)')
|
|
166
146
|
.option('-h, --host <host>', 'use specified host (default: localhost)')
|
|
167
|
-
.action(
|
|
168
|
-
|
|
169
|
-
siteDir,
|
|
170
|
-
{
|
|
171
|
-
dir = 'build',
|
|
172
|
-
port = 3000,
|
|
173
|
-
host = 'localhost',
|
|
174
|
-
build: buildSite = false,
|
|
175
|
-
config,
|
|
176
|
-
},
|
|
177
|
-
) => {
|
|
178
|
-
serve(await resolveDir(siteDir), {
|
|
179
|
-
dir,
|
|
180
|
-
port,
|
|
181
|
-
build: buildSite,
|
|
182
|
-
config,
|
|
183
|
-
host,
|
|
184
|
-
});
|
|
185
|
-
},
|
|
147
|
+
.action(async (siteDir, options) =>
|
|
148
|
+
serve(await resolveDir(siteDir), options),
|
|
186
149
|
);
|
|
187
150
|
|
|
188
151
|
cli
|
|
189
152
|
.command('clear [siteDir]')
|
|
190
153
|
.description('Remove build artifacts.')
|
|
191
|
-
.action(async (siteDir) =>
|
|
192
|
-
clear(await resolveDir(siteDir));
|
|
193
|
-
});
|
|
154
|
+
.action(async (siteDir) => clear(await resolveDir(siteDir)));
|
|
194
155
|
|
|
195
156
|
cli
|
|
196
157
|
.command('write-translations [siteDir]')
|
|
197
158
|
.description('Extract required translations of your site.')
|
|
198
159
|
.option(
|
|
199
160
|
'-l, --locale <locale>',
|
|
200
|
-
'the locale folder to write the translations
|
|
161
|
+
'the locale folder to write the translations.\n"--locale fr" will write translations in the ./i18n/fr folder.',
|
|
201
162
|
)
|
|
202
163
|
.option(
|
|
203
164
|
'--override',
|
|
204
|
-
'
|
|
165
|
+
'By default, we only append missing translation messages to existing translation files. This option allows to override existing translation messages. Make sure to commit or backup your existing translations, as they may be overridden. (default: false)',
|
|
205
166
|
)
|
|
206
167
|
.option(
|
|
207
168
|
'--config <config>',
|
|
@@ -209,20 +170,10 @@ cli
|
|
|
209
170
|
)
|
|
210
171
|
.option(
|
|
211
172
|
'--messagePrefix <messagePrefix>',
|
|
212
|
-
'
|
|
173
|
+
'Allows to init new written messages with a given prefix. This might help you to highlight untranslated message by making them stand out in the UI (default: "")',
|
|
213
174
|
)
|
|
214
|
-
.action(
|
|
215
|
-
|
|
216
|
-
siteDir,
|
|
217
|
-
{locale = undefined, override = false, messagePrefix = '', config},
|
|
218
|
-
) => {
|
|
219
|
-
writeTranslations(await resolveDir(siteDir), {
|
|
220
|
-
locale,
|
|
221
|
-
override,
|
|
222
|
-
config,
|
|
223
|
-
messagePrefix,
|
|
224
|
-
});
|
|
225
|
-
},
|
|
175
|
+
.action(async (siteDir, options) =>
|
|
176
|
+
writeTranslations(await resolveDir(siteDir), options),
|
|
226
177
|
);
|
|
227
178
|
|
|
228
179
|
cli
|
package/lib/client/App.d.ts
CHANGED
package/lib/client/App.js
CHANGED
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*/
|
|
7
7
|
import React from 'react';
|
|
8
|
+
import '@generated/client-modules';
|
|
8
9
|
import routes from '@generated/routes';
|
|
9
10
|
import { useLocation } from '@docusaurus/router';
|
|
10
11
|
import normalizeLocation from './normalizeLocation';
|
|
@@ -16,7 +17,6 @@ import BaseUrlIssueBanner from './BaseUrlIssueBanner';
|
|
|
16
17
|
import SiteMetadataDefaults from './SiteMetadataDefaults';
|
|
17
18
|
import Root from '@theme/Root';
|
|
18
19
|
import SiteMetadata from '@theme/SiteMetadata';
|
|
19
|
-
import './clientLifecyclesDispatcher';
|
|
20
20
|
// TODO, quick fix for CSS insertion order
|
|
21
21
|
import ErrorBoundary from '@docusaurus/ErrorBoundary';
|
|
22
22
|
import Error from '@theme/Error';
|
|
@@ -30,7 +30,7 @@ export default function App() {
|
|
|
30
30
|
<SiteMetadataDefaults />
|
|
31
31
|
<SiteMetadata />
|
|
32
32
|
<BaseUrlIssueBanner />
|
|
33
|
-
<PendingNavigation location={normalizeLocation(location)}
|
|
33
|
+
<PendingNavigation location={normalizeLocation(location)}>
|
|
34
34
|
{routeElement}
|
|
35
35
|
</PendingNavigation>
|
|
36
36
|
</Root>
|
|
@@ -0,0 +1,16 @@
|
|
|
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 { type ReactElement } from 'react';
|
|
8
|
+
import type { ClientModule } from '@docusaurus/types';
|
|
9
|
+
import type { Location } from 'history';
|
|
10
|
+
export declare function dispatchLifecycleAction<K extends keyof ClientModule>(lifecycleAction: K, ...args: Parameters<NonNullable<ClientModule[K]>>): () => void;
|
|
11
|
+
declare function ClientLifecyclesDispatcher({ children, location, previousLocation, }: {
|
|
12
|
+
children: ReactElement;
|
|
13
|
+
location: Location;
|
|
14
|
+
previousLocation: Location | null;
|
|
15
|
+
}): JSX.Element;
|
|
16
|
+
export default ClientLifecyclesDispatcher;
|
|
@@ -0,0 +1,34 @@
|
|
|
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 { useLayoutEffect } from 'react';
|
|
8
|
+
import clientModules from '@generated/client-modules';
|
|
9
|
+
export function dispatchLifecycleAction(lifecycleAction, ...args) {
|
|
10
|
+
const callbacks = clientModules.map((clientModule) => {
|
|
11
|
+
const lifecycleFunction = (clientModule?.default?.[lifecycleAction] ??
|
|
12
|
+
clientModule[lifecycleAction]);
|
|
13
|
+
return lifecycleFunction?.(...args);
|
|
14
|
+
});
|
|
15
|
+
return () => callbacks.forEach((cb) => cb?.());
|
|
16
|
+
}
|
|
17
|
+
function ClientLifecyclesDispatcher({ children, location, previousLocation, }) {
|
|
18
|
+
useLayoutEffect(() => {
|
|
19
|
+
if (previousLocation !== location) {
|
|
20
|
+
const { hash } = location;
|
|
21
|
+
if (!hash) {
|
|
22
|
+
window.scrollTo(0, 0);
|
|
23
|
+
}
|
|
24
|
+
else {
|
|
25
|
+
const id = decodeURIComponent(hash.substring(1));
|
|
26
|
+
const element = document.getElementById(id);
|
|
27
|
+
element?.scrollIntoView();
|
|
28
|
+
}
|
|
29
|
+
dispatchLifecycleAction('onRouteDidUpdate', { previousLocation, location });
|
|
30
|
+
}
|
|
31
|
+
}, [previousLocation, location]);
|
|
32
|
+
return children;
|
|
33
|
+
}
|
|
34
|
+
export default ClientLifecyclesDispatcher;
|
|
@@ -6,9 +6,7 @@
|
|
|
6
6
|
*/
|
|
7
7
|
import React from 'react';
|
|
8
8
|
import type { Location } from 'history';
|
|
9
|
-
import './nprogress.css';
|
|
10
9
|
declare type Props = {
|
|
11
|
-
readonly delay: number;
|
|
12
10
|
readonly location: Location;
|
|
13
11
|
readonly children: JSX.Element;
|
|
14
12
|
};
|
|
@@ -17,12 +15,9 @@ declare type State = {
|
|
|
17
15
|
};
|
|
18
16
|
declare class PendingNavigation extends React.Component<Props, State> {
|
|
19
17
|
private previousLocation;
|
|
20
|
-
private
|
|
18
|
+
private routeUpdateCleanupCb;
|
|
21
19
|
constructor(props: Props);
|
|
22
20
|
shouldComponentUpdate(nextProps: Props, nextState: State): boolean;
|
|
23
|
-
private clearProgressBarTimeout;
|
|
24
|
-
private startProgressBar;
|
|
25
|
-
private stopProgressBar;
|
|
26
21
|
render(): JSX.Element;
|
|
27
22
|
}
|
|
28
23
|
export default PendingNavigation;
|
|
@@ -6,17 +6,20 @@
|
|
|
6
6
|
*/
|
|
7
7
|
import React from 'react';
|
|
8
8
|
import { Route } from 'react-router-dom';
|
|
9
|
-
import
|
|
10
|
-
import
|
|
9
|
+
import ClientLifecyclesDispatcher, { dispatchLifecycleAction, } from './ClientLifecyclesDispatcher';
|
|
10
|
+
import ExecutionEnvironment from './exports/ExecutionEnvironment';
|
|
11
11
|
import preload from './preload';
|
|
12
|
-
import './nprogress.css';
|
|
13
|
-
nprogress.configure({ showSpinner: false });
|
|
14
12
|
class PendingNavigation extends React.Component {
|
|
15
13
|
constructor(props) {
|
|
16
14
|
super(props);
|
|
17
15
|
// previousLocation doesn't affect rendering, hence not stored in state.
|
|
18
16
|
this.previousLocation = null;
|
|
19
|
-
this.
|
|
17
|
+
this.routeUpdateCleanupCb = ExecutionEnvironment.canUseDOM
|
|
18
|
+
? dispatchLifecycleAction('onRouteUpdate', {
|
|
19
|
+
previousLocation: null,
|
|
20
|
+
location: this.props.location,
|
|
21
|
+
})
|
|
22
|
+
: () => { };
|
|
20
23
|
this.state = {
|
|
21
24
|
nextRouteHasLoaded: true,
|
|
22
25
|
};
|
|
@@ -35,52 +38,26 @@ class PendingNavigation extends React.Component {
|
|
|
35
38
|
// Save the location first.
|
|
36
39
|
this.previousLocation = this.props.location;
|
|
37
40
|
this.setState({ nextRouteHasLoaded: false });
|
|
38
|
-
this.
|
|
41
|
+
this.routeUpdateCleanupCb = dispatchLifecycleAction('onRouteUpdate', {
|
|
42
|
+
previousLocation: this.previousLocation,
|
|
43
|
+
location: nextLocation,
|
|
44
|
+
});
|
|
39
45
|
// Load data while the old screen remains.
|
|
40
46
|
preload(nextLocation.pathname)
|
|
41
47
|
.then(() => {
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
location: nextLocation,
|
|
45
|
-
});
|
|
46
|
-
this.setState({ nextRouteHasLoaded: true }, this.stopProgressBar);
|
|
47
|
-
const { hash } = nextLocation;
|
|
48
|
-
if (!hash) {
|
|
49
|
-
window.scrollTo(0, 0);
|
|
50
|
-
}
|
|
51
|
-
else {
|
|
52
|
-
const id = decodeURIComponent(hash.substring(1));
|
|
53
|
-
const element = document.getElementById(id);
|
|
54
|
-
element?.scrollIntoView();
|
|
55
|
-
}
|
|
48
|
+
this.routeUpdateCleanupCb?.();
|
|
49
|
+
this.setState({ nextRouteHasLoaded: true });
|
|
56
50
|
})
|
|
57
51
|
.catch((e) => console.warn(e));
|
|
58
52
|
return false;
|
|
59
53
|
}
|
|
60
|
-
clearProgressBarTimeout() {
|
|
61
|
-
if (this.progressBarTimeout) {
|
|
62
|
-
window.clearTimeout(this.progressBarTimeout);
|
|
63
|
-
this.progressBarTimeout = null;
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
startProgressBar() {
|
|
67
|
-
this.clearProgressBarTimeout();
|
|
68
|
-
this.progressBarTimeout = window.setTimeout(() => {
|
|
69
|
-
clientLifecyclesDispatcher.onRouteUpdateDelayed({
|
|
70
|
-
location: this.props.location,
|
|
71
|
-
});
|
|
72
|
-
nprogress.start();
|
|
73
|
-
}, this.props.delay);
|
|
74
|
-
}
|
|
75
|
-
stopProgressBar() {
|
|
76
|
-
this.clearProgressBarTimeout();
|
|
77
|
-
nprogress.done();
|
|
78
|
-
}
|
|
79
54
|
render() {
|
|
80
55
|
const { children, location } = this.props;
|
|
81
56
|
// Use a controlled <Route> to trick all descendants into rendering the old
|
|
82
57
|
// location.
|
|
83
|
-
return <
|
|
58
|
+
return (<ClientLifecyclesDispatcher previousLocation={this.previousLocation} location={location}>
|
|
59
|
+
<Route location={location} render={() => children}/>
|
|
60
|
+
</ClientLifecyclesDispatcher>);
|
|
84
61
|
}
|
|
85
62
|
}
|
|
86
63
|
export default PendingNavigation;
|
package/lib/commands/build.d.ts
CHANGED
|
@@ -5,4 +5,4 @@
|
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*/
|
|
7
7
|
import type { BuildCLIOptions } from '@docusaurus/types';
|
|
8
|
-
export declare function build(siteDir: string, cliOptions
|
|
8
|
+
export declare function build(siteDir: string, cliOptions: Partial<BuildCLIOptions>, forceTerminate?: boolean): Promise<string>;
|
package/lib/commands/build.js
CHANGED
|
@@ -23,7 +23,7 @@ const utils_1 = require("../webpack/utils");
|
|
|
23
23
|
const CleanWebpackPlugin_1 = tslib_1.__importDefault(require("../webpack/plugins/CleanWebpackPlugin"));
|
|
24
24
|
const i18n_1 = require("../server/i18n");
|
|
25
25
|
const utils_2 = require("@docusaurus/utils");
|
|
26
|
-
async function build(siteDir, cliOptions
|
|
26
|
+
async function build(siteDir, cliOptions,
|
|
27
27
|
// When running build, we force terminate the process to prevent async
|
|
28
28
|
// operations from never returning. However, if run as part of docusaurus
|
|
29
29
|
// deploy, we have to let deploy finish.
|
package/lib/commands/clear.d.ts
CHANGED
package/lib/commands/clear.js
CHANGED
|
@@ -39,6 +39,6 @@ async function clear(siteDir) {
|
|
|
39
39
|
path: path_1.default.join(siteDir, p, '.cache'),
|
|
40
40
|
description: 'Webpack persistent cache folder',
|
|
41
41
|
}));
|
|
42
|
-
|
|
42
|
+
await Promise.all([generatedFolder, buildFolder, ...cacheFolders].map(removePath));
|
|
43
43
|
}
|
|
44
44
|
exports.clear = clear;
|
package/lib/commands/deploy.d.ts
CHANGED
|
@@ -5,4 +5,4 @@
|
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*/
|
|
7
7
|
import type { BuildCLIOptions } from '@docusaurus/types';
|
|
8
|
-
export declare function deploy(siteDir: string, cliOptions
|
|
8
|
+
export declare function deploy(siteDir: string, cliOptions: Partial<BuildCLIOptions>): Promise<void>;
|
package/lib/commands/deploy.js
CHANGED
|
@@ -34,7 +34,7 @@ function shellExecLog(cmd) {
|
|
|
34
34
|
throw err;
|
|
35
35
|
}
|
|
36
36
|
}
|
|
37
|
-
async function deploy(siteDir, cliOptions
|
|
37
|
+
async function deploy(siteDir, cliOptions) {
|
|
38
38
|
const { outDir, siteConfig, siteConfigPath } = await (0, server_1.loadContext)({
|
|
39
39
|
siteDir,
|
|
40
40
|
customConfigFilePath: cliOptions.config,
|
package/lib/commands/serve.d.ts
CHANGED
|
@@ -5,4 +5,4 @@
|
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*/
|
|
7
7
|
import type { ServeCLIOptions } from '@docusaurus/types';
|
|
8
|
-
export declare function serve(siteDir: string, cliOptions: ServeCLIOptions): Promise<void>;
|
|
8
|
+
export declare function serve(siteDir: string, cliOptions: Partial<ServeCLIOptions>): Promise<void>;
|
package/lib/commands/serve.js
CHANGED
|
@@ -15,8 +15,10 @@ const path_1 = tslib_1.__importDefault(require("path"));
|
|
|
15
15
|
const config_1 = require("../server/config");
|
|
16
16
|
const build_1 = require("./build");
|
|
17
17
|
const commandUtils_1 = require("./commandUtils");
|
|
18
|
+
const utils_1 = require("@docusaurus/utils");
|
|
18
19
|
async function serve(siteDir, cliOptions) {
|
|
19
|
-
|
|
20
|
+
const buildDir = cliOptions.dir ?? utils_1.DEFAULT_BUILD_DIR_NAME;
|
|
21
|
+
let dir = path_1.default.resolve(siteDir, buildDir);
|
|
20
22
|
if (cliOptions.build) {
|
|
21
23
|
dir = await (0, build_1.build)(siteDir, {
|
|
22
24
|
config: cliOptions.config,
|
|
@@ -52,7 +54,7 @@ async function serve(siteDir, cliOptions) {
|
|
|
52
54
|
directoryListing: false,
|
|
53
55
|
});
|
|
54
56
|
});
|
|
55
|
-
logger_1.default.success `Serving path=${
|
|
57
|
+
logger_1.default.success `Serving path=${buildDir} directory at url=${servingUrl + baseUrl}.`;
|
|
56
58
|
server.listen(port);
|
|
57
59
|
}
|
|
58
60
|
exports.serve = serve;
|
|
@@ -5,4 +5,4 @@
|
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*/
|
|
7
7
|
import { type WriteHeadingIDOptions } from '@docusaurus/utils';
|
|
8
|
-
export declare function writeHeadingIds(siteDir: string, files
|
|
8
|
+
export declare function writeHeadingIds(siteDir: string, files: string[], options: WriteHeadingIDOptions): Promise<void>;
|
|
@@ -6,6 +6,6 @@
|
|
|
6
6
|
*/
|
|
7
7
|
import type { ConfigOptions } from '@docusaurus/types';
|
|
8
8
|
import { type WriteTranslationsOptions } from '../server/translations/translations';
|
|
9
|
-
export declare function writeTranslations(siteDir: string, options: WriteTranslationsOptions & ConfigOptions & {
|
|
9
|
+
export declare function writeTranslations(siteDir: string, options: Partial<WriteTranslationsOptions & ConfigOptions & {
|
|
10
10
|
locale?: string;
|
|
11
|
-
}): Promise<void>;
|
|
11
|
+
}>): Promise<void>;
|
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-4924",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"publishConfig": {
|
|
7
7
|
"access": "public"
|
|
@@ -41,13 +41,13 @@
|
|
|
41
41
|
"@babel/runtime": "^7.17.9",
|
|
42
42
|
"@babel/runtime-corejs3": "^7.17.9",
|
|
43
43
|
"@babel/traverse": "^7.17.9",
|
|
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-4924",
|
|
45
|
+
"@docusaurus/logger": "0.0.0-4924",
|
|
46
|
+
"@docusaurus/mdx-loader": "0.0.0-4924",
|
|
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-4924",
|
|
49
|
+
"@docusaurus/utils-common": "0.0.0-4924",
|
|
50
|
+
"@docusaurus/utils-validation": "0.0.0-4924",
|
|
51
51
|
"@slorber/static-site-generator-webpack-plugin": "^4.0.4",
|
|
52
52
|
"@svgr/webpack": "^6.2.1",
|
|
53
53
|
"autoprefixer": "^10.4.4",
|
|
@@ -77,7 +77,6 @@
|
|
|
77
77
|
"leven": "^3.1.0",
|
|
78
78
|
"lodash": "^4.17.21",
|
|
79
79
|
"mini-css-extract-plugin": "^2.6.0",
|
|
80
|
-
"nprogress": "^0.2.0",
|
|
81
80
|
"postcss": "^8.4.12",
|
|
82
81
|
"postcss-loader": "^6.2.1",
|
|
83
82
|
"prompts": "^2.4.2",
|
|
@@ -105,10 +104,9 @@
|
|
|
105
104
|
"webpackbar": "^5.0.2"
|
|
106
105
|
},
|
|
107
106
|
"devDependencies": {
|
|
108
|
-
"@docusaurus/module-type-aliases": "0.0.0-
|
|
109
|
-
"@docusaurus/types": "0.0.0-
|
|
107
|
+
"@docusaurus/module-type-aliases": "0.0.0-4924",
|
|
108
|
+
"@docusaurus/types": "0.0.0-4924",
|
|
110
109
|
"@types/detect-port": "^1.3.2",
|
|
111
|
-
"@types/nprogress": "^0.2.0",
|
|
112
110
|
"@types/react-dom": "^18.0.2",
|
|
113
111
|
"@types/react-router-config": "^5.0.6",
|
|
114
112
|
"@types/rtl-detect": "^1.0.0",
|
|
@@ -127,5 +125,5 @@
|
|
|
127
125
|
"engines": {
|
|
128
126
|
"node": ">=14"
|
|
129
127
|
},
|
|
130
|
-
"gitHead": "
|
|
128
|
+
"gitHead": "9a5e4f9e3588967ccfb235a808f4bfc1447e403c"
|
|
131
129
|
}
|
|
@@ -1,9 +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
|
-
import type { ClientModule } from '@docusaurus/types';
|
|
8
|
-
declare const clientLifecyclesDispatchers: Required<ClientModule>;
|
|
9
|
-
export default clientLifecyclesDispatchers;
|
|
@@ -1,23 +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
|
-
import clientModules from '@generated/client-modules';
|
|
8
|
-
function dispatchLifecycleAction(lifecycleAction, args) {
|
|
9
|
-
clientModules.forEach((clientModule) => {
|
|
10
|
-
const lifecycleFunction = (clientModule?.default?.[lifecycleAction] ??
|
|
11
|
-
clientModule[lifecycleAction]);
|
|
12
|
-
lifecycleFunction?.(...args);
|
|
13
|
-
});
|
|
14
|
-
}
|
|
15
|
-
const clientLifecyclesDispatchers = {
|
|
16
|
-
onRouteUpdate(...args) {
|
|
17
|
-
dispatchLifecycleAction('onRouteUpdate', args);
|
|
18
|
-
},
|
|
19
|
-
onRouteUpdateDelayed(...args) {
|
|
20
|
-
dispatchLifecycleAction('onRouteUpdateDelayed', args);
|
|
21
|
-
},
|
|
22
|
-
};
|
|
23
|
-
export default clientLifecyclesDispatchers;
|
package/lib/client/nprogress.css
DELETED
|
@@ -1,36 +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
|
-
/**
|
|
9
|
-
* Styles for NProgress
|
|
10
|
-
* Copied over to remove unused styles for the spinner.
|
|
11
|
-
* https://github.com/rstacruz/nprogress/blob/master/nprogress.css
|
|
12
|
-
*/
|
|
13
|
-
|
|
14
|
-
#nprogress {
|
|
15
|
-
pointer-events: none;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
#nprogress .bar {
|
|
19
|
-
background: #29d;
|
|
20
|
-
position: fixed;
|
|
21
|
-
z-index: 1031;
|
|
22
|
-
top: 0;
|
|
23
|
-
left: 0;
|
|
24
|
-
width: 100%;
|
|
25
|
-
height: 2px;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
#nprogress .peg {
|
|
29
|
-
position: absolute;
|
|
30
|
-
right: 0;
|
|
31
|
-
width: 100px;
|
|
32
|
-
height: 100%;
|
|
33
|
-
box-shadow: 0 0 10px #29d, 0 0 5px #29d;
|
|
34
|
-
opacity: 1;
|
|
35
|
-
transform: rotate(3deg) translate(0, -4px);
|
|
36
|
-
}
|