feat(editor): add edgeless crud extension (#9335)

This commit is contained in:
Saul-Mirone
2024-12-26 08:58:06 +00:00
parent 0de4f7abbb
commit 6afa1d542f
48 changed files with 629 additions and 423 deletions

View File

@@ -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}]`,

View File

@@ -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 },