setHovered(false)}
align={align}
side={side}
+ sideOffset={sideOffset}
className={DROPDOWN_CONTENT_OUTER_CLASS}
>
diff --git a/packages/gitbook/src/components/primitives/Tooltip.tsx b/packages/gitbook/src/components/primitives/Tooltip.tsx
index d09aa0679..13a0994ee 100644
--- a/packages/gitbook/src/components/primitives/Tooltip.tsx
+++ b/packages/gitbook/src/components/primitives/Tooltip.tsx
@@ -20,6 +20,7 @@ export function Tooltip(props: {
arrowProps?: RadixTooltip.TooltipArrowProps;
arrow?: boolean;
className?: string;
+ pinOnClick?: boolean;
}) {
const {
children,
@@ -31,6 +32,7 @@ export function Tooltip(props: {
arrowProps,
arrow = false,
className,
+ pinOnClick = true,
} = props;
const [open, setOpen] = useState(false);
@@ -56,7 +58,11 @@ export function Tooltip(props: {
return (
- setClicked(true)} {...triggerProps}>
+ setClicked(true) : undefined}
+ {...triggerProps}
+ >
{children}
diff --git a/packages/gitbook/src/lib/data/api.ts b/packages/gitbook/src/lib/data/api.ts
index 75a802639..fa5704904 100644
--- a/packages/gitbook/src/lib/data/api.ts
+++ b/packages/gitbook/src/lib/data/api.ts
@@ -139,6 +139,20 @@ export function createDataFetcher(
changeRequestId: params.changeRequestId,
});
},
+ getChangeRequestChanges(params) {
+ return getChangeRequestChanges(input, {
+ spaceId: params.spaceId,
+ changeRequestId: params.changeRequestId,
+ limit: params.limit,
+ });
+ },
+ getRevisionSemanticChanges(params) {
+ return getRevisionSemanticChanges(input, {
+ spaceId: params.spaceId,
+ revisionId: params.revisionId,
+ limit: params.limit,
+ });
+ },
getDocument(params) {
return getDocument(input, {
spaceId: params.spaceId,
@@ -323,6 +337,76 @@ const getRevision = cache(
}
);
+const getChangeRequestChanges = cache(
+ async (
+ input: DataFetcherInput,
+ params: { spaceId: string; changeRequestId: string; limit?: number }
+ ) => {
+ 'use cache: remote';
+ cacheTag(
+ getCacheTag({
+ tag: 'change-request',
+ space: params.spaceId,
+ changeRequest: params.changeRequestId,
+ })
+ );
+
+ return wrapDataFetcherError(async () => {
+ return trace(
+ `getChangeRequestChanges(${params.spaceId}, ${params.changeRequestId})`,
+ async () => {
+ const api = apiClient(input);
+ const res = await api.spaces.getChangeRequestChanges(
+ params.spaceId,
+ params.changeRequestId,
+ {
+ limit: params.limit,
+ },
+ {
+ ...noCacheFetchOptions,
+ }
+ );
+ cacheTag(...getCacheTagsFromResponse(res));
+ cacheLife('minutes');
+ return res.data;
+ }
+ );
+ });
+ }
+);
+
+const getRevisionSemanticChanges = cache(
+ async (
+ input: DataFetcherInput,
+ params: { spaceId: string; revisionId: string; limit?: number }
+ ) => {
+ 'use cache: remote';
+ return wrapDataFetcherError(async () => {
+ return trace(
+ `getRevisionSemanticChanges(${params.spaceId}, ${params.revisionId})`,
+ async () => {
+ const api = apiClient(input);
+ const res = await api.spaces.getRevisionSemanticChanges(
+ params.spaceId,
+ params.revisionId,
+ {
+ computed: false,
+ limit: params.limit,
+ metadata: false,
+ },
+ {
+ ...noCacheFetchOptions,
+ }
+ );
+ cacheTag(...getCacheTagsFromResponse(res));
+ cacheLife('max');
+ return res.data;
+ }
+ );
+ });
+ }
+);
+
const getRevisionPageMarkdown = cache(
async (
input: DataFetcherInput,
diff --git a/packages/gitbook/src/lib/data/types.ts b/packages/gitbook/src/lib/data/types.ts
index b01a823dc..878479f98 100644
--- a/packages/gitbook/src/lib/data/types.ts
+++ b/packages/gitbook/src/lib/data/types.ts
@@ -65,6 +65,15 @@ export interface GitBookDataFetcher {
changeRequestId: string;
}): Promise>;
+ /**
+ * Get the semantic changes for a change request.
+ */
+ getChangeRequestChanges(params: {
+ spaceId: string;
+ changeRequestId: string;
+ limit?: number;
+ }): Promise>;
+
/**
* Get the revision by its space ID and revision ID.
*/
@@ -73,6 +82,15 @@ export interface GitBookDataFetcher {
revisionId: string;
}): Promise>;
+ /**
+ * Get the semantic changes for a revision.
+ */
+ getRevisionSemanticChanges(params: {
+ spaceId: string;
+ revisionId: string;
+ limit?: number;
+ }): Promise>;
+
/**
* Get a revision page by its path.
*/