Files
AFFiNE-Mirror/blocksuite/affine/blocks/embed/src/store.ts
T
Saul-Mirone 04531508cb feat(editor): add embed doc block extension (#12090)
Closes: BS-3393

<!-- This is an auto-generated comment: release notes by coderabbit.ai -->

## Summary by CodeRabbit

- **New Features**
  - Introduced a new "Embed Doc" block, enabling embedding and rendering of linked and synced documents within cards, including support for banners and note previews.
  - Added new toolbar and quick search options for inserting embedded linked and synced documents.

- **Improvements**
  - Updated dependencies and internal references to support the new embed doc functionality across related blocks and components.
  - Enhanced support for edgeless environments with new clipboard and configuration options for embedded docs.

- **Refactor**
  - Streamlined and reorganized embed-related code, moving linked and synced doc logic into a dedicated embed doc module.
  - Removed obsolete adapter and utility files to simplify maintenance.

- **Chores**
  - Updated project and TypeScript configuration files to include the new embed doc module in builds and references.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2025-04-30 09:16:17 +00:00

49 lines
1.9 KiB
TypeScript

import {
type StoreExtensionContext,
StoreExtensionProvider,
} from '@blocksuite/affine-ext-loader';
import {
EmbedFigmaBlockSchemaExtension,
EmbedGithubBlockSchemaExtension,
EmbedHtmlBlockSchemaExtension,
EmbedIframeBlockSchemaExtension,
EmbedLinkedDocBlockSchemaExtension,
EmbedLoomBlockSchemaExtension,
EmbedSyncedDocBlockSchemaExtension,
EmbedYoutubeBlockSchemaExtension,
} from '@blocksuite/affine-model';
import { EmbedIframeService } from '@blocksuite/affine-shared/services';
import { EmbedFigmaBlockAdapterExtensions } from './embed-figma-block/adapters/extension';
import { EmbedGithubBlockAdapterExtensions } from './embed-github-block/adapters/extension';
import { EmbedIframeConfigExtensions } from './embed-iframe-block';
import { EmbedIframeBlockAdapterExtensions } from './embed-iframe-block/adapters';
import { EmbedLoomBlockAdapterExtensions } from './embed-loom-block/adapters/extension';
import { EmbedYoutubeBlockAdapterExtensions } from './embed-youtube-block/adapters/extension';
export class EmbedStoreExtension extends StoreExtensionProvider {
override name = 'affine-embed-block';
override setup(context: StoreExtensionContext) {
super.setup(context);
context.register([
EmbedSyncedDocBlockSchemaExtension,
EmbedLinkedDocBlockSchemaExtension,
EmbedHtmlBlockSchemaExtension,
EmbedIframeBlockSchemaExtension,
EmbedGithubBlockSchemaExtension,
EmbedFigmaBlockSchemaExtension,
EmbedLoomBlockSchemaExtension,
EmbedYoutubeBlockSchemaExtension,
]);
context.register(EmbedFigmaBlockAdapterExtensions);
context.register(EmbedGithubBlockAdapterExtensions);
context.register(EmbedYoutubeBlockAdapterExtensions);
context.register(EmbedLoomBlockAdapterExtensions);
context.register(EmbedIframeBlockAdapterExtensions);
context.register(EmbedIframeConfigExtensions);
context.register(EmbedIframeService);
}
}