mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-24 09:52:49 +08:00
feat(editor): add edgeless crud extension (#9335)
This commit is contained in:
@@ -508,7 +508,7 @@ const CREATE_AS_LINKED_DOC = {
|
||||
y = viewportCenter.y - height / 2;
|
||||
}
|
||||
|
||||
service.addBlock(
|
||||
service.crud.addBlock(
|
||||
'affine:embed-linked-doc',
|
||||
{
|
||||
xywh: `[${x}, ${y}, ${width}, ${height}]`,
|
||||
|
||||
@@ -174,7 +174,7 @@ export class AIChatBlockPeekView extends LitElement {
|
||||
|
||||
const edgelessService = this._rootService as EdgelessRootService;
|
||||
const bound = calcChildBound(this.parentModel, edgelessService);
|
||||
const aiChatBlockId = edgelessService.addBlock(
|
||||
const aiChatBlockId = edgelessService.crud.addBlock(
|
||||
'affine:embed-ai-chat' as keyof BlockSuite.BlockModels,
|
||||
{
|
||||
xywh: bound.serialize(),
|
||||
@@ -193,7 +193,7 @@ export class AIChatBlockPeekView extends LitElement {
|
||||
this.updateContext({ currentChatBlockId: aiChatBlockId });
|
||||
|
||||
// Connect the parent chat block to the AI chat block
|
||||
edgelessService.addElement(CanvasElementType.CONNECTOR, {
|
||||
edgelessService.crud.addElement(CanvasElementType.CONNECTOR, {
|
||||
mode: ConnectorMode.Curve,
|
||||
controllers: [],
|
||||
source: { id: this.parentChatBlockId },
|
||||
|
||||
Reference in New Issue
Block a user