mirror of
https://github.com/codex-team/editor.js
synced 2024-05-18 14:26:48 +02:00
b7b00fd060
* block onchange stash * improve block filtration * update tool root * chore(block): remove willSelect und willUnselect * onchange events batching * get rid of CustomEvent extension, create custom event map instead * improve types of EventsDispatcher * fix tests * custom sinon + chai matchers * improve tests, add mutex for fake cursor * add test for fake-cursor mutex * test for batch filtering * fix caret setting by enter press at the end of the block * test for detectToolRootChange * remove resolved todos * changelog added * fix tests * Update CHANGELOG.md * rename FakeCursorAboutToBeSet -> FakeCursorAboutToBeToggled * update didMutated statements * move inputs cache clearing to a separate method * rm Record inheritance from Event maps * add type alisases * rename isElementContainsFakeCursor -> isFakeCursorInsideContainer * improve code style
27 lines
542 B
TypeScript
27 lines
542 B
TypeScript
import { BlockMutationEventDetail } from './Base';
|
|
|
|
/**
|
|
* Type name of CustomEvent related to block moved event
|
|
*/
|
|
export const BlockMovedMutationType = 'block-moved';
|
|
|
|
/**
|
|
* Information about moved block
|
|
*/
|
|
interface BlockMovedEventDetail extends BlockMutationEventDetail {
|
|
/**
|
|
* Previous block position
|
|
*/
|
|
fromIndex: number;
|
|
|
|
/**
|
|
* New block position
|
|
*/
|
|
toIndex: number;
|
|
}
|
|
|
|
/**
|
|
* Event will be fired when some block is moved to another position
|
|
*/
|
|
export type BlockMovedEvent = CustomEvent<BlockMovedEventDetail>;
|