mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-08-11 14:08:55 +08:00
feat(core): support block or element reference links (#7946)
Upstreams: https://github.com/toeverything/blocksuite/pull/8021 * open doc with mode * monitor mode changes in query string * scroll anchoring https://github.com/user-attachments/assets/681abff8-e51b-47ea-bb71-447e8b312142 https://github.com/user-attachments/assets/e73ed4c0-4e33-45f8-9db4-d8eed3525d05
This commit is contained in:
@@ -52,7 +52,6 @@ export const resolveRouteLinkMeta = (href: string) => {
|
||||
workspaceId,
|
||||
moduleName: 'doc' as const,
|
||||
docId: moduleName,
|
||||
blockId: hash.slice(1),
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import type { BlockComponent, EditorHost } from '@blocksuite/block-std';
|
||||
import {
|
||||
AffineReference,
|
||||
type DocMode,
|
||||
DocMode,
|
||||
type EmbedLinkedDocModel,
|
||||
type EmbedSyncedDocModel,
|
||||
type ImageBlockModel,
|
||||
@@ -135,7 +135,7 @@ function resolvePeekInfoFromPeekTarget(
|
||||
return {
|
||||
type: 'doc',
|
||||
docId,
|
||||
mode: 'edgeless' as DocMode,
|
||||
mode: DocMode.Edgeless,
|
||||
xywh: refModel.xywh,
|
||||
};
|
||||
}
|
||||
|
||||
@@ -112,8 +112,7 @@ export const DocPeekViewControls = ({
|
||||
nameKey: 'open',
|
||||
onClick: () => {
|
||||
// TODO(@Peng): for frame blocks, we should mimic "view in edgeless" button behavior
|
||||
workbench.openDoc({ docId, blockId, mode });
|
||||
|
||||
workbench.openDoc({ docId, mode, blockId });
|
||||
peekView.close('none');
|
||||
},
|
||||
},
|
||||
@@ -122,7 +121,7 @@ export const DocPeekViewControls = ({
|
||||
nameKey: 'new-tab',
|
||||
name: t['com.affine.peek-view-controls.open-doc-in-new-tab'](),
|
||||
onClick: () => {
|
||||
workbench.openDoc(docId, { at: 'new-tab' });
|
||||
workbench.openDoc({ docId, mode }, { at: 'new-tab' });
|
||||
peekView.close('none');
|
||||
},
|
||||
},
|
||||
@@ -131,7 +130,7 @@ export const DocPeekViewControls = ({
|
||||
nameKey: 'split-view',
|
||||
name: t['com.affine.peek-view-controls.open-doc-in-split-view'](),
|
||||
onClick: () => {
|
||||
workbench.openDoc(docId, { at: 'beside' });
|
||||
workbench.openDoc({ docId, mode }, { at: 'beside' });
|
||||
peekView.close('none');
|
||||
},
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user