mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-13 12:55:00 +00:00
refactor(editor): refactor linkPreviewer as an extension and remove bookmark service (#9754)
[BS-2427](https://linear.app/affine-design/issue/BS-2427/移除-bookmark-block-service) [BS-2418](https://linear.app/affine-design/issue/BS-2418/linkpreviewer-重构成插件)
This commit is contained in:
@@ -1,13 +1,10 @@
|
||||
import { useRefEffect } from '@affine/component';
|
||||
import { EditorLoading } from '@affine/component/page-detail-skeleton';
|
||||
import {
|
||||
BookmarkBlockService,
|
||||
customImageProxyMiddleware,
|
||||
type DocMode,
|
||||
EmbedGithubBlockService,
|
||||
EmbedLoomBlockService,
|
||||
EmbedYoutubeBlockService,
|
||||
ImageBlockService,
|
||||
LinkPreviewerService,
|
||||
} from '@blocksuite/affine/blocks';
|
||||
import { DisposableGroup } from '@blocksuite/affine/global/utils';
|
||||
import type { AffineEditorContainer } from '@blocksuite/affine/presets';
|
||||
@@ -71,19 +68,9 @@ const BlockSuiteEditorImpl = ({
|
||||
);
|
||||
ImageBlockService.setImageProxyURL(BUILD_CONFIG.imageProxyUrl);
|
||||
|
||||
// provide link preview endpoint to blocksuite
|
||||
BookmarkBlockService.setLinkPreviewEndpoint(
|
||||
BUILD_CONFIG.linkPreviewUrl
|
||||
);
|
||||
EmbedGithubBlockService.setLinkPreviewEndpoint(
|
||||
BUILD_CONFIG.linkPreviewUrl
|
||||
);
|
||||
EmbedYoutubeBlockService.setLinkPreviewEndpoint(
|
||||
BUILD_CONFIG.linkPreviewUrl
|
||||
);
|
||||
EmbedLoomBlockService.setLinkPreviewEndpoint(
|
||||
BUILD_CONFIG.linkPreviewUrl
|
||||
);
|
||||
editor.host?.doc
|
||||
.get(LinkPreviewerService)
|
||||
.setEndpoint(BUILD_CONFIG.linkPreviewUrl);
|
||||
|
||||
return editor.host?.updateComplete;
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user