Skip to content

Commit 7dc7701

Browse files
committed
Merge branch 'main' into update-embed-frame
2 parents d2725f5 + 3fbd6f0 commit 7dc7701

File tree

10 files changed

+31
-29
lines changed

10 files changed

+31
-29
lines changed

.changeset/tiny-carrots-rush.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'gitbook': patch
3+
---
4+
5+
Fix hidden section not found

bun.lock

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -345,7 +345,7 @@
345345
"react-dom": "catalog:",
346346
},
347347
"catalog": {
348-
"@gitbook/api": "0.152.0",
348+
"@gitbook/api": "0.153.0",
349349
"@scalar/api-client-react": "^1.3.46",
350350
"@tsconfig/node20": "^20.1.6",
351351
"@tsconfig/strictest": "^2.0.6",
@@ -726,7 +726,7 @@
726726

727727
"@fortawesome/fontawesome-svg-core": ["@fortawesome/[email protected]", "", { "dependencies": { "@fortawesome/fontawesome-common-types": "6.6.0" } }, "sha512-KHwPkCk6oRT4HADE7smhfsKudt9N/9lm6EJ5BVg0tD1yPA5hht837fB87F8pn15D8JfTqQOjhKTktwmLMiD7Kg=="],
728728

729-
"@gitbook/api": ["@gitbook/api@0.152.0", "", { "dependencies": { "event-iterator": "^2.0.0", "eventsource-parser": "^3.0.0" } }, "sha512-BC+SXnBybtzKYY3aUYDOjwz17uQwMM1kTNiij8OTKZyFByyWcz1FifJGNmKHmDG3XeZLJtCi3nOTEIcGIdG1VA=="],
729+
"@gitbook/api": ["@gitbook/api@0.153.0", "", { "dependencies": { "event-iterator": "^2.0.0", "eventsource-parser": "^3.0.0" } }, "sha512-ArNPFoqwId4Flicz8xPEdGqXQkzxyxP7S8Uv3wIfCX2e4cLhpcS7xCJGEHOJrqe1tNs1ovT1N2MWfpdIqzXqig=="],
730730

731731
"@gitbook/browser-types": ["@gitbook/browser-types@workspace:packages/browser-types"],
732732

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
"catalog": {
4242
"@tsconfig/strictest": "^2.0.6",
4343
"@tsconfig/node20": "^20.1.6",
44-
"@gitbook/api": "0.152.0",
44+
"@gitbook/api": "0.153.0",
4545
"@scalar/api-client-react": "^1.3.46",
4646
"@types/react": "^19.0.0",
4747
"@types/react-dom": "^19.0.0",

packages/gitbook/src/components/DocumentView/Hint.tsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,9 @@ export function Hint({
3232
className={tcls(
3333
'hint',
3434
'transition-colors',
35-
'rounded-md',
36-
hasHeading ? 'rounded-l-sm' : null,
37-
'straight-corners:rounded-none',
35+
'rounded-corners:rounded-md',
3836
'circular-corners:rounded-xl',
37+
hasHeading ? 'circular-corners:rounded-l-none rounded-corners:rounded-l-none' : '',
3938
'overflow-hidden',
4039
hasHeading ? ['border-l-2', hintStyle.containerWithHeader] : hintStyle.container,
4140

packages/gitbook/src/components/DocumentView/StepperStep.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,13 +36,13 @@ export function StepperStep(props: BlockProps<DocumentBlockStepperStep>) {
3636
<div className="relative select-none">
3737
<div
3838
className={tcls(
39-
'can-override-bg can-override-text flex size-[calc(1.75rem+1px)] items-center justify-center rounded-full bg-primary-original theme-muted:bg-primary-subtle tabular-nums contrast-more:bg-primary-solid',
40-
'font-medium text-contrast-primary-original theme-muted:text-primary contrast-more:text-contrast-primary-solid'
39+
'can-override-bg can-override-text flex size-[calc(1.75rem+1px)] items-center justify-center rounded-full bg-primary-solid theme-muted:bg-tint-base tabular-nums contrast-more:bg-primary-11',
40+
'font-medium text-contrast-primary-solid theme-muted:text-tint contrast-more:text-contrast-primary-11'
4141
)}
4242
>
4343
{index + 1}
4444
</div>
45-
<div className="can-override-bg absolute top-9 bottom-2 left-3.5 w-px bg-primary-7 theme-muted:bg-primary-subtle" />
45+
<div className="can-override-bg absolute top-9 bottom-2 left-3.5 w-px bg-primary-7 theme-muted:bg-tint-6" />
4646
</div>
4747
<Blocks
4848
{...contextProps}

packages/gitbook/src/components/DocumentView/utils/colors.ts

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,17 @@ import type { DocumentMarkColor } from '@gitbook/api';
33

44
export const textColorToStyle: { [color in DocumentMarkColor['data']['text']]: ClassValue } = {
55
default: [],
6-
blue: ['text-blue-500'],
7-
red: ['text-red-500'],
8-
green: ['text-green-500'],
9-
yellow: ['text-yellow-600'],
10-
purple: ['text-purple-500'],
11-
orange: ['text-orange-500'],
12-
$primary: ['text-primary'],
13-
$info: ['text-info'],
14-
$success: ['text-success'],
15-
$warning: ['text-warning'],
16-
$danger: ['text-danger'],
6+
blue: ['text-blue-500 contrast-more:text-blue-800'],
7+
red: ['text-red-500 contrast-more:text-red-800'],
8+
green: ['text-green-500 contrast-more:text-green-800'],
9+
yellow: ['text-yellow-600 contrast-more:text-yellow-800'],
10+
purple: ['text-purple-500 contrast-more:text-purple-800'],
11+
orange: ['text-orange-500 contrast-more:text-orange-800'],
12+
$primary: ['text-primary-subtle contrast-more:text-primary'],
13+
$info: ['text-info-subtle contrast-more:text-info'],
14+
$success: ['text-success-subtle contrast-more:text-success'],
15+
$warning: ['text-warning-subtle contrast-more:text-warning'],
16+
$danger: ['text-danger-subtle contrast-more:text-danger'],
1717
};
1818

1919
export const backgroundColorToStyle: {

packages/gitbook/src/components/Footer/Footer.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ export function Footer(props: { context: GitBookSiteContext }) {
2929
className={tcls(
3030
'border-tint-subtle border-t',
3131
// If the footer only contains a mode toggle, we only show it on smaller screens
32-
mobileOnly ? '@7xl:hidden' : null
32+
mobileOnly ? 'xl:hidden' : null
3333
)}
3434
>
3535
<div className="motion-safe:transition-[padding] motion-safe:duration-300 lg:chat-open:pr-80 xl:chat-open:pr-96">

packages/gitbook/src/components/TableOfContents/encodeClientTableOfContents.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ export async function encodeClientTableOfContents(
7272
result.push(
7373
removeUndefined({
7474
id: page.id,
75-
title: page.title,
75+
title: page.linkTitle ?? page.title,
7676
href,
7777
emoji: page.emoji,
7878
icon: page.icon,

packages/gitbook/src/lib/context.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -465,9 +465,7 @@ function parseVisibleSiteSectionsAndGroups(structure: SiteStructure, siteSection
465465
siteSectionId
466466
);
467467
const visibleSectionsAndGroups = filterSectionsAndGroupsWithHiddenSiteSpaces(sectionsAndGroups);
468-
const current = section && !sectionHasOnlyHiddenSiteSpaces(section) ? section : null;
469-
assert(current, `couldn't find section "${siteSectionId}" in site structure`);
470-
return { list: visibleSectionsAndGroups, current } satisfies SiteSections;
468+
return { list: visibleSectionsAndGroups, current: section } satisfies SiteSections;
471469
}
472470

473471
function parseCurrentSection(structure: SiteStructure, siteSectionId: string) {

packages/gitbook/src/lib/references.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ export async function resolveContentRef(
129129
const page = resolvePageResult?.page;
130130
const ancestors =
131131
resolvePageResult?.ancestors.map((ancestor) => ({
132-
label: ancestor.title,
132+
label: ancestor.linkTitle ?? ancestor.title,
133133
icon:
134134
ancestor.emoji || ancestor.icon ? (
135135
<PageIcon
@@ -153,9 +153,9 @@ export async function resolveContentRef(
153153

154154
// Compute the text to display for the link
155155
if (anchor) {
156-
text = page.title;
156+
text = page.linkTitle || page.title;
157157
ancestors.push({
158-
label: page.title,
158+
label: page.linkTitle || page.title,
159159
icon: <PageIcon page={page} style={iconStyle} />,
160160
href,
161161
});
@@ -177,7 +177,7 @@ export async function resolveContentRef(
177177
parentPage && contentRef.page === parentPage.id && parentPage.type === 'group'
178178
? parentPage
179179
: page;
180-
text = pageOrGroup.title;
180+
text = pageOrGroup.linkTitle ?? pageOrGroup.title;
181181
emoji = isCurrentPage ? undefined : page.emoji;
182182
icon = <PageIcon page={pageOrGroup} style={iconStyle} />;
183183
}

0 commit comments

Comments
 (0)