@docusaurus/plugin-content-docs 3.9.2-canary-6465 → 3.9.2-canary-6499

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.
@@ -148,11 +148,18 @@ function getSidebarBreadcrumbs({ sidebarItems, pathname, onlyCategories = false,
148
148
  const breadcrumbs = [];
149
149
  function extract(items) {
150
150
  for (const item of items) {
151
- if ((item.type === 'category' &&
152
- (isSamePath(item.href, pathname) || extract(item.items))) ||
153
- (item.type === 'link' && isSamePath(item.href, pathname))) {
154
- const filtered = onlyCategories && item.type !== 'category';
155
- if (!filtered) {
151
+ // Extract category item
152
+ if (item.type === 'category') {
153
+ if (isSamePath(item.href, pathname) || extract(item.items)) {
154
+ breadcrumbs.unshift(item);
155
+ return true;
156
+ }
157
+ }
158
+ // Extract doc item
159
+ else if (item.type === 'link' &&
160
+ item.docId &&
161
+ isSamePath(item.href, pathname)) {
162
+ if (!onlyCategories) {
156
163
  breadcrumbs.unshift(item);
157
164
  }
158
165
  return true;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@docusaurus/plugin-content-docs",
3
- "version": "3.9.2-canary-6465",
3
+ "version": "3.9.2-canary-6499",
4
4
  "description": "Docs plugin for Docusaurus.",
5
5
  "main": "lib/index.js",
6
6
  "sideEffects": false,
@@ -35,15 +35,15 @@
35
35
  },
36
36
  "license": "MIT",
37
37
  "dependencies": {
38
- "@docusaurus/core": "3.9.2-canary-6465",
39
- "@docusaurus/logger": "3.9.2-canary-6465",
40
- "@docusaurus/mdx-loader": "3.9.2-canary-6465",
41
- "@docusaurus/module-type-aliases": "3.9.2-canary-6465",
42
- "@docusaurus/theme-common": "3.9.2-canary-6465",
43
- "@docusaurus/types": "3.9.2-canary-6465",
44
- "@docusaurus/utils": "3.9.2-canary-6465",
45
- "@docusaurus/utils-common": "3.9.2-canary-6465",
46
- "@docusaurus/utils-validation": "3.9.2-canary-6465",
38
+ "@docusaurus/core": "3.9.2-canary-6499",
39
+ "@docusaurus/logger": "3.9.2-canary-6499",
40
+ "@docusaurus/mdx-loader": "3.9.2-canary-6499",
41
+ "@docusaurus/module-type-aliases": "3.9.2-canary-6499",
42
+ "@docusaurus/theme-common": "3.9.2-canary-6499",
43
+ "@docusaurus/types": "3.9.2-canary-6499",
44
+ "@docusaurus/utils": "3.9.2-canary-6499",
45
+ "@docusaurus/utils-common": "3.9.2-canary-6499",
46
+ "@docusaurus/utils-validation": "3.9.2-canary-6499",
47
47
  "@types/react-router-config": "^5.0.7",
48
48
  "combine-promises": "^1.1.0",
49
49
  "fs-extra": "^11.1.1",
@@ -67,5 +67,5 @@
67
67
  "engines": {
68
68
  "node": ">=20.0"
69
69
  },
70
- "gitHead": "3b356ca82e7bac46de224279685a7788a7154fea"
70
+ "gitHead": "5ad8c2b9301411f0be8fabe95315c6a4ac7a7af4"
71
71
  }
@@ -234,15 +234,22 @@ function getSidebarBreadcrumbs({
234
234
  }): PropSidebarBreadcrumbsItem[] {
235
235
  const breadcrumbs: PropSidebarBreadcrumbsItem[] = [];
236
236
 
237
- function extract(items: PropSidebarItem[]) {
237
+ function extract(items: PropSidebarItem[]): boolean {
238
238
  for (const item of items) {
239
- if (
240
- (item.type === 'category' &&
241
- (isSamePath(item.href, pathname) || extract(item.items))) ||
242
- (item.type === 'link' && isSamePath(item.href, pathname))
239
+ // Extract category item
240
+ if (item.type === 'category') {
241
+ if (isSamePath(item.href, pathname) || extract(item.items)) {
242
+ breadcrumbs.unshift(item);
243
+ return true;
244
+ }
245
+ }
246
+ // Extract doc item
247
+ else if (
248
+ item.type === 'link' &&
249
+ item.docId &&
250
+ isSamePath(item.href, pathname)
243
251
  ) {
244
- const filtered = onlyCategories && item.type !== 'category';
245
- if (!filtered) {
252
+ if (!onlyCategories) {
246
253
  breadcrumbs.unshift(item);
247
254
  }
248
255
  return true;