mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-07-19 02:56:23 +08:00
1f45cc5dec
**Directory Structure Changes** - Renamed multiple block-related directories by removing the "block-" prefix: - `block-attachment` → `attachment` - `block-bookmark` → `bookmark` - `block-callout` → `callout` - `block-code` → `code` - `block-data-view` → `data-view` - `block-database` → `database` - `block-divider` → `divider` - `block-edgeless-text` → `edgeless-text` - `block-embed` → `embed`
25 lines
668 B
TypeScript
25 lines
668 B
TypeScript
import { EdgelessClipboardConfig } from '@blocksuite/affine-block-surface';
|
|
import { type BlockSnapshot } from '@blocksuite/store';
|
|
|
|
export class EdgelessClipboardEmbedHtmlConfig extends EdgelessClipboardConfig {
|
|
static override readonly key = 'affine:embed-html';
|
|
|
|
override createBlock(htmlEmbed: BlockSnapshot): string | null {
|
|
if (!this.surface) return null;
|
|
const { xywh, style, caption, html, design } = htmlEmbed.props;
|
|
|
|
const embedHtmlId = this.crud.addBlock(
|
|
'affine:embed-html',
|
|
{
|
|
xywh,
|
|
style,
|
|
caption,
|
|
html,
|
|
design,
|
|
},
|
|
this.surface.model.id
|
|
);
|
|
return embedHtmlId;
|
|
}
|
|
}
|