mirror of
https://github.com/codex-team/editor.js
synced 2024-05-17 22:06:49 +02:00
6f36707f67
* Add tunes improvements * Allow to show Inline Toolbar at Block Tune Wrapper element * Add fake cursor on block selection * Fix lint * Update types * Fix bugs with selection * Remove selection observer * Update due to comments * Fix tests * Update docs/block-tunes.md Co-authored-by: Peter Savchenko <specc.dev@gmail.com> * Move fake cursor to selection utils * Fix missing range for Safari * Fix data attribute value * Add comment * Update z-index for inline-toolbar * Add changelog * Remove fake cursor visibility for the core Co-authored-by: Peter Savchenko <specc.dev@gmail.com>
37 lines
910 B
TypeScript
37 lines
910 B
TypeScript
import BaseTool, { ToolType } from './base';
|
|
import { BlockAPI, BlockTune as IBlockTune, BlockTuneConstructable } from '../../../types';
|
|
import { BlockTuneData } from '../../../types/block-tunes/block-tune-data';
|
|
|
|
/**
|
|
* Stub class for BlockTunes
|
|
*
|
|
* @todo Implement
|
|
*/
|
|
export default class BlockTune extends BaseTool<IBlockTune> {
|
|
/**
|
|
* Tool type — Tune
|
|
*/
|
|
public type = ToolType.Tune;
|
|
|
|
/**
|
|
* Tool's constructable blueprint
|
|
*/
|
|
protected readonly constructable: BlockTuneConstructable;
|
|
|
|
/**
|
|
* Constructs new BlockTune instance from constructable
|
|
*
|
|
* @param data - Tune data
|
|
* @param block - Block API object
|
|
*/
|
|
public create(data: BlockTuneData, block: BlockAPI): IBlockTune {
|
|
// eslint-disable-next-line new-cap
|
|
return new this.constructable({
|
|
api: this.api.getMethodsForTool(this),
|
|
config: this.settings,
|
|
block,
|
|
data,
|
|
});
|
|
}
|
|
}
|