@primer/doctocat-nextjs 0.0.0-20250625130205 → 0.0.0-20250626090518
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/CHANGELOG.md
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
# @primer/doctocat-nextjs
|
|
2
2
|
|
|
3
|
-
## 0.0.0-
|
|
3
|
+
## 0.0.0-20250626090518
|
|
4
4
|
|
|
5
5
|
### Patch Changes
|
|
6
6
|
|
|
7
7
|
- Fake entry to force publishing
|
|
8
8
|
|
|
9
|
-
## 0.
|
|
9
|
+
## 0.5.4
|
|
10
10
|
|
|
11
11
|
### Patch Changes
|
|
12
12
|
|
|
13
|
-
- [#51](https://github.com/primer/doctocat-nextjs/pull/51) [`
|
|
13
|
+
- [#51](https://github.com/primer/doctocat-nextjs/pull/51) [`4c76c4f`](https://github.com/primer/doctocat-nextjs/commit/4c76c4f5ccd248ec7d1f448c054808287a3ff51d) Thanks [@rezrah](https://github.com/rezrah)! - Add auto-collapsed React code blocks for large code snippets. This feature only applies to code fences with the `jsx live` language identifiers.
|
|
14
14
|
|
|
15
15
|
E.g.
|
|
16
16
|
|
|
@@ -149,22 +149,40 @@ export function Theme({pageMap, children}: ThemeProps) {
|
|
|
149
149
|
{activeHeaderLink ? activeHeaderLink.title : siteTitle}
|
|
150
150
|
</Breadcrumbs.Item>
|
|
151
151
|
)}
|
|
152
|
-
{activePath.
|
|
153
|
-
|
|
152
|
+
{activePath.reduce((acc, item, index, items) => {
|
|
153
|
+
// Skip duplicate item for index pages without tab-label
|
|
154
|
+
if (
|
|
155
|
+
index > 0 &&
|
|
156
|
+
item.route === items[index - 1].route &&
|
|
157
|
+
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
|
|
158
|
+
!item.frontMatter?.['tab-label']
|
|
159
|
+
) {
|
|
160
|
+
return acc
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
|
|
164
|
+
const itemTitle = item.frontMatter?.['tab-label'] || item.title
|
|
165
|
+
const isLastItem = index === items.length - 1
|
|
166
|
+
|
|
167
|
+
acc.push(
|
|
154
168
|
<Breadcrumbs.Item
|
|
155
169
|
as={NextLink}
|
|
156
|
-
key={item.name}
|
|
170
|
+
key={`${item.name}-${index}`}
|
|
157
171
|
href={item.route}
|
|
158
|
-
selected={
|
|
172
|
+
selected={isLastItem}
|
|
159
173
|
sx={{
|
|
160
174
|
textTransform: 'capitalize',
|
|
161
175
|
color: 'var(--brand-InlineLink-color-rest)',
|
|
176
|
+
pointerEvents: isLastItem ? 'none' : undefined,
|
|
177
|
+
cursor: isLastItem ? 'default' : undefined,
|
|
162
178
|
}}
|
|
163
179
|
>
|
|
164
|
-
{
|
|
165
|
-
</Breadcrumbs.Item
|
|
180
|
+
{itemTitle.replace(/-/g, ' ')}
|
|
181
|
+
</Breadcrumbs.Item>,
|
|
166
182
|
)
|
|
167
|
-
|
|
183
|
+
|
|
184
|
+
return acc
|
|
185
|
+
}, [] as React.ReactNode[])}
|
|
168
186
|
</Breadcrumbs>
|
|
169
187
|
)}
|
|
170
188
|
|