mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-07-29 08:09:52 +08:00
feat: bump blocksuite (#7603)
## Features - https://github.com/toeverything/BlockSuite/pull/7717 @L-Sun - https://github.com/toeverything/BlockSuite/pull/7691 @L-Sun ## Bugfix - https://github.com/toeverything/BlockSuite/pull/7720 @akumatus - https://github.com/toeverything/BlockSuite/pull/7719 @doouding ## Refactor - https://github.com/toeverything/BlockSuite/pull/7703 @donteatfriedrice - https://github.com/toeverything/BlockSuite/pull/7694 @doouding - https://github.com/toeverything/BlockSuite/pull/7700 @L-Sun - https://github.com/toeverything/BlockSuite/pull/7716 @doodlewind ## Misc
This commit is contained in:
@@ -160,7 +160,7 @@ const DetailPageImpl = memo(function DetailPageImpl() {
|
||||
const editorHost = editor.host;
|
||||
|
||||
// provide image proxy endpoint to blocksuite
|
||||
editorHost.std.clipboard.use(
|
||||
editorHost?.std.clipboard.use(
|
||||
customImageProxyMiddleware(runtimeConfig.imageProxyUrl)
|
||||
);
|
||||
ImageBlockService.setImageProxyURL(runtimeConfig.imageProxyUrl);
|
||||
@@ -179,22 +179,24 @@ const DetailPageImpl = memo(function DetailPageImpl() {
|
||||
|
||||
// provide page mode and updated date to blocksuite
|
||||
const pageService =
|
||||
editorHost.std.spec.getService<PageRootService>('affine:page');
|
||||
editorHost?.std.spec.getService<PageRootService>('affine:page');
|
||||
const disposable = new DisposableGroup();
|
||||
|
||||
doc.setMode(mode);
|
||||
disposable.add(
|
||||
pageService.slots.docLinkClicked.on(({ docId, blockId }) => {
|
||||
return blockId
|
||||
? jumpToPageBlock(docCollection.id, docId, blockId)
|
||||
: openPage(docCollection.id, docId);
|
||||
})
|
||||
);
|
||||
disposable.add(
|
||||
pageService.slots.tagClicked.on(({ tagId }) => {
|
||||
jumpToTag(workspace.id, tagId);
|
||||
})
|
||||
);
|
||||
if (pageService) {
|
||||
disposable.add(
|
||||
pageService.slots.docLinkClicked.on(({ docId, blockId }) => {
|
||||
return blockId
|
||||
? jumpToPageBlock(docCollection.id, docId, blockId)
|
||||
: openPage(docCollection.id, docId);
|
||||
})
|
||||
);
|
||||
disposable.add(
|
||||
pageService.slots.tagClicked.on(({ tagId }) => {
|
||||
jumpToTag(workspace.id, tagId);
|
||||
})
|
||||
);
|
||||
}
|
||||
|
||||
setEditor(editor);
|
||||
|
||||
|
||||
@@ -42,7 +42,8 @@ export const EditorChatPanel = forwardRef(function EditorChatPanel(
|
||||
|
||||
useEffect(() => {
|
||||
if (!editor) return;
|
||||
const pageService = editor.host.spec.getService('affine:page');
|
||||
const pageService = editor.host?.spec.getService('affine:page');
|
||||
if (!pageService) return;
|
||||
|
||||
const disposable = [
|
||||
pageService.slots.docLinkClicked.on(() => {
|
||||
@@ -65,7 +66,9 @@ export const EditorChatPanel = forwardRef(function EditorChatPanel(
|
||||
chatPanelRef.current = new ChatPanel();
|
||||
}
|
||||
|
||||
(chatPanelRef.current as ChatPanel).host = editor.host;
|
||||
if (editor.host) {
|
||||
(chatPanelRef.current as ChatPanel).host = editor.host;
|
||||
}
|
||||
(chatPanelRef.current as ChatPanel).doc = editor.doc;
|
||||
// (copilotPanelRef.current as CopilotPanel).fitPadding = [20, 20, 20, 20];
|
||||
|
||||
|
||||
Reference in New Issue
Block a user