refactor(editor): cleanup dead code (#12281)
<!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **Refactor** - Streamlined and consolidated block and inline extension exports by removing multiple block-spec and inline extension arrays from public APIs. - Reduced exported constants, types, and utility functions related to various block and embed features. - Simplified the codebase by removing deprecated type guards, adapter extensions, and redundant extension groupings. - **Chores** - Cleaned up internal APIs by deleting unused exports, imports, and outdated code, enhancing maintainability. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
This commit is contained in:
parent
6959a2dab3
commit
7c22b3931f
@ -1,33 +0,0 @@
|
||||
import { AttachmentBlockSchema } 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 { AttachmentBlockAdapterExtensions } from './adapters/extension.js';
|
||||
import { AttachmentBlockInteraction } from './attachment-edgeless-block.js';
|
||||
import { AttachmentDropOption } from './attachment-service.js';
|
||||
import { attachmentSlashMenuConfig } from './configs/slash-menu.js';
|
||||
import { createBuiltinToolbarConfigExtension } from './configs/toolbar';
|
||||
import {
|
||||
AttachmentEmbedConfigExtension,
|
||||
AttachmentEmbedService,
|
||||
} from './embed';
|
||||
|
||||
const flavour = AttachmentBlockSchema.model.flavour;
|
||||
|
||||
export const AttachmentBlockSpec: ExtensionType[] = [
|
||||
FlavourExtension(flavour),
|
||||
BlockViewExtension(flavour, model => {
|
||||
return model.parent?.flavour === 'affine:surface'
|
||||
? literal`affine-edgeless-attachment`
|
||||
: literal`affine-attachment`;
|
||||
}),
|
||||
AttachmentDropOption,
|
||||
AttachmentEmbedConfigExtension(),
|
||||
AttachmentEmbedService,
|
||||
AttachmentBlockAdapterExtensions,
|
||||
AttachmentBlockInteraction,
|
||||
createBuiltinToolbarConfigExtension(flavour),
|
||||
SlashMenuConfigExtension(flavour, attachmentSlashMenuConfig),
|
||||
].flat();
|
@ -1,7 +1,6 @@
|
||||
export * from './adapters';
|
||||
export * from './attachment-block';
|
||||
export * from './attachment-service';
|
||||
export * from './attachment-spec';
|
||||
export { attachmentViewDropdownMenu } from './configs/toolbar';
|
||||
export * from './edgeless-clipboard-config';
|
||||
export {
|
||||
|
@ -1,24 +0,0 @@
|
||||
import { BookmarkBlockSchema } from '@blocksuite/affine-model';
|
||||
import { BlockViewExtension, FlavourExtension } from '@blocksuite/std';
|
||||
import type { ExtensionType } from '@blocksuite/store';
|
||||
import { literal } from 'lit/static-html.js';
|
||||
|
||||
import { BookmarkBlockAdapterExtensions } from './adapters/extension';
|
||||
import { BookmarkBlockInteraction } from './bookmark-edgeless-block';
|
||||
import { BookmarkSlashMenuConfigExtension } from './configs/slash-menu';
|
||||
import { createBuiltinToolbarConfigExtension } from './configs/toolbar';
|
||||
|
||||
const flavour = BookmarkBlockSchema.model.flavour;
|
||||
|
||||
export const BookmarkBlockSpec: ExtensionType[] = [
|
||||
FlavourExtension(flavour),
|
||||
BlockViewExtension(flavour, model => {
|
||||
return model.parent?.flavour === 'affine:surface'
|
||||
? literal`affine-edgeless-bookmark`
|
||||
: literal`affine-bookmark`;
|
||||
}),
|
||||
BookmarkBlockInteraction,
|
||||
BookmarkBlockAdapterExtensions,
|
||||
createBuiltinToolbarConfigExtension(flavour),
|
||||
BookmarkSlashMenuConfigExtension,
|
||||
].flat();
|
@ -1,6 +1,5 @@
|
||||
export * from './adapters';
|
||||
export * from './bookmark-block';
|
||||
export * from './bookmark-spec';
|
||||
export * from './commands';
|
||||
export * from './components';
|
||||
export { BookmarkSlashMenuConfigIdentifier } from './configs/slash-menu';
|
||||
|
@ -1,16 +0,0 @@
|
||||
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 { CalloutBlockMarkdownAdapterExtension } from './adapters/markdown';
|
||||
import { CalloutKeymapExtension } from './callout-keymap';
|
||||
import { calloutSlashMenuConfig } from './configs/slash-menu';
|
||||
|
||||
export const CalloutBlockSpec: ExtensionType[] = [
|
||||
FlavourExtension('affine:callout'),
|
||||
BlockViewExtension('affine:callout', literal`affine-callout`),
|
||||
CalloutKeymapExtension,
|
||||
SlashMenuConfigExtension('affine:callout', calloutSlashMenuConfig),
|
||||
CalloutBlockMarkdownAdapterExtension,
|
||||
];
|
@ -1,3 +1,2 @@
|
||||
export * from './callout-block.js';
|
||||
export * from './callout-spec.js';
|
||||
export * from './effects.js';
|
||||
|
@ -1,38 +0,0 @@
|
||||
import { SlashMenuConfigExtension } from '@blocksuite/affine-widget-slash-menu';
|
||||
import {
|
||||
BlockViewExtension,
|
||||
FlavourExtension,
|
||||
WidgetViewExtension,
|
||||
} from '@blocksuite/std';
|
||||
import type { ExtensionType } from '@blocksuite/store';
|
||||
import { literal, unsafeStatic } from 'lit/static-html.js';
|
||||
|
||||
import { CodeBlockAdapterExtensions } from './adapters/extension.js';
|
||||
import { getCodeClipboardExtensions } from './clipboard/index.js';
|
||||
import {
|
||||
CodeBlockInlineManagerExtension,
|
||||
CodeBlockUnitSpecExtension,
|
||||
} from './code-block-inline.js';
|
||||
import { CodeBlockHighlighter } from './code-block-service.js';
|
||||
import { CodeKeymapExtension } from './code-keymap.js';
|
||||
import { AFFINE_CODE_TOOLBAR_WIDGET } from './code-toolbar/index.js';
|
||||
import { codeSlashMenuConfig } from './configs/slash-menu.js';
|
||||
|
||||
export const codeToolbarWidget = WidgetViewExtension(
|
||||
'affine:code',
|
||||
AFFINE_CODE_TOOLBAR_WIDGET,
|
||||
literal`${unsafeStatic(AFFINE_CODE_TOOLBAR_WIDGET)}`
|
||||
);
|
||||
|
||||
export const CodeBlockSpec: ExtensionType[] = [
|
||||
FlavourExtension('affine:code'),
|
||||
CodeBlockHighlighter,
|
||||
BlockViewExtension('affine:code', literal`affine-code`),
|
||||
codeToolbarWidget,
|
||||
CodeBlockInlineManagerExtension,
|
||||
CodeBlockUnitSpecExtension,
|
||||
CodeBlockAdapterExtensions,
|
||||
SlashMenuConfigExtension('affine:code', codeSlashMenuConfig),
|
||||
CodeKeymapExtension,
|
||||
...getCodeClipboardExtensions(),
|
||||
].flat();
|
@ -2,7 +2,6 @@ export * from './adapters';
|
||||
export * from './clipboard';
|
||||
export * from './code-block';
|
||||
export * from './code-block-config';
|
||||
export * from './code-block-spec';
|
||||
export * from './code-preview-extension';
|
||||
export * from './code-toolbar';
|
||||
export * from './turbo/code-layout-handler';
|
||||
|
@ -1,10 +0,0 @@
|
||||
import { BlockViewExtension } from '@blocksuite/std';
|
||||
import type { ExtensionType } from '@blocksuite/store';
|
||||
import { literal } from 'lit/static-html.js';
|
||||
|
||||
import { DividerBlockAdapterExtensions } from './adapters/extension.js';
|
||||
|
||||
export const DividerBlockSpec: ExtensionType[] = [
|
||||
BlockViewExtension('affine:divider', literal`affine-divider`),
|
||||
DividerBlockAdapterExtensions,
|
||||
].flat();
|
@ -1,3 +1,2 @@
|
||||
export * from './adapters';
|
||||
export * from './divider-block';
|
||||
export * from './divider-spec';
|
||||
|
@ -1,10 +0,0 @@
|
||||
import { BlockViewExtension } from '@blocksuite/std';
|
||||
import type { ExtensionType } from '@blocksuite/store';
|
||||
import { literal } from 'lit/static-html.js';
|
||||
|
||||
import { EdgelessTextInteraction } from './edgeless-text-block';
|
||||
|
||||
export const EdgelessTextBlockSpec: ExtensionType[] = [
|
||||
BlockViewExtension('affine:edgeless-text', literal`affine-edgeless-text`),
|
||||
EdgelessTextInteraction,
|
||||
];
|
@ -1,4 +1,3 @@
|
||||
export * from './edgeless-clipboard-config';
|
||||
export * from './edgeless-text-block.js';
|
||||
export * from './edgeless-text-spec.js';
|
||||
export * from './edgeless-toolbar';
|
||||
|
@ -3,24 +3,12 @@ import { BlockViewExtension } from '@blocksuite/std';
|
||||
import type { ExtensionType } from '@blocksuite/store';
|
||||
import { literal } from 'lit/static-html.js';
|
||||
|
||||
import { EmbedLinkedDocBlockAdapterExtensions } from './adapters/extension';
|
||||
import { LinkedDocSlashMenuConfigExtension } from './configs/slash-menu';
|
||||
import { createBuiltinToolbarConfigExtension } from './configs/toolbar';
|
||||
import { EmbedLinkedDocInteraction } from './embed-edgeless-linked-doc-block';
|
||||
|
||||
const flavour = EmbedLinkedDocBlockSchema.model.flavour;
|
||||
|
||||
export const EmbedLinkedDocBlockSpec: ExtensionType[] = [
|
||||
BlockViewExtension(flavour, model => {
|
||||
return model.parent?.flavour === 'affine:surface'
|
||||
? literal`affine-embed-edgeless-linked-doc-block`
|
||||
: literal`affine-embed-linked-doc-block`;
|
||||
}),
|
||||
EmbedLinkedDocBlockAdapterExtensions,
|
||||
createBuiltinToolbarConfigExtension(flavour),
|
||||
LinkedDocSlashMenuConfigExtension,
|
||||
].flat();
|
||||
|
||||
export const EmbedLinkedDocViewExtensions: ExtensionType[] = [
|
||||
BlockViewExtension(flavour, model => {
|
||||
return model.parent?.flavour === 'affine:surface'
|
||||
|
@ -3,23 +3,11 @@ import { BlockViewExtension, FlavourExtension } from '@blocksuite/std';
|
||||
import type { ExtensionType } from '@blocksuite/store';
|
||||
import { literal } from 'lit/static-html.js';
|
||||
|
||||
import { EmbedSyncedDocBlockAdapterExtensions } from './adapters/extension';
|
||||
import { createBuiltinToolbarConfigExtension } from './configs/toolbar';
|
||||
import { HeightInitializationExtension } from './init-height-extension';
|
||||
|
||||
const flavour = EmbedSyncedDocBlockSchema.model.flavour;
|
||||
|
||||
export const EmbedSyncedDocBlockSpec: ExtensionType[] = [
|
||||
FlavourExtension(flavour),
|
||||
BlockViewExtension(flavour, model => {
|
||||
return model.parent?.flavour === 'affine:surface'
|
||||
? literal`affine-embed-edgeless-synced-doc-block`
|
||||
: literal`affine-embed-synced-doc-block`;
|
||||
}),
|
||||
EmbedSyncedDocBlockAdapterExtensions,
|
||||
createBuiltinToolbarConfigExtension(flavour),
|
||||
].flat();
|
||||
|
||||
export const EmbedSyncedDocViewExtensions: ExtensionType[] = [
|
||||
FlavourExtension(flavour),
|
||||
BlockViewExtension(flavour, model => {
|
||||
|
@ -5,7 +5,6 @@ import type { ExtensionType } from '@blocksuite/store';
|
||||
import { literal } from 'lit/static-html.js';
|
||||
|
||||
import { createBuiltinToolbarConfigExtension } from '../configs/toolbar';
|
||||
import { EmbedFigmaBlockAdapterExtensions } from './adapters/extension';
|
||||
import { embedFigmaSlashMenuConfig } from './configs/slash-menu';
|
||||
import { EmbedFigmaBlockInteraction } from './embed-edgeless-figma-block';
|
||||
import { EmbedFigmaBlockComponent } from './embed-figma-block';
|
||||
@ -13,19 +12,6 @@ import { EmbedFigmaBlockOptionConfig } from './embed-figma-service';
|
||||
|
||||
const flavour = EmbedFigmaBlockSchema.model.flavour;
|
||||
|
||||
export const EmbedFigmaBlockSpec: ExtensionType[] = [
|
||||
FlavourExtension(flavour),
|
||||
BlockViewExtension(flavour, model => {
|
||||
return model.parent?.flavour === 'affine:surface'
|
||||
? literal`affine-embed-edgeless-figma-block`
|
||||
: literal`affine-embed-figma-block`;
|
||||
}),
|
||||
EmbedFigmaBlockAdapterExtensions,
|
||||
EmbedFigmaBlockOptionConfig,
|
||||
createBuiltinToolbarConfigExtension(flavour, EmbedFigmaBlockComponent),
|
||||
SlashMenuConfigExtension(flavour, embedFigmaSlashMenuConfig),
|
||||
].flat();
|
||||
|
||||
export const EmbedFigmaViewExtensions: ExtensionType[] = [
|
||||
FlavourExtension(flavour),
|
||||
BlockViewExtension(flavour, model => {
|
||||
|
@ -5,7 +5,6 @@ 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 { EmbedGithubBlockInteraction } from './embed-edgeless-github-block';
|
||||
import { EmbedGithubBlockComponent } from './embed-github-block';
|
||||
@ -16,20 +15,6 @@ import {
|
||||
|
||||
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();
|
||||
|
||||
export const EmbedGithubViewExtensions: ExtensionType[] = [
|
||||
FlavourExtension(flavour),
|
||||
EmbedGithubBlockService,
|
||||
|
@ -8,15 +8,6 @@ import { EmbedEdgelessHtmlBlockInteraction } from './embed-edgeless-html-block';
|
||||
|
||||
const flavour = EmbedHtmlBlockSchema.model.flavour;
|
||||
|
||||
export const EmbedHtmlBlockSpec: ExtensionType[] = [
|
||||
BlockViewExtension(flavour, model => {
|
||||
return model.parent?.flavour === 'affine:surface'
|
||||
? literal`affine-embed-edgeless-html-block`
|
||||
: literal`affine-embed-html-block`;
|
||||
}),
|
||||
createBuiltinToolbarConfigExtension(flavour),
|
||||
].flat();
|
||||
|
||||
export const EmbedHtmlViewExtensions: ExtensionType[] = [
|
||||
BlockViewExtension(flavour, model => {
|
||||
return model.parent?.flavour === 'affine:surface'
|
||||
|
@ -4,25 +4,12 @@ import { BlockViewExtension, FlavourExtension } from '@blocksuite/std';
|
||||
import type { ExtensionType } from '@blocksuite/store';
|
||||
import { literal } from 'lit/static-html.js';
|
||||
|
||||
import { EmbedIframeBlockAdapterExtensions } from './adapters';
|
||||
import { embedIframeSlashMenuConfig } from './configs/slash-menu/slash-menu';
|
||||
import { createBuiltinToolbarConfigExtension } from './configs/toolbar';
|
||||
import { EmbedIframeInteraction } from './embed-edgeless-iframe-block';
|
||||
|
||||
const flavour = EmbedIframeBlockSchema.model.flavour;
|
||||
|
||||
export const EmbedIframeBlockSpec: ExtensionType[] = [
|
||||
FlavourExtension(flavour),
|
||||
BlockViewExtension(flavour, model => {
|
||||
return model.parent?.flavour === 'affine:surface'
|
||||
? literal`affine-embed-edgeless-iframe-block`
|
||||
: literal`affine-embed-iframe-block`;
|
||||
}),
|
||||
EmbedIframeBlockAdapterExtensions,
|
||||
createBuiltinToolbarConfigExtension(flavour),
|
||||
SlashMenuConfigExtension(flavour, embedIframeSlashMenuConfig),
|
||||
].flat();
|
||||
|
||||
export const EmbedIframeViewExtensions: ExtensionType[] = [
|
||||
FlavourExtension(flavour),
|
||||
BlockViewExtension(flavour, model => {
|
||||
|
@ -5,7 +5,6 @@ import type { ExtensionType } from '@blocksuite/store';
|
||||
import { literal } from 'lit/static-html.js';
|
||||
|
||||
import { createBuiltinToolbarConfigExtension } from '../configs/toolbar';
|
||||
import { EmbedLoomBlockAdapterExtensions } from './adapters/extension';
|
||||
import { embedLoomSlashMenuConfig } from './configs/slash-menu';
|
||||
import { EmbedLoomBlockInteraction } from './embed-edgeless-loom-bock';
|
||||
import { EmbedLoomBlockComponent } from './embed-loom-block';
|
||||
@ -16,20 +15,6 @@ import {
|
||||
|
||||
const flavour = EmbedLoomBlockSchema.model.flavour;
|
||||
|
||||
export const EmbedLoomBlockSpec: ExtensionType[] = [
|
||||
FlavourExtension(flavour),
|
||||
EmbedLoomBlockService,
|
||||
BlockViewExtension(flavour, model => {
|
||||
return model.parent?.flavour === 'affine:surface'
|
||||
? literal`affine-embed-edgeless-loom-block`
|
||||
: literal`affine-embed-loom-block`;
|
||||
}),
|
||||
EmbedLoomBlockAdapterExtensions,
|
||||
EmbedLoomBlockOptionConfig,
|
||||
createBuiltinToolbarConfigExtension(flavour, EmbedLoomBlockComponent),
|
||||
SlashMenuConfigExtension(flavour, embedLoomSlashMenuConfig),
|
||||
].flat();
|
||||
|
||||
export const EmbedLoomViewExtensions: ExtensionType[] = [
|
||||
FlavourExtension(flavour),
|
||||
EmbedLoomBlockService,
|
||||
|
@ -5,7 +5,6 @@ import type { ExtensionType } from '@blocksuite/store';
|
||||
import { literal } from 'lit/static-html.js';
|
||||
|
||||
import { createBuiltinToolbarConfigExtension } from '../configs/toolbar';
|
||||
import { EmbedYoutubeBlockAdapterExtensions } from './adapters/extension';
|
||||
import { embedYoutubeSlashMenuConfig } from './configs/slash-menu';
|
||||
import { EmbedYoutubeBlockInteraction } from './embed-edgeless-youtube-block';
|
||||
import { EmbedYoutubeBlockComponent } from './embed-youtube-block';
|
||||
@ -16,20 +15,6 @@ import {
|
||||
|
||||
const flavour = EmbedYoutubeBlockSchema.model.flavour;
|
||||
|
||||
export const EmbedYoutubeBlockSpec: ExtensionType[] = [
|
||||
FlavourExtension(flavour),
|
||||
EmbedYoutubeBlockService,
|
||||
BlockViewExtension(flavour, model => {
|
||||
return model.parent?.flavour === 'affine:surface'
|
||||
? literal`affine-embed-edgeless-youtube-block`
|
||||
: literal`affine-embed-youtube-block`;
|
||||
}),
|
||||
EmbedYoutubeBlockAdapterExtensions,
|
||||
EmbedYoutubeBlockOptionConfig,
|
||||
createBuiltinToolbarConfigExtension(flavour, EmbedYoutubeBlockComponent),
|
||||
SlashMenuConfigExtension('affine:embed-youtube', embedYoutubeSlashMenuConfig),
|
||||
].flat();
|
||||
|
||||
export const EmbedYoutubeViewExtensions: ExtensionType[] = [
|
||||
FlavourExtension(flavour),
|
||||
EmbedYoutubeBlockService,
|
||||
|
@ -1,22 +1,3 @@
|
||||
import type { ExtensionType } from '@blocksuite/store';
|
||||
|
||||
import { EmbedFigmaBlockSpec } from './embed-figma-block';
|
||||
import { EmbedGithubBlockSpec } from './embed-github-block';
|
||||
import { EmbedHtmlBlockSpec } from './embed-html-block';
|
||||
import { EmbedIframeBlockSpec } from './embed-iframe-block';
|
||||
import { EmbedLoomBlockSpec } from './embed-loom-block';
|
||||
import { EmbedYoutubeBlockSpec } from './embed-youtube-block';
|
||||
|
||||
export const EmbedExtensions: ExtensionType[] = [
|
||||
// External embed blocks
|
||||
EmbedFigmaBlockSpec,
|
||||
EmbedGithubBlockSpec,
|
||||
EmbedLoomBlockSpec,
|
||||
EmbedYoutubeBlockSpec,
|
||||
EmbedHtmlBlockSpec,
|
||||
EmbedIframeBlockSpec,
|
||||
].flat();
|
||||
|
||||
export { createEmbedBlockHtmlAdapterMatcher } from './common/adapters/html';
|
||||
export { createEmbedBlockMarkdownAdapterMatcher } from './common/adapters/markdown';
|
||||
export { createEmbedBlockPlainTextAdapterMatcher } from './common/adapters/plain-text';
|
||||
|
@ -3,7 +3,6 @@ import type * as RemarkMathType from 'remark-math';
|
||||
export * from './adapters';
|
||||
export * from './commands';
|
||||
export * from './latex-block';
|
||||
export * from './latex-spec';
|
||||
|
||||
// Global types
|
||||
declare type _GLOBAl = typeof RemarkMathType;
|
||||
|
@ -1,13 +0,0 @@
|
||||
import { SlashMenuConfigExtension } from '@blocksuite/affine-widget-slash-menu';
|
||||
import { BlockViewExtension } from '@blocksuite/std';
|
||||
import type { ExtensionType } from '@blocksuite/store';
|
||||
import { literal } from 'lit/static-html.js';
|
||||
|
||||
import { LatexBlockAdapterExtensions } from './adapters/extension.js';
|
||||
import { latexSlashMenuConfig } from './configs/slash-menu.js';
|
||||
|
||||
export const LatexBlockSpec: ExtensionType[] = [
|
||||
BlockViewExtension('affine:latex', literal`affine-latex`),
|
||||
LatexBlockAdapterExtensions,
|
||||
SlashMenuConfigExtension('affine:latex', latexSlashMenuConfig),
|
||||
].flat();
|
@ -2,6 +2,5 @@ export * from './adapters/index.js';
|
||||
export * from './commands';
|
||||
export { correctNumberedListsOrderToPrev } from './commands/utils';
|
||||
export * from './list-block.js';
|
||||
export * from './list-spec.js';
|
||||
export * from './turbo/list-layout-handler';
|
||||
export * from './turbo/list-painter.worker';
|
||||
|
@ -1,14 +0,0 @@
|
||||
import { BlockViewExtension, FlavourExtension } from '@blocksuite/std';
|
||||
import type { ExtensionType } from '@blocksuite/store';
|
||||
import { literal } from 'lit/static-html.js';
|
||||
|
||||
import { ListBlockAdapterExtensions } from './adapters/extension.js';
|
||||
import { ListKeymapExtension, ListTextKeymapExtension } from './list-keymap.js';
|
||||
|
||||
export const ListBlockSpec: ExtensionType[] = [
|
||||
FlavourExtension('affine:list'),
|
||||
BlockViewExtension('affine:list', literal`affine-list`),
|
||||
ListKeymapExtension,
|
||||
ListTextKeymapExtension,
|
||||
ListBlockAdapterExtensions,
|
||||
].flat();
|
@ -5,6 +5,5 @@ export * from './config';
|
||||
export * from './edgeless-clipboard-config';
|
||||
export * from './note-block';
|
||||
export * from './note-edgeless-block';
|
||||
export * from './note-spec';
|
||||
export * from './turbo/note-layout-handler';
|
||||
export * from './turbo/note-painter.worker';
|
||||
|
@ -1,33 +0,0 @@
|
||||
import { NoteBlockSchema } from '@blocksuite/affine-model';
|
||||
import { BlockViewExtension, FlavourExtension } from '@blocksuite/std';
|
||||
import type { ExtensionType } from '@blocksuite/store';
|
||||
import { literal } from 'lit/static-html.js';
|
||||
|
||||
import {
|
||||
DocNoteBlockAdapterExtensions,
|
||||
EdgelessNoteBlockAdapterExtensions,
|
||||
} from './adapters/index';
|
||||
import { NoteSlashMenuConfigExtension } from './configs/slash-menu';
|
||||
import { createBuiltinToolbarConfigExtension } from './configs/toolbar';
|
||||
import { EdgelessNoteInteraction } from './note-edgeless-block';
|
||||
import { NoteKeymapExtension } from './note-keymap.js';
|
||||
|
||||
const flavour = NoteBlockSchema.model.flavour;
|
||||
|
||||
export const NoteBlockSpec: ExtensionType[] = [
|
||||
FlavourExtension(flavour),
|
||||
BlockViewExtension(flavour, literal`affine-note`),
|
||||
DocNoteBlockAdapterExtensions,
|
||||
NoteSlashMenuConfigExtension,
|
||||
NoteKeymapExtension,
|
||||
].flat();
|
||||
|
||||
export const EdgelessNoteBlockSpec: ExtensionType[] = [
|
||||
FlavourExtension(flavour),
|
||||
BlockViewExtension(flavour, literal`affine-edgeless-note`),
|
||||
EdgelessNoteBlockAdapterExtensions,
|
||||
NoteSlashMenuConfigExtension,
|
||||
createBuiltinToolbarConfigExtension(flavour),
|
||||
NoteKeymapExtension,
|
||||
EdgelessNoteInteraction,
|
||||
].flat();
|
@ -2,6 +2,5 @@ export * from './adapters/index.js';
|
||||
export * from './commands';
|
||||
export * from './paragraph-block.js';
|
||||
export * from './paragraph-block-config.js';
|
||||
export * from './paragraph-spec.js';
|
||||
export * from './turbo/paragraph-layout-handler';
|
||||
export * from './turbo/paragraph-painter.worker';
|
||||
|
@ -1,34 +0,0 @@
|
||||
import { BlockViewExtension, FlavourExtension } from '@blocksuite/std';
|
||||
import type { ExtensionType } from '@blocksuite/store';
|
||||
import { literal } from 'lit/static-html.js';
|
||||
|
||||
import { ParagraphBlockAdapterExtensions } from './adapters/extension.js';
|
||||
import { ParagraphBlockConfigExtension } from './paragraph-block-config.js';
|
||||
import {
|
||||
ParagraphKeymapExtension,
|
||||
ParagraphTextKeymapExtension,
|
||||
} from './paragraph-keymap.js';
|
||||
|
||||
const placeholders = {
|
||||
text: "Type '/' for commands",
|
||||
h1: 'Heading 1',
|
||||
h2: 'Heading 2',
|
||||
h3: 'Heading 3',
|
||||
h4: 'Heading 4',
|
||||
h5: 'Heading 5',
|
||||
h6: 'Heading 6',
|
||||
quote: '',
|
||||
};
|
||||
|
||||
export const ParagraphBlockSpec: ExtensionType[] = [
|
||||
FlavourExtension('affine:paragraph'),
|
||||
BlockViewExtension('affine:paragraph', literal`affine-paragraph`),
|
||||
ParagraphTextKeymapExtension,
|
||||
ParagraphKeymapExtension,
|
||||
ParagraphBlockAdapterExtensions,
|
||||
ParagraphBlockConfigExtension({
|
||||
getPlaceholder: model => {
|
||||
return placeholders[model.props.type];
|
||||
},
|
||||
}),
|
||||
].flat();
|
@ -28,6 +28,7 @@ import {
|
||||
shapeMethods,
|
||||
} from '@blocksuite/affine-model';
|
||||
import { ToolbarRegistryIdentifier } from '@blocksuite/affine-shared/services';
|
||||
import type { SelectedRect } from '@blocksuite/affine-shared/types';
|
||||
import { handleNativeRangeAtPoint } from '@blocksuite/affine-shared/utils';
|
||||
import { DisposableGroup } from '@blocksuite/global/disposable';
|
||||
import type { Bound, IVec } from '@blocksuite/global/gfx';
|
||||
@ -51,7 +52,6 @@ import { property, state } from 'lit/decorators.js';
|
||||
import { classMap } from 'lit/directives/class-map.js';
|
||||
import { styleMap } from 'lit/directives/style-map.js';
|
||||
|
||||
import type { SelectedRect } from '../rects/edgeless-selected-rect.js';
|
||||
import { EdgelessAutoCompletePanel } from './auto-complete-panel.js';
|
||||
import {
|
||||
createEdgelessElement,
|
||||
|
@ -5,6 +5,7 @@ import {
|
||||
type RootBlockModel,
|
||||
} from '@blocksuite/affine-model';
|
||||
import { unsafeCSSVarV2 } from '@blocksuite/affine-shared/theme';
|
||||
import type { SelectedRect } from '@blocksuite/affine-shared/types';
|
||||
import {
|
||||
getSelectedRect,
|
||||
requestThrottledConnectedFrame,
|
||||
@ -30,16 +31,6 @@ import type { EdgelessRootBlockComponent } from '../../edgeless-root-block.js';
|
||||
import { RenderResizeHandles } from '../resize/resize-handles.js';
|
||||
import { generateCursorUrl, getRotatedResizeCursor } from '../utils.js';
|
||||
|
||||
export type SelectedRect = {
|
||||
left: number;
|
||||
top: number;
|
||||
width: number;
|
||||
height: number;
|
||||
borderWidth: number;
|
||||
borderStyle: string;
|
||||
rotate: number;
|
||||
};
|
||||
|
||||
export const EDGELESS_SELECTED_RECT_WIDGET = 'edgeless-selected-rect';
|
||||
|
||||
export class EdgelessSelectedRectWidget extends WidgetComponent<
|
||||
|
@ -1,11 +1,3 @@
|
||||
export const DEFAULT_NOTE_CHILD_FLAVOUR = 'affine:paragraph';
|
||||
export const DEFAULT_NOTE_CHILD_TYPE = 'text';
|
||||
export const DEFAULT_NOTE_TIP = 'Text';
|
||||
|
||||
export const FIT_TO_SCREEN_PADDING = 100;
|
||||
|
||||
export const ATTACHED_DISTANCE = 20;
|
||||
|
||||
export const SurfaceColor = '#6046FE';
|
||||
export const NoteColor = '#1E96EB';
|
||||
export const BlendColor = '#7D91FF';
|
||||
|
@ -2,28 +2,14 @@ import type { CanvasElementWithText } from '@blocksuite/affine-block-surface';
|
||||
import type { PanTool } from '@blocksuite/affine-gfx-pointer';
|
||||
import {
|
||||
type AttachmentBlockModel,
|
||||
type BookmarkBlockModel,
|
||||
type Connectable,
|
||||
ConnectorElementModel,
|
||||
type EdgelessTextBlockModel,
|
||||
type EmbedBlockModel,
|
||||
type EmbedFigmaModel,
|
||||
type EmbedGithubModel,
|
||||
type EmbedHtmlModel,
|
||||
type EmbedLinkedDocModel,
|
||||
type EmbedLoomModel,
|
||||
type EmbedSyncedDocModel,
|
||||
type EmbedYoutubeModel,
|
||||
type ImageBlockModel,
|
||||
ShapeElementModel,
|
||||
TextElementModel,
|
||||
} from '@blocksuite/affine-model';
|
||||
import {
|
||||
getElementsWithoutGroup,
|
||||
isTopLevelBlock,
|
||||
} from '@blocksuite/affine-shared/utils';
|
||||
import type { PointLocation } from '@blocksuite/global/gfx';
|
||||
import { Bound } from '@blocksuite/global/gfx';
|
||||
import { isTopLevelBlock } from '@blocksuite/affine-shared/utils';
|
||||
import type {
|
||||
GfxModel,
|
||||
GfxPrimitiveElementModel,
|
||||
@ -59,100 +45,6 @@ export function isAttachmentBlock(
|
||||
);
|
||||
}
|
||||
|
||||
export function isBookmarkBlock(
|
||||
element: BlockModel | GfxModel | null
|
||||
): element is BookmarkBlockModel {
|
||||
return (
|
||||
!!element && 'flavour' in element && element.flavour === 'affine:bookmark'
|
||||
);
|
||||
}
|
||||
|
||||
export function isEmbeddedBlock(
|
||||
element: BlockModel | GfxModel | null
|
||||
): element is EmbedBlockModel {
|
||||
return (
|
||||
!!element && 'flavour' in element && /affine:embed-*/.test(element.flavour)
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* TODO: Remove this function after the edgeless refactor completed
|
||||
* This function is used to check if the block is an AI chat block for edgeless selected rect
|
||||
* Should not be used in the future
|
||||
* Related issue: https://linear.app/affine-design/issue/BS-1009/
|
||||
* @deprecated
|
||||
*/
|
||||
export function isAIChatBlock(element: BlockModel | GfxModel | null) {
|
||||
return (
|
||||
!!element &&
|
||||
'flavour' in element &&
|
||||
element.flavour === 'affine:embed-ai-chat'
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* TODO: Remove this function after the edgeless refactor completed
|
||||
* This function is used to check if the block is an EmbedIframeBlock for edgeless selected rect
|
||||
* Should not be used in the future
|
||||
* Related issue: https://linear.app/affine-design/issue/BS-2841/
|
||||
* @deprecated
|
||||
*/
|
||||
export function isEmbedIframeBlock(element: BlockModel | GfxModel | null) {
|
||||
return (
|
||||
!!element &&
|
||||
'flavour' in element &&
|
||||
element.flavour === 'affine:embed-iframe'
|
||||
);
|
||||
}
|
||||
|
||||
export function isEmbedGithubBlock(
|
||||
element: BlockModel | GfxModel | null
|
||||
): element is EmbedGithubModel {
|
||||
return (
|
||||
!!element &&
|
||||
'flavour' in element &&
|
||||
element.flavour === 'affine:embed-github'
|
||||
);
|
||||
}
|
||||
|
||||
export function isEmbedYoutubeBlock(
|
||||
element: BlockModel | GfxModel | null
|
||||
): element is EmbedYoutubeModel {
|
||||
return (
|
||||
!!element &&
|
||||
'flavour' in element &&
|
||||
element.flavour === 'affine:embed-youtube'
|
||||
);
|
||||
}
|
||||
|
||||
export function isEmbedLoomBlock(
|
||||
element: BlockModel | GfxModel | null
|
||||
): element is EmbedLoomModel {
|
||||
return (
|
||||
!!element && 'flavour' in element && element.flavour === 'affine:embed-loom'
|
||||
);
|
||||
}
|
||||
|
||||
export function isEmbedFigmaBlock(
|
||||
element: BlockModel | GfxModel | null
|
||||
): element is EmbedFigmaModel {
|
||||
return (
|
||||
!!element &&
|
||||
'flavour' in element &&
|
||||
element.flavour === 'affine:embed-figma'
|
||||
);
|
||||
}
|
||||
|
||||
export function isEmbedLinkedDocBlock(
|
||||
element: BlockModel | GfxModel | null
|
||||
): element is EmbedLinkedDocModel {
|
||||
return (
|
||||
!!element &&
|
||||
'flavour' in element &&
|
||||
element.flavour === 'affine:embed-linked-doc'
|
||||
);
|
||||
}
|
||||
|
||||
export function isEmbedSyncedDocBlock(
|
||||
element: BlockModel | GfxModel | null
|
||||
): element is EmbedSyncedDocModel {
|
||||
@ -163,14 +55,6 @@ export function isEmbedSyncedDocBlock(
|
||||
);
|
||||
}
|
||||
|
||||
export function isEmbedHtmlBlock(
|
||||
element: BlockModel | GfxModel | null
|
||||
): element is EmbedHtmlModel {
|
||||
return (
|
||||
!!element && 'flavour' in element && element.flavour === 'affine:embed-html'
|
||||
);
|
||||
}
|
||||
|
||||
export function isCanvasElement(
|
||||
selectable: GfxModel | BlockModel | null
|
||||
): selectable is GfxPrimitiveElementModel {
|
||||
@ -218,30 +102,3 @@ export function getCursorMode(edgelessTool: ToolOptionWithType) {
|
||||
return 'default';
|
||||
}
|
||||
}
|
||||
|
||||
export type SelectableProps = {
|
||||
bound: Bound;
|
||||
rotate: number;
|
||||
path?: PointLocation[];
|
||||
};
|
||||
|
||||
export function getSelectableBounds(
|
||||
selected: GfxModel[]
|
||||
): Map<string, SelectableProps> {
|
||||
const bounds = new Map();
|
||||
getElementsWithoutGroup(selected).forEach(ele => {
|
||||
const bound = Bound.deserialize(ele.xywh);
|
||||
const props: SelectableProps = {
|
||||
bound,
|
||||
rotate: ele.rotate,
|
||||
};
|
||||
|
||||
if (isCanvasElement(ele) && ele instanceof ConnectorElementModel) {
|
||||
props.path = ele.absolutePath.map(p => p.clone());
|
||||
}
|
||||
|
||||
bounds.set(ele.id, props);
|
||||
});
|
||||
|
||||
return bounds;
|
||||
}
|
||||
|
@ -1,4 +1,3 @@
|
||||
export * from './commands.js';
|
||||
export * from './surface-ref-block.js';
|
||||
export * from './surface-ref-block-edgeless.js';
|
||||
export * from './surface-ref-spec.js';
|
||||
|
@ -1,30 +0,0 @@
|
||||
import { SurfaceRefBlockSchema } from '@blocksuite/affine-model';
|
||||
import { ToolbarModuleExtension } from '@blocksuite/affine-shared/services';
|
||||
import {
|
||||
BlockFlavourIdentifier,
|
||||
BlockViewExtension,
|
||||
FlavourExtension,
|
||||
} from '@blocksuite/std';
|
||||
import type { ExtensionType } from '@blocksuite/store';
|
||||
import { literal } from 'lit/static-html.js';
|
||||
|
||||
import { SurfaceRefSlashMenuConfigExtension } from './configs/slash-menu';
|
||||
import { surfaceRefToolbarModuleConfig } from './configs/toolbar';
|
||||
|
||||
const flavour = SurfaceRefBlockSchema.model.flavour;
|
||||
|
||||
export const PageSurfaceRefBlockSpec: ExtensionType[] = [
|
||||
FlavourExtension(flavour),
|
||||
BlockViewExtension(flavour, literal`affine-surface-ref`),
|
||||
ToolbarModuleExtension({
|
||||
id: BlockFlavourIdentifier(flavour),
|
||||
config: surfaceRefToolbarModuleConfig,
|
||||
}),
|
||||
SurfaceRefSlashMenuConfigExtension,
|
||||
];
|
||||
|
||||
export const EdgelessSurfaceRefBlockSpec: ExtensionType[] = [
|
||||
FlavourExtension(flavour),
|
||||
BlockViewExtension(flavour, literal`affine-edgeless-surface-ref`),
|
||||
SurfaceRefSlashMenuConfigExtension,
|
||||
];
|
@ -28,10 +28,6 @@ export {
|
||||
SurfaceBlockSchema,
|
||||
SurfaceBlockSchemaExtension,
|
||||
} from './surface-model.js';
|
||||
export {
|
||||
EdgelessSurfaceBlockSpec,
|
||||
PageSurfaceBlockSpec,
|
||||
} from './surface-spec.js';
|
||||
export { SurfaceBlockTransformer } from './surface-transformer.js';
|
||||
export * from './tool/default-tool.js';
|
||||
export {
|
||||
|
@ -1,26 +0,0 @@
|
||||
import { BlockViewExtension, FlavourExtension } from '@blocksuite/std';
|
||||
import type { ExtensionType } from '@blocksuite/store';
|
||||
import { literal } from 'lit/static-html.js';
|
||||
|
||||
import {
|
||||
EdgelessCRUDExtension,
|
||||
EdgelessLegacySlotExtension,
|
||||
} from './extensions';
|
||||
import { ExportManagerExtension } from './extensions/export-manager/export-manager';
|
||||
|
||||
const CommonSurfaceBlockSpec: ExtensionType[] = [
|
||||
FlavourExtension('affine:surface'),
|
||||
EdgelessCRUDExtension,
|
||||
EdgelessLegacySlotExtension,
|
||||
ExportManagerExtension,
|
||||
];
|
||||
|
||||
export const PageSurfaceBlockSpec: ExtensionType[] = [
|
||||
...CommonSurfaceBlockSpec,
|
||||
BlockViewExtension('affine:surface', literal`affine-surface-void`),
|
||||
];
|
||||
|
||||
export const EdgelessSurfaceBlockSpec: ExtensionType[] = [
|
||||
...CommonSurfaceBlockSpec,
|
||||
BlockViewExtension('affine:surface', literal`affine-surface`),
|
||||
];
|
@ -2,4 +2,3 @@ export * from './adapters';
|
||||
export * from './commands.js';
|
||||
export * from './selection-schema.js';
|
||||
export * from './table-data-manager.js';
|
||||
export * from './table-spec.js';
|
||||
|
@ -1,15 +0,0 @@
|
||||
import { TableModelFlavour } 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 { TableBlockAdapterExtensions } from './adapters/extension.js';
|
||||
import { tableSlashMenuConfig } from './configs/slash-menu.js';
|
||||
|
||||
export const TableBlockSpec: ExtensionType[] = [
|
||||
FlavourExtension(TableModelFlavour),
|
||||
BlockViewExtension(TableModelFlavour, literal`affine-table`),
|
||||
TableBlockAdapterExtensions,
|
||||
SlashMenuConfigExtension(TableModelFlavour, tableSlashMenuConfig),
|
||||
].flat();
|
@ -1,7 +0,0 @@
|
||||
import type { ExtensionType } from '@blocksuite/store';
|
||||
|
||||
import { FootNoteInlineSpecExtension } from './inline-spec';
|
||||
|
||||
export const inlineFootnoteExtensions: ExtensionType[] = [
|
||||
FootNoteInlineSpecExtension,
|
||||
];
|
@ -1,5 +1,4 @@
|
||||
export * from './adapters';
|
||||
export * from './exts';
|
||||
export * from './footnote-node/footnote-config.js';
|
||||
export { AffineFootnoteNode } from './footnote-node/footnote-node.js';
|
||||
export * from './inline-spec';
|
||||
|
@ -1,11 +0,0 @@
|
||||
import {
|
||||
LatexEditorUnitSpecExtension,
|
||||
LatexInlineSpecExtension,
|
||||
} from './inline-spec';
|
||||
import { LatexEditorInlineManagerExtension } from './latex-node/latex-editor-menu';
|
||||
|
||||
export const inlineLatexExtensions = [
|
||||
LatexInlineSpecExtension,
|
||||
LatexEditorUnitSpecExtension,
|
||||
LatexEditorInlineManagerExtension,
|
||||
];
|
@ -3,7 +3,6 @@ import type RemarkMath from 'remark-math';
|
||||
|
||||
export * from './adapters';
|
||||
export * from './command';
|
||||
export * from './exts';
|
||||
export * from './inline-spec';
|
||||
export * from './markdown';
|
||||
|
||||
|
@ -1,9 +0,0 @@
|
||||
import type { ExtensionType } from '@blocksuite/store';
|
||||
|
||||
import { LinkInlineSpecExtension } from './inline-spec';
|
||||
import { linkToolbar } from './toolbar';
|
||||
|
||||
export const inlineLinkExtensions: ExtensionType[] = [
|
||||
LinkInlineSpecExtension,
|
||||
linkToolbar,
|
||||
];
|
@ -1,6 +1,5 @@
|
||||
export * from './adapters';
|
||||
export * from './command';
|
||||
export * from './exts';
|
||||
export * from './inline-spec';
|
||||
export * from './link-node';
|
||||
export * from './markdown';
|
||||
|
@ -1,7 +0,0 @@
|
||||
import type { ExtensionType } from '@blocksuite/store';
|
||||
|
||||
import { MentionInlineSpecExtension } from './inline-spec';
|
||||
|
||||
export const inlineMentionExtensions: ExtensionType[] = [
|
||||
MentionInlineSpecExtension,
|
||||
];
|
@ -1,4 +1,3 @@
|
||||
export * from './affine-mention';
|
||||
export * from './effects';
|
||||
export * from './exts';
|
||||
export * from './inline-spec';
|
||||
|
@ -1,11 +0,0 @@
|
||||
import { InlineAdapterExtensions } from './adapters/extensions';
|
||||
import { DefaultInlineManagerExtension } from './default-inline-manager';
|
||||
import { InlineSpecExtensions } from './inline-spec';
|
||||
import { MarkdownExtensions } from './markdown';
|
||||
|
||||
export const inlinePresetExtensions = [
|
||||
DefaultInlineManagerExtension,
|
||||
...MarkdownExtensions,
|
||||
...InlineSpecExtensions,
|
||||
...InlineAdapterExtensions,
|
||||
];
|
@ -5,7 +5,6 @@ declare type _GLOBAL_ = typeof RichTextEffects;
|
||||
export * from './adapters/extensions';
|
||||
export * from './command';
|
||||
export * from './default-inline-manager';
|
||||
export * from './exts';
|
||||
export * from './inline-spec';
|
||||
export * from './keymap';
|
||||
export * from './markdown';
|
||||
|
@ -1,11 +0,0 @@
|
||||
import type { ExtensionType } from '@blocksuite/store';
|
||||
|
||||
import { ReferenceInlineSpecExtension } from './inline-spec';
|
||||
import { RefNodeSlotsExtension } from './reference-node';
|
||||
import { referenceNodeToolbar } from './toolbar';
|
||||
|
||||
export const inlineReferenceExtensions: ExtensionType[] = [
|
||||
referenceNodeToolbar,
|
||||
ReferenceInlineSpecExtension,
|
||||
RefNodeSlotsExtension,
|
||||
];
|
@ -1,5 +1,4 @@
|
||||
export * from './adapters';
|
||||
export * from './exts';
|
||||
export * from './inline-spec';
|
||||
export * from './reference-node';
|
||||
export * from './toolbar';
|
||||
|
@ -1,17 +1,7 @@
|
||||
import type {
|
||||
EmbedCardStyle,
|
||||
FootNote,
|
||||
ReferenceInfo,
|
||||
} from '@blocksuite/affine-model';
|
||||
import type { BlockComponent } from '@blocksuite/std';
|
||||
import type { FootNote, ReferenceInfo } from '@blocksuite/affine-model';
|
||||
import type { InlineEditor } from '@blocksuite/std/inline';
|
||||
import type { BlockModel } from '@blocksuite/store';
|
||||
export * from './uni-component';
|
||||
export interface EditingState {
|
||||
element: BlockComponent;
|
||||
model: BlockModel;
|
||||
rect: DOMRect;
|
||||
}
|
||||
|
||||
export type NoteChildrenFlavour =
|
||||
| 'affine:paragraph'
|
||||
@ -38,13 +28,6 @@ export interface Viewport {
|
||||
|
||||
export type ExtendedModel = BlockModel & Record<string, any>;
|
||||
|
||||
export type EmbedOptions = {
|
||||
flavour: string;
|
||||
urlRegex: RegExp;
|
||||
styles: EmbedCardStyle[];
|
||||
viewType: 'card' | 'embed';
|
||||
};
|
||||
|
||||
export type IndentContext = {
|
||||
blockId: string;
|
||||
inlineIndex: number;
|
||||
@ -75,3 +58,13 @@ export interface AffineTextAttributes {
|
||||
}
|
||||
|
||||
export type AffineInlineEditor = InlineEditor<AffineTextAttributes>;
|
||||
|
||||
export type SelectedRect = {
|
||||
left: number;
|
||||
top: number;
|
||||
width: number;
|
||||
height: number;
|
||||
borderWidth: number;
|
||||
borderStyle: string;
|
||||
rotate: number;
|
||||
};
|
||||
|
Loading…
x
Reference in New Issue
Block a user