refactor(editor): improve edgeless clipboard config (#11472)

This commit is contained in:
Saul-Mirone
2025-04-05 03:48:26 +00:00
parent 96e860caf3
commit 0fbca31c27
30 changed files with 492 additions and 451 deletions
@@ -0,0 +1,25 @@
import { EdgelessClipboardConfig } from '@blocksuite/affine-block-surface';
import { type BlockSnapshot } from '@blocksuite/store';
export class EdgelessClipboardEmbedFigmaConfig extends EdgelessClipboardConfig {
static override readonly key = 'affine:embed-figma';
override createBlock(figmaEmbed: BlockSnapshot): string | null {
if (!this.surface) return null;
const { xywh, style, url, caption, title, description } = figmaEmbed.props;
const embedFigmaId = this.crud.addBlock(
'affine:embed-figma',
{
xywh,
style,
url,
caption,
title,
description,
},
this.surface.model.id
);
return embedFigmaId;
}
}
@@ -1,4 +1,5 @@
export * from './adapters/index.js';
export * from './edgeless-clipboard-config';
export * from './embed-figma-block.js';
export * from './embed-figma-model.js';
export * from './embed-figma-spec.js';