diff --git a/.changeset/twelve-falcons-exist.md b/.changeset/twelve-falcons-exist.md new file mode 100644 index 000000000..b65f0f5f0 --- /dev/null +++ b/.changeset/twelve-falcons-exist.md @@ -0,0 +1,5 @@ +--- +"gitbook": patch +--- + +Fix OpenAPI block overflow issue diff --git a/packages/gitbook/e2e/internal.spec.ts b/packages/gitbook/e2e/internal.spec.ts index 60e9f2f7f..e29bcb2fa 100644 --- a/packages/gitbook/e2e/internal.spec.ts +++ b/packages/gitbook/e2e/internal.spec.ts @@ -420,7 +420,6 @@ const testCases: TestsCase[] = [ await zoomImage.first().click(); await expect(page.getByTestId('zoom-image-modal')).toBeVisible(); }, - fullPage: true, screenshot: { threshold: 0.8 }, }, { diff --git a/packages/gitbook/e2e/util.ts b/packages/gitbook/e2e/util.ts index 1307125c8..757b90c25 100644 --- a/packages/gitbook/e2e/util.ts +++ b/packages/gitbook/e2e/util.ts @@ -340,6 +340,11 @@ async function waitForIcons(page: Page) { return false; } + // Ignore icons that are not visible. + if (!icon.checkVisibility()) { + return true; + } + // url("https://ka-p.fontawesome.com/releases/v6.6.0/svgs/light/moon.svg?v=2&token=a463935e93") const maskImage = window.getComputedStyle(icon).getPropertyValue('mask-image'); const urlMatch = maskImage.match(/url\("([^"]+)"\)/); diff --git a/packages/gitbook/src/components/DocumentView/OpenAPI/OpenAPIOperation.tsx b/packages/gitbook/src/components/DocumentView/OpenAPI/OpenAPIOperation.tsx index 870a71dca..85aaef171 100644 --- a/packages/gitbook/src/components/DocumentView/OpenAPI/OpenAPIOperation.tsx +++ b/packages/gitbook/src/components/DocumentView/OpenAPI/OpenAPIOperation.tsx @@ -20,7 +20,7 @@ import type { AnyOpenAPIOperationsBlock } from '@/lib/openapi/types'; export async function OpenAPIOperation(props: BlockProps) { const { style } = props; return ( -
+
); diff --git a/packages/gitbook/src/components/DocumentView/OpenAPI/style.css b/packages/gitbook/src/components/DocumentView/OpenAPI/style.css index baf61b081..0ee2a8b14 100644 --- a/packages/gitbook/src/components/DocumentView/OpenAPI/style.css +++ b/packages/gitbook/src/components/DocumentView/OpenAPI/style.css @@ -1,6 +1,6 @@ /* Layout Components */ .openapi-operation { - @apply flex-1 flex flex-col gap-8 mb-14; + @apply flex-1 flex flex-col gap-8 mb-14 min-w-0; } .openapi-schemas { @@ -397,7 +397,7 @@ /* Path */ .openapi-path { - @apply flex items-center text-sm gap-2 h-fit; + @apply flex items-start text-sm gap-2 h-fit min-w-0 max-w-full; } .openapi-path-variable { @@ -409,14 +409,12 @@ } .openapi-path .openapi-method { - @apply text-[0.813rem] m-0 h-full items-center flex px-2; + @apply text-[0.813rem] m-0 mt-0.5 items-center flex px-2; } .openapi-path-title { - @apply flex-1 relative font-normal whitespace-nowrap overflow-x-auto font-mono text-tint-strong/10; + @apply flex-1 relative font-normal text-left font-mono text-tint-strong/10; @apply py-0.5 px-1 rounded hover:bg-tint cursor-pointer transition-colors; - scrollbar-width: none; - -ms-overflow-style: none; } .openapi-path-title[data-deprecated="true"] { diff --git a/packages/gitbook/src/components/PageBody/PageBody.tsx b/packages/gitbook/src/components/PageBody/PageBody.tsx index 84213777a..54623ad66 100644 --- a/packages/gitbook/src/components/PageBody/PageBody.tsx +++ b/packages/gitbook/src/components/PageBody/PageBody.tsx @@ -35,25 +35,19 @@ export function PageBody(props: { return ( <>
{page.cover && page.layout.cover && page.layout.coverSize === 'hero' ? ( @@ -66,14 +60,14 @@ export function PageBody(props: { fallback={ } > *+*]:mt-5', 'grid']} - blockStyle={['page-api-block:ml-0']} + style="grid [&>*+*]:mt-5" + blockStyle="page-api-block:ml-0" context={{ mode: 'default', contentContext: context, @@ -88,23 +82,9 @@ export function PageBody(props: { ) : null} -
+
{updatedAt ? ( -

+

{t(language, 'page_last_modified', )}

) : null} diff --git a/packages/gitbook/src/components/SpaceLayout/SpaceLayout.tsx b/packages/gitbook/src/components/SpaceLayout/SpaceLayout.tsx index 0baed51ed..dee2bf390 100644 --- a/packages/gitbook/src/components/SpaceLayout/SpaceLayout.tsx +++ b/packages/gitbook/src/components/SpaceLayout/SpaceLayout.tsx @@ -136,7 +136,7 @@ export function SpaceLayout(props: { } /> -
{children}
+
{children}