Skip to content

Commit

Permalink
Merge branch 'main' into scottcazan/rnd-5393-track-page-view-with-sit…
Browse files Browse the repository at this point in the history
…espaceid-in-api
  • Loading branch information
scazan authored Nov 11, 2024
2 parents e6324c4 + d48926e commit 72051bd
Show file tree
Hide file tree
Showing 23 changed files with 372 additions and 336 deletions.
5 changes: 5 additions & 0 deletions .changeset/large-months-hang.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@gitbook/react-openapi': patch
---

Fixed scalar api client routing
5 changes: 5 additions & 0 deletions .changeset/sharp-beans-build.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@gitbook/react-openapi': patch
---

Bumped scalar api client pacakge
5 changes: 5 additions & 0 deletions .changeset/shiny-chefs-compare.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'gitbook': minor
---

Fix an issue where the space dropdown was shown under the site sections in Safari.
5 changes: 5 additions & 0 deletions .changeset/weak-dodos-love.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'gitbook': minor
---

Fix an issue where the space dropdown could appear behind the header.
5 changes: 5 additions & 0 deletions .changeset/weak-swans-battle.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'gitbook': minor
---

Fix the styling of site section tabs on smaller screens.
Binary file modified bun.lockb
Binary file not shown.
8 changes: 2 additions & 6 deletions packages/gitbook/src/components/DocumentView/Block.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,8 @@ import { Heading } from './Heading';
import { Hint } from './Hint';
import { Images } from './Images';
import { IntegrationBlock } from './Integration';
import { List } from './List';
import { ListItem } from './ListItem';
import { ListOrdered } from './ListOrdered';
import { ListTasks } from './ListTasks';
import { ListUnordered } from './ListUnordered';
import { BlockMath } from './Math';
import { OpenAPI } from './OpenAPI';
import { Paragraph } from './Paragraph';
Expand Down Expand Up @@ -65,11 +63,9 @@ export function Block<T extends DocumentBlock>(props: BlockProps<T>) {
case 'heading-3':
return <Heading {...props} block={block} />;
case 'list-ordered':
return <ListOrdered {...props} block={block} />;
case 'list-unordered':
return <ListUnordered {...props} block={block} />;
case 'list-tasks':
return <ListTasks {...props} block={block} />;
return <List {...props} block={block} />;
case 'list-item':
return <ListItem {...props} block={block} />;
case 'code':
Expand Down
44 changes: 44 additions & 0 deletions packages/gitbook/src/components/DocumentView/List.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
import {
DocumentBlockListOrdered,
DocumentBlockListTasks,
DocumentBlockListUnordered,
} from '@gitbook/api';
import assertNever from 'assert-never';

import { BlockProps } from './Block';
import { Blocks } from './Blocks';

export function List(
props: BlockProps<
DocumentBlockListUnordered | DocumentBlockListOrdered | DocumentBlockListTasks
>,
) {
const { block, style, ancestorBlocks, ...contextProps } = props;

return (
<Blocks
{...contextProps}
tag={getListTag(block.type)}
nodes={block.nodes}
ancestorBlocks={[...ancestorBlocks, block]}
style={['space-y-2', style]}
/>
);
}

function getListTag(
type:
| DocumentBlockListUnordered['type']
| DocumentBlockListOrdered['type']
| DocumentBlockListTasks['type'],
) {
switch (type) {
case 'list-ordered':
return 'ol';
case 'list-unordered':
case 'list-tasks':
return 'ul';
default:
assertNever(type);
}
}
13 changes: 0 additions & 13 deletions packages/gitbook/src/components/DocumentView/ListItem.module.css

This file was deleted.

Loading

0 comments on commit 72051bd

Please sign in to comment.