mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-12-04 19:04:37 +03:00
31 lines
1.3 KiB
TypeScript
31 lines
1.3 KiB
TypeScript
import { EmbedGithubBlockSchema } from '@blocksuite/affine-model';
|
|
import { SlashMenuConfigExtension } from '@blocksuite/affine-widget-slash-menu';
|
|
import { BlockViewExtension, FlavourExtension } from '@blocksuite/std';
|
|
import type { ExtensionType } from '@blocksuite/store';
|
|
import { literal } from 'lit/static-html.js';
|
|
|
|
import { createBuiltinToolbarConfigExtension } from '../configs/toolbar';
|
|
import { EmbedGithubBlockAdapterExtensions } from './adapters/extension';
|
|
import { embedGithubSlashMenuConfig } from './configs/slash-menu';
|
|
import { EmbedGithubBlockComponent } from './embed-github-block';
|
|
import {
|
|
EmbedGithubBlockOptionConfig,
|
|
EmbedGithubBlockService,
|
|
} from './embed-github-service';
|
|
|
|
const flavour = EmbedGithubBlockSchema.model.flavour;
|
|
|
|
export const EmbedGithubBlockSpec: ExtensionType[] = [
|
|
FlavourExtension(flavour),
|
|
EmbedGithubBlockService,
|
|
BlockViewExtension(flavour, model => {
|
|
return model.parent?.flavour === 'affine:surface'
|
|
? literal`affine-embed-edgeless-github-block`
|
|
: literal`affine-embed-github-block`;
|
|
}),
|
|
EmbedGithubBlockAdapterExtensions,
|
|
EmbedGithubBlockOptionConfig,
|
|
createBuiltinToolbarConfigExtension(flavour, EmbedGithubBlockComponent),
|
|
SlashMenuConfigExtension(flavour, embedGithubSlashMenuConfig),
|
|
].flat();
|