diff --git a/bun.lockb b/bun.lockb index 426c0b291..cf322fbd6 100755 Binary files a/bun.lockb and b/bun.lockb differ diff --git a/package.json b/package.json index 34d3c1a83..38d06167b 100644 --- a/package.json +++ b/package.json @@ -20,7 +20,7 @@ ], "dependencies": { "@geist-ui/icons": "^1.0.2", - "@gitbook/api": "^0.43.0", + "@gitbook/api": "^0.46.0", "@radix-ui/react-checkbox": "^1.0.4", "@radix-ui/react-popover": "^1.0.7", "@sentry/nextjs": "^7.94.1", diff --git a/packages/react-contentkit/package.json b/packages/react-contentkit/package.json index 6e4a5ed66..2826bca3a 100644 --- a/packages/react-contentkit/package.json +++ b/packages/react-contentkit/package.json @@ -3,7 +3,7 @@ "exports": "./src/index.ts", "dependencies": { "classnames": "^2.5.1", - "@gitbook/api": "^0.41.0", + "@gitbook/api": "^0.46.0", "assert-never": "^1.2.1" }, "peerDependencies": { diff --git a/src/components/DocumentView/Embed.tsx b/src/components/DocumentView/Embed.tsx index d118f2dea..6066bf3cb 100644 --- a/src/components/DocumentView/Embed.tsx +++ b/src/components/DocumentView/Embed.tsx @@ -1,4 +1,4 @@ -import { DocumentBlockEmbed } from '@gitbook/api'; +import * as gitbookAPI from '@gitbook/api'; import Script from 'next/script'; import { Card } from '@/components/primitives'; @@ -7,11 +7,14 @@ import { tcls } from '@/lib/tailwind'; import { BlockProps } from './Block'; import { Caption } from './Caption'; +import { IntegrationBlock } from './Integration'; -export async function Embed(props: BlockProps) { - const { block } = props; +export async function Embed(props: BlockProps) { + const { block, context, ...otherProps } = props; - const { data: embed } = await api().urls.getEmbedByUrl({ url: block.data.url }); + const { data: embed } = await (context.content + ? api().spaces.getEmbedByUrlInSpace(context.content.spaceId, { url: block.data.url }) + : api().urls.getEmbedByUrl({ url: block.data.url })); return ( @@ -25,6 +28,12 @@ export async function Embed(props: BlockProps) { {/* We load the iframely script to resize the embed iframes dynamically */}