mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-07-21 03:56:23 +08:00
94c9717a35
Close [BS-2315](https://linear.app/affine-design/issue/BS-2315/page-block-header) ### What Changes - Add header toolbar to page block (the first note in canvas) - Add e2e tests - Add some edgeless e2e test utils. **The package `@blocksuite/affine` was added to `"@affine-test/kit"`**
57 lines
2.1 KiB
TypeScript
57 lines
2.1 KiB
TypeScript
import type { BlockComponent } from '@blocksuite/block-std';
|
|
import type { BlockModel } from '@blocksuite/store';
|
|
|
|
import type { updateBlockType } from './commands/block-type';
|
|
import type { dedentBlock } from './commands/dedent-block';
|
|
import type { dedentBlockToRoot } from './commands/dedent-block-to-root';
|
|
import type { dedentBlocks } from './commands/dedent-blocks';
|
|
import type { dedentBlocksToRoot } from './commands/dedent-blocks-to-root';
|
|
import type { focusBlockEnd } from './commands/focus-block-end';
|
|
import type { focusBlockStart } from './commands/focus-block-start';
|
|
import type { indentBlock } from './commands/indent-block';
|
|
import type { indentBlocks } from './commands/indent-blocks';
|
|
import type { selectBlock } from './commands/select-block';
|
|
import type { selectBlocksBetween } from './commands/select-blocks-between';
|
|
import type { NoteConfig } from './config';
|
|
import { NoteBlockComponent } from './note-block';
|
|
import {
|
|
EdgelessNoteBlockComponent,
|
|
EdgelessNoteMask,
|
|
} from './note-edgeless-block';
|
|
import type { NoteBlockService } from './note-service';
|
|
|
|
export function effects() {
|
|
customElements.define('affine-note', NoteBlockComponent);
|
|
customElements.define('edgeless-note-mask', EdgelessNoteMask);
|
|
customElements.define('affine-edgeless-note', EdgelessNoteBlockComponent);
|
|
}
|
|
|
|
declare global {
|
|
namespace BlockSuite {
|
|
interface Commands {
|
|
selectBlock: typeof selectBlock;
|
|
selectBlocksBetween: typeof selectBlocksBetween;
|
|
focusBlockStart: typeof focusBlockStart;
|
|
focusBlockEnd: typeof focusBlockEnd;
|
|
indentBlocks: typeof indentBlocks;
|
|
dedentBlock: typeof dedentBlock;
|
|
dedentBlocksToRoot: typeof dedentBlocksToRoot;
|
|
dedentBlocks: typeof dedentBlocks;
|
|
indentBlock: typeof indentBlock;
|
|
updateBlockType: typeof updateBlockType;
|
|
dedentBlockToRoot: typeof dedentBlockToRoot;
|
|
}
|
|
interface CommandContext {
|
|
focusBlock?: BlockComponent | null;
|
|
anchorBlock?: BlockComponent | null;
|
|
updatedBlocks?: BlockModel[];
|
|
}
|
|
interface BlockServices {
|
|
'affine:note': NoteBlockService;
|
|
}
|
|
interface BlockConfigs {
|
|
'affine:note': NoteConfig;
|
|
}
|
|
}
|
|
}
|