mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-08-09 13:15:51 +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`
52 lines
1.0 KiB
TypeScript
52 lines
1.0 KiB
TypeScript
import { EdgelessClipboardConfig } from '@blocksuite/affine-block-surface';
|
|
import { type BlockSnapshot } from '@blocksuite/store';
|
|
|
|
export class EdgelessClipboardEmbedGithubConfig extends EdgelessClipboardConfig {
|
|
static override readonly key = 'affine:embed-github';
|
|
|
|
override createBlock(githubEmbed: BlockSnapshot): string | null {
|
|
if (!this.surface) return null;
|
|
|
|
const {
|
|
xywh,
|
|
style,
|
|
owner,
|
|
repo,
|
|
githubType,
|
|
githubId,
|
|
url,
|
|
caption,
|
|
image,
|
|
status,
|
|
statusReason,
|
|
title,
|
|
description,
|
|
createdAt,
|
|
assignees,
|
|
} = githubEmbed.props;
|
|
|
|
const embedGithubId = this.crud.addBlock(
|
|
'affine:embed-github',
|
|
{
|
|
xywh,
|
|
style,
|
|
owner,
|
|
repo,
|
|
githubType,
|
|
githubId,
|
|
url,
|
|
caption,
|
|
image,
|
|
status,
|
|
statusReason,
|
|
title,
|
|
description,
|
|
createdAt,
|
|
assignees,
|
|
},
|
|
this.surface.model.id
|
|
);
|
|
return embedGithubId;
|
|
}
|
|
}
|