@docusaurus/theme-classic 0.0.0-5042 → 0.0.0-5043
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,64 +5,8 @@
|
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*/
|
|
7
7
|
import { Joi } from '@docusaurus/utils-validation';
|
|
8
|
-
import type { ThemeConfig
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
disableSwitch: boolean;
|
|
13
|
-
respectPrefersColorScheme: boolean;
|
|
14
|
-
};
|
|
15
|
-
docs: {
|
|
16
|
-
versionPersistence: string;
|
|
17
|
-
sidebar: {
|
|
18
|
-
hideable: boolean;
|
|
19
|
-
autoCollapseCategories: boolean;
|
|
20
|
-
};
|
|
21
|
-
};
|
|
22
|
-
metadata: never[];
|
|
23
|
-
prism: {
|
|
24
|
-
additionalLanguages: never[];
|
|
25
|
-
theme: {
|
|
26
|
-
plain: {
|
|
27
|
-
[styleKey: string]: string | number | void;
|
|
28
|
-
color?: string | undefined;
|
|
29
|
-
backgroundColor?: string | undefined;
|
|
30
|
-
fontStyle?: "normal" | "italic" | undefined;
|
|
31
|
-
fontWeight?: "bold" | "normal" | "100" | "200" | "300" | "400" | "500" | "600" | "700" | "800" | "900" | undefined;
|
|
32
|
-
textDecorationLine?: "none" | "underline" | "line-through" | "underline line-through" | undefined;
|
|
33
|
-
opacity?: number | undefined;
|
|
34
|
-
};
|
|
35
|
-
styles: {
|
|
36
|
-
types: string[];
|
|
37
|
-
style: {
|
|
38
|
-
[styleKey: string]: string | number | void;
|
|
39
|
-
color?: string | undefined;
|
|
40
|
-
backgroundColor?: string | undefined;
|
|
41
|
-
fontStyle?: "normal" | "italic" | undefined;
|
|
42
|
-
fontWeight?: "bold" | "normal" | "100" | "200" | "300" | "400" | "500" | "600" | "700" | "800" | "900" | undefined;
|
|
43
|
-
textDecorationLine?: "none" | "underline" | "line-through" | "underline line-through" | undefined;
|
|
44
|
-
opacity?: number | undefined;
|
|
45
|
-
};
|
|
46
|
-
languages?: ("markup" | "bash" | "clike" | "c" | "cpp" | "css" | "javascript" | "jsx" | "coffeescript" | "actionscript" | "css-extr" | "diff" | "git" | "go" | "graphql" | "handlebars" | "json" | "less" | "makefile" | "markdown" | "objectivec" | "ocaml" | "python" | "reason" | "sass" | "scss" | "sql" | "stylus" | "tsx" | "typescript" | "wasm" | "yaml")[] | undefined;
|
|
47
|
-
}[];
|
|
48
|
-
};
|
|
49
|
-
magicComments: {
|
|
50
|
-
className: string;
|
|
51
|
-
line: string;
|
|
52
|
-
block: {
|
|
53
|
-
start: string;
|
|
54
|
-
end: string;
|
|
55
|
-
};
|
|
56
|
-
}[];
|
|
57
|
-
};
|
|
58
|
-
navbar: {
|
|
59
|
-
hideOnScroll: boolean;
|
|
60
|
-
items: never[];
|
|
61
|
-
};
|
|
62
|
-
tableOfContents: {
|
|
63
|
-
minHeadingLevel: number;
|
|
64
|
-
maxHeadingLevel: number;
|
|
65
|
-
};
|
|
66
|
-
};
|
|
67
|
-
export declare const ThemeConfigSchema: Joi.ObjectSchema<any>;
|
|
8
|
+
import type { ThemeConfig } from '@docusaurus/theme-common';
|
|
9
|
+
import type { ThemeConfigValidationContext } from '@docusaurus/types';
|
|
10
|
+
export declare const DEFAULT_CONFIG: ThemeConfig;
|
|
11
|
+
export declare const ThemeConfigSchema: Joi.ObjectSchema<ThemeConfig>;
|
|
68
12
|
export declare function validateThemeConfig({ validate, themeConfig, }: ThemeConfigValidationContext<ThemeConfig>): ThemeConfig;
|
|
@@ -269,6 +269,7 @@ const CustomCssSchema = utils_validation_1.Joi.alternatives()
|
|
|
269
269
|
.optional();
|
|
270
270
|
exports.ThemeConfigSchema = utils_validation_1.Joi.object({
|
|
271
271
|
// TODO temporary (@alpha-58)
|
|
272
|
+
// @ts-expect-error: forbidden
|
|
272
273
|
disableDarkMode: utils_validation_1.Joi.any().forbidden().messages({
|
|
273
274
|
'any.unknown': 'disableDarkMode theme config is deprecated. Please use the new colorMode attribute. You likely want: config.themeConfig.colorMode.disableSwitch = true',
|
|
274
275
|
}),
|
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-5043",
|
|
4
4
|
"description": "Classic theme for Docusaurus",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"types": "src/theme-classic.d.ts",
|
|
@@ -20,15 +20,15 @@
|
|
|
20
20
|
"copy:watch": "node ../../admin/scripts/copyUntypedFiles.js --watch"
|
|
21
21
|
},
|
|
22
22
|
"dependencies": {
|
|
23
|
-
"@docusaurus/core": "0.0.0-
|
|
24
|
-
"@docusaurus/plugin-content-blog": "0.0.0-
|
|
25
|
-
"@docusaurus/plugin-content-docs": "0.0.0-
|
|
26
|
-
"@docusaurus/plugin-content-pages": "0.0.0-
|
|
27
|
-
"@docusaurus/theme-common": "0.0.0-
|
|
28
|
-
"@docusaurus/theme-translations": "0.0.0-
|
|
29
|
-
"@docusaurus/utils": "0.0.0-
|
|
30
|
-
"@docusaurus/utils-common": "0.0.0-
|
|
31
|
-
"@docusaurus/utils-validation": "0.0.0-
|
|
23
|
+
"@docusaurus/core": "0.0.0-5043",
|
|
24
|
+
"@docusaurus/plugin-content-blog": "0.0.0-5043",
|
|
25
|
+
"@docusaurus/plugin-content-docs": "0.0.0-5043",
|
|
26
|
+
"@docusaurus/plugin-content-pages": "0.0.0-5043",
|
|
27
|
+
"@docusaurus/theme-common": "0.0.0-5043",
|
|
28
|
+
"@docusaurus/theme-translations": "0.0.0-5043",
|
|
29
|
+
"@docusaurus/utils": "0.0.0-5043",
|
|
30
|
+
"@docusaurus/utils-common": "0.0.0-5043",
|
|
31
|
+
"@docusaurus/utils-validation": "0.0.0-5043",
|
|
32
32
|
"@mdx-js/react": "^1.6.22",
|
|
33
33
|
"clsx": "^1.1.1",
|
|
34
34
|
"copy-text-to-clipboard": "^3.0.1",
|
|
@@ -43,8 +43,8 @@
|
|
|
43
43
|
"tslib": "^2.4.0"
|
|
44
44
|
},
|
|
45
45
|
"devDependencies": {
|
|
46
|
-
"@docusaurus/module-type-aliases": "0.0.0-
|
|
47
|
-
"@docusaurus/types": "0.0.0-
|
|
46
|
+
"@docusaurus/module-type-aliases": "0.0.0-5043",
|
|
47
|
+
"@docusaurus/types": "0.0.0-5043",
|
|
48
48
|
"@types/mdx-js__react": "^1.5.5",
|
|
49
49
|
"@types/nprogress": "^0.2.0",
|
|
50
50
|
"@types/prismjs": "^1.26.0",
|
|
@@ -60,5 +60,5 @@
|
|
|
60
60
|
"engines": {
|
|
61
61
|
"node": ">=14"
|
|
62
62
|
},
|
|
63
|
-
"gitHead": "
|
|
63
|
+
"gitHead": "28ad11cdb6c55b7a8355e327913f617d4fe359bd"
|
|
64
64
|
}
|
|
@@ -7,12 +7,10 @@
|
|
|
7
7
|
|
|
8
8
|
import defaultPrismTheme from 'prism-react-renderer/themes/palenight';
|
|
9
9
|
import {Joi, URISchema} from '@docusaurus/utils-validation';
|
|
10
|
-
import type {
|
|
11
|
-
|
|
12
|
-
ThemeConfigValidationContext,
|
|
13
|
-
} from '@docusaurus/types';
|
|
10
|
+
import type {ThemeConfig} from '@docusaurus/theme-common';
|
|
11
|
+
import type {ThemeConfigValidationContext} from '@docusaurus/types';
|
|
14
12
|
|
|
15
|
-
const DEFAULT_DOCS_CONFIG = {
|
|
13
|
+
const DEFAULT_DOCS_CONFIG: ThemeConfig['docs'] = {
|
|
16
14
|
versionPersistence: 'localStorage',
|
|
17
15
|
sidebar: {
|
|
18
16
|
hideable: false,
|
|
@@ -31,13 +29,13 @@ const DocsSchema = Joi.object({
|
|
|
31
29
|
}).default(DEFAULT_DOCS_CONFIG.sidebar),
|
|
32
30
|
}).default(DEFAULT_DOCS_CONFIG);
|
|
33
31
|
|
|
34
|
-
const DEFAULT_COLOR_MODE_CONFIG = {
|
|
32
|
+
const DEFAULT_COLOR_MODE_CONFIG: ThemeConfig['colorMode'] = {
|
|
35
33
|
defaultMode: 'light',
|
|
36
34
|
disableSwitch: false,
|
|
37
35
|
respectPrefersColorScheme: false,
|
|
38
36
|
};
|
|
39
37
|
|
|
40
|
-
export const DEFAULT_CONFIG = {
|
|
38
|
+
export const DEFAULT_CONFIG: ThemeConfig = {
|
|
41
39
|
colorMode: DEFAULT_COLOR_MODE_CONFIG,
|
|
42
40
|
docs: DEFAULT_DOCS_CONFIG,
|
|
43
41
|
metadata: [],
|
|
@@ -301,8 +299,9 @@ const CustomCssSchema = Joi.alternatives()
|
|
|
301
299
|
.try(Joi.array().items(Joi.string().required()), Joi.string().required())
|
|
302
300
|
.optional();
|
|
303
301
|
|
|
304
|
-
export const ThemeConfigSchema = Joi.object({
|
|
302
|
+
export const ThemeConfigSchema = Joi.object<ThemeConfig>({
|
|
305
303
|
// TODO temporary (@alpha-58)
|
|
304
|
+
// @ts-expect-error: forbidden
|
|
306
305
|
disableDarkMode: Joi.any().forbidden().messages({
|
|
307
306
|
'any.unknown':
|
|
308
307
|
'disableDarkMode theme config is deprecated. Please use the new colorMode attribute. You likely want: config.themeConfig.colorMode.disableSwitch = true',
|