@docusaurus/plugin-content-docs 0.0.0-4498 → 0.0.0-4501

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.
@@ -13,6 +13,6 @@ export declare type CategoryMetadataFile = {
13
13
  collapsed?: boolean;
14
14
  collapsible?: boolean;
15
15
  className?: string;
16
- link?: SidebarItemCategoryLinkConfig;
16
+ link?: SidebarItemCategoryLinkConfig | null;
17
17
  };
18
18
  export declare const DefaultSidebarItemsGenerator: SidebarItemsGenerator;
@@ -144,8 +144,8 @@ const DefaultSidebarItemsGenerator = async ({ numberPrefixParser, isCategoryInde
144
144
  function getCategoryLinkedDocId() {
145
145
  var _a, _b;
146
146
  const link = categoryMetadata === null || categoryMetadata === void 0 ? void 0 : categoryMetadata.link;
147
- if (link) {
148
- if (link.type === 'doc') {
147
+ if (link !== undefined) {
148
+ if (link && link.type === 'doc') {
149
149
  return ((_a = findDocByLocalId(link.id)) === null || _a === void 0 ? void 0 : _a.id) || getDoc(link.id).id;
150
150
  }
151
151
  else {
@@ -35,6 +35,7 @@ const sidebarItemLinkSchema = sidebarItemBaseSchema.append({
35
35
  .messages({ 'any.unknown': '"label" must be a string' }),
36
36
  });
37
37
  const sidebarItemCategoryLinkSchema = utils_validation_1.Joi.object()
38
+ .allow(null)
38
39
  .when('.type', {
39
40
  switch: [
40
41
  {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@docusaurus/plugin-content-docs",
3
- "version": "0.0.0-4498",
3
+ "version": "0.0.0-4501",
4
4
  "description": "Docs plugin for Docusaurus.",
5
5
  "main": "lib/index.js",
6
6
  "exports": {
@@ -22,11 +22,11 @@
22
22
  },
23
23
  "license": "MIT",
24
24
  "dependencies": {
25
- "@docusaurus/core": "0.0.0-4498",
26
- "@docusaurus/logger": "0.0.0-4498",
27
- "@docusaurus/mdx-loader": "0.0.0-4498",
28
- "@docusaurus/utils": "0.0.0-4498",
29
- "@docusaurus/utils-validation": "0.0.0-4498",
25
+ "@docusaurus/core": "0.0.0-4501",
26
+ "@docusaurus/logger": "0.0.0-4501",
27
+ "@docusaurus/mdx-loader": "0.0.0-4501",
28
+ "@docusaurus/utils": "0.0.0-4501",
29
+ "@docusaurus/utils-validation": "0.0.0-4501",
30
30
  "combine-promises": "^1.1.0",
31
31
  "fs-extra": "^10.0.0",
32
32
  "import-fresh": "^3.2.2",
@@ -39,8 +39,8 @@
39
39
  "webpack": "^5.61.0"
40
40
  },
41
41
  "devDependencies": {
42
- "@docusaurus/module-type-aliases": "0.0.0-4498",
43
- "@docusaurus/types": "0.0.0-4498",
42
+ "@docusaurus/module-type-aliases": "0.0.0-4501",
43
+ "@docusaurus/types": "0.0.0-4501",
44
44
  "@types/js-yaml": "^4.0.0",
45
45
  "@types/picomatch": "^2.2.1",
46
46
  "commander": "^5.1.0",
@@ -55,5 +55,5 @@
55
55
  "engines": {
56
56
  "node": ">=14"
57
57
  },
58
- "gitHead": "ddd1f81672386de932f1c4116af5853b58608d98"
58
+ "gitHead": "53867e522d42d77e0668fe9ccda6fa674978f010"
59
59
  }
@@ -45,7 +45,7 @@ export type CategoryMetadataFile = {
45
45
  collapsed?: boolean;
46
46
  collapsible?: boolean;
47
47
  className?: string;
48
- link?: SidebarItemCategoryLinkConfig;
48
+ link?: SidebarItemCategoryLinkConfig | null;
49
49
 
50
50
  // TODO should we allow "items" here? how would this work? would an "autogenerated" type be allowed?
51
51
  // This mkdocs plugin do something like that: https://github.com/lukasgeiter/mkdocs-awesome-pages-plugin/
@@ -222,8 +222,8 @@ export const DefaultSidebarItemsGenerator: SidebarItemsGenerator = async ({
222
222
 
223
223
  function getCategoryLinkedDocId(): string | undefined {
224
224
  const link = categoryMetadata?.link;
225
- if (link) {
226
- if (link.type === 'doc') {
225
+ if (link !== undefined) {
226
+ if (link && link.type === 'doc') {
227
227
  return findDocByLocalId(link.id)?.id || getDoc(link.id).id;
228
228
  } else {
229
229
  // We don't continue for other link types on purpose!
@@ -56,6 +56,7 @@ const sidebarItemLinkSchema = sidebarItemBaseSchema.append<SidebarItemLink>({
56
56
  });
57
57
 
58
58
  const sidebarItemCategoryLinkSchema = Joi.object<SidebarItemCategoryLink>()
59
+ .allow(null)
59
60
  .when('.type', {
60
61
  switch: [
61
62
  {