fix: ai ppt preview with toolbar widget (#8882)

Fix issue [AF-1716](https://linear.app/affine-design/issue/AF-1716).
This commit is contained in:
akumatus
2024-11-21 06:56:26 +00:00
parent a6232849e3
commit c6ac426b4c
2 changed files with 5 additions and 3 deletions
@@ -1,7 +1,7 @@
import { BlockStdScope, type EditorHost } from '@blocksuite/affine/block-std';
import {
type AffineAIPanelWidgetConfig,
EdgelessEditorBlockSpecs,
SpecProvider,
} from '@blocksuite/affine/blocks';
import { AffineSchemas } from '@blocksuite/affine/blocks/schemas';
import { WithDisposable } from '@blocksuite/affine/global/utils';
@@ -208,7 +208,8 @@ export class AISlidesRenderer extends WithDisposable(LitElement) {
>
${new BlockStdScope({
doc: this._doc,
extensions: EdgelessEditorBlockSpecs,
extensions:
SpecProvider.getInstance().getSpec('edgeless:preview').value,
}).render()}
</div>
<div class="mask"></div>
@@ -438,12 +438,13 @@ Could you make a new website based on these notes and send back just the html fi
const url = new URL(getBaseUrl() + '/api/copilot/unsplash/photos');
url.searchParams.set('query', options.query);
const result: {
results: {
results?: {
urls: {
regular: string;
};
}[];
} = await fetch(url.toString()).then(res => res.json());
if (!result.results) return [];
return result.results.map(r => {
const url = new URL(r.urls.regular);
url.searchParams.set('fit', 'crop');